All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] pci_find_* to pci_get_*
Date: Mon, 20 Sep 2004 17:12:13 +0000	[thread overview]
Message-ID: <20040920181213.A13178@infradead.org> (raw)
In-Reply-To: <1095662774.4052.10.camel@sfeldma-mobl2.dsl-verizon.net>

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On Mon, Sep 20, 2004 at 12:39:44PM +0100, Matthew Wilcox wrote:
> On Mon, Sep 20, 2004 at 01:20:20AM -0700, Scott Feldman wrote:
> > diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> > --- a/drivers/net/e1000/e1000_main.c	2004-09-20 00:25:03 -07:00
> > +++ b/drivers/net/e1000/e1000_main.c	2004-09-20 00:25:03 -07:00
> > @@ -2789,9 +2789,10 @@
> >  	case SYS_DOWN:
> >  	case SYS_HALT:
> >  	case SYS_POWER_OFF:
> > -		while((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
> > +		while((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
> >  			if(pci_dev_driver(pdev) == &e1000_driver)
> >  				e1000_suspend(pdev, 3);
> > +			pci_dev_put(pdev);
> >  		}
> >  	}
> >  	return NOTIFY_DONE;
> 
> Ummm... there's still a race here.  Between the pci_dev_put() returning and
> the invocation of pci_get_device(), the pdev can go away.  I guess you have
> to do something like:

Umm, no.  Just implement the ->shutdown method and kill all this junk ;-)

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2004-09-20 17:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20  6:46 [Kernel-janitors] pci_find_* to pci_get_* Scott Feldman
2004-09-20  7:03 ` Greg KH
2004-09-20  8:20 ` Scott Feldman
2004-09-20 11:39 ` Matthew Wilcox
2004-09-20 15:37 ` Greg KH
2004-09-20 15:38 ` Greg KH
2004-09-20 17:12 ` Christoph Hellwig [this message]
2004-09-20 18:16 ` Feldman, Scott
2004-09-20 18:25 ` Hanna Linder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040920181213.A13178@infradead.org \
    --to=hch@infradead.org \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.