Skip to content

Commit 00de6a5

Browse files
claudiubezneagregkh
authored andcommitted
usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses
On SAMA7G5 suspending ports will cut the access to OHCI registers and any subsequent access to them will lead to CPU being blocked trying to access that memory. Same thing happens on resume: if OHCI memory is accessed before resuming ports the CPU will block on that access. The OCHI memory is accessed on suspend/resume though ohci_suspend()/ohci_resume(). Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210721132905.1970713-1-claudiu.beznea@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 68d9f95 commit 00de6a5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/usb/host/ohci-at91.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,6 @@ ohci_hcd_at91_drv_suspend(struct device *dev)
611611
if (ohci_at91->wakeup)
612612
enable_irq_wake(hcd->irq);
613613

614-
ohci_at91_port_suspend(ohci_at91->sfr_regmap, 1);
615-
616614
ret = ohci_suspend(hcd, ohci_at91->wakeup);
617615
if (ret) {
618616
if (ohci_at91->wakeup)
@@ -632,7 +630,10 @@ ohci_hcd_at91_drv_suspend(struct device *dev)
632630
/* flush the writes */
633631
(void) ohci_readl (ohci, &ohci->regs->control);
634632
msleep(1);
633+
ohci_at91_port_suspend(ohci_at91->sfr_regmap, 1);
635634
at91_stop_clock(ohci_at91);
635+
} else {
636+
ohci_at91_port_suspend(ohci_at91->sfr_regmap, 1);
636637
}
637638

638639
return ret;
@@ -644,15 +645,15 @@ ohci_hcd_at91_drv_resume(struct device *dev)
644645
struct usb_hcd *hcd = dev_get_drvdata(dev);
645646
struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd);
646647

648+
ohci_at91_port_suspend(ohci_at91->sfr_regmap, 0);
649+
647650
if (ohci_at91->wakeup)
648651
disable_irq_wake(hcd->irq);
649652
else
650653
at91_start_clock(ohci_at91);
651654

652655
ohci_resume(hcd, false);
653656

654-
ohci_at91_port_suspend(ohci_at91->sfr_regmap, 0);
655-
656657
return 0;
657658
}
658659

0 commit comments

Comments
 (0)