Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752744Ab2FEUVp (ORCPT ); Tue, 5 Jun 2012 16:21:45 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:37194 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752666Ab2FEUVn (ORCPT ); Tue, 5 Jun 2012 16:21:43 -0400 Date: Wed, 6 Jun 2012 05:21:37 +0900 From: Greg Kroah-Hartman To: Alan Stern Cc: Ming Lei , USB list , Kernel development list , Paul McKenney Subject: Re: [PATCH] driver core: fix shutdown races with probe/remove Message-ID: <20120605202137.GD27297@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1374 Lines: 33 On Tue, Jun 05, 2012 at 01:09:45PM -0400, Alan Stern wrote: > On Tue, 5 Jun 2012, Ming Lei wrote: > > > On Tue, Jun 5, 2012 at 10:47 PM, Alan Stern wrote: > > > > > > Avoid running probe, that's fine. ?But avoiding remove can lead to > > > problems, because the subsystem and the driver will no longer agree on > > > who should manage the device. > > > > After device_shutdown() has been called, the whole system will enter power down > > or reset later, so it doesn't matter if who should manage the device. > > Maybe. But there might be quite some time between the shutdown call > and the eventual power-off or reboot. > > > Also once shutdown callback is called for the device, looks its other callbacks > > should not touch the device any more. > > You shouldn't depend on that. Shutdown methods generally put the > device into a state suitable for power-off or reboot; they don't often > guarantee that the driver won't change the state later on. > > On the whole, it might be easier just to hold the device lock during > the shutdown call. That sounds much simpler to me. greg k-h -- 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/