[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVXFVMCaYPWMiWeKa7tz=Xmi4PLez-3=1rnVPODYvSXBG4Y2Q@mail.gmail.com>
Date: Tue, 22 May 2012 08:35:21 +0800
From: Ming Lei <ming.lei@...onical.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Wedson Almeida Filho <wedsonaf@...il.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 Tue, May 22, 2012 at 2:29 AM, Alan Stern <stern@...land.harvard.edu> wrote:
> On Mon, 21 May 2012, Ming Lei wrote:
>> Another candidate fix is to register a reboot notifier in driver core to prevent
>> driver from being bound or unbound from start of reboot/shutdown, but looks
>> not easy as the way of holding device locks.
>
> I'd guess it was done this way so that the shutdown task wouldn't have
> to wait for a buggy driver that didn't want to release the device lock
> (or that crashed while holding the lock).
Maybe, so I understand you agree on adding the device lock as did
in the patch, don't I?
Also we can add below line before acquiring device lock to help
toubleshoot buggy driver.
dev_dbg(dev, "acquiring device lock for shutdown\n");
>
> It's not clear that the reboot notifier approach would work. What
> about probes that had already started when notifier was called?
Looks holding device lock is still needed in the notifier callback for
handling the case if reboot notifier approach is taken.
IMO, the way of holding device lock is better than reboot notifier approach.
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