Skip to content

Commit c38f83b

Browse files
bus: mhi: host: pci_generic: Flush recovery worker during freeze
It is possible that the recovery work might be running while the freeze gets executed (during hibernation etc.,). Currently, we don't powerdown the stack if it is not up but if the recovery work completes after freeze, then the device will be up afterwards. This will not be a sane situation. So let's flush the recovery worker before trying to powerdown the device. Cc: [email protected] Fixes: 5f0c2ee ("bus: mhi: pci-generic: Fix hibernation") Reported-by: Bhaumik Vasav Bhatt <[email protected]> Reviewed-by: Bhaumik Vasav Bhatt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent e64d5fa commit c38f83b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/bus/mhi/host/pci_generic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ static int __maybe_unused mhi_pci_freeze(struct device *dev)
10601060
* the intermediate restore kernel reinitializes MHI device with new
10611061
* context.
10621062
*/
1063+
flush_work(&mhi_pdev->recovery_work);
10631064
if (test_and_clear_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status)) {
10641065
mhi_power_down(mhi_cntrl, true);
10651066
mhi_unprepare_after_power_down(mhi_cntrl);

0 commit comments

Comments
 (0)