Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772Ab2FEUoS (ORCPT ); Tue, 5 Jun 2012 16:44:18 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:47758 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751882Ab2FEUoQ (ORCPT ); Tue, 5 Jun 2012 16:44:16 -0400 Date: Tue, 5 Jun 2012 16:44:15 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Greg Kroah-Hartman cc: Ming Lei , USB list , Kernel development list , Paul McKenney Subject: Re: [PATCH] driver core: fix shutdown races with probe/remove In-Reply-To: <20120605202137.GD27297@kroah.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 716 Lines: 21 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/