Skip to content

Commit 8e527aa

Browse files
snitsvinodkoul
authored andcommitted
dmaengine: idxd: Set wq state to disabled in idxd_wq_disable_cleanup()
If we are calling idxd_wq_disable_cleanup(), the workqueue should be in a disabled state. So set the workqueue state to IDXD_WQ_DISABLED so that the state reflects that. Currently if there is a device failure, and a software reset is attempted the workqueues will not be re-enabled due to idxd_wq_enable() seeing that state as already being IDXD_WQ_ENABLED. Cc: Fenghua Yu <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Vinod Koul <[email protected]> Signed-off-by: Jerry Snitselaar <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 5c43442 commit 8e527aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/idxd/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ void idxd_wq_reset(struct idxd_wq *wq)
258258
operand = BIT(wq->id % 16) | ((wq->id / 16) << 16);
259259
idxd_cmd_exec(idxd, IDXD_CMD_RESET_WQ, operand, NULL);
260260
idxd_wq_disable_cleanup(wq);
261-
wq->state = IDXD_WQ_DISABLED;
262261
}
263262

264263
int idxd_wq_map_portal(struct idxd_wq *wq)
@@ -378,6 +377,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
378377
struct idxd_device *idxd = wq->idxd;
379378

380379
lockdep_assert_held(&wq->wq_lock);
380+
wq->state = IDXD_WQ_DISABLED;
381381
memset(wq->wqcfg, 0, idxd->wqcfg_size);
382382
wq->type = IDXD_WQT_NONE;
383383
wq->threshold = 0;

0 commit comments

Comments
 (0)