PCI: Re-factor 'pcibios_setup()'
PATCH 2/16 alpha/PCI: Factor 'pcibios_setup()' out of alpha
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop alpha's architecture specific version in favor of that as it does not need to be over-ridden.
No functional change.
---
arch/alpha/kernel/pci.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
arch/alpha/kernel/pci.c +0 -6
@@ -198,12 +198,6 @@ pcibios_init(void)subsys_initcall (pcibios_init); -char *__devinit -pcibios_setup (char *str) -{ -return str; -} -#ifdef ALPHA_RESTORE_SRM_SETUP static struct pdev_srm_saved_conf *srm_saved_configs;
PATCH 3/16 ia64/PCI: Factor 'pcibios_setup' out of ia64
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop ia64's architecture specific version in favor of that as it does not need to be over-ridden.
No functional change.
---
arch/ia64/pci/pci.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
arch/ia64/pci/pci.c +0 -9
@@ -496,15 +496,6 @@ pcibios_align_resource (void *data, const struct resource *res,return res->start; } -/* -* PCI BIOS setup, always defaults to SAL interface -*/ -char *__init -pcibios_setup (char *str) -{ -return str; -} -int pci_mmap_page_range (struct pci_dev *dev,struct vm_area_struct *vma,enum pci_mmap_state mmap_state,int write_combine)
PATCH 5/16 MIPS/PCI: Factor 'pcibios_setup()' out of MIPS/pmc-sierra
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop MIPS/pmc-sierra's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/mips/pmc-sierra/yosemite/ht.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-)
arch/mips/pmc-sierra/yosemite/ht.c +0 -11
@@ -395,17 +395,6 @@ void __init pcibios_init(void)pci_scan_bus (3 , &titan_pci_ops,NULL ); } -/* -* for parsing "pci=" kernel boot arguments. -*/ -char *pcibios_setup (char *str) -{ -printk (KERN_INFO "rr: pcibios_setup\n" ); -/* Nothing to do for now. */ - -return str; -} -unsigned __init int pcibios_assign_all_busses (void ) {/* We want to use the PCI bus detection done by PMON */
PATCH 6/16 MIPS/PCI: adjust section annotations for 'pcibios_setup()'
In reply to Myron StoweMake pcibios_setup() consistently use the "__init" section annotation.
---
arch/mips/pci/pci.c | 4 ++-- arch/mips/txx9/generic/pci.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/pci/pci.c +2 -2
@@ -348,9 +348,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, vma->vm_end - vma->vm_start, vma->vm_page_prot); } -char * (*pcibios_plat_setup)(char *str)__devinitdata ; +char * (*pcibios_plat_setup)(char *str)__initdata ; -char *__devinit pcibios_setup (char *str) +char *__init pcibios_setup (char *str) {if (pcibios_plat_setup)return pcibios_plat_setup (str);
arch/mips/txx9/generic/pci.c +2 -2
@@ -398,9 +398,9 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)return txx9_board_vec->pci_map_irq (dev, slot, pin); } -char * (*txx9_board_pcibios_setup)(char *str)__devinitdata ; +char * (*txx9_board_pcibios_setup)(char *str)__initdata ; -char *__devinit txx9_pcibios_setup (char *str) +char *__init txx9_pcibios_setup (char *str) {if (txx9_board_pcibios_setup && !txx9_board_pcibios_setup (str))return NULL ;
PATCH 7/16 parisc/PCI: Factor 'pcibios_setup()' out of parisc
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop parisc's architecture specific version in favor of that as it does not need to be over-ridden.
No functional change.
---
arch/parisc/kernel/pci.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/parisc/kernel/pci.c +0 -5
@@ -139,11 +139,6 @@ void pcibios_fixup_bus(struct pci_bus *bus) } -char *pcibios_setup (char *str) -{ -return str; -} -/* * Called by pci_set_master() - a driver interface. *
PATCH 8/16 powerpc/PCI: Factor 'pcibios_setup()' out of powerpc
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop powerpc's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/powerpc/kernel/pci-common.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/powerpc/kernel/pci-common.c +0 -5
@@ -200,11 +200,6 @@ int pcibios_add_platform_entries(struct pci_dev *pdev)return device_create_file (&pdev->dev, &dev_attr_devspec); } -char __devinit *pcibios_setup (char *str) -{ -return str; -} -/* * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the
PATCH 9/16 sh/PCI: Factor 'pcibios_setup()' out of sh
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop sh's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/sh/drivers/pci/pci.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/sh/drivers/pci/pci.c +0 -5
@@ -197,11 +197,6 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq)pci_write_config_byte (dev,PCI_INTERRUPT_LINE , irq); } -char *__devinit __weak pcibios_setup (char *str) -{ -return str; -} - static void __init pcibios_bus_report_status_early(struct pci_channel *hose, int top_bus, int current_bus,
PATCH 11/16 sparc/PCI: Factor 'pcibios_setup()' out of sparc
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop sparc's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/sparc/kernel/leon_pci.c | 8 -------- arch/sparc/kernel/pci.c | 5 ----- arch/sparc/kernel/pcic.c | 8 -------- 3 files changed, 0 insertions(+), 21 deletions(-)
arch/sparc/kernel/leon_pci.c +0 -8
@@ -91,14 +91,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *pbus) } } -/* -* Other archs parse arguments here. -*/ -char *__devinit pcibios_setup (char *str) -{ -return str; -} -resource_size_t pcibios_align_resource (void *data,const struct resource *res,resource_size_t size,resource_size_t align) {
arch/sparc/kernel/pci.c +0 -5
@@ -747,11 +747,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)return 0 ; } -char *__devinit pcibios_setup (char *str) -{ -return str; -} -/* Platform support for /proc/bus/pci/X/Y mmap()s. */ /* If the user uses a host-bridge as the PCI device, he may use
arch/sparc/kernel/pcic.c +0 -8
@@ -767,14 +767,6 @@ static void watchdog_reset() { }#endif -/* -* Other archs parse arguments here. -*/ -char *__devinit pcibios_setup (char *str) -{ -return str; -} -resource_size_t pcibios_align_resource (void *data,const struct resource *res,resource_size_t size,resource_size_t align) {
cover PCI: Re-factor 'pcibios_setup()'
Currently, all of the architectures implement their own 'pcibios_setup()' routine. Most of the implementations do nothing so this patch introduces a generic (__weak) routine into PCI's core that can be used by all architectures as a default. If necessary, it can then be over-ridden by architecture-specific code.
This series also cleans up 'pcibios_setup()' as necessary to consistently use the "__init" section annotation.
Suggested by Bjorn Helgaas -
http://marc.info/?l=linux-kernel&m=134023745124680&w=2
It looks as if there is a bug in the CRIS architecture's version of 'pcibios_setup()'. It implements pcibios_setup() such that pci_setup() doesn't look for any generic options. I included the fix for this in this series. If this ends up not being correct - i.e. PCI support for CRIS should be dropped - then that specific patch (which I included last in the series) can be dropped.
Note: I do not have a cross-compile environment so I have only tested x86.
---
Myron Stowe (16):
cris/PCI: Factor 'pcibios_setup()' out of cris xtensa/PCI: Factor 'pcibios_setup()' out of xtensa x86/PCI: adjust section annotations for 'pcibios_setup()' unicore32/PCI: adjust section annotations for 'pcibios_setup()' tile/PCI: Factor 'pcibios_setup()' out of tile sparc/PCI: Factor 'pcibios_setup()' out of sparc sh/PCI: adjust section annotations for 'pcibios_setup()' sh/PCI: Factor 'pcibios_setup()' out of sh powerpc/PCI: Factor 'pcibios_setup()' out of powerpc parisc/PCI: Factor 'pcibios_setup()' out of parisc MIPS/PCI: adjust section annotations for 'pcibios_setup()' MIPS/PCI: Factor 'pcibios_setup()' out of MIPS/pmc-sierra microblaze/PCI: Factor 'pcibios_setup()' out of microblaze ia64/PCI: Factor 'pcibios_setup' out of ia64 alpha/PCI: Factor 'pcibios_setup()' out of alpha
PCI: Pull 'pcibios_setup' up into PCI's core
arch/alpha/kernel/pci.c | 6 ------ arch/cris/arch-v32/drivers/pci/bios.c | 5 ----- arch/ia64/pci/pci.c | 9 --------- arch/microblaze/pci/pci-common.c | 5 ----- arch/mips/pci/pci.c | 4 ++-- arch/mips/pmc-sierra/yosemite/ht.c | 11 ----------- arch/mips/txx9/generic/pci.c | 4 ++-- arch/parisc/kernel/pci.c | 5 ----- arch/powerpc/kernel/pci-common.c | 5 ----- arch/sh/drivers/pci/fixups-sdk7786.c | 4 ++-- arch/sh/drivers/pci/pci.c | 5 ----- arch/sparc/kernel/leon_pci.c | 8 -------- arch/sparc/kernel/pci.c | 5 ----- arch/sparc/kernel/pcic.c | 8 -------- arch/tile/kernel/pci.c | 10 ---------- arch/unicore32/kernel/pci.c | 2 +- arch/x86/pci/common.c | 2 +- arch/xtensa/kernel/pci.c | 6 ------ drivers/pci/pci.c | 12 ++++++++++++ include/linux/pci.h | 1 + 20 files changed, 21 insertions(+), 96 deletions(-)
PATCH 1/16 PCI: Pull 'pcibios_setup' up into PCI's core
Currently, all of the architectures implement their own 'pcibios_setup()' routine. Most of the implementations do nothing so this patch introduces a generic (__weak) routine into PCI's core that can be used by all architectures as a default. If necessary, it can be over-ridden by architecture-specific code.
No functional change.
---
drivers/pci/pci.c | 12 ++++++++++++ include/linux/pci.h | 1 + 2 files changed, 13 insertions(+), 0 deletions(-)
drivers/pci/pci.c +12 -0
@@ -2671,6 +2671,18 @@ static void __pci_set_master(struct pci_dev *dev, bool enable) }/** +* pcibios_setup - process "pci=" kernel boot arguments +* @str: string used to pass in "pci=" kernel boot arguments +* +* Process kernel boot arguments. This is the default implementation. +* Architecture specific implementations can override this as necessary. +*/ +char *__weak __init pcibios_setup (char *str) +{ +return str; +} + +/** * pcibios_set_master - enable PCI bus-mastering for device dev * @dev: the PCI device to enable *
include/linux/pci.h +1 -0
@@ -644,6 +644,7 @@ extern int no_pci_devices(void);void pcibios_fixup_bus (struct pci_bus *);int __must_check pcibios_enable_device (struct pci_dev *,int mask); +/* Architecture specific versions may override this (weak) */ char *pcibios_setup (char *str);/* Used only when drivers/pci/setup.c is used */
PATCH 4/16 microblaze/PCI: Factor 'pcibios_setup()' out of microblaze
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop microblaze's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/microblaze/pci/pci-common.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/microblaze/pci/pci-common.c +0 -5
@@ -192,11 +192,6 @@ void pcibios_set_master(struct pci_dev *dev)/* No special bus mastering setup handling */ } -char __devinit *pcibios_setup (char *str) -{ -return str; -} -/* * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the
PATCH 14/16 x86/PCI: adjust section annotations for 'pcibios_setup()'
In reply to Myron StoweMake pcibios_setup() consistently use the "__init" section annotation.
---
arch/x86/pci/common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/pci/common.c +1 -1
@@ -494,7 +494,7 @@ int __init pcibios_init(void)return 0 ; } -char *__devinit pcibios_setup (char *str) +char *__init pcibios_setup (char *str) {if (!strcmp (str,"off" )) { pci_probe =0 ;
PATCH 16/16 cris/PCI: Factor 'pcibios_setup()' out of cris
In reply to Myron StoweThis patch fixes what looks like a bug in cris, which implements pcibios_setup() such that pci_setup() doesn't look for any generic options.
The PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop cris's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/cris/arch-v32/drivers/pci/bios.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/cris/arch-v32/drivers/pci/bios.c +0 -5
@@ -6,11 +6,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b) { } -char *__devinit pcibios_setup (char *str) -{ -return NULL ; -} -void pcibios_set_master (struct pci_dev *dev) {u8 lat;
PATCH 10/16 sh/PCI: adjust section annotations for 'pcibios_setup()'
In reply to Myron StoweMake pcibios_setup() consistently use the "__init" section annotation.
---
arch/sh/drivers/pci/fixups-sdk7786.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/sh/drivers/pci/fixups-sdk7786.c +2 -2
@@ -23,9 +23,9 @@* Misconfigurations can be detected through the FPGA via the slot * resistors to determine card presence. Hotplug remains unsupported. */ -static unsigned int slot4en__devinitdata ; +static unsigned int slot4en__initdata ; -char *__devinit pcibios_setup (char *str) +char *__init pcibios_setup (char *str) {if (strcmp (str,"slot4en" ) ==0 ) { slot4en =1 ;
PATCH 12/16 tile/PCI: Factor 'pcibios_setup()' out of tile
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop tile's architecture specific version in favor of that as it does not need to be over-ridden.
---
arch/tile/kernel/pci.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)
arch/tile/kernel/pci.c +0 -10
@@ -401,16 +401,6 @@ void pcibios_set_master(struct pci_dev *dev) }/* -* This can be called from the generic PCI layer, but doesn't need to -* do anything. -*/ -char __devinit *pcibios_setup (char *str) -{ -/* Nothing needs to be done. */ -return str; -} - -/* * This is called from the generic Linux layer. */ void __devinit pcibios_update_irq (struct pci_dev *dev,int irq)
PATCH 13/16 unicore32/PCI: adjust section annotations for 'pcibios_setup()'
In reply to Myron StoweMake pcibios_setup() consistently use the "__init" section annotation.
---
arch/unicore32/kernel/pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/unicore32/kernel/pci.c +1 -1
@@ -296,7 +296,7 @@ static int __init pci_common_init(void) }subsys_initcall (pci_common_init); -char *__devinit pcibios_setup (char *str) +char *__init pcibios_setup (char *str) {if (!strcmp (str,"debug" )) { debug_pci =1 ;
PATCH 15/16 xtensa/PCI: Factor 'pcibios_setup()' out of xtensa
In reply to Myron StoweThe PCI core provides a generic (__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop xtensa's architecture specific version in favor of that as it does not need to be over-ridden.
No functional change.
---
arch/xtensa/kernel/pci.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
arch/xtensa/kernel/pci.c +0 -6
@@ -46,7 +46,6 @@* pcibios_fixups * pcibios_align_resource * pcibios_fixup_bus -* pcibios_setup * pci_bus_add_device * pci_mmap_page_range */
@@ -206,11 +205,6 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) } } -char __init *pcibios_setup (char *str) -{ -return str; -} -void pcibios_set_master (struct pci_dev *dev) {/* No special bus mastering setup handling */
Re: [PATCH 11/16] sparc/PCI: Factor 'pcibios_setup()' out of sparc
In reply to Myron StoweFrom: Myron Stowe <[email protected]>
Date: Mon, 25 Jun 2012 21:32:12 -0600
Quoted 6 lines
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop sparc's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>
Re: [PATCH 08/16] powerpc/PCI: Factor 'pcibios_setup()' out of powerpc
In reply to Myron StoweQuoted 6 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop powerpc's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>
Quoted 26 lines
---
arch/powerpc/kernel/pci-common.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)arch/powerpc/kernel/pci-common.c +0
-6@@ -200,11 +200,6 @@ int pcibios_add_platform_entries(struct pci_dev *pdev)return device_create_file (&pdev->dev, &dev_attr_devspec); } -char __devinit *pcibios_setup (char *str) -{ -return str; -} -/* * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/16] sh/PCI: Factor 'pcibios_setup()' out of sh
In reply to Myron Stowe2012/6/26 Myron Stowe <[email protected]>:
Quoted 5 lines
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop sh's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>
Signature · 1 line
Nobuhiro Iwamatsu
Re: [PATCH 04/16] microblaze/PCI: Factor 'pcibios_setup()' out of microblaze
In reply to Myron StoweQuoted 18 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop microblaze's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe<[email protected]>---
arch/microblaze/pci/pci-common.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)arch/microblaze/pci/pci-common.c +0
-0@@ -192,11 +192,6 @@ void pcibios_set_master(struct pci_dev *dev)/* No special bus mastering setup handling */
arch/microblaze/pci/pci-common.c void pcibios_set_master(struct pci_dev *dev) · line 197
Quoted 10 lines
arch/microblaze/pci/pci-common.c +0
-5} -char __devinit *pcibios_setup (char *str) -{ -return str; -} -/* * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the
Thanks,
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Re: [PATCH 09/16] sh/PCI: Factor 'pcibios_setup()' out of sh
In reply to Myron StoweQuoted 5 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop sh's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>
Re: [PATCH 13/16] unicore32/PCI: adjust section annotations for 'pcibios_setup()'
In reply to Myron StoweQuoted 3 lines
Make
pcibios_setup()consistently use the "__init" section annotation.Signed-off-by Myron Stowe <[email protected]>
Re: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile
In reply to Myron StoweQuoted 10 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop tile's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>---
arch/tile/kernel/pci.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)
In our internal tree we have x86-like support for "pci=off" here. When I push that I can just push it as a new function to override the removed one, so I'm happy with your change as proposed. But perhaps it would make sense to move the support for "pci=off" to common code, since multiple architectures handle this the same way?
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
Re: [PATCH 02/16] alpha/PCI: Factor 'pcibios_setup()' out of alpha
In reply to Myron StoweQuoted 5 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop alpha's architecture specific version in favor of that as it does not need to be over-ridden.
Quoted 7 lines
No functional change.
Signed-off-by Myron Stowe <[email protected]>---
arch/alpha/kernel/pci.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
r~
Re: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile
In reply to Chris MetcalfQuoted 9 lines · Chris Metcalf
Quoted 8 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop tile's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>---
Quoted 8 lines
Quoted 2 lines
arch/tile/kernel/pci.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)Acked-by Chris Metcalf <[email protected]>In our internal tree we have x86-like support for "pci=off" here. When I push that I can just push it as a new function to override the removed one, so I'm happy with your change as proposed.
Yes, that should be fine. Just an FYI - when you introduce the over-ride, I believe that it should be __init and not __devinit as the previous tile version of 'pcibios_setup()' was.
Quoted 3 lines
But perhaps it would make sense
to move the support for "pci=off" to common code, since multiple architectures handle this the same way?
Looking at the tree I only see three of the architectures currently using/implementing "pci=off" (four with the 'tile' addition). Perhaps there is a way to avoid such but it seems like adding this to the core would require introducing the global variable 'pci_probe' which seems like unnecessary pollution?
Myron
Re: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile
Quoted 17 lines · Myron Stowe
Quoted 9 lines · Chris Metcalf
Quoted 8 lines · Myron Stowe
The PCI core provides a generic (
__weak) 'pcibios_setup()' routine that can be used by all architectures as a default. Drop tile's architecture specific version in favor of that as it does not need to be over-ridden.Signed-off-by Myron Stowe <[email protected]>---
Quoted 7 lines
Quoted 2 lines
arch/tile/kernel/pci.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)[...]
In our internal tree we have x86-like support for "pci=off" here. [...] But perhaps it would make sense
to move the support for "pci=off" to common code, since multiple architectures handle this the same way?
Quoted 5 lines
Looking at the tree I only see three of the architectures currently using/implementing "pci=off" (four with the 'tile' addition). Perhaps there is a way to avoid such but it seems like adding this to the core would require introducing the global variable '
pci_probe' which seems like unnecessary pollution?
I'd argue that the core might expose a pci_probing_disabled() function that returns whether "pci=off" was seen, and modify the other architectures that already support pci_probe to call that function instead. It's true that x86 has a much more elaborate use of pci_probe than the other architectures, which means x86 would probably want to keep the variable as-is and just call pci_probing_disabled() to set pci_probe to zero and return.
All that said, I'm not volunteering to make this change, so if it doesn't seem right to you, I certainly won't insist. :-)
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
Bjorn Helgaas
maintainerQuoted 55 lines · Myron Stowe
Currently, all of the architectures implement their own '
pcibios_setup()' routine. Most of the implementations do nothing so this patch introduces a generic (__weak) routine into PCI's core that can be used by all architectures as a default. If necessary, it can then be over-ridden by architecture-specific code.This series also cleans up '
pcibios_setup()' as necessary to consistently use the "__init" section annotation.Suggested by Bjorn Helgaas -
http://marc.info/?l=linux-kernel&m=134023745124680&w=2It looks as if there is a bug in the CRIS architecture's version of '
pcibios_setup()'. It implementspcibios_setup()such thatpci_setup()doesn't look for any generic options. I included the fix for this in this series. If this ends up not being correct - i.e. PCI support for CRIS should be dropped - then that specific patch (which I included last in the series) can be dropped.Note: I do not have a cross-compile environment so I have only tested x86.
---Myron Stowe (16):
cris/PCI: Factor 'pcibios_setup()' out of cris xtensa/PCI: Factor 'pcibios_setup()' out of xtensa x86/PCI: adjust section annotations for 'pcibios_setup()' unicore32/PCI: adjust section annotations for 'pcibios_setup()' tile/PCI: Factor 'pcibios_setup()' out of tile sparc/PCI: Factor 'pcibios_setup()' out of sparc sh/PCI: adjust section annotations for 'pcibios_setup()' sh/PCI: Factor 'pcibios_setup()' out of sh powerpc/PCI: Factor 'pcibios_setup()' out of powerpc parisc/PCI: Factor 'pcibios_setup()' out of parisc MIPS/PCI: adjust section annotations for 'pcibios_setup()' MIPS/PCI: Factor 'pcibios_setup()' out of MIPS/pmc-sierra microblaze/PCI: Factor 'pcibios_setup()' out of microblaze ia64/PCI: Factor 'pcibios_setup' out of ia64 alpha/PCI: Factor 'pcibios_setup()' out of alpha
PCI: Pull 'pcibios_setup' up into PCI's corearch/alpha/kernel/pci.c | 6 ------ arch/cris/arch-v32/drivers/pci/bios.c | 5 ----- arch/ia64/pci/pci.c | 9 --------- arch/microblaze/pci/pci-common.c | 5 ----- arch/mips/pci/pci.c | 4 ++-- arch/mips/pmc-sierra/yosemite/ht.c | 11 ----------- arch/mips/txx9/generic/pci.c | 4 ++-- arch/parisc/kernel/pci.c | 5 ----- arch/powerpc/kernel/pci-common.c | 5 ----- arch/sh/drivers/pci/fixups-sdk7786.c | 4 ++-- arch/sh/drivers/pci/pci.c | 5 ----- arch/sparc/kernel/leon_pci.c | 8 -------- arch/sparc/kernel/pci.c | 5 -----
Quoted 8 lines
arch/sparc/kernel/pcic.c | 8 -------- arch/tile/kernel/pci.c | 10 ---------- arch/unicore32/kernel/pci.c | 2 +- arch/x86/pci/common.c | 2 +- arch/xtensa/kernel/pci.c | 6 ------ drivers/pci/pci.c | 12 ++++++++++++ include/linux/pci.h | 1 + 20 files changed, 21 insertions(+), 96 deletions(-)
I pushed these to my -next branch, for inclusion in 3.6. Thanks for the cleanups!
Bjorn