]> git.baikalelectronics.ru Git - kernel.git/commit
bus: mhi: host: pci_generic: Add missing poweroff() PM callback
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tue, 5 Apr 2022 12:59:07 +0000 (18:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:30 +0000 (09:14 +0200)
commit045fcbbd64a7aed4891d566337c0faa3e7cff6cd
tree4c5f054e6e7a3cc0e3f8e074ab1051367a1e618b
parent4d078fa6a15365c4412d9f1242da67fec5d1cdec
bus: mhi: host: pci_generic: Add missing poweroff() PM callback

commit b6270200f3f46feae76044170cbb03ad60751bee upstream.

During hibernation process, once thaw() stage completes, the MHI endpoint
devices will be in M0 state post recovery. After that, the devices will be
powered down so that the system can enter the target sleep state. During
this stage, the PCI core will put the devices in D3hot. But this transition
is allowed by the MHI spec. The devices can only enter D3hot when it is in
M3 state.

So for fixing this issue, let's add the poweroff() callback that will get
executed before putting the system in target sleep state during
hibernation. This callback will power down the device properly so that it
could be restored during restore() or thaw() stage.

Cc: stable@vger.kernel.org
Fixes: 86379c9250e5 ("bus: mhi: pci-generic: Fix hibernation")
Reported-by: Hemant Kumar <quic_hemantk@quicinc.com>
Suggested-by: Hemant Kumar <quic_hemantk@quicinc.com>
Link: https://lore.kernel.org/r/20220405125907.5644-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/pci_generic.c