summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-22 15:45:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-22 15:45:22 +0200
commite90d20c9df11cf33e33e6e3e1445454e044216b1 (patch)
tree8b09904b8bdf804f0114954a340e5da8596da374 /drivers
parentLinux 5.18-rc2 (diff)
parentbus: mhi: host: pci_generic: Flush recovery worker during freeze (diff)
downloadlinux-e90d20c9df11cf33e33e6e3e1445454e044216b1.tar.xz
linux-e90d20c9df11cf33e33e6e3e1445454e044216b1.zip
Merge tag 'mhi-fixes-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-linus
Manivannan writes: MHI fixes for v5.18 Couple of patches fixing the hibernation issue seen on MHI endpoint devices like SDX65 modems: - During hibernation, the host puts the device into D3cold after thaw() stage. But at that time, the device would be in M0 state. So the device emits a warning (not visible to the host but to device firmware only) stating invalid transition. This is fixed by adding a poweroff() callback that puts the device into M3 before D3cold. - There is a possibility that the recovery worker might be running while trying to powerdown the device. So flush the recovery worker before that. * tag 'mhi-fixes-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi: bus: mhi: host: pci_generic: Flush recovery worker during freeze bus: mhi: host: pci_generic: Add missing poweroff() PM callback
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bus/mhi/host/pci_generic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index 9527b7d63840..541ced27d941 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -1060,6 +1060,7 @@ static int __maybe_unused mhi_pci_freeze(struct device *dev)
* the intermediate restore kernel reinitializes MHI device with new
* context.
*/
+ flush_work(&mhi_pdev->recovery_work);
if (test_and_clear_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status)) {
mhi_power_down(mhi_cntrl, true);
mhi_unprepare_after_power_down(mhi_cntrl);
@@ -1085,6 +1086,7 @@ static const struct dev_pm_ops mhi_pci_pm_ops = {
.resume = mhi_pci_resume,
.freeze = mhi_pci_freeze,
.thaw = mhi_pci_restore,
+ .poweroff = mhi_pci_freeze,
.restore = mhi_pci_restore,
#endif
};