From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>
Subject: [RFC/PATCH 6/10] powerpc: pci32: Add platform option to enable /proc PCI domains
Date: Thu, 06 Dec 2007 19:11:35 +1100 [thread overview]
Message-ID: <20071206081246.C94C3DE502@ozlabs.org> (raw)
In-Reply-To: <1196928690.864849.322811660859.qpush@grosgo>
This adds flags the platforms can use to enable domain numbers
in /proc/bus/pci.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/pci-common.c | 20 ++++++++++++++++++++
arch/powerpc/kernel/pci_64.c | 12 ------------
include/asm-powerpc/pci-bridge.h | 5 +++++
include/asm-powerpc/pci.h | 14 ++++----------
4 files changed, 29 insertions(+), 22 deletions(-)
Index: linux-work/arch/powerpc/kernel/pci-common.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci-common.c 2007-12-05 13:33:21.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c 2007-12-05 13:34:51.000000000 +1100
@@ -656,3 +656,23 @@ void __devinit pci_process_bridge_OF_ran
hose->mem_resources[memno-1] = tmp;
}
}
+
+/* Decide whether to display the domain number in /proc */
+int pci_proc_domain(struct pci_bus *bus)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return 0;
+ else {
+ struct pci_controller *hose = pci_bus_to_host(bus);
+#ifdef CONFIG_PPC64
+ return hose->buid != 0;
+#else
+ if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS))
+ return 0;
+ if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0)
+ return hose->global_number != 0;
+ return 1;
+#endif
+ }
+}
+
Index: linux-work/arch/powerpc/kernel/pci_64.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/pci_64.c 2007-12-05 13:33:21.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci_64.c 2007-12-05 13:33:34.000000000 +1100
@@ -580,18 +580,6 @@ int pcibios_enable_device(struct pci_dev
return 0;
}
-/* Decide whether to display the domain number in /proc */
-int pci_proc_domain(struct pci_bus *bus)
-{
- if (firmware_has_feature(FW_FEATURE_ISERIES))
- return 0;
- else {
- struct pci_controller *hose = pci_bus_to_host(bus);
- return hose->buid != 0;
- }
-}
-
-
#ifdef CONFIG_HOTPLUG
int pcibios_unmap_io_space(struct pci_bus *bus)
Index: linux-work/include/asm-powerpc/pci-bridge.h
===================================================================
--- linux-work.orig/include/asm-powerpc/pci-bridge.h 2007-12-05 13:33:21.000000000 +1100
+++ linux-work/include/asm-powerpc/pci-bridge.h 2007-12-05 13:33:34.000000000 +1100
@@ -28,6 +28,11 @@ enum {
* ISA forwarding enabled
*/
PPC_PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
+
+ /* Enable domain numbers in /proc */
+ PPC_PCI_ENABLE_PROC_DOMAINS = 0x00000010,
+ /* ... except for domain 0 */
+ PPC_PCI_COMPAT_DOMAIN_0 = 0x00000020,
};
Index: linux-work/include/asm-powerpc/pci.h
===================================================================
--- linux-work.orig/include/asm-powerpc/pci.h 2007-12-05 13:33:21.000000000 +1100
+++ linux-work/include/asm-powerpc/pci.h 2007-12-05 13:33:34.000000000 +1100
@@ -98,9 +98,6 @@ static inline void pci_dma_burst_advice(
#define get_pci_dma_ops() NULL
#endif
-/* Decide whether to display the domain number in /proc */
-extern int pci_proc_domain(struct pci_bus *bus);
-
#else /* 32-bit */
#ifdef CONFIG_PCI
@@ -112,17 +109,14 @@ static inline void pci_dma_burst_advice(
*strategy_parameter = ~0UL;
}
#endif
-
-/* Set the name of the bus as it appears in /proc/bus/pci */
-static inline int pci_proc_domain(struct pci_bus *bus)
-{
- return 0;
-}
-
#endif /* CONFIG_PPC64 */
extern int pci_domain_nr(struct pci_bus *bus);
+/* Decide whether to display the domain number in /proc */
+extern int pci_proc_domain(struct pci_bus *bus);
+
+
struct vm_area_struct;
/* Map a range of PCI memory or I/O space for a device into user space */
int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
next prev parent reply other threads:[~2007-12-06 8:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-06 8:11 [RFC/PATCH 0/10] powerpc: PCI updates & merges Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 1/10] powerpc: pci32: remove bogus alignment message Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 2/10] powerpc: pci32: use generic pci_assign_unassign_resources Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 4/10] powerpc: pci32: Add flags modifying the PCI code behaviour Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 3/10] powerpc: pci32: Remove PowerMac P2P bridge IO hack Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 5/10] powerpc: pci32: Remove obsolete PowerMac bus number hack Benjamin Herrenschmidt
2007-12-06 17:02 ` Jon Loeliger
2007-12-06 8:11 ` Benjamin Herrenschmidt [this message]
2007-12-06 8:11 ` [RFC/PATCH 7/10] powerpc: Merge pcibios_resource_to_bus/bus_to_resource Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 8/10] powerpc: Merge PCI resource fixups Benjamin Herrenschmidt
2007-12-06 11:51 ` Stephen Rothwell
2007-12-06 8:11 ` [RFC/PATCH 9/10] powerpc: Merge PCI resource allocation & assignment Benjamin Herrenschmidt
2007-12-06 8:11 ` [RFC/PATCH 10/10] powerpc: Clear pci_probe_only on 64 bits PowerMac Benjamin Herrenschmidt
2007-12-07 10:19 ` [RFC/PATCH 0/10] powerpc: PCI updates & merges Stefan Roese
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=20071206081246.C94C3DE502@ozlabs.org \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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).