lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220824192913.2425634-1-jsnitsel@redhat.com>
Date:   Wed, 24 Aug 2022 12:29:13 -0700
From:   Jerry Snitselaar <jsnitsel@...hat.com>
To:     linux-kernel@...r.kernel.org
Cc:     Fenghua Yu <fenghua.yu@...el.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Vinod Koul <vkoul@...nel.org>, dmaengine@...r.kernel.org
Subject: [PATCH] dmaengine: idxd: Set workqueue state to disabled before trying to re-enable

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@...el.com>
Cc: Dave Jiang <dave.jiang@...el.com>
Cc: Vinod Koul <vkoul@...nel.org>
Cc: dmaengine@...r.kernel.org
Fixes: bfe1d56091c1 ("dmaengine: idxd: Init and probe for Intel data accelerators")
Signed-off-by: Jerry Snitselaar <jsnitsel@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ