Re: [PATCH] driver core: fix shutdown races with probe/remove

From: Alan Stern
Date: Tue Jun 05 2012 - 16:44:11 EST


On Wed, 6 Jun 2012, Greg Kroah-Hartman wrote:

> > On the whole, it might be easier just to hold the device lock during
> > the shutdown call.
>
> That sounds much simpler to me.

Maybe use device_trylock() in a loop, and if the lock can't be acquired
within a second or so, either call the shutdown method without the lock
or else skip the device entirely.

That way, crashed or buggy drivers will have less chance of interfering
with system shutdown.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/