Re: [PATCH] usb: dwc2: Fix shutdown callback in platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 29, 2020 at 1:53 PM Doug Anderson <dianders@xxxxxxxxxxxx> wrote:
> >
> > I don't get it.  A hypothetical machine could have literally anything
> > sharing the IRQ line, right?
>
> It's not a real physical line, though?  I don't think it's common to
> have a shared interrupt between different IP blocks in a given SoC.
> Even if it existed, all the drivers should disable their interrupts?

I don't know, it's a hypothetical machine so it can be whatever you
want.  The driver requests shared irqs, if it doesn't actually support
irq sharing, it shouldn't request them.

> > Anyways, my screaming interrupt occurs after a a new kernel has been
> > booted with kexec.  In this case, it doesn't matter if the old kernel
> > called disable_irq or not.  As soon as the new kernel re-enables the
> > interrupt line, the kernel immediately disables it again with a
> > backtrace due to the unhandled screaming interrupt.  That's why the
> > dwc2 hardware needs to have its interrupts turned off when the old
> > kernel is shutdown.
>
> Isn't that a bug with your new kernel?  I've seen plenty of bugs where
> drivers enable their interrupt before their interrupt handler is set
> to handle it.  You never know what state the bootloader (or previous
> kernel) might have left things in and if an interrupt was pending it
> shouldn't kill you.

It wouldn't hurt to add disabling of the dwc2 irq early in dwc2
initialization, but why leave the irq screaming after shutdown?  If
there is another device using the same irq, it will generate unhandled
interrupt backtraces and get its irq disabled when the new kernel
requests its irq, if the device's driver is loaded before the dwc2
driver (assuming the new kernel even has a dwc2 driver).  The dwc2
driver in its current state will generate unhandled interrupt
backtraces by itself until it registers the right handler.

-- 
Frank



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux