From: Frank Du <frank.du@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
Kevin Laatz <kevin.laatz@intel.com>
Cc: dev@dpdk.org
Subject: [PATCH] dma/idxd: add reset in the init routine
Date: Fri, 11 Aug 2023 10:10:54 +0800 [thread overview]
Message-ID: <20230811021054.3848656-1-frank.du@intel.com> (raw)
Fix for windows, no one reset the dev to a clear status. In Linux,
kernel driver will reset during the prob.
Signed-off-by: Frank Du <frank.du@intel.com>
---
drivers/dma/idxd/idxd_pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c
index 3696c7f452..a78889a7ef 100644
--- a/drivers/dma/idxd/idxd_pci.c
+++ b/drivers/dma/idxd/idxd_pci.c
@@ -196,6 +196,14 @@ init_pci_device(struct rte_pci_device *dev, struct idxd_dmadev *idxd,
pci->portals = dev->mem_resource[2].addr;
pci->wq_cfg_sz = (pci->regs->wqcap >> 24) & 0x0F;
+ /* reset */
+ idxd->u.pci = pci;
+ err_code = idxd_pci_dev_command(idxd, idxd_reset_device);
+ if (err_code) {
+ IDXD_PMD_ERR("Error reset device: code %#x", err_code);
+ goto err;
+ }
+
/* sanity check device status */
if (pci->regs->gensts & GENSTS_DEV_STATE_MASK) {
/* need function-level-reset (FLR) or is enabled */
--
2.34.1
next reply other threads:[~2023-08-11 2:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 2:10 Frank Du [this message]
2023-08-14 15:37 ` Bruce Richardson
2023-10-17 9:42 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230811021054.3848656-1-frank.du@intel.com \
--to=frank.du@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=kevin.laatz@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).