Skip to content

Commit f80d3a3

Browse files
chenhuacaiKexyBiscuit
authored andcommitted
AOSCOS: USB: OHCI: Fix ohci_resume() for hibernation
During hibernation restore, some OHCI controllers (such as in AMD RS780 and Loongson LS7A) may generate RHSC interrupt. Once RHSC interrupt occurs, it will be NOT really handled (just return IRQ_NOTMINE) by ohci_irq() because of OHCI_RH_HALTED at that time, until HCR command done. So we turn off MIE before OHCI reset to prevent from possible interrupt so that to reset safely. MIE will be enabled later in ohci_rh_resume(), and as a result this patch is also suitable for controllers without this trouble. Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Jianmin Lv <[email protected]> Signed-off-by: Kexy Biscuit <[email protected]>
1 parent c14ee07 commit f80d3a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/host/ohci-hcd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,10 @@ int ohci_resume(struct usb_hcd *hcd, bool hibernated)
11391139
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
11401140

11411141
/* Make sure resume from hibernation re-enumerates everything */
1142-
if (hibernated)
1142+
if (hibernated) {
1143+
ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
11431144
ohci_usb_reset(ohci);
1145+
}
11441146

11451147
/* See if the controller is already running or has been reset */
11461148
ohci->hc_control = ohci_readl(ohci, &ohci->regs->control);

0 commit comments

Comments
 (0)