Messages in this thread | | | Date | Sat, 8 Dec 2012 00:27:34 +0800 | Subject | Re: Race condition between driver_probe_device and device_shutdown | From | Ming Lei <> |
| |
On Fri, Dec 7, 2012 at 11:25 PM, Alan Stern <stern@rowland.harvard.edu> wrote: > On Fri, 7 Dec 2012, Ming Lei wrote: >> device_pm_lock() can prevent device_move() from being running. > > That wouldn't prevent problems during unbinding. Wedson is right; the
Right.
> places that lock dev->parent must save a local copy of dev->parent.
One simple fix is to remove acquiring/releasing dev->parent lock and get/put the parent reference, because holding the device lock only may avoid the race between probe/remove and shutdown.
But __driver_attach and __device_release_driver need save the local copy of dev->parent.
Thanks, -- Ming Lei
| |