Bluetooth: btintel_pcie: Use blocking reset for FLR
Subsystems (2)
PATCH v2 1/1 Bluetooth: btintel_pcie: Use blocking reset for FLR
Several paths request an FLR asynchronously, including S3/S4 resume, resume recovery, HCI reset, and hardware-error recovery. A queued reset may run before the PM callback releases the PCI device lock, causing pci_try_reset_function() to return -EAGAIN without attempting the FLR.
Use pci_reset_function() so reset work waits for the device lock and performs the FLR once the PM callback releases it. If the reset fails, clear the recovery in-progress flag so a later reset request can try again.
--- drivers/bluetooth/btintel_pcie.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/bluetooth/btintel_pcie.c +7 -10
@@ -3745,13 +3745,10 @@ static int btintel_pcie_perform_flr(struct btintel_pcie_data *data)struct pci_dev *pdev = data->pdev;int err; -/* pci_try_reset_function() avoids the device_lock ABBA against -* btintel_pcie_remove(): .remove() runs with device_lock held and -* then waits for this work via disable_work_sync(); the blocking -* pci_reset_function() would deadlock by trying to re-acquire -* device_lock here. +/* Reset work runs asynchronously, so it can wait for the device lock +* held by a PM callback to be released. */ - err =pci_try_reset_function (pdev); + err =pci_reset_function (pdev);if (err) {BT_ERR ("Failed resetting the pcie device (%d)" , err);return err;
@@ -3817,6 +3814,7 @@ static void btintel_pcie_reset_work(struct work_struct *wk)enable_work (&data->hwexp_work);enable_work (&data->fwtrigger_work);enable_work (&data->mbox_work); +clear_bit (BTINTEL_PCIE_RECOVERY_IN_PROGRESS , &data->flags); } out:
@@ -3841,10 +3839,9 @@ static void btintel_pcie_reset_work(struct work_struct *wk)* in-flight one (whose recovery will reinitialize the device * regardless of the dropped trigger's variant). * -* The bit is cleared only by .remove() / re-probe via fresh devm -* allocation, which is the intended one-shot semantics: a reset -* tears down and re-probes 'data', so there is no "in-flight" -* reset to follow up after device_reprobe() succeeds. +* A successful reset clears the bit through .remove() / re-probe via +* fresh devm allocation. A failed FLR clears it in reset_work so a +* later request can retry; there is no in-flight reset after failure. */ static void btintel_pcie_request_reset (struct btintel_pcie_data *data,enum btintel_pcie_reset_type type)
Signature · 1 line
2.43.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1186224/
---Test result---
Test Summary:
CheckPatch PASS 0.92 seconds VerifyFixes PASS 0.06 seconds VerifySignedoff PASS 0.06 seconds GitLint PASS 0.21 seconds SubjectPrefix PASS 0.06 seconds BuildKernel PASS 29.56 seconds CheckAllWarning PASS 33.43 seconds CheckSparse PASS 36.14 seconds BuildKernel32 PASS 32.05 seconds CheckKernelLLVM PASS 33.29 seconds TestRunnerSetup PASS 716.90 seconds IncrementalBuild PASS 28.39 seconds
https://github.com/bluez/bluetooth-next/pull/942
---
Regards,
Linux Bluetooth