From: Michael Ellerman <michael@ellerman.id.au>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
sparclinux@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2/2] Use of_get_pci_dev_node() in axon_msi.c
Date: Tue, 23 Oct 2007 17:36:56 +1000 [thread overview]
Message-ID: <1193125016.20274.4.camel@concordia> (raw)
In-Reply-To: <20071018190939.GE29903@austin.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]
On Thu, 2007-10-18 at 14:09 -0500, Linas Vepstas wrote:
> On Thu, Oct 18, 2007 at 11:27:23AM +1000, Michael Ellerman wrote:
> >
> > It does what pci_device_to_OF_node() does, but in the right way.
> >
> > The plan is to remove pci_device_to_OF_node() once all the callers have
> > been converted to properly handle the refcounting.
>
> Oh. Yes. well, of course, then. Excellent reason. I didn't get
> that from the patch commit comments. So, FWIW:
>
> Ack'ed-by: Linas Vepstas <linas@austin.ibm.com>
Thanks for the ACK. But on further consideration I'm going to NACK my
own patch :)
The reasoning being that a lot of the code that uses
pci_device_to_OF_node() only uses the device_node while it also holds a
reference to the pci_dev - so there's no possibility of the device_node
going away.
So Ben suggested what we really want is two routines,
of_get_pci_dev_node() and of_peek_pci_dev_node() - the former returning
a refcounted copy and the latter allowing you to "peek" at the
device_node as long as you own the pci_dev.
I'm not sure it's worth the churn really, so we should probably just
document that pci_device_to_OF_node() is contrary, and any users that
need a reference can take one explicitly.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-10-23 7:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-17 7:12 [PATCH 1/2] Introduce of_get_pci_dev_node() Michael Ellerman
2007-10-17 7:12 ` [PATCH 2/2] Use of_get_pci_dev_node() in axon_msi.c Michael Ellerman
2007-10-17 11:22 ` David Miller
2007-10-17 11:23 ` David Miller
2007-10-18 1:23 ` Michael Ellerman
2007-10-17 11:36 ` Benjamin Herrenschmidt
2007-10-18 1:30 ` Michael Ellerman
2007-10-17 23:04 ` Linas Vepstas
2007-10-18 1:27 ` Michael Ellerman
2007-10-18 19:09 ` Linas Vepstas
2007-10-23 7:36 ` Michael Ellerman [this message]
2007-10-23 7:40 ` Benjamin Herrenschmidt
2007-10-18 5:22 ` Stephen Rothwell
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=1193125016.20274.4.camel@concordia \
--to=michael@ellerman.id.au \
--cc=davem@davemloft.net \
--cc=linas@austin.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=sfr@canb.auug.org.au \
--cc=sparclinux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).