From: Jerry Snitselaar <jsnitsel@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Fenghua Yu <fenghua.yu@intel.com>,
Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>,
dmaengine@vger.kernel.org
Subject: [PATCH] dmaengine: idxd: Set workqueue state to disabled before trying to re-enable
Date: Wed, 24 Aug 2022 12:29:13 -0700 [thread overview]
Message-ID: <20220824192913.2425634-1-jsnitsel@redhat.com> (raw)
For a software reset idxd_device_reinit() is called, which will walk
the device workqueues to see which ones were enabled, and try to
re-enable them. It keys off wq->state being iDXD_WQ_ENABLED, but the
first thing idxd_enable_wq() will do is see that the state of the
workqueue is enabled, and return 0 instead of attempting to issue
a command to enable the workqueue.
So once a workqueue is found that needs to be re-enabled,
set the state to disabled prior to calling idxd_enable_wq().
This would accurately reflect the state if the enable fails
as well.
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: dmaengine@vger.kernel.org
Fixes: bfe1d56091c1 ("dmaengine: idxd: Init and probe for Intel data accelerators")
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
drivers/dma/idxd/irq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c
index 743ead5ebc57..723eeb5328d6 100644
--- a/drivers/dma/idxd/irq.c
+++ b/drivers/dma/idxd/irq.c
@@ -52,6 +52,7 @@ static void idxd_device_reinit(struct work_struct *work)
struct idxd_wq *wq = idxd->wqs[i];
if (wq->state == IDXD_WQ_ENABLED) {
+ wq->state = IDXD_WQ_DISABLED;
rc = idxd_wq_enable(wq);
if (rc < 0) {
dev_warn(dev, "Unable to re-enable wq %s\n",
--
2.37.2
next reply other threads:[~2022-08-24 19:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 19:29 Jerry Snitselaar [this message]
2022-08-24 20:29 ` [PATCH] dmaengine: idxd: Set workqueue state to disabled before trying to re-enable Dave Jiang
2022-08-24 21:16 ` Jerry Snitselaar
2022-08-24 21:59 ` Dave Jiang
2022-08-24 22:07 ` Jerry Snitselaar
2022-08-24 22:19 ` Dave Jiang
2022-08-24 22:21 ` Jerry Snitselaar
2022-09-17 17:05 ` Jerry Snitselaar
2022-09-19 15:28 ` Dave Jiang
2022-09-19 19:52 ` Jerry Snitselaar
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=20220824192913.2425634-1-jsnitsel@redhat.com \
--to=jsnitsel@redhat.com \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/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).