[PATCH 00/16] PCI: Re-factor 'pcibios_setup()'

June 25th, 2012 - 11:40 pm ET by Myron Stowe | Report spam
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&m4023745124680&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(-)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 10 repliesReplies Make a reply

Similar topics

Replies

#1 Benjamin Herrenschmidt
June 26th, 2012 - 12:40 am ET | Report spam
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



Acked-by: Benjamin Herrenschmidt


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
More majordomo info at http://vger.kernel.org/majordomo-info.html




To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#2 Nobuhiro Iwamatsu
June 26th, 2012 - 01:00 am ET | Report spam
2012/6/26 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



Tested-by: Nobuhiro Iwamatsu

Nobuhiro Iwamatsu
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#3 Michal Simek
June 26th, 2012 - 01:50 am ET | Report spam
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


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

Thanks,
Michal


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
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#4 Paul Mundt
June 26th, 2012 - 02:00 am ET | Report spam
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



Acked-by: Paul Mundt
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
#5 guanxuetao
June 26th, 2012 - 02:40 am ET | Report spam
Make pcibios_setup() consistently use the "__init" section annotation.

Signed-off-by: Myron Stowe



Acked-by: Guan Xuetao


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Replies Reply to this message
Help Create a new topicNext page Replies Make a reply
Search Make your own search