On 7 Mar 2005, Eric W. Biederman wrote:

> David Brownell <[EMAIL PROTECTED]> writes:
> 
> > On Monday 07 March 2005 2:08 pm, Eric W. Biederman wrote:
> > 
> > > 
> > > The ongoing DMA transfers which are companions of the irq generating
> > > events are what really concern me, as we could get all kinds of
> > > interesting memory stomps.  Do you think you could implement
> > > a reboot notifier or a shutdown() method to handle that case?
> > > 
> > > This appears to be yet another case of kexec transforming theoretical
> > > bugs into actual ones.  Groan.
> > 
> > Reboot notifiers seem to be a more general solution than the
> > driver model shutdown() hooks, since as Alan noted not every
> > bus framework uses shutdown() ... and although remove() would
> > solve the issue too, for essentially all busses, it doesn't
> > kick in here (and linker tricks may have removed it anyway).
> 
> shutdown()/remove() are better in that they are more likely
> to get any ordering requirements correct.   Making the
> connection between a reboot notifier and a driver is a messing
> proposition. 
> 
> Possibly a version of suspend that only would quiesce the device
> would work as well.

I can implement either a shutdown method or a reboot notifier for
uhci-hcd.  Note however that the upcoming changes to the PM core include a
suspend call (PMSG_FREEZE) that does exactly what you want: quiesce the
device, disable IRQ and DMA, but don't necessarily switch the power level.  
(See Documentation/power/devices.txt.)  Unfortunately it won't be
implemented until another few kernel releases have gone by.

The idea of using kexec to recover from a partially-damaged kernel seems 
unreliable.  Even attempting to quiesce devices prior to rebooting may 
not work because of locks whose owners have crashed.

> There used to be documentation in Documentation/driver-model/
> for the shutdown() method but it is no longer there.
> 
> It looks fairly clear that shutdown() has not been implemented
> to any reasonable degree so it may be time to revisit that.
> 
> The whole linux reboot path is a mess. 

Indeed.

Alan Stern



-------------------------------------------------------
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