[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACVXFVPLTHZkveghRc+sp6Fid=Mft5FKW1Yk1Stmj+EEpZwYwQ@mail.gmail.com>
Date: Sat, 8 Dec 2012 00:27:34 +0800
From: Ming Lei <ming.lei@...onical.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Wedson Almeida Filho <wedsonaf@...il.com>,
Greg KH <gregkh@...uxfoundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Linux PM List <linux-pm@...r.kernel.org>
Subject: Re: Race condition between driver_probe_device and device_shutdown
On Fri, Dec 7, 2012 at 11:25 PM, Alan Stern <stern@...land.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists