Skip to content

Commit 72f30b6

Browse files
David Brownellgregkh
authored andcommitted
[PATCH] USB: ehci.patch (earlier irq disable)
This tweaks the EHCI reboot notifier to also halt the EHCI controller, and makes that halt code force IRQs off. Both should always have been done. Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> drivers/usb/host/ehci-hcd.c | 8 ++++++++ 1 file changed, 8 insertions(+)
1 parent 7efe5d7 commit 72f30b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/usb/host/ehci-hcd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ static int ehci_halt (struct ehci_hcd *ehci)
182182
{
183183
u32 temp = readl (&ehci->regs->status);
184184

185+
/* disable any irqs left enabled by previous code */
186+
writel (0, &ehci->regs->intr_enable);
187+
185188
if ((temp & STS_HALT) != 0)
186189
return 0;
187190

@@ -335,12 +338,17 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
335338

336339
#endif
337340

341+
/* Reboot notifiers kick in for silicon on any bus (not just pci, etc).
342+
* This forcibly disables dma and IRQs, helping kexec and other cases
343+
* where the next system software may expect clean state.
344+
*/
338345
static int
339346
ehci_reboot (struct notifier_block *self, unsigned long code, void *null)
340347
{
341348
struct ehci_hcd *ehci;
342349

343350
ehci = container_of (self, struct ehci_hcd, reboot_notifier);
351+
(void) ehci_halt (ehci);
344352

345353
/* make BIOS/etc use companion controller during reboot */
346354
writel (0, &ehci->regs->configured_flag);

0 commit comments

Comments
 (0)