Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1324552 > unrolled thread
| Started by | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| First post | 2016-02-02 20:40 +0100 |
| Last post | 2016-02-05 23:40 +0100 |
| Articles | 8 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/5] Clean up warnings (part 2, asm/pci-bridge.h) Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 20:40 +0100
[PATCH 4/5] PCI: Remove empty asm-generic/pci-bridge.h Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 20:40 +0100
[PATCH 5/5] PCI: Remove includes of asm/pci-bridge.h Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 20:40 +0100
[PATCH 3/5] ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 20:40 +0100
[PATCH 1/5] PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 20:40 +0100
[PATCH 2/5] PCI: Remove includes of empty asm-generic/pci-bridge.h Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 20:50 +0100
Re: [PATCH 0/5] Clean up warnings (part 2, asm/pci-bridge.h) Will Deacon <will.deacon@arm.com> - 2016-02-03 10:30 +0100
Re: [PATCH 0/5] Clean up warnings (part 2, asm/pci-bridge.h) Bjorn Helgaas <helgaas@kernel.org> - 2016-02-05 23:40 +0100
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2016-02-02 20:40 +0100 |
| Subject | [PATCH 0/5] Clean up warnings (part 2, asm/pci-bridge.h) |
| Message-ID | <qXOXT-7QE-3@gated-at.bofh.it> |
We've had some non-arch-specific stuff (pci_has_flag() and associated
definitions like PCI_PROBE_ONLY) in asm/pci-bridge.h. This leads to
warnings like:
drivers/pci/host/pcie-designware.c:562:20: error: 'PCI_PROBE_ONLY' undeclared (first use in this function)
drivers/pci/host/pcie-designware.c:562:7: error: implicit declaration of function 'pci_has_flag' [-Werror=implicit-function-declaration]
because arches don't consistently supply asm/pci-bridge.h, and several
drivers include it when they shouldn't.
This series moves the generic stuff to linux/pci.h, so it's the same for
everybody, and removes the now-empty asm-generic/pci-bridge.h.
There still a few arches that provide asm/pci-bridge.h (microblaze,
powerpc, and xtensa), but now they contain truly arch-dependent things like
struct pci_controller definitions, and they're only included by
arch-specific files.
---
Bjorn Helgaas (5):
PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h
PCI: Remove includes of empty asm-generic/pci-bridge.h
ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h
PCI: Remove empty asm-generic/pci-bridge.h
PCI: Remove includes of asm/pci-bridge.h
arch/alpha/include/asm/pci.h | 1
arch/arm/include/asm/pci.h | 3 -
arch/arm64/include/asm/Kbuild | 3 -
arch/arm64/include/asm/pci.h | 1
arch/arm64/kernel/pci.c | 2 -
arch/mips/include/asm/pci.h | 1
arch/powerpc/include/asm/pci-bridge.h | 1
arch/unicore32/include/asm/pci.h | 2 -
arch/x86/pci/common.c | 1
drivers/ata/pata_macio.c | 2 -
drivers/char/agp/uninorth-agp.c | 1
drivers/gpu/drm/radeon/radeon_combios.c | 1
drivers/ide/pdc202xx_new.c | 1
drivers/ide/pmac.c | 1
drivers/macintosh/macio_asic.c | 1
drivers/misc/cxl/pci.c | 1
drivers/net/ethernet/sun/sungem.c | 1
drivers/net/ethernet/toshiba/spider_net.c | 1
drivers/of/of_pci.c | 1
drivers/pci/pci.c | 1
drivers/pci/probe.c | 8 +++
drivers/pci/setup-bus.c | 1
drivers/scsi/mac53c94.c | 2 -
drivers/scsi/mesh.c | 2 -
drivers/usb/core/hcd-pci.c | 1
drivers/video/fbdev/aty/aty128fb.c | 1
drivers/video/fbdev/aty/radeon_base.c | 1
drivers/video/fbdev/imsttfb.c | 1
drivers/video/fbdev/matrox/matroxfb_base.h | 1
drivers/video/fbdev/offb.c | 4 --
include/asm-generic/pci-bridge.h | 74 ----------------------------
include/linux/pci.h | 22 ++++++++
sound/ppc/pmac.c | 1
33 files changed, 32 insertions(+), 114 deletions(-)
delete mode 100644 include/asm-generic/pci-bridge.h
[toc] | [next] | [standalone]
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2016-02-02 20:40 +0100 |
| Subject | [PATCH 4/5] PCI: Remove empty asm-generic/pci-bridge.h |
| Message-ID | <qXOXT-7QE-5@gated-at.bofh.it> |
| In reply to | #1324552 |
include/asm-generic/pci-bridge.h is empty, and nobody includes it, so remove it. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- include/asm-generic/pci-bridge.h | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 include/asm-generic/pci-bridge.h diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h deleted file mode 100644 index 1b1d82f..0000000 --- a/include/asm-generic/pci-bridge.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_GENERIC_PCI_BRIDGE_H -#define _ASM_GENERIC_PCI_BRIDGE_H -#endif /* _ASM_GENERIC_PCI_BRIDGE_H */
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2016-02-02 20:40 +0100 |
| Subject | [PATCH 5/5] PCI: Remove includes of asm/pci-bridge.h |
| Message-ID | <qXOXU-7QE-17@gated-at.bofh.it> |
| In reply to | #1324552 |
Drivers should include asm/pci-bridge.h only when they need the arch- specific things provided there. Outside of the arch/ directories, the only drivers that actually need things provided by asm/pci-bridge.h are the powerpc RPA hotplug drivers in drivers/pci/hotplug/rpa*. Remove the includes of asm/pci-bridge.h from the other drivers, adding an include of linux/pci.h if necessary. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- drivers/ata/pata_macio.c | 2 +- drivers/char/agp/uninorth-agp.c | 1 - drivers/gpu/drm/radeon/radeon_combios.c | 1 - drivers/ide/pdc202xx_new.c | 1 - drivers/ide/pmac.c | 1 - drivers/macintosh/macio_asic.c | 1 - drivers/misc/cxl/pci.c | 1 - drivers/net/ethernet/sun/sungem.c | 1 - drivers/net/ethernet/toshiba/spider_net.c | 1 - drivers/scsi/mac53c94.c | 2 +- drivers/scsi/mesh.c | 2 +- drivers/usb/core/hcd-pci.c | 1 - drivers/video/fbdev/aty/aty128fb.c | 1 - drivers/video/fbdev/aty/radeon_base.c | 1 - drivers/video/fbdev/imsttfb.c | 1 - drivers/video/fbdev/matrox/matroxfb_base.h | 1 - drivers/video/fbdev/offb.c | 4 ---- sound/ppc/pmac.c | 1 - 18 files changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c index e3d4b05..e347e7a 100644 --- a/drivers/ata/pata_macio.c +++ b/drivers/ata/pata_macio.c @@ -22,6 +22,7 @@ #include <linux/scatterlist.h> #include <linux/of.h> #include <linux/gfp.h> +#include <linux/pci.h> #include <scsi/scsi.h> #include <scsi/scsi_host.h> @@ -30,7 +31,6 @@ #include <asm/macio.h> #include <asm/io.h> #include <asm/dbdma.h> -#include <asm/pci-bridge.h> #include <asm/machdep.h> #include <asm/pmac_feature.h> #include <asm/mediabay.h> diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 0575544..fdced54 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c @@ -10,7 +10,6 @@ #include <linux/delay.h> #include <linux/vmalloc.h> #include <asm/uninorth.h> -#include <asm/pci-bridge.h> #include <asm/prom.h> #include <asm/pmac_feature.h> #include "agp.h" diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index a9b01bc..432480f 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -34,7 +34,6 @@ #include <asm/machdep.h> #include <asm/pmac_feature.h> #include <asm/prom.h> -#include <asm/pci-bridge.h> #endif /* CONFIG_PPC_PMAC */ /* from radeon_legacy_encoder.c */ diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c index 9ad014a..b33646b 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c @@ -28,7 +28,6 @@ #ifdef CONFIG_PPC_PMAC #include <asm/prom.h> -#include <asm/pci-bridge.h> #endif #define DRV_NAME "pdc202xx_new" diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index 96a3452..7f0434f 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -40,7 +40,6 @@ #include <asm/io.h> #include <asm/dbdma.h> #include <asm/ide.h> -#include <asm/pci-bridge.h> #include <asm/machdep.h> #include <asm/pmac_feature.h> #include <asm/sections.h> diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 4f12c6f..b6819f0 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -31,7 +31,6 @@ #include <asm/macio.h> #include <asm/pmac_feature.h> #include <asm/prom.h> -#include <asm/pci-bridge.h> #undef DEBUG diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 4c1903f..a214032 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c @@ -19,7 +19,6 @@ #include <linux/delay.h> #include <asm/opal.h> #include <asm/msi_bitmap.h> -#include <asm/pci-bridge.h> /* for struct pci_controller */ #include <asm/pnv-pci.h> #include <asm/io.h> diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c index e23a642..2437227 100644 --- a/drivers/net/ethernet/sun/sungem.c +++ b/drivers/net/ethernet/sun/sungem.c @@ -51,7 +51,6 @@ #endif #ifdef CONFIG_PPC_PMAC -#include <asm/pci-bridge.h> #include <asm/prom.h> #include <asm/machdep.h> #include <asm/pmac_feature.h> diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c index 3c54a2c..6761027 100644 --- a/drivers/net/ethernet/toshiba/spider_net.c +++ b/drivers/net/ethernet/toshiba/spider_net.c @@ -48,7 +48,6 @@ #include <linux/wait.h> #include <linux/workqueue.h> #include <linux/bitops.h> -#include <asm/pci-bridge.h> #include <net/checksum.h> #include "spider_net.h" diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c index 1412266..a6682c5 100644 --- a/drivers/scsi/mac53c94.c +++ b/drivers/scsi/mac53c94.c @@ -18,11 +18,11 @@ #include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/module.h> +#include <linux/pci.h> #include <asm/dbdma.h> #include <asm/io.h> #include <asm/pgtable.h> #include <asm/prom.h> -#include <asm/pci-bridge.h> #include <asm/macio.h> #include <scsi/scsi.h> diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index 555367f..1753e42 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -29,6 +29,7 @@ #include <linux/interrupt.h> #include <linux/reboot.h> #include <linux/spinlock.h> +#include <linux/pci.h> #include <asm/dbdma.h> #include <asm/io.h> #include <asm/pgtable.h> @@ -38,7 +39,6 @@ #include <asm/processor.h> #include <asm/machdep.h> #include <asm/pmac_feature.h> -#include <asm/pci-bridge.h> #include <asm/macio.h> #include <scsi/scsi.h> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 9eb1cff..c3640f8 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -28,7 +28,6 @@ #ifdef CONFIG_PPC_PMAC #include <asm/machdep.h> #include <asm/pmac_feature.h> -#include <asm/pci-bridge.h> #include <asm/prom.h> #endif diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index c42ce2f..0a46268 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -68,7 +68,6 @@ #include <asm/machdep.h> #include <asm/pmac_feature.h> #include <asm/prom.h> -#include <asm/pci-bridge.h> #include "../macmodes.h" #endif diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index ce0b1d0..218339a 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -76,7 +76,6 @@ #ifdef CONFIG_PPC -#include <asm/pci-bridge.h> #include "../macmodes.h" #ifdef CONFIG_BOOTX_TEXT diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index 9b167f7..4363c64 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c @@ -33,7 +33,6 @@ #if defined(CONFIG_PPC) #include <linux/nvram.h> #include <asm/prom.h> -#include <asm/pci-bridge.h> #include "macmodes.h" #endif diff --git a/drivers/video/fbdev/matrox/matroxfb_base.h b/drivers/video/fbdev/matrox/matroxfb_base.h index 09b02cd..7a90ea2 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.h +++ b/drivers/video/fbdev/matrox/matroxfb_base.h @@ -47,7 +47,6 @@ #if defined(CONFIG_PPC_PMAC) #include <asm/prom.h> -#include <asm/pci-bridge.h> #include "../macmodes.h" #endif diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 43a0a52..fb60a8f 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -28,10 +28,6 @@ #include <linux/pci.h> #include <asm/io.h> -#ifdef CONFIG_PPC64 -#include <asm/pci-bridge.h> -#endif - #ifdef CONFIG_PPC32 #include <asm/bootx.h> #endif diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 0095a80..a5843fc 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -34,7 +34,6 @@ #include "pmac.h" #include <sound/pcm_params.h> #include <asm/pmac_feature.h> -#include <asm/pci-bridge.h> /* fixed frequency table for awacs, screamer, burgundy, DACA (44100 max) */
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2016-02-02 20:40 +0100 |
| Subject | [PATCH 3/5] ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h |
| Message-ID | <qXOXU-7QE-23@gated-at.bofh.it> |
| In reply to | #1324552 |
arm64 generates asm/pci-bridge.h, which merely includes the now-empty asm-generic/pci-bridge.h. Stop generating asm/pci-bridge.h, and stop including it. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- arch/arm64/include/asm/Kbuild | 3 --- arch/arm64/kernel/pci.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 70fd9ff..cff532a 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -1,5 +1,3 @@ - - generic-y += bug.h generic-y += bugs.h generic-y += checksum.h @@ -31,7 +29,6 @@ generic-y += msgbuf.h generic-y += msi.h generic-y += mutex.h generic-y += pci.h -generic-y += pci-bridge.h generic-y += poll.h generic-y += preempt.h generic-y += resource.h diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index b3d098b..c72de66 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -19,8 +19,6 @@ #include <linux/of_platform.h> #include <linux/slab.h> -#include <asm/pci-bridge.h> - /* * Called after each bus is probed, but before its children are examined */
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2016-02-02 20:40 +0100 |
| Subject | [PATCH 1/5] PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h |
| Message-ID | <qXOXU-7QE-21@gated-at.bofh.it> |
| In reply to | #1324552 |
The PCI flag management constants and functions were previously declared in
include/asm-generic/pci-bridge.h. But they are not specific to bridges,
and arches did not include pci-bridge.h consistently.
Move the following interfaces and related constants to include/linux/pci.h
and remove pci-bridge.h:
pci_set_flags()
pci_add_flags()
pci_clear_flags()
pci_has_flag()
This fixes these warnings when building for some arches:
drivers/pci/host/pcie-designware.c:562:20: error: 'PCI_PROBE_ONLY' undeclared (first use in this function)
drivers/pci/host/pcie-designware.c:562:7: error: implicit declaration of function 'pci_has_flag' [-Werror=implicit-function-declaration]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/probe.c | 7 ++++
include/asm-generic/pci-bridge.h | 65 --------------------------------------
include/linux/pci.h | 22 +++++++++++++
3 files changed, 29 insertions(+), 65 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6d7ab9b..ead1ac1 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1803,6 +1803,13 @@ static int only_one_child(struct pci_bus *bus)
return 0;
if (pci_pcie_type(parent) == PCI_EXP_TYPE_ROOT_PORT)
return 1;
+
+ /*
+ * PCIe downstream ports are bridges that normally lead to only a
+ * device 0, but if PCI_SCAN_ALL_PCIE_DEVS is set, scan all
+ * possible devices, not just device 0. See PCIe spec r3.0,
+ * sec 7.3.1.
+ */
if (parent->has_secondary_link &&
!pci_has_flag(PCI_SCAN_ALL_PCIE_DEVS))
return 1;
diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h
index 20db2e5..1b1d82f 100644
--- a/include/asm-generic/pci-bridge.h
+++ b/include/asm-generic/pci-bridge.h
@@ -6,69 +6,4 @@
*/
#ifndef _ASM_GENERIC_PCI_BRIDGE_H
#define _ASM_GENERIC_PCI_BRIDGE_H
-
-#ifdef __KERNEL__
-
-enum {
- /* Force re-assigning all resources (ignore firmware
- * setup completely)
- */
- PCI_REASSIGN_ALL_RSRC = 0x00000001,
-
- /* Re-assign all bus numbers */
- PCI_REASSIGN_ALL_BUS = 0x00000002,
-
- /* Do not try to assign, just use existing setup */
- PCI_PROBE_ONLY = 0x00000004,
-
- /* Don't bother with ISA alignment unless the bridge has
- * ISA forwarding enabled
- */
- PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
-
- /* Enable domain numbers in /proc */
- PCI_ENABLE_PROC_DOMAINS = 0x00000010,
- /* ... except for domain 0 */
- PCI_COMPAT_DOMAIN_0 = 0x00000020,
-
- /* PCIe downstream ports are bridges that normally lead to only a
- * device 0, but if this is set, we scan all possible devices, not
- * just device 0.
- */
- PCI_SCAN_ALL_PCIE_DEVS = 0x00000040,
-};
-
-#ifdef CONFIG_PCI
-extern unsigned int pci_flags;
-
-static inline void pci_set_flags(int flags)
-{
- pci_flags = flags;
-}
-
-static inline void pci_add_flags(int flags)
-{
- pci_flags |= flags;
-}
-
-static inline void pci_clear_flags(int flags)
-{
- pci_flags &= ~flags;
-}
-
-static inline int pci_has_flag(int flag)
-{
- return pci_flags & flag;
-}
-#else
-static inline void pci_set_flags(int flags) { }
-static inline void pci_add_flags(int flags) { }
-static inline void pci_clear_flags(int flags) { }
-static inline int pci_has_flag(int flag)
-{
- return 0;
-}
-#endif /* CONFIG_PCI */
-
-#endif /* __KERNEL__ */
#endif /* _ASM_GENERIC_PCI_BRIDGE_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 27df4a6..3d371c1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -746,9 +746,26 @@ struct pci_driver {
.vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
+enum {
+ PCI_REASSIGN_ALL_RSRC = 0x00000001, /* ignore firmware setup */
+ PCI_REASSIGN_ALL_BUS = 0x00000002, /* reassign all bus numbers */
+ PCI_PROBE_ONLY = 0x00000004, /* use existing setup */
+ PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, /* don't do ISA alignment */
+ PCI_ENABLE_PROC_DOMAINS = 0x00000010, /* enable domains in /proc */
+ PCI_COMPAT_DOMAIN_0 = 0x00000020, /* ... except domain 0 */
+ PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* scan all, not just dev 0 */
+};
+
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
+extern unsigned int pci_flags;
+
+static inline void pci_set_flags(int flags) { pci_flags = flags; }
+static inline void pci_add_flags(int flags) { pci_flags |= flags; }
+static inline void pci_clear_flags(int flags) { pci_flags &= ~flags; }
+static inline int pci_has_flag(int flag) { return pci_flags & flag; }
+
void pcie_bus_configure_settings(struct pci_bus *bus);
enum pcie_bus_config_types {
@@ -1405,6 +1422,11 @@ void pci_register_set_vga_state(arch_set_vga_state_t func);
#else /* CONFIG_PCI is not enabled */
+static inline void pci_set_flags(int flags) { }
+static inline void pci_add_flags(int flags) { }
+static inline void pci_clear_flags(int flags) { }
+static inline int pci_has_flag(int flag) { return 0; }
+
/*
* If the system does not have PCI, clearly these return errors. Define
* these as simple inline functions to avoid hair in drivers.
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <bhelgaas@google.com> |
|---|---|
| Date | 2016-02-02 20:50 +0100 |
| Subject | [PATCH 2/5] PCI: Remove includes of empty asm-generic/pci-bridge.h |
| Message-ID | <qXP7B-7Ux-11@gated-at.bofh.it> |
| In reply to | #1324552 |
include/asm-generic/pci-bridge.h is now empty, so remove every #include of it. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- arch/alpha/include/asm/pci.h | 1 - arch/arm/include/asm/pci.h | 3 --- arch/arm64/include/asm/pci.h | 1 - arch/mips/include/asm/pci.h | 1 - arch/powerpc/include/asm/pci-bridge.h | 1 - arch/unicore32/include/asm/pci.h | 2 -- arch/x86/pci/common.c | 1 - drivers/of/of_pci.c | 1 - drivers/pci/pci.c | 1 - drivers/pci/probe.c | 1 - drivers/pci/setup-bus.c | 1 - 11 files changed, 14 deletions(-) diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h index 98f2eee..75d8865 100644 --- a/arch/alpha/include/asm/pci.h +++ b/arch/alpha/include/asm/pci.h @@ -7,7 +7,6 @@ #include <linux/dma-mapping.h> #include <linux/scatterlist.h> #include <asm/machvec.h> -#include <asm-generic/pci-bridge.h> /* * The following structure is used to manage multiple PCI busses. diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index a563544..d7de19a 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h @@ -3,8 +3,6 @@ #ifdef __KERNEL__ #include <asm-generic/pci-dma-compat.h> -#include <asm-generic/pci-bridge.h> - #include <asm/mach/pci.h> /* for pci_sys_data */ extern unsigned long pcibios_min_io; @@ -41,5 +39,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) } #endif /* __KERNEL__ */ - #endif diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h index b008a72..f75b04e 100644 --- a/arch/arm64/include/asm/pci.h +++ b/arch/arm64/include/asm/pci.h @@ -7,7 +7,6 @@ #include <linux/dma-mapping.h> #include <asm/io.h> -#include <asm-generic/pci-bridge.h> #include <asm-generic/pci-dma-compat.h> #define PCIBIOS_MIN_IO 0x1000 diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 98c31e5..108d193 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h @@ -102,7 +102,6 @@ static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, #include <linux/scatterlist.h> #include <linux/string.h> #include <asm/io.h> -#include <asm-generic/pci-bridge.h> struct pci_dev; diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 54843ca..78968c1 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -10,7 +10,6 @@ #include <linux/pci.h> #include <linux/list.h> #include <linux/ioport.h> -#include <asm-generic/pci-bridge.h> struct device_node; diff --git a/arch/unicore32/include/asm/pci.h b/arch/unicore32/include/asm/pci.h index 38b3f37..eb9dcce 100644 --- a/arch/unicore32/include/asm/pci.h +++ b/arch/unicore32/include/asm/pci.h @@ -14,7 +14,6 @@ #ifdef __KERNEL__ #include <asm-generic/pci-dma-compat.h> -#include <asm-generic/pci-bridge.h> #include <asm-generic/pci.h> #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ @@ -23,5 +22,4 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); #endif /* __KERNEL__ */ - #endif diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 2879efc..b4a9f23 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -12,7 +12,6 @@ #include <linux/dmi.h> #include <linux/slab.h> -#include <asm-generic/pci-bridge.h> #include <asm/acpi.h> #include <asm/segment.h> #include <asm/io.h> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c index b1449f7..13f4fed 100644 --- a/drivers/of/of_pci.c +++ b/drivers/of/of_pci.c @@ -5,7 +5,6 @@ #include <linux/of_device.h> #include <linux/of_pci.h> #include <linux/slab.h> -#include <asm-generic/pci-bridge.h> static inline int __of_pci_pci_compare(struct device_node *node, unsigned int data) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 602eb42..64c0a12 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -25,7 +25,6 @@ #include <linux/device.h> #include <linux/pm_runtime.h> #include <linux/pci_hotplug.h> -#include <asm-generic/pci-bridge.h> #include <asm/setup.h> #include <linux/aer.h> #include "pci.h" diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ead1ac1..5eb378f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -15,7 +15,6 @@ #include <linux/pci-aspm.h> #include <linux/aer.h> #include <linux/acpi.h> -#include <asm-generic/pci-bridge.h> #include "pci.h" #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 7796d0a..55641a3 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -25,7 +25,6 @@ #include <linux/ioport.h> #include <linux/cache.h> #include <linux/slab.h> -#include <asm-generic/pci-bridge.h> #include "pci.h" unsigned int pci_flags;
[toc] | [prev] | [next] | [standalone]
| From | Will Deacon <will.deacon@arm.com> |
|---|---|
| Date | 2016-02-03 10:30 +0100 |
| Message-ID | <qY1V9-8wg-23@gated-at.bofh.it> |
| In reply to | #1324552 |
On Tue, Feb 02, 2016 at 01:38:26PM -0600, Bjorn Helgaas wrote: > We've had some non-arch-specific stuff (pci_has_flag() and associated > definitions like PCI_PROBE_ONLY) in asm/pci-bridge.h. This leads to > warnings like: > > drivers/pci/host/pcie-designware.c:562:20: error: 'PCI_PROBE_ONLY' undeclared (first use in this function) > drivers/pci/host/pcie-designware.c:562:7: error: implicit declaration of function 'pci_has_flag' [-Werror=implicit-function-declaration] > > because arches don't consistently supply asm/pci-bridge.h, and several > drivers include it when they shouldn't. > > This series moves the generic stuff to linux/pci.h, so it's the same for > everybody, and removes the now-empty asm-generic/pci-bridge.h. > > There still a few arches that provide asm/pci-bridge.h (microblaze, > powerpc, and xtensa), but now they contain truly arch-dependent things like > struct pci_controller definitions, and they're only included by > arch-specific files. For the arm64 bits: Acked-by: Will Deacon <will.deacon@arm.com> Will
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2016-02-05 23:40 +0100 |
| Message-ID | <qYXcJ-6kF-9@gated-at.bofh.it> |
| In reply to | #1324552 |
On Tue, Feb 02, 2016 at 01:38:26PM -0600, Bjorn Helgaas wrote: > We've had some non-arch-specific stuff (pci_has_flag() and associated > definitions like PCI_PROBE_ONLY) in asm/pci-bridge.h. This leads to > warnings like: > > drivers/pci/host/pcie-designware.c:562:20: error: 'PCI_PROBE_ONLY' undeclared (first use in this function) > drivers/pci/host/pcie-designware.c:562:7: error: implicit declaration of function 'pci_has_flag' [-Werror=implicit-function-declaration] > > because arches don't consistently supply asm/pci-bridge.h, and several > drivers include it when they shouldn't. > > This series moves the generic stuff to linux/pci.h, so it's the same for > everybody, and removes the now-empty asm-generic/pci-bridge.h. > > There still a few arches that provide asm/pci-bridge.h (microblaze, > powerpc, and xtensa), but now they contain truly arch-dependent things like > struct pci_controller definitions, and they're only included by > arch-specific files. > > --- > > Bjorn Helgaas (5): > PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h > PCI: Remove includes of empty asm-generic/pci-bridge.h > ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h > PCI: Remove empty asm-generic/pci-bridge.h > PCI: Remove includes of asm/pci-bridge.h I applied these, with Will's ack on the arm64 parts, to pci/misc for v4.6. > arch/alpha/include/asm/pci.h | 1 > arch/arm/include/asm/pci.h | 3 - > arch/arm64/include/asm/Kbuild | 3 - > arch/arm64/include/asm/pci.h | 1 > arch/arm64/kernel/pci.c | 2 - > arch/mips/include/asm/pci.h | 1 > arch/powerpc/include/asm/pci-bridge.h | 1 > arch/unicore32/include/asm/pci.h | 2 - > arch/x86/pci/common.c | 1 > drivers/ata/pata_macio.c | 2 - > drivers/char/agp/uninorth-agp.c | 1 > drivers/gpu/drm/radeon/radeon_combios.c | 1 > drivers/ide/pdc202xx_new.c | 1 > drivers/ide/pmac.c | 1 > drivers/macintosh/macio_asic.c | 1 > drivers/misc/cxl/pci.c | 1 > drivers/net/ethernet/sun/sungem.c | 1 > drivers/net/ethernet/toshiba/spider_net.c | 1 > drivers/of/of_pci.c | 1 > drivers/pci/pci.c | 1 > drivers/pci/probe.c | 8 +++ > drivers/pci/setup-bus.c | 1 > drivers/scsi/mac53c94.c | 2 - > drivers/scsi/mesh.c | 2 - > drivers/usb/core/hcd-pci.c | 1 > drivers/video/fbdev/aty/aty128fb.c | 1 > drivers/video/fbdev/aty/radeon_base.c | 1 > drivers/video/fbdev/imsttfb.c | 1 > drivers/video/fbdev/matrox/matroxfb_base.h | 1 > drivers/video/fbdev/offb.c | 4 -- > include/asm-generic/pci-bridge.h | 74 ---------------------------- > include/linux/pci.h | 22 ++++++++ > sound/ppc/pmac.c | 1 > 33 files changed, 32 insertions(+), 114 deletions(-) > delete mode 100644 include/asm-generic/pci-bridge.h > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web