Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932634Ab3D2VX6 (ORCPT ); Mon, 29 Apr 2013 17:23:58 -0400 Received: from mga02.intel.com ([134.134.136.20]:25974 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932466Ab3D2VX4 (ORCPT ); Mon, 29 Apr 2013 17:23:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,576,1363158000"; d="scan'208";a="328477565" Date: Mon, 29 Apr 2013 14:23:50 -0700 From: Sarah Sharp To: Greg Kroah-Hartman Cc: Bjorn Helgaas , Yinghai Lu , Gu Zheng , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] PCI: Fix racing for pci device removing via sysfs Message-ID: <20130429212350.GA14978@xanatos> References: <1366940841-15370-1-git-send-email-yinghai@kernel.org> <517E45C8.4060407@cn.fujitsu.com> <20130429181550.GA17343@google.com> <20130429182142.GA3385@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130429182142.GA3385@kroah.com> 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: 2014 Lines: 41 On Mon, Apr 29, 2013 at 11:21:42AM -0700, Greg Kroah-Hartman wrote: > On Mon, Apr 29, 2013 at 11:15:50AM -0700, Bjorn Helgaas wrote: > > On Mon, Apr 29, 2013 at 08:19:10AM -0700, Yinghai Lu wrote: > > > On Mon, Apr 29, 2013 at 3:04 AM, Gu Zheng wrote: > > > > On 04/27/2013 05:01 AM, Yinghai Lu wrote: > > > >> On Fri, Apr 26, 2013 at 1:53 PM, Bjorn Helgaas wrote: > > > >>> > > > >>> You can't be serious. This is a disgusting mess. Checking a list > > > >>> pointer for LIST_POISON1? As far as I'm concerned, this is a waste of > > > >>> my time. > > > > > > looks like xhci is using that LIST_POISON1 ... > > > > > Maybe my allergic reaction to your use of LIST_POISON1 is unjustified, > > but I am dubious about the idea that xhci was the only place that needed > > it before now, and we just happened to find one more place in PCI that > > needs it. That doesn't make sense because good design patterns are used > > many times, not just once or twice. > > > > I thought the whole point of the get/put scheme was that if we had a > > pointer to a correctly reference-counted object, we didn't need to check > > whether the object was still valid because the object remains valid until > > all the references are released. > > You are correct, you shouldn't have to worry about that. If you have to > do something like the LIST_POISON test, something is really wrong. All right, I'll take a look at the xHCI code. From a brief glance, both places that use LIST_POISON are handling a timed-out command. The command handling in xHCI needs to get completely reworked anyway, due to other race conditions. Were you suggesting I use the get/put scheme in the xHCI driver, or was that for Yinghai? Sarah Sharp -- 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/