• Yinbo Zhu's avatar
    usb: ohci-platform: fix usb disconnect issue after s4 · f3d47885
    Yinbo Zhu authored
    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 'cd1965db ("USB: ohci: move ohci_pci_{
    suspend,resume} to ohci-hcd.c")' and commit '6ec4beb5 ("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: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarYinbo Zhu <zhuyinbo@loongson.cn>
    Link: https://lore.kernel.org/r/20220902063639.17875-1-zhuyinbo@loongson.cnSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f3d47885
ohci-platform.c 9.18 KB