]> git.baikalelectronics.ru Git - kernel.git/commit
usb: ohci-platform: fix usb disconnect issue after s4
authorYinbo Zhu <zhuyinbo@loongson.cn>
Fri, 2 Sep 2022 06:36:39 +0000 (14:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Sep 2022 11:08:00 +0000 (13:08 +0200)
commit6d8a63f7c4696d0c8aa63b157ac161c39db2d075
tree30a0b84f4a134f49a423d17e6e66306cc7dd575a
parent57a0d8d5f98c0b5d166c530611e606429a887ecc
usb: ohci-platform: fix usb disconnect issue after s4

The ohci retaining bogus hardware states cause usb disconnect devices
connected before hibernation(s4), this issue occur when ohci-platform
driver build as a module and the built-in ohci-platform driver will
re probe and re enumerate the devices, so there will be no such problem.

Avoid retaining bogus hardware states during resume-from-hibernation.
Previously we had reset the hardware as part of preparing to reinstate
the snapshot image. But we can do better now with the new PM framework,
since we know exactly which resume operations are from hibernation.

According to the commit '58d8c485b86d ("USB: ohci: move ohci_pci_{
suspend,resume} to ohci-hcd.c")' and commit '3702952f449d ("USB: new
flag for resume-from-hibernation")', the flag "hibernated" is for
resume-from-hibernation and it should be true when usb resume from disk.

When this flag "hibernated" is set, the drivers will reset the hardware
to get rid of any existing state and make sure resume from hibernation
re-enumerates everything for ohci.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
Link: https://lore.kernel.org/r/20220902063639.17875-1-zhuyinbo@loongson.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-platform.c