Skip to contentSkip to conversation

crypto: qat - cancel work on re-enable SR-IOV timeout

PATCH In review Giovanni Cabiddu 2 participants 2 messages Jun 8 – Jul 5

Subsystems (2)
lore
Share & tools
lore

Giovanni Cabiddu

author maintainer
#0 lore raw

PATCH 1/1 crypto: qat - cancel work on re-enable SR-IOV timeout

The QAT reset worker queues SR-IOV reenable work using a work_struct and completion embedded in an on-stack adf_sriov_dev_data. If the completion wait times out, the reset worker can return while device_sriov_wq still holds or executes the stack-backed work item.

Cancel the work on the device_sriov_wq on timeout before the stack frame unwinds.

Fixes 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")
---
 drivers/crypto/intel/qat/qat_common/adf_aer.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/crypto/intel/qat/qat_common/adf_aer.c +2 -0
index d58cd7fbf707..afded3030e9a 100644
@@ -189,6 +189,8 @@ static void adf_device_reset_worker(struct work_struct *work)
 	queue_work(device_sriov_wq, &sriov_data.sriov_work);
 	if (wait_for_completion_timeout(&sriov_data.compl, wait_jiffies))
 		adf_pf2vf_notify_restarted(accel_dev);
+	else
+		cancel_work_sync(&sriov_data.sriov_work);
 
 	adf_dev_restarted_notify(accel_dev);
 	clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);

base-commit: 36d82ddc0f8a88444e8d65646a3c43147005ed35

Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 8 lines · Giovanni Cabiddu

The QAT reset worker queues SR-IOV reenable work using a work_struct and completion embedded in an on-stack adf_sriov_dev_data. If the completion wait times out, the reset worker can return while device_sriov_wq still holds or executes the stack-backed work item.

Cancel the work on the device_sriov_wq on timeout before the stack frame unwinds.

Quoted 6 lines
Fixes 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")
---
 drivers/crypto/intel/qat/qat_common/adf_aer.c | 2 ++
 1 file changed, 2 insertions(+)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt