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.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZ6VDKoFIy9ikWCeXVZ8R5v6RzvUFAmJWjlgACgkQVZ8R5v6R
 zvVCBAf+IbM923JOgGtevCqvStFSEBsHUqr8XZSAhNLD6MdeITlNGbkd3Esf/Tl7
 09+mn6mXX5Y0vKKyXqO9g52MBaiaVeTKdoqreYQjAVQVxFAFX1n3+WF/oh7E915Q
 WnTYmJ/XEcM+v1XZNWlrmc9pzbvLzr7c+1aWav7/cn90MXDa1uTIudX1Unjzt9E0
 SWmyVgIFgLDU7oNznp1O7G9kpimu9IAntZOtkUl/r6c66bR4nrb3X6w1yicp7mvj
 wLamYc8iaHohxpfCApKo+yXuvAKdib98W71a39UdbJ32fj9duORMGjC4pnckL+dx
 JmGQ3nENuSdJcZjNCudlOH3G6a156g==
 =9xW7
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Greg Kroah-Hartman 2022-04-22 15:45:22 +02:00
commit e90d20c9df
1 changed files with 2 additions and 0 deletions
drivers/bus/mhi/host

View File

@ -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
};