diff options
author | Ryo Kataoka <ryo.kataoka.wt@renesas.com> | 2019-03-22 20:50:33 +0900 |
---|---|---|
committer | Ryo Kataoka <ryo.kataoka.wt@renesas.com> | 2019-03-22 20:50:33 +0900 |
commit | 442e4daf2ba7cee3749f0cc6c6f0b3d15f0804ed (patch) | |
tree | ddc7008daf1ee2b20b9c7054fcec7160c75601a7 | |
parent | 1381140743fc2acd5b125b9adefad7717fada71b (diff) | |
parent | 42378b1937bb1b6af914cfc0f3bd79d0cd6125e8 (diff) | |
download | renesas-bsp-442e4daf2ba7cee3749f0cc6c6f0b3d15f0804ed.tar.gz |
Merge branch 'rcar-3.9.2/ehci_ohci.rc1' into v4.14.75-ltsi/rcar-3.9.3
* rcar-3.9.2/ehci_ohci.rc1:
USB: ohci-hcd.c: Add spinlock when disabling OHCI interrupts in ohci_shutdown
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 41fd0b8937d715..c9be649a2a5645 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -424,8 +424,13 @@ ohci_shutdown (struct usb_hcd *hcd) struct ohci_hcd *ohci; ohci = hcd_to_ohci (hcd); - ohci_writel(ohci, (u32) ~0, &ohci->regs->intrdisable); + /* Locking is not necessary if HC dies */ + if (!test_bit(HCD_FLAG_DEAD, &hcd->flags)) + spin_lock_irq(&ohci->lock); + + /* Disable HC interrupts */ + ohci_writel(ohci, (u32)~0, &ohci->regs->intrdisable); /* Software reset, after which the controller goes into SUSPEND */ ohci_writel(ohci, OHCI_HCR, &ohci->regs->cmdstatus); ohci_readl(ohci, &ohci->regs->cmdstatus); /* flush the writes */ @@ -433,6 +438,10 @@ ohci_shutdown (struct usb_hcd *hcd) ohci_writel(ohci, ohci->fminterval, &ohci->regs->fminterval); ohci->rh_state = OHCI_RH_HALTED; + + if (!test_bit(HCD_FLAG_DEAD, &hcd->flags)) + spin_unlock_irq(&ohci->lock); + } /*-------------------------------------------------------------------------* |