Alan Stern <[EMAIL PROTECTED]> writes:

> Eric and Randy:
> 
> Can you answer a question regarding kexec?  How does it handle shared 
> IRQs when shutting down the old kernel?
> 
> The problem arises when the new kernel initializes a driver for the first
> device sharing an IRQ line.  The driver will enable the IRQ.  If the
> second device is actively generating an interrupt request the driver will
> ignore it, leading to "irq x - nobody cared" errors.  What does kexec do
> about this?
> 
> Normally the BIOS will disable all devices from generating interrupts 
> when it boots a kernel (all except for Legacy USB and a few others, that 
> is!).  Somehow kexec must duplicate that functionality.

There are two cases.
There is the kexec_on_panic case where we can't do anything.  And
will take some really robust drivers to deal with.

Then there is the primary case, kexec case where we can trust
the kernel code.  Before a reboot we call the reboot_notifiers
and the device_shutdown() (which calls the appropriate device method).
The expectation is that the drivers will shutdown DMA and IRQs from
their hardware.

The interrupt controllers are also disabled, until the new kernel
enables them.

The BIOS doesn't actually disable all devices from generating
interrupts that just happens to be their state coming out of
reset.

So in short the hooks are already in the device model they just need
to be used appropriately.

The common work around for devices not shutting down properly on
a reboot is to build the drivers modular and remove them
before the final kexec reboot.  Not a beautiful solution but
something that shows most drivers actually have a code path
where they do the right thing.

Eric



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to