[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1003041420510.1742-100000@iolanthe.rowland.org>
Date: Thu, 4 Mar 2010 14:22:34 -0500 (EST)
From: Alan Stern <stern@...land.harvard.edu>
To: Hugh Daschbach <hdasch@...adcom.com>
cc: Greg KH <gregkh@...e.de>, Kay Sievers <kay.sievers@...y.org>,
Jan Blunck <jblunck@...e.de>,
David Vrabel <david.vrabel@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
james Bottomley <James.Bottomley@...e.de>,
James Smart <james.smart@...lex.com>
Subject: RE: System reboot hangs due to race against devices_kset->list
triggered by SCSI FC workqueue
On Thu, 4 Mar 2010, Hugh Daschbach wrote:
> Apparently I still don't understand your original suggestion. I'd
> prefer to, especially if it leads to a simpler fix. The loop in
> device_shutdown() looks something like:
>
> struct device *dev, *devn;
>
> list_for_each_entry_safe_reverse(dev, devn, &devices_kset->list,
> kobj.entry) {
> if (dev->bus && dev->bus->shutdown) {
> dev->bus->shutdown(dev);
> } else if (dev->driver && dev->driver->shutdown) {
> dev->driver->shutdown(dev);
> }
> }
>
> *dev gets delinked kobj_kset_leave() indirectly called from
> dev->*->shutdown(dev). This is protected by the spinlock.
>
> The secondary thread similarly calls kobj_kset_leave(). But when the
> secondary thread calls the shutdown routine for the device that devn
> points to, the loop hangs.
>
> Is there some way I can detect that devn no longer points to a valid
> device upon return from dev->*->shutdown(dev)? Or, where else can I
> look to better understand your suggestion?
Did you read the patch in my previous message? You didn't quote it.
It removes the devn variable, so the problem you're worried about
cannot occur.
Alan Stern
--
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