2012-06-26 03:32:25

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 00/16] 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(-)

--


2012-06-26 03:32:33

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 02/16] alpha/PCI: Factor 'pcibios_setup()' out of alpha

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.

No functional change.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/alpha/kernel/pci.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 1a62963..133d2d4 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -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;

2012-06-26 03:32:44

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 05/16] MIPS/PCI: Factor 'pcibios_setup()' out of MIPS/pmc-sierra

The 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.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/mips/pmc-sierra/yosemite/ht.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c
index 63be40e..14dc9c8 100644
--- a/arch/mips/pmc-sierra/yosemite/ht.c
+++ b/arch/mips/pmc-sierra/yosemite/ht.c
@@ -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 */

2012-06-26 03:32:51

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 07/16] parisc/PCI: Factor 'pcibios_setup()' out of parisc

The 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.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/parisc/kernel/pci.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 24644ac..6030905 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -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.
*

2012-06-26 03:33:05

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 06/16] MIPS/PCI: adjust section annotations for 'pcibios_setup()'

Make pcibios_setup() consistently use the "__init" section annotation.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/mips/pci/pci.c | 4 ++--
arch/mips/txx9/generic/pci.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 271e8c4..0e111d2 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -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);
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index 682efb0..f028e3d 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -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;

2012-06-26 03:33:10

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 09/16] sh/PCI: Factor 'pcibios_setup()' out of sh

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]>
---

arch/sh/drivers/pci/pci.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 9d10a3c..7d42288 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -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,

2012-06-26 03:33:16

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 10/16] sh/PCI: adjust section annotations for 'pcibios_setup()'

Make pcibios_setup() consistently use the "__init" section annotation.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/sh/drivers/pci/fixups-sdk7786.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sh/drivers/pci/fixups-sdk7786.c b/arch/sh/drivers/pci/fixups-sdk7786.c
index 0e18ee3..36eb6fc 100644
--- a/arch/sh/drivers/pci/fixups-sdk7786.c
+++ b/arch/sh/drivers/pci/fixups-sdk7786.c
@@ -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;

2012-06-26 03:33:21

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 11/16] sparc/PCI: Factor 'pcibios_setup()' out of sparc

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]>
---

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(-)

diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c
index 19f5605..21dcda7 100644
--- a/arch/sparc/kernel/leon_pci.c
+++ b/arch/sparc/kernel/leon_pci.c
@@ -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)
{
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index fdaf218..3e7fba0 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -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
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index ded3f60..97eb529 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -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)
{

2012-06-26 03:33:30

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 13/16] unicore32/PCI: adjust section annotations for 'pcibios_setup()'

Make pcibios_setup() consistently use the "__init" section annotation.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/unicore32/kernel/pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c
index 2fc2b1b..46cb6c9 100644
--- a/arch/unicore32/kernel/pci.c
+++ b/arch/unicore32/kernel/pci.c
@@ -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;

2012-06-26 03:33:26

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile

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(-)

diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index b56d12b..e257226 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -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)

2012-06-26 03:33:46

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 14/16] x86/PCI: adjust section annotations for 'pcibios_setup()'

Make pcibios_setup() consistently use the "__init" section annotation.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/x86/pci/common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 0ad990a..720e973 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -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;

2012-06-26 03:33:52

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 15/16] xtensa/PCI: Factor 'pcibios_setup()' out of xtensa

The 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.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/xtensa/kernel/pci.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index eb30e35..3a2cae4 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -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 */

2012-06-26 03:33:59

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 16/16] cris/PCI: Factor 'pcibios_setup()' out of cris

This 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.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/cris/arch-v32/drivers/pci/bios.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
index bc0cfda..5b1ee82 100644
--- a/arch/cris/arch-v32/drivers/pci/bios.c
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -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;

2012-06-26 03:33:03

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 08/16] powerpc/PCI: Factor 'pcibios_setup()' out of powerpc

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]>
---

arch/powerpc/kernel/pci-common.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 8e78e93..bf2306b 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -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

2012-06-26 03:35:47

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 04/16] microblaze/PCI: Factor 'pcibios_setup()' out of microblaze

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(-)

diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index ed22bfc..7b510ae 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -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

2012-06-26 03:32:30

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 03/16] ia64/PCI: Factor 'pcibios_setup' out of ia64

The 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.

Signed-off-by: Myron Stowe <[email protected]>
---

arch/ia64/pci/pci.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 524df42..e51941f 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -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)

2012-06-26 03:32:28

by Myron Stowe

[permalink] [raw]
Subject: [PATCH 01/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.

Signed-off-by: Myron Stowe <[email protected]>
---

drivers/pci/pci.c | 12 ++++++++++++
include/linux/pci.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 77cb54a..0f6d472 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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
*
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fefb4e1..fdcff0e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -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 */

2012-06-26 03:36:54

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 11/16] sparc/PCI: Factor 'pcibios_setup()' out of sparc

From: Myron Stowe <[email protected]>
Date: Mon, 25 Jun 2012 21:32:12 -0600

> 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]>

Acked-by: David S. Miller <[email protected]>

2012-06-26 04:39:46

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [PATCH 08/16] powerpc/PCI: Factor 'pcibios_setup()' out of powerpc

On Mon, 2012-06-25 at 21:31 -0600, Myron Stowe wrote:
> 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]>

Acked-by: Benjamin Herrenschmidt <[email protected]>
> ---

> arch/powerpc/kernel/pci-common.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index 8e78e93..bf2306b 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -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

2012-06-26 04:57:59

by Nobuhiro Iwamatsu

[permalink] [raw]
Subject: Re: [PATCH 09/16] sh/PCI: Factor 'pcibios_setup()' out of sh

2012/6/26 Myron Stowe <[email protected]>:
> 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]>

Tested-by: Nobuhiro Iwamatsu <[email protected]>

--
Nobuhiro Iwamatsu

2012-06-26 05:48:01

by Michal Simek

[permalink] [raw]
Subject: Re: [PATCH 04/16] microblaze/PCI: Factor 'pcibios_setup()' out of microblaze

On 06/26/2012 05:31 AM, Myron Stowe wrote:
> 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(-)
>
> diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
> index ed22bfc..7b510ae 100644
> --- a/arch/microblaze/pci/pci-common.c
> +++ b/arch/microblaze/pci/pci-common.c
> @@ -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
>

Acked-by: Michal Simek <[email protected]>

Thanks,
Michal


--
Michal Simek, Ing. (M.Eng)
w: http://www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

2012-06-26 05:53:34

by Paul Mundt

[permalink] [raw]
Subject: Re: [PATCH 09/16] sh/PCI: Factor 'pcibios_setup()' out of sh

On Mon, Jun 25, 2012 at 09:31:58PM -0600, Myron Stowe wrote:
> 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]>

Acked-by: Paul Mundt <[email protected]>

2012-06-26 06:34:57

by Guan Xuetao

[permalink] [raw]
Subject: Re: [PATCH 13/16] unicore32/PCI: adjust section annotations for 'pcibios_setup()'

> Make pcibios_setup() consistently use the "__init" section annotation.
>
> Signed-off-by: Myron Stowe <[email protected]>

Acked-by: Guan Xuetao <[email protected]>

2012-06-26 13:19:03

by Chris Metcalf

[permalink] [raw]
Subject: Re: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile

On 6/25/2012 11:32 PM, Myron Stowe wrote:
> 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(-)

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. But perhaps it would make sense
to move the support for "pci=off" to common code, since multiple
architectures handle this the same way?

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com


2012-06-26 15:43:46

by Richard Henderson

[permalink] [raw]
Subject: Re: [PATCH 02/16] alpha/PCI: Factor 'pcibios_setup()' out of alpha

On 06/25/2012 08:31 PM, Myron Stowe wrote:
> 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.
>
> No functional change.
>
> Signed-off-by: Myron Stowe <[email protected]>
> ---
>
> arch/alpha/kernel/pci.c | 6 ------
> 1 files changed, 0 insertions(+), 6 deletions(-)

Acked-by: Richard Henderson <[email protected]>


r~

2012-06-28 17:31:55

by Myron Stowe

[permalink] [raw]
Subject: Re: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile

On Tue, 2012-06-26 at 09:18 -0400, Chris Metcalf wrote:
> On 6/25/2012 11:32 PM, Myron Stowe wrote:
> > 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(-)
>
> 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.

> 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

2012-06-28 17:44:28

by Chris Metcalf

[permalink] [raw]
Subject: Re: [PATCH 12/16] tile/PCI: Factor 'pcibios_setup()' out of tile

On 6/28/2012 1:30 PM, Myron Stowe wrote:
> On Tue, 2012-06-26 at 09:18 -0400, Chris Metcalf wrote:
>> On 6/25/2012 11:32 PM, Myron Stowe wrote:
>>> 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. [...]
>> 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?

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. :-)

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com