lkml.org 
[lkml]   [2013]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI: Fix racing for pci device removing via sysfs
On Mon, Apr 29, 2013 at 02:23:50PM -0700, Sarah Sharp wrote:
> 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 <guz.fnst@cn.fujitsu.com> wrote:
> > > > > On 04/27/2013 05:01 AM, Yinghai Lu wrote:
> > > > >> On Fri, Apr 26, 2013 at 1:53 PM, Bjorn Helgaas <bhelgaas@google.com> 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?

I thought for Yinghai, but really, no code should have to check that
type of thing, so if the xhci driver is, it shouldn't :)

thanks,

greg k-h


\
 
 \ /
  Last update: 2013-04-30 00:21    [W:0.875 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site