lkml.org 
[lkml]   [2012]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] driver core: fix shutdown races with probe/remove
On Tue, Jun 05, 2012 at 01:09:45PM -0400, Alan Stern wrote:
> On Tue, 5 Jun 2012, Ming Lei wrote:
>
> > On Tue, Jun 5, 2012 at 10:47 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > >
> > > Avoid running probe, that's fine. ?But avoiding remove can lead to
> > > problems, because the subsystem and the driver will no longer agree on
> > > who should manage the device.
> >
> > After device_shutdown() has been called, the whole system will enter power down
> > or reset later, so it doesn't matter if who should manage the device.
>
> Maybe. But there might be quite some time between the shutdown call
> and the eventual power-off or reboot.
>
> > Also once shutdown callback is called for the device, looks its other callbacks
> > should not touch the device any more.
>
> You shouldn't depend on that. Shutdown methods generally put the
> device into a state suitable for power-off or reboot; they don't often
> guarantee that the driver won't change the state later on.
>
> On the whole, it might be easier just to hold the device lock during
> the shutdown call.

That sounds much simpler to me.

greg k-h


\
 
 \ /
  Last update: 2012-06-05 22:41    [W:0.096 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site