From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Andi Kleen <ak@suse.de>, LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] x86/x86-64 PCI domain support
Date: Sun, 02 Sep 2007 10:15:17 -0700 [thread overview]
Message-ID: <46DAEFA5.70800@oracle.com> (raw)
In-Reply-To: <46DAEB58.3070109@garzik.org>
Jeff Garzik wrote:
> Randy Dunlap wrote:
>> On Sat, 01 Sep 2007 18:40:27 -0400 Jeff Garzik wrote:
>>
>>> Andi Kleen wrote:
>>>>>> The second function is redundant?
>>>>> No, it's a hook we must implement, when CONFIG_PCI_DOMAINS is enabled.
>>>> Then the other function is redundant.
>>> No, both functions are required by the interface.
>>
>> by what interface? and why, please? (instead of just stating
>> "required")
>
> grep for CONFIG_PCI_DOMAINS in arch code and include/linux/pci.h.
Thanks, I get it.
> This is normal "arch" interface: you enable a define, and a group of
> functions is assumed to be present. Otherwise (!defined), a set of stub
> no-ops is activated for your arch.
>
> I have implemented the [small] group of functions the code assumes to be
> present, when CONFIG_PCI_DOMAINS is enabled, like all the other arches
> that implement PCI domain support.
+#ifdef CONFIG_PCI_DOMAINS
+static inline int pci_domain_nr(struct pci_bus *bus)
+{
+ struct pci_sysdata *sd = bus->sysdata;
+ return sd->domain;
+}
+
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+ return pci_domain_nr(bus);
+}
+#endif /* CONFIG_PCI_DOMAINS */
So if CONFIG_PCI_DOMAINS=y, proc_proc_domain() decides to print the domain nr
in /proc iff the domain nr != 0 ? so that the /proc file format is
different depending on the domain nr (0 vs. !0) ?
I suppose that is similar to what arch/powerpc/kernel/pci_64.c does
with hose->buid. I think that I had rather see the domain nr printed
whenever CONFIG_PCI_DOMAINS=y... oh well.
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2007-09-02 17:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-01 14:32 [PATCH] x86/x86-64 PCI domain support Jeff Garzik
2007-09-01 22:00 ` Andi Kleen
2007-09-01 22:06 ` Jeff Garzik
2007-09-01 22:26 ` Andi Kleen
2007-09-01 22:40 ` Jeff Garzik
2007-09-02 16:46 ` Randy Dunlap
2007-09-02 16:56 ` Jeff Garzik
2007-09-02 17:15 ` Randy Dunlap [this message]
2007-09-02 9:19 ` Muli Ben-Yehuda
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=46DAEFA5.70800@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@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