linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Annotate PCI fixups with __devinit instead of __init
@ 2012-06-03 18:48 Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 1/9] scripts/modpost: check for bad refernces in .pci.fixups area Sebastian Andrzej Siewior
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-kbuild, Bjorn Helgaas, Michal Marek

This patch series adds a section missmatch check to modpost which will
splat a warning if a PCI fixup routine (declared via
DECLARE_PCI_FIXUP_HEADER for instance) is defined in __init. Even if the
platform does not support hot-plug, one could remove the PCI bus during
run time (soft remove, now HW touching involved) and rediscover it again.
The rediscover process will call the PCI-fixups again.
This is patch #1. After posting it Bjorn ask for fixing the noisy warnings
and this is done by patch #2 to #9.


Sebastian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/9] scripts/modpost: check for bad refernces in .pci.fixups area
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 2/9] x86/quirks: move PCI fixup hooks from __init to __devinit Sebastian Andrzej Siewior
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, Rusty Russell

Functions used for PCI fixups (like DECLARE_PCI_FIXUP_HEADER) are often
marked __init. This is okay as long as nobody is using PCI hotplug.
However if one does execute
| echo 1 > /sys/bus/pci/rescan

and we hit a module which is marked __init istead of __devinit then we
go boom because the code is removed after the kernel booted. This patch
help to see those section miss-matches.

Acked-By: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 scripts/mod/modpost.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0f84bb3..68e9f5e 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -865,6 +865,11 @@ static void check_section(const char *modname, struct elf_info *elf,
 #define ALL_EXIT_TEXT_SECTIONS \
 	".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$"
 
+#define ALL_PCI_INIT_SECTIONS	\
+	".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \
+	".pci_fixup_enable$", ".pci_fixup_resume$", \
+	".pci_fixup_resume_early$", ".pci_fixup_suspend$"
+
 #define ALL_XXXINIT_SECTIONS DEV_INIT_SECTIONS, CPU_INIT_SECTIONS, \
 	MEM_INIT_SECTIONS
 #define ALL_XXXEXIT_SECTIONS DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, \
@@ -1027,6 +1032,12 @@ const struct sectioncheck sectioncheck[] = {
 	.mismatch = ANY_EXIT_TO_ANY_INIT,
 	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
 },
+{
+	.fromsec = { ALL_PCI_INIT_SECTIONS, NULL },
+	.tosec   = { INIT_SECTIONS, NULL },
+	.mismatch = ANY_INIT_TO_ANY_EXIT,
+	.symbol_white_list = { NULL },
+},
 /* Do not export init/exit functions or data */
 {
 	.fromsec = { "__ksymtab*", NULL },
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/9] x86/quirks: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 1/9] scripts/modpost: check for bad refernces in .pci.fixups area Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 3/9] pci/quirks: " Sebastian Andrzej Siewior
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, x86

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: x86@kernel.org
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/x86/kernel/quirks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 03920a1..1b27de5 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -512,7 +512,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
 
 #if defined(CONFIG_PCI) && defined(CONFIG_NUMA)
 /* Set correct numa_node information for AMD NB functions */
-static void __init quirk_amd_nb_node(struct pci_dev *dev)
+static void __devinit quirk_amd_nb_node(struct pci_dev *dev)
 {
 	struct pci_dev *nb_ht;
 	unsigned int devfn;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/9] pci/quirks: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 1/9] scripts/modpost: check for bad refernces in .pci.fixups area Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 2/9] x86/quirks: move PCI fixup hooks from __init to __devinit Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 4/9] alpha: " Sebastian Andrzej Siewior
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 drivers/pci/quirks.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 2a75216..993cec8 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C576,	quirk_vsfx)
  *	workaround applied too
  *	[Info kindly provided by ALi]
  */	
-static void __init quirk_alimagik(struct pci_dev *dev)
+static void __devinit quirk_alimagik(struct pci_dev *dev)
 {
 	if ((pci_pci_problems&PCIPCI_ALIMAGIK)==0) {
 		dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n");
@@ -789,7 +789,7 @@ static void __devinit quirk_amd_ioapic(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,	PCI_DEVICE_ID_AMD_VIPER_7410,	quirk_amd_ioapic);
 
-static void __init quirk_ioapic_rmw(struct pci_dev *dev)
+static void __devinit quirk_ioapic_rmw(struct pci_dev *dev)
 {
 	if (dev->devfn == 0 && dev->bus->number == 0)
 		sis_apic_bug = 1;
@@ -801,7 +801,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI,	PCI_ANY_ID,			quirk_ioapic_rmw);
  * Some settings of MMRBC can lead to data corruption so block changes.
  * See AMD 8131 HyperTransport PCI-X Tunnel Revision Guide
  */
-static void __init quirk_amd_8131_mmrbc(struct pci_dev *dev)
+static void __devinit quirk_amd_8131_mmrbc(struct pci_dev *dev)
 {
 	if (dev->subordinate && dev->revision <= 0x12) {
 		dev_info(&dev->dev, "AMD8131 rev %x detected; "
@@ -1082,7 +1082,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB
 /*
  *	Intel 82801CAM ICH3-M datasheet says IDE modes must be the same
  */
-static void __init quirk_ide_samemode(struct pci_dev *pdev)
+static void __devinit quirk_ide_samemode(struct pci_dev *pdev)
 {
 	u8 prog;
 
@@ -1121,7 +1121,7 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID,
 /* This was originally an Alpha specific thing, but it really fits here.
  * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
  */
-static void __init quirk_eisa_bridge(struct pci_dev *dev)
+static void __devinit quirk_eisa_bridge(struct pci_dev *dev)
 {
 	dev->class = PCI_CLASS_BRIDGE_EISA << 8;
 }
@@ -1155,7 +1155,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82375,	quirk_e
  */
 static int asus_hides_smbus;
 
-static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
+static void __devinit asus_hides_smbus_hostbridge(struct pci_dev *dev)
 {
 	if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) {
 		if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB)
@@ -1538,7 +1538,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB3
 #endif
 
 #ifdef CONFIG_X86_IO_APIC
-static void __init quirk_alder_ioapic(struct pci_dev *pdev)
+static void __devinit quirk_alder_ioapic(struct pci_dev *pdev)
 {
 	int i;
 
@@ -1777,7 +1777,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8111_SMBUS, 	qui
  * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes.
  * Re-allocate the region if needed...
  */
-static void __init quirk_tc86c001_ide(struct pci_dev *dev)
+static void __devinit quirk_tc86c001_ide(struct pci_dev *dev)
 {
 	struct resource *r = &dev->resource[0];
 
@@ -2169,7 +2169,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8624, quirk_tile_plx_gen1);
  * aware of it.  Instead of setting the flag on all busses in the
  * machine, simply disable MSI globally.
  */
-static void __init quirk_disable_all_msi(struct pci_dev *dev)
+static void __devinit quirk_disable_all_msi(struct pci_dev *dev)
 {
 	pci_no_msi();
 	dev_warn(&dev->dev, "MSI quirk detected; MSI disabled\n");
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/9] alpha: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (2 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 3/9] pci/quirks: " Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 5/9] arm: " Sebastian Andrzej Siewior
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, Richard Henderson, Ivan Kokshaysky,
	Matt Turner

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/alpha/kernel/pci.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 1a62963..026d49f 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -59,15 +59,13 @@ struct pci_controller *pci_isa_hose;
  * Quirks.
  */
 
-static void __init
-quirk_isa_bridge(struct pci_dev *dev)
+static void __devinit quirk_isa_bridge(struct pci_dev *dev)
 {
 	dev->class = PCI_CLASS_BRIDGE_ISA << 8;
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge);
 
-static void __init
-quirk_cypress(struct pci_dev *dev)
+static void __devinit quirk_cypress(struct pci_dev *dev)
 {
 	/* The Notorious Cy82C693 chip.  */
 
@@ -106,8 +104,7 @@ quirk_cypress(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress);
 
 /* Called for each device after PCI setup is done. */
-static void __init
-pcibios_fixup_final(struct pci_dev *dev)
+static void __devinit pcibios_fixup_final(struct pci_dev *dev)
 {
 	unsigned int class = dev->class >> 8;
 
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/9] arm: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (3 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 4/9] alpha: " Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 6/9] frv: " Sebastian Andrzej Siewior
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, Russell King

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/arm/kernel/bios32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 2555250..1c1a0e2 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -253,7 +253,7 @@ static void __devinit pci_fixup_cy82c693(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693);
 
-static void __init pci_fixup_it8152(struct pci_dev *dev)
+static void __devinit pci_fixup_it8152(struct pci_dev *dev)
 {
 	int i;
 	/* fixup for ITE 8152 devices */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 6/9] frv: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (4 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 5/9] arm: " Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-03 18:48 ` [PATCH 7/9] mips: " Sebastian Andrzej Siewior
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, David Howells

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/frv/mb93090-mb00/pci-vdk.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index 6b0b82f..d04ed14 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -268,7 +268,7 @@ static void __init pci_fixup_umc_ide(struct pci_dev *d)
 		d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
 }
 
-static void __init pci_fixup_ide_bases(struct pci_dev *d)
+static void __devinit pci_fixup_ide_bases(struct pci_dev *d)
 {
 	int i;
 
@@ -287,7 +287,7 @@ static void __init pci_fixup_ide_bases(struct pci_dev *d)
 	}
 }
 
-static void __init pci_fixup_ide_trash(struct pci_dev *d)
+static void __devinit pci_fixup_ide_trash(struct pci_dev *d)
 {
 	int i;
 
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (5 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 6/9] frv: " Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-14 16:39   ` Myron Stowe
  2012-06-03 18:48 ` [PATCH 8/9] powerpc: " Sebastian Andrzej Siewior
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, Ralf Baechle

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/mips/mti-malta/malta-pci.c |    2 +-
 arch/mips/pci/fixup-fuloong2e.c |   12 ++++++------
 arch/mips/pci/fixup-lemote2f.c  |   12 ++++++------
 arch/mips/pci/fixup-malta.c     |    4 ++--
 arch/mips/pci/fixup-sb1250.c    |    6 +++---
 arch/mips/pci/ops-tx4927.c      |    2 +-
 arch/mips/pci/pci-ip27.c        |    2 +-
 arch/mips/txx9/generic/pci.c    |    2 +-
 8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c
index bf80921..b663402 100644
--- a/arch/mips/mti-malta/malta-pci.c
+++ b/arch/mips/mti-malta/malta-pci.c
@@ -253,7 +253,7 @@ void __init mips_pcibios_init(void)
 }
 
 /* Enable PCI 2.1 compatibility in PIIX4 */
-static void __init quirk_dlcsetup(struct pci_dev *dev)
+static void __devinit quirk_dlcsetup(struct pci_dev *dev)
 {
 	u8 odlc, ndlc;
 	(void) pci_read_config_byte(dev, 0x82, &odlc);
diff --git a/arch/mips/pci/fixup-fuloong2e.c b/arch/mips/pci/fixup-fuloong2e.c
index d5d4c01..0857ab8 100644
--- a/arch/mips/pci/fixup-fuloong2e.c
+++ b/arch/mips/pci/fixup-fuloong2e.c
@@ -48,7 +48,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
 	return 0;
 }
 
-static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
+static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
@@ -60,7 +60,7 @@ static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
 	pci_write_config_dword(pdev, 0xe4, 1 << 5);
 }
 
-static void __init loongson2e_686b_func0_fixup(struct pci_dev *pdev)
+static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev)
 {
 	unsigned char c;
 
@@ -135,7 +135,7 @@ static void __init loongson2e_686b_func0_fixup(struct pci_dev *pdev)
 	printk(KERN_INFO"via686b fix: ISA bridge done\n");
 }
 
-static void __init loongson2e_686b_func1_fixup(struct pci_dev *pdev)
+static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev)
 {
 	printk(KERN_INFO"via686b fix: IDE\n");
 
@@ -168,19 +168,19 @@ static void __init loongson2e_686b_func1_fixup(struct pci_dev *pdev)
 	printk(KERN_INFO"via686b fix: IDE done\n");
 }
 
-static void __init loongson2e_686b_func2_fixup(struct pci_dev *pdev)
+static void __devinit loongson2e_686b_func2_fixup(struct pci_dev *pdev)
 {
 	/* irq routing */
 	pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 10);
 }
 
-static void __init loongson2e_686b_func3_fixup(struct pci_dev *pdev)
+static void __devinit loongson2e_686b_func3_fixup(struct pci_dev *pdev)
 {
 	/* irq routing */
 	pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 11);
 }
 
-static void __init loongson2e_686b_func5_fixup(struct pci_dev *pdev)
+static void __devinit loongson2e_686b_func5_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 	unsigned char c;
diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c
index 4b9768d..a7b917dcf 100644
--- a/arch/mips/pci/fixup-lemote2f.c
+++ b/arch/mips/pci/fixup-lemote2f.c
@@ -96,21 +96,21 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
 }
 
 /* CS5536 SPEC. fixup */
-static void __init loongson_cs5536_isa_fixup(struct pci_dev *pdev)
+static void __devinit loongson_cs5536_isa_fixup(struct pci_dev *pdev)
 {
 	/* the uart1 and uart2 interrupt in PIC is enabled as default */
 	pci_write_config_dword(pdev, PCI_UART1_INT_REG, 1);
 	pci_write_config_dword(pdev, PCI_UART2_INT_REG, 1);
 }
 
-static void __init loongson_cs5536_ide_fixup(struct pci_dev *pdev)
+static void __devinit loongson_cs5536_ide_fixup(struct pci_dev *pdev)
 {
 	/* setting the mutex pin as IDE function */
 	pci_write_config_dword(pdev, PCI_IDE_CFG_REG,
 			       CS5536_IDE_FLASH_SIGNATURE);
 }
 
-static void __init loongson_cs5536_acc_fixup(struct pci_dev *pdev)
+static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev)
 {
 	/* enable the AUDIO interrupt in PIC  */
 	pci_write_config_dword(pdev, PCI_ACC_INT_REG, 1);
@@ -118,14 +118,14 @@ static void __init loongson_cs5536_acc_fixup(struct pci_dev *pdev)
 	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0);
 }
 
-static void __init loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
+static void __devinit loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
 {
 	/* enable the OHCI interrupt in PIC */
 	/* THE OHCI, EHCI, UDC, OTG are shared with interrupt in PIC */
 	pci_write_config_dword(pdev, PCI_OHCI_INT_REG, 1);
 }
 
-static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
+static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
 {
 	u32 hi, lo;
 
@@ -137,7 +137,7 @@ static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
 	pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000);
 }
 
-static void __init loongson_nec_fixup(struct pci_dev *pdev)
+static void __devinit loongson_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index 0f48498..59cfbc8 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -49,7 +49,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
 	return 0;
 }
 
-static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
+static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev)
 {
 	unsigned char reg_val;
 	static int piixirqmap[16] __initdata = {  /* PIIX PIRQC[A:D] irq mappings */
@@ -83,7 +83,7 @@ static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,
 	 malta_piix_func0_fixup);
 
-static void __init malta_piix_func1_fixup(struct pci_dev *pdev)
+static void __devinit malta_piix_func1_fixup(struct pci_dev *pdev)
 {
 	unsigned char reg_val;
 
diff --git a/arch/mips/pci/fixup-sb1250.c b/arch/mips/pci/fixup-sb1250.c
index f0bb914..d02900a 100644
--- a/arch/mips/pci/fixup-sb1250.c
+++ b/arch/mips/pci/fixup-sb1250.c
@@ -15,7 +15,7 @@
  * Set the BCM1250, etc. PCI host bridge's TRDY timeout
  * to the finite max.
  */
-static void __init quirk_sb1250_pci(struct pci_dev *dev)
+static void __devinit quirk_sb1250_pci(struct pci_dev *dev)
 {
 	pci_write_config_byte(dev, 0x40, 0xff);
 }
@@ -25,7 +25,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_PCI,
 /*
  * The BCM1250, etc. PCI/HT bridge reports as a host bridge.
  */
-static void __init quirk_sb1250_ht(struct pci_dev *dev)
+static void __devinit quirk_sb1250_ht(struct pci_dev *dev)
 {
 	dev->class = PCI_CLASS_BRIDGE_PCI << 8;
 }
@@ -35,7 +35,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_HT,
 /*
  * Set the SP1011 HT/PCI bridge's TRDY timeout to the finite max.
  */
-static void __init quirk_sp1011(struct pci_dev *dev)
+static void __devinit quirk_sp1011(struct pci_dev *dev)
 {
 	pci_write_config_byte(dev, 0x64, 0xff);
 }
diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
index a1e7e6d..bc13e29 100644
--- a/arch/mips/pci/ops-tx4927.c
+++ b/arch/mips/pci/ops-tx4927.c
@@ -495,7 +495,7 @@ irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id)
 }
 
 #ifdef CONFIG_TOSHIBA_FPCIB0
-static void __init tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
+static void __devinit tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
 {
 	struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus);
 
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index 0fbe4c0..fdc2444 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -212,7 +212,7 @@ static inline void pci_enable_swapping(struct pci_dev *dev)
 	bridge->b_widget.w_tflush;	/* Flush */
 }
 
-static void __init pci_fixup_ioc3(struct pci_dev *d)
+static void __devinit pci_fixup_ioc3(struct pci_dev *d)
 {
 	pci_disable_swapping(d);
 }
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index 682efb0..64eb71b 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -269,7 +269,7 @@ txx9_i8259_irq_setup(int irq)
 	return err;
 }
 
-static void __init quirk_slc90e66_bridge(struct pci_dev *dev)
+static void __devinit quirk_slc90e66_bridge(struct pci_dev *dev)
 {
 	int irq;	/* PCI/ISA Bridge interrupt */
 	u8 reg_64;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 8/9] powerpc: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (6 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 7/9] mips: " Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-06  5:28   ` Benjamin Herrenschmidt
  2012-06-03 18:48 ` [PATCH 9/9] sh: " Sebastian Andrzej Siewior
  2012-06-04  1:12 ` Annotate PCI fixups with __devinit instead of __init Bjorn Helgaas
  9 siblings, 1 reply; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, Kumar Gala, Benjamin Herrenschmidt,
	Paul Mackerras

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/powerpc/platforms/85xx/tqm85xx.c    |    2 +-
 arch/powerpc/platforms/86xx/gef_ppc9a.c  |    2 +-
 arch/powerpc/platforms/86xx/gef_sbc310.c |    2 +-
 arch/powerpc/platforms/86xx/gef_sbc610.c |    2 +-
 arch/powerpc/sysdev/fsl_pci.c            |    2 +-
 arch/powerpc/sysdev/mv64x60_pci.c        |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 4d786c2..3e70a20 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -102,7 +102,7 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
 }
 
-static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
+static void __devinit tqm85xx_ti1520_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index 1fca663..563aafa8 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -164,7 +164,7 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
 		gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");
 }
 
-static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev)
+static void __devinit gef_ppc9a_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index 14e0e576..cc6a91a 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -152,7 +152,7 @@ static void gef_sbc310_show_cpuinfo(struct seq_file *m)
 
 }
 
-static void __init gef_sbc310_nec_fixup(struct pci_dev *pdev)
+static void __devinit gef_sbc310_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 1638f43..aead6b3 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -141,7 +141,7 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "SVR\t\t: 0x%x\n", svid);
 }
 
-static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
+static void __devinit gef_sbc610_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 6073288..edbf794 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -36,7 +36,7 @@
 
 static int fsl_pcie_bus_fixup, is_mpc83xx_pci;
 
-static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
+static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev)
 {
 	u8 progif;
 
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index b0037ce..364b14d 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -104,7 +104,7 @@ subsys_initcall(mv64x60_sysfs_init);
 
 #endif /* CONFIG_SYSFS */
 
-static void __init mv64x60_pci_fixup_early(struct pci_dev *dev)
+static void __devinit mv64x60_pci_fixup_early(struct pci_dev *dev)
 {
 	/*
 	 * Set the host bridge hdr_type to an invalid value so that
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 9/9] sh: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (7 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 8/9] powerpc: " Sebastian Andrzej Siewior
@ 2012-06-03 18:48 ` Sebastian Andrzej Siewior
  2012-06-04  1:12 ` Annotate PCI fixups with __devinit instead of __init Bjorn Helgaas
  9 siblings, 0 replies; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-03 18:48 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kbuild, Bjorn Helgaas, Michal Marek,
	Sebastian Andrzej Siewior, Paul Mundt

The fixups are executed once the pci-device is found which is during
boot process so __init seems fine as long as the platform does not
support hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
 arch/sh/drivers/pci/fixups-dreamcast.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c
index edeea89..a5fe1b5 100644
--- a/arch/sh/drivers/pci/fixups-dreamcast.c
+++ b/arch/sh/drivers/pci/fixups-dreamcast.c
@@ -28,7 +28,7 @@
 #include <asm/irq.h>
 #include <mach/pci.h>
 
-static void __init gapspci_fixup_resources(struct pci_dev *dev)
+static void __devinit gapspci_fixup_resources(struct pci_dev *dev)
 {
 	struct pci_channel *p = dev->sysdata;
 
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: Annotate PCI fixups with __devinit instead of __init
  2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
                   ` (8 preceding siblings ...)
  2012-06-03 18:48 ` [PATCH 9/9] sh: " Sebastian Andrzej Siewior
@ 2012-06-04  1:12 ` Bjorn Helgaas
  2012-06-12  1:27   ` Bjorn Helgaas
  9 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2012-06-04  1:12 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-pci, linux-kbuild, Michal Marek

On Sun, Jun 3, 2012 at 11:48 AM, Sebastian Andrzej Siewior
<sebastian@breakpoint.cc> wrote:
> This patch series adds a section missmatch check to modpost which will
> splat a warning if a PCI fixup routine (declared via
> DECLARE_PCI_FIXUP_HEADER for instance) is defined in __init. Even if the
> platform does not support hot-plug, one could remove the PCI bus during
> run time (soft remove, now HW touching involved) and rediscover it again.
> The rediscover process will call the PCI-fixups again.
> This is patch #1. After posting it Bjorn ask for fixing the noisy warnings
> and this is done by patch #2 to #9.

These all look good to me.

There's not a real dependency between #1 and the rest of them, so I
propose that I feed #2-9 through the PCI tree and whoever normally
handles modpost can take #1.

Bjorn

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 8/9] powerpc: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 ` [PATCH 8/9] powerpc: " Sebastian Andrzej Siewior
@ 2012-06-06  5:28   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 19+ messages in thread
From: Benjamin Herrenschmidt @ 2012-06-06  5:28 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-pci, linux-kbuild, Bjorn Helgaas, Michal Marek, Kumar Gala,
	Paul Mackerras

On Sun, 2012-06-03 at 20:48 +0200, Sebastian Andrzej Siewior wrote:
> The fixups are executed once the pci-device is found which is during
> boot process so __init seems fine as long as the platform does not
> support hotplug.
> However it is possible to remove the PCI bus at run time and have it
> rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
> the fixups again.
> 
> Cc: Kumar Gala <galak@kernel.crashing.org>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Thanks !

Ben.

> Cc: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> ---
>  arch/powerpc/platforms/85xx/tqm85xx.c    |    2 +-
>  arch/powerpc/platforms/86xx/gef_ppc9a.c  |    2 +-
>  arch/powerpc/platforms/86xx/gef_sbc310.c |    2 +-
>  arch/powerpc/platforms/86xx/gef_sbc610.c |    2 +-
>  arch/powerpc/sysdev/fsl_pci.c            |    2 +-
>  arch/powerpc/sysdev/mv64x60_pci.c        |    2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
> index 4d786c2..3e70a20 100644
> --- a/arch/powerpc/platforms/85xx/tqm85xx.c
> +++ b/arch/powerpc/platforms/85xx/tqm85xx.c
> @@ -102,7 +102,7 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)
>  	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
>  }
>  
> -static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
> +static void __devinit tqm85xx_ti1520_fixup(struct pci_dev *pdev)
>  {
>  	unsigned int val;
>  
> diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
> index 1fca663..563aafa8 100644
> --- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
> +++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
> @@ -164,7 +164,7 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
>  		gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");
>  }
>  
> -static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev)
> +static void __devinit gef_ppc9a_nec_fixup(struct pci_dev *pdev)
>  {
>  	unsigned int val;
>  
> diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
> index 14e0e576..cc6a91a 100644
> --- a/arch/powerpc/platforms/86xx/gef_sbc310.c
> +++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
> @@ -152,7 +152,7 @@ static void gef_sbc310_show_cpuinfo(struct seq_file *m)
>  
>  }
>  
> -static void __init gef_sbc310_nec_fixup(struct pci_dev *pdev)
> +static void __devinit gef_sbc310_nec_fixup(struct pci_dev *pdev)
>  {
>  	unsigned int val;
>  
> diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
> index 1638f43..aead6b3 100644
> --- a/arch/powerpc/platforms/86xx/gef_sbc610.c
> +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
> @@ -141,7 +141,7 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
>  	seq_printf(m, "SVR\t\t: 0x%x\n", svid);
>  }
>  
> -static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
> +static void __devinit gef_sbc610_nec_fixup(struct pci_dev *pdev)
>  {
>  	unsigned int val;
>  
> diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
> index 6073288..edbf794 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -36,7 +36,7 @@
>  
>  static int fsl_pcie_bus_fixup, is_mpc83xx_pci;
>  
> -static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
> +static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev)
>  {
>  	u8 progif;
>  
> diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
> index b0037ce..364b14d 100644
> --- a/arch/powerpc/sysdev/mv64x60_pci.c
> +++ b/arch/powerpc/sysdev/mv64x60_pci.c
> @@ -104,7 +104,7 @@ subsys_initcall(mv64x60_sysfs_init);
>  
>  #endif /* CONFIG_SYSFS */
>  
> -static void __init mv64x60_pci_fixup_early(struct pci_dev *dev)
> +static void __devinit mv64x60_pci_fixup_early(struct pci_dev *dev)
>  {
>  	/*
>  	 * Set the host bridge hdr_type to an invalid value so that



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Annotate PCI fixups with __devinit instead of __init
  2012-06-04  1:12 ` Annotate PCI fixups with __devinit instead of __init Bjorn Helgaas
@ 2012-06-12  1:27   ` Bjorn Helgaas
  0 siblings, 0 replies; 19+ messages in thread
From: Bjorn Helgaas @ 2012-06-12  1:27 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-pci, linux-kbuild, Michal Marek

On Sun, Jun 3, 2012 at 7:12 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Sun, Jun 3, 2012 at 11:48 AM, Sebastian Andrzej Siewior
> <sebastian@breakpoint.cc> wrote:
>> This patch series adds a section missmatch check to modpost which will
>> splat a warning if a PCI fixup routine (declared via
>> DECLARE_PCI_FIXUP_HEADER for instance) is defined in __init. Even if the
>> platform does not support hot-plug, one could remove the PCI bus during
>> run time (soft remove, now HW touching involved) and rediscover it again.
>> The rediscover process will call the PCI-fixups again.
>> This is patch #1. After posting it Bjorn ask for fixing the noisy warnings
>> and this is done by patch #2 to #9.
>
> These all look good to me.
>
> There's not a real dependency between #1 and the rest of them, so I
> propose that I feed #2-9 through the PCI tree and whoever normally
> handles modpost can take #1.

I put all these, including #1, in my "next" branch, which should
appear in v3.6.  If somebody wants to push the modpost change
separately, I'll remove it, but since nobody objected or stepped up to
claim it, I just kept them all together.

Thanks for doing this work!

Bjorn

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-03 18:48 ` [PATCH 7/9] mips: " Sebastian Andrzej Siewior
@ 2012-06-14 16:39   ` Myron Stowe
  2012-06-15 16:33     ` Bjorn Helgaas
  0 siblings, 1 reply; 19+ messages in thread
From: Myron Stowe @ 2012-06-14 16:39 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-pci, linux-kbuild, Bjorn Helgaas, Michal Marek,
	Ralf Baechle

On Sun, Jun 3, 2012 at 12:48 PM, Sebastian Andrzej Siewior
<sebastian@breakpoint.cc> wrote:
> The fixups are executed once the pci-device is found which is during
> boot process so __init seems fine as long as the platform does not
> support hotplug.
> However it is possible to remove the PCI bus at run time and have it
> rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
> the fixups again.
>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> ---
>  arch/mips/mti-malta/malta-pci.c |    2 +-
>  arch/mips/pci/fixup-fuloong2e.c |   12 ++++++------
>  arch/mips/pci/fixup-lemote2f.c  |   12 ++++++------
>  arch/mips/pci/fixup-malta.c     |    4 ++--
>  arch/mips/pci/fixup-sb1250.c    |    6 +++---
>  arch/mips/pci/ops-tx4927.c      |    2 +-
>  arch/mips/pci/pci-ip27.c        |    2 +-
>  arch/mips/txx9/generic/pci.c    |    2 +-
>  8 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c
> index bf80921..b663402 100644
> --- a/arch/mips/mti-malta/malta-pci.c
> +++ b/arch/mips/mti-malta/malta-pci.c
> @@ -253,7 +253,7 @@ void __init mips_pcibios_init(void)
>  }
>
>  /* Enable PCI 2.1 compatibility in PIIX4 */
> -static void __init quirk_dlcsetup(struct pci_dev *dev)
> +static void __devinit quirk_dlcsetup(struct pci_dev *dev)
>  {
>        u8 odlc, ndlc;
>        (void) pci_read_config_byte(dev, 0x82, &odlc);
> diff --git a/arch/mips/pci/fixup-fuloong2e.c b/arch/mips/pci/fixup-fuloong2e.c
> index d5d4c01..0857ab8 100644
> --- a/arch/mips/pci/fixup-fuloong2e.c
> +++ b/arch/mips/pci/fixup-fuloong2e.c
> @@ -48,7 +48,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
>        return 0;
>  }
>
> -static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
> +static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev)
>  {
>        unsigned int val;
>
> @@ -60,7 +60,7 @@ static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
>        pci_write_config_dword(pdev, 0xe4, 1 << 5);
>  }
>
> -static void __init loongson2e_686b_func0_fixup(struct pci_dev *pdev)
> +static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev)
>  {
>        unsigned char c;
>
> @@ -135,7 +135,7 @@ static void __init loongson2e_686b_func0_fixup(struct pci_dev *pdev)
>        printk(KERN_INFO"via686b fix: ISA bridge done\n");
>  }
>
> -static void __init loongson2e_686b_func1_fixup(struct pci_dev *pdev)
> +static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev)
>  {
>        printk(KERN_INFO"via686b fix: IDE\n");
>
> @@ -168,19 +168,19 @@ static void __init loongson2e_686b_func1_fixup(struct pci_dev *pdev)
>        printk(KERN_INFO"via686b fix: IDE done\n");
>  }
>
> -static void __init loongson2e_686b_func2_fixup(struct pci_dev *pdev)
> +static void __devinit loongson2e_686b_func2_fixup(struct pci_dev *pdev)
>  {
>        /* irq routing */
>        pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 10);
>  }
>
> -static void __init loongson2e_686b_func3_fixup(struct pci_dev *pdev)
> +static void __devinit loongson2e_686b_func3_fixup(struct pci_dev *pdev)
>  {
>        /* irq routing */
>        pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 11);
>  }
>
> -static void __init loongson2e_686b_func5_fixup(struct pci_dev *pdev)
> +static void __devinit loongson2e_686b_func5_fixup(struct pci_dev *pdev)
>  {
>        unsigned int val;
>        unsigned char c;
> diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c
> index 4b9768d..a7b917dcf 100644
> --- a/arch/mips/pci/fixup-lemote2f.c
> +++ b/arch/mips/pci/fixup-lemote2f.c
> @@ -96,21 +96,21 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
>  }
>
>  /* CS5536 SPEC. fixup */
> -static void __init loongson_cs5536_isa_fixup(struct pci_dev *pdev)
> +static void __devinit loongson_cs5536_isa_fixup(struct pci_dev *pdev)
>  {
>        /* the uart1 and uart2 interrupt in PIC is enabled as default */
>        pci_write_config_dword(pdev, PCI_UART1_INT_REG, 1);
>        pci_write_config_dword(pdev, PCI_UART2_INT_REG, 1);
>  }
>
> -static void __init loongson_cs5536_ide_fixup(struct pci_dev *pdev)
> +static void __devinit loongson_cs5536_ide_fixup(struct pci_dev *pdev)
>  {
>        /* setting the mutex pin as IDE function */
>        pci_write_config_dword(pdev, PCI_IDE_CFG_REG,
>                               CS5536_IDE_FLASH_SIGNATURE);
>  }
>
> -static void __init loongson_cs5536_acc_fixup(struct pci_dev *pdev)
> +static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev)
>  {
>        /* enable the AUDIO interrupt in PIC  */
>        pci_write_config_dword(pdev, PCI_ACC_INT_REG, 1);
> @@ -118,14 +118,14 @@ static void __init loongson_cs5536_acc_fixup(struct pci_dev *pdev)
>        pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0);
>  }
>
> -static void __init loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
> +static void __devinit loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
>  {
>        /* enable the OHCI interrupt in PIC */
>        /* THE OHCI, EHCI, UDC, OTG are shared with interrupt in PIC */
>        pci_write_config_dword(pdev, PCI_OHCI_INT_REG, 1);
>  }
>
> -static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
> +static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
>  {
>        u32 hi, lo;
>
> @@ -137,7 +137,7 @@ static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
>        pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000);
>  }
>
> -static void __init loongson_nec_fixup(struct pci_dev *pdev)
> +static void __devinit loongson_nec_fixup(struct pci_dev *pdev)
>  {
>        unsigned int val;
>
> diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
> index 0f48498..59cfbc8 100644
> --- a/arch/mips/pci/fixup-malta.c
> +++ b/arch/mips/pci/fixup-malta.c
> @@ -49,7 +49,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
>        return 0;
>  }
>
> -static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
> +static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev)
>  {
>        unsigned char reg_val;
>        static int piixirqmap[16] __initdata = {  /* PIIX PIRQC[A:D] irq mappings */

Doesn't the above line also need changed to __devinitdata if the
function itself is being
changed from __init to __devinit?

> @@ -83,7 +83,7 @@ static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
>  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,
>         malta_piix_func0_fixup);
>
> -static void __init malta_piix_func1_fixup(struct pci_dev *pdev)
> +static void __devinit malta_piix_func1_fixup(struct pci_dev *pdev)
>  {
>        unsigned char reg_val;
>
> diff --git a/arch/mips/pci/fixup-sb1250.c b/arch/mips/pci/fixup-sb1250.c
> index f0bb914..d02900a 100644
> --- a/arch/mips/pci/fixup-sb1250.c
> +++ b/arch/mips/pci/fixup-sb1250.c
> @@ -15,7 +15,7 @@
>  * Set the BCM1250, etc. PCI host bridge's TRDY timeout
>  * to the finite max.
>  */
> -static void __init quirk_sb1250_pci(struct pci_dev *dev)
> +static void __devinit quirk_sb1250_pci(struct pci_dev *dev)
>  {
>        pci_write_config_byte(dev, 0x40, 0xff);
>  }
> @@ -25,7 +25,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_PCI,
>  /*
>  * The BCM1250, etc. PCI/HT bridge reports as a host bridge.
>  */
> -static void __init quirk_sb1250_ht(struct pci_dev *dev)
> +static void __devinit quirk_sb1250_ht(struct pci_dev *dev)
>  {
>        dev->class = PCI_CLASS_BRIDGE_PCI << 8;
>  }
> @@ -35,7 +35,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_HT,
>  /*
>  * Set the SP1011 HT/PCI bridge's TRDY timeout to the finite max.
>  */
> -static void __init quirk_sp1011(struct pci_dev *dev)
> +static void __devinit quirk_sp1011(struct pci_dev *dev)
>  {
>        pci_write_config_byte(dev, 0x64, 0xff);
>  }
> diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
> index a1e7e6d..bc13e29 100644
> --- a/arch/mips/pci/ops-tx4927.c
> +++ b/arch/mips/pci/ops-tx4927.c
> @@ -495,7 +495,7 @@ irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id)
>  }
>
>  #ifdef CONFIG_TOSHIBA_FPCIB0
> -static void __init tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
> +static void __devinit tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
>  {
>        struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus);
>
> diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
> index 0fbe4c0..fdc2444 100644
> --- a/arch/mips/pci/pci-ip27.c
> +++ b/arch/mips/pci/pci-ip27.c
> @@ -212,7 +212,7 @@ static inline void pci_enable_swapping(struct pci_dev *dev)
>        bridge->b_widget.w_tflush;      /* Flush */
>  }
>
> -static void __init pci_fixup_ioc3(struct pci_dev *d)
> +static void __devinit pci_fixup_ioc3(struct pci_dev *d)
>  {
>        pci_disable_swapping(d);
>  }
> diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
> index 682efb0..64eb71b 100644
> --- a/arch/mips/txx9/generic/pci.c
> +++ b/arch/mips/txx9/generic/pci.c
> @@ -269,7 +269,7 @@ txx9_i8259_irq_setup(int irq)
>        return err;
>  }
>
> -static void __init quirk_slc90e66_bridge(struct pci_dev *dev)
> +static void __devinit quirk_slc90e66_bridge(struct pci_dev *dev)
>  {
>        int irq;        /* PCI/ISA Bridge interrupt */
>        u8 reg_64;
> --
> 1.7.10
>
> --
> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-14 16:39   ` Myron Stowe
@ 2012-06-15 16:33     ` Bjorn Helgaas
  2012-06-15 16:38       ` Ralf Baechle
  0 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2012-06-15 16:33 UTC (permalink / raw)
  To: Myron Stowe
  Cc: Sebastian Andrzej Siewior, linux-pci, linux-kbuild, Michal Marek,
	Ralf Baechle

On Thu, Jun 14, 2012 at 10:39 AM, Myron Stowe <myron.stowe@gmail.com> wrote:
> On Sun, Jun 3, 2012 at 12:48 PM, Sebastian Andrzej Siewior
> <sebastian@breakpoint.cc> wrote:
>> The fixups are executed once the pci-device is found which is during
>> boot process so __init seems fine as long as the platform does not
>> support hotplug.
>> However it is possible to remove the PCI bus at run time and have it
>> rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
>> the fixups again.
>>
>> Cc: Ralf Baechle <ralf@linux-mips.org>
>> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
>> ---
>>  arch/mips/mti-malta/malta-pci.c |    2 +-
>>  arch/mips/pci/fixup-fuloong2e.c |   12 ++++++------
>>  arch/mips/pci/fixup-lemote2f.c  |   12 ++++++------
>>  arch/mips/pci/fixup-malta.c     |    4 ++--
>>  arch/mips/pci/fixup-sb1250.c    |    6 +++---
>>  arch/mips/pci/ops-tx4927.c      |    2 +-
>>  arch/mips/pci/pci-ip27.c        |    2 +-
>>  arch/mips/txx9/generic/pci.c    |    2 +-
>>  8 files changed, 21 insertions(+), 21 deletions(-)
>>
>> diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c
>> index bf80921..b663402 100644
>> --- a/arch/mips/mti-malta/malta-pci.c
>> +++ b/arch/mips/mti-malta/malta-pci.c
>> @@ -253,7 +253,7 @@ void __init mips_pcibios_init(void)
>>  }
>>
>>  /* Enable PCI 2.1 compatibility in PIIX4 */
>> -static void __init quirk_dlcsetup(struct pci_dev *dev)
>> +static void __devinit quirk_dlcsetup(struct pci_dev *dev)
>>  {
>>        u8 odlc, ndlc;
>>        (void) pci_read_config_byte(dev, 0x82, &odlc);
>> diff --git a/arch/mips/pci/fixup-fuloong2e.c b/arch/mips/pci/fixup-fuloong2e.c
>> index d5d4c01..0857ab8 100644
>> --- a/arch/mips/pci/fixup-fuloong2e.c
>> +++ b/arch/mips/pci/fixup-fuloong2e.c
>> @@ -48,7 +48,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
>>        return 0;
>>  }
>>
>> -static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev)
>>  {
>>        unsigned int val;
>>
>> @@ -60,7 +60,7 @@ static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
>>        pci_write_config_dword(pdev, 0xe4, 1 << 5);
>>  }
>>
>> -static void __init loongson2e_686b_func0_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev)
>>  {
>>        unsigned char c;
>>
>> @@ -135,7 +135,7 @@ static void __init loongson2e_686b_func0_fixup(struct pci_dev *pdev)
>>        printk(KERN_INFO"via686b fix: ISA bridge done\n");
>>  }
>>
>> -static void __init loongson2e_686b_func1_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev)
>>  {
>>        printk(KERN_INFO"via686b fix: IDE\n");
>>
>> @@ -168,19 +168,19 @@ static void __init loongson2e_686b_func1_fixup(struct pci_dev *pdev)
>>        printk(KERN_INFO"via686b fix: IDE done\n");
>>  }
>>
>> -static void __init loongson2e_686b_func2_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson2e_686b_func2_fixup(struct pci_dev *pdev)
>>  {
>>        /* irq routing */
>>        pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 10);
>>  }
>>
>> -static void __init loongson2e_686b_func3_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson2e_686b_func3_fixup(struct pci_dev *pdev)
>>  {
>>        /* irq routing */
>>        pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 11);
>>  }
>>
>> -static void __init loongson2e_686b_func5_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson2e_686b_func5_fixup(struct pci_dev *pdev)
>>  {
>>        unsigned int val;
>>        unsigned char c;
>> diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c
>> index 4b9768d..a7b917dcf 100644
>> --- a/arch/mips/pci/fixup-lemote2f.c
>> +++ b/arch/mips/pci/fixup-lemote2f.c
>> @@ -96,21 +96,21 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
>>  }
>>
>>  /* CS5536 SPEC. fixup */
>> -static void __init loongson_cs5536_isa_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson_cs5536_isa_fixup(struct pci_dev *pdev)
>>  {
>>        /* the uart1 and uart2 interrupt in PIC is enabled as default */
>>        pci_write_config_dword(pdev, PCI_UART1_INT_REG, 1);
>>        pci_write_config_dword(pdev, PCI_UART2_INT_REG, 1);
>>  }
>>
>> -static void __init loongson_cs5536_ide_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson_cs5536_ide_fixup(struct pci_dev *pdev)
>>  {
>>        /* setting the mutex pin as IDE function */
>>        pci_write_config_dword(pdev, PCI_IDE_CFG_REG,
>>                               CS5536_IDE_FLASH_SIGNATURE);
>>  }
>>
>> -static void __init loongson_cs5536_acc_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev)
>>  {
>>        /* enable the AUDIO interrupt in PIC  */
>>        pci_write_config_dword(pdev, PCI_ACC_INT_REG, 1);
>> @@ -118,14 +118,14 @@ static void __init loongson_cs5536_acc_fixup(struct pci_dev *pdev)
>>        pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0);
>>  }
>>
>> -static void __init loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson_cs5536_ohci_fixup(struct pci_dev *pdev)
>>  {
>>        /* enable the OHCI interrupt in PIC */
>>        /* THE OHCI, EHCI, UDC, OTG are shared with interrupt in PIC */
>>        pci_write_config_dword(pdev, PCI_OHCI_INT_REG, 1);
>>  }
>>
>> -static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
>>  {
>>        u32 hi, lo;
>>
>> @@ -137,7 +137,7 @@ static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev)
>>        pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000);
>>  }
>>
>> -static void __init loongson_nec_fixup(struct pci_dev *pdev)
>> +static void __devinit loongson_nec_fixup(struct pci_dev *pdev)
>>  {
>>        unsigned int val;
>>
>> diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
>> index 0f48498..59cfbc8 100644
>> --- a/arch/mips/pci/fixup-malta.c
>> +++ b/arch/mips/pci/fixup-malta.c
>> @@ -49,7 +49,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
>>        return 0;
>>  }
>>
>> -static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
>> +static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev)
>>  {
>>        unsigned char reg_val;
>>        static int piixirqmap[16] __initdata = {  /* PIIX PIRQC[A:D] irq mappings */
>
> Doesn't the above line also need changed to __devinitdata if the
> function itself is being
> changed from __init to __devinit?

I think so.  And pci_irq[] and piixirqmap[] also need to be moved,
since they're referenced by __devinit code.  I fixed these, audited
all the other patches, and updated the "next" branch.

Bjorn

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-15 16:33     ` Bjorn Helgaas
@ 2012-06-15 16:38       ` Ralf Baechle
  2012-06-15 21:13         ` Bjorn Helgaas
  0 siblings, 1 reply; 19+ messages in thread
From: Ralf Baechle @ 2012-06-15 16:38 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Myron Stowe, Sebastian Andrzej Siewior, linux-pci, linux-kbuild,
	Michal Marek

On Fri, Jun 15, 2012 at 10:33:15AM -0600, Bjorn Helgaas wrote:

> > Doesn't the above line also need changed to __devinitdata if the
> > function itself is being
> > changed from __init to __devinit?
> 
> I think so.  And pci_irq[] and piixirqmap[] also need to be moved,
> since they're referenced by __devinit code.  I fixed these, audited
> all the other patches, and updated the "next" branch.

I'm going to patch that up.

Thanks folks,

  Ralf

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-15 16:38       ` Ralf Baechle
@ 2012-06-15 21:13         ` Bjorn Helgaas
  2012-06-16  8:50           ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 19+ messages in thread
From: Bjorn Helgaas @ 2012-06-15 21:13 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Myron Stowe, Sebastian Andrzej Siewior, linux-pci, linux-kbuild,
	Michal Marek

On Fri, Jun 15, 2012 at 10:38 AM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Fri, Jun 15, 2012 at 10:33:15AM -0600, Bjorn Helgaas wrote:
>
>> > Doesn't the above line also need changed to __devinitdata if the
>> > function itself is being
>> > changed from __init to __devinit?
>>
>> I think so.  And pci_irq[] and piixirqmap[] also need to be moved,
>> since they're referenced by __devinit code.  I fixed these, audited
>> all the other patches, and updated the "next" branch.
>
> I'm going to patch that up.

Does this mean you're going to push it through your tree and I should
remove the mips patch from my "next" branch?  Either way is fine with
me; currently I'm planning to push all the other arch patches via my
tree.

Bjorn

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-15 21:13         ` Bjorn Helgaas
@ 2012-06-16  8:50           ` Sebastian Andrzej Siewior
  2012-06-16 18:45             ` Bjorn Helgaas
  0 siblings, 1 reply; 19+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-06-16  8:50 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Ralf Baechle, Myron Stowe, linux-pci, linux-kbuild, Michal Marek

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Fri, Jun 15, 2012 at 03:13:26PM -0600, Bjorn Helgaas wrote:
> On Fri, Jun 15, 2012 at 10:38 AM, Ralf Baechle <ralf@linux-mips.org> wrote:
> > On Fri, Jun 15, 2012 at 10:33:15AM -0600, Bjorn Helgaas wrote:
> >
> >> > Doesn't the above line also need changed to __devinitdata if the
> >> > function itself is being
> >> > changed from __init to __devinit?
> >>
> >> I think so.  And pci_irq[] and piixirqmap[] also need to be moved,
> >> since they're referenced by __devinit code.  I fixed these, audited
> >> all the other patches, and updated the "next" branch.
> >
> > I'm going to patch that up.
> 
> Does this mean you're going to push it through your tree and I should
> remove the mips patch from my "next" branch?  Either way is fine with
> me; currently I'm planning to push all the other arch patches via my
> tree.

Ralf picked up my patch [0] and commited a few fixups on top [1] and a malta
fixup [2].

[0] http://git.linux-mips.org/?p=ralf/linux.git;a=commitdiff;h=184170a613f4bccf4d58a4e73fa5d3a1ee839f38
[1] http://git.linux-mips.org/?p=ralf/linux.git;a=commitdiff;h=f54d03696bdc1a9457c11ed6ae61e8f001217b25
[2] http://git.linux-mips.org/?p=ralf/linux.git;a=commitdiff;h=2ec8663f9c03a96f2c328c7c483603c31d62ad37

> Bjorn

Sebastian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJP3EjpAAoJEHuW6BYqjPXRNnQP/j6+Dt1fklG3wKYkU+svqhiE
P7BeOQa4AK+8cPG7o5T1e+F3aNszSu8J/f7d0Y4qSy5u/b1kwNSgochU6fGSTeIt
jFZM7Yevft4RUU76q5ga1CdRWEVVJ8aex0lbfQs2aEsASndXZNSCkm3KQOXGd+mj
pwwe3rdiDxKBQJ0QeebpQRym0sUw9hsAaO4XXLJ8d2fVo+rIjJMSKM3bzMzb6GFh
D3slYMCIYvIXg8+s6Hslv2Wc51oL+FkoASZXx1d7gCK/Utf+WLo30OyQdStC5rsq
MqVy7+P4cZOKAAq181gX7Jx655ghVrnllJNjtMXgauCu8wjLE5FjIyh5DBz1VzDj
w7rG7mbRMQz2P+CEmPNQwy6e4pspUh7GgKnc0duTQaPRderi3CN+rQRVdz9bBEDK
Qtcf+vtReW8fRdcIAqgRcs/JmTgTZLyLeKf0Aa8s0h2SA9TRz/U7lqxf8Mq2zzyq
TJXLtTtqXekTum11cuxbAUsbfuDCVtuHu648WJu0YS5J3mWEbIg94kULGLKclSy9
aK3feDiS1kSWonKxr4LZ4pPh452dJl1+1Eq121rnK+IAG2qWSsda4ju8RVxxIHex
hVhME1x8rkarBEUH2w4Y4aMKCgNbeHIVotnGhzwzYUQXXkZ+43RvQgPeCIkhwYx4
1cx3lPomgGNN9JIETK6n
=pKYs
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 7/9] mips: move PCI fixup hooks from __init to __devinit
  2012-06-16  8:50           ` Sebastian Andrzej Siewior
@ 2012-06-16 18:45             ` Bjorn Helgaas
  0 siblings, 0 replies; 19+ messages in thread
From: Bjorn Helgaas @ 2012-06-16 18:45 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Ralf Baechle, Myron Stowe, linux-pci, linux-kbuild, Michal Marek

On Sat, Jun 16, 2012 at 2:50 AM, Sebastian Andrzej Siewior
<sebastian@breakpoint.cc> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On Fri, Jun 15, 2012 at 03:13:26PM -0600, Bjorn Helgaas wrote:
>> On Fri, Jun 15, 2012 at 10:38 AM, Ralf Baechle <ralf@linux-mips.org> wrote:
>> > On Fri, Jun 15, 2012 at 10:33:15AM -0600, Bjorn Helgaas wrote:
>> >
>> >> > Doesn't the above line also need changed to __devinitdata if the
>> >> > function itself is being
>> >> > changed from __init to __devinit?
>> >>
>> >> I think so.  And pci_irq[] and piixirqmap[] also need to be moved,
>> >> since they're referenced by __devinit code.  I fixed these, audited
>> >> all the other patches, and updated the "next" branch.
>> >
>> > I'm going to patch that up.
>>
>> Does this mean you're going to push it through your tree and I should
>> remove the mips patch from my "next" branch?  Either way is fine with
>> me; currently I'm planning to push all the other arch patches via my
>> tree.
>
> Ralf picked up my patch [0] and commited a few fixups on top [1] and a malta
> fixup [2].
>
> [0] http://git.linux-mips.org/?p=ralf/linux.git;a=commitdiff;h=184170a613f4bccf4d58a4e73fa5d3a1ee839f38
> [1] http://git.linux-mips.org/?p=ralf/linux.git;a=commitdiff;h=f54d03696bdc1a9457c11ed6ae61e8f001217b25
> [2] http://git.linux-mips.org/?p=ralf/linux.git;a=commitdiff;h=2ec8663f9c03a96f2c328c7c483603c31d62ad37

OK, I'll drop the MIPS patch from my branch.  Note that the three
patches you mention above don't yet include the pci_irq[] and
piixirqmap[] fixes.  I assume you'll include those, too, Ralf.

Bjorn

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-06-16 18:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-03 18:48 Annotate PCI fixups with __devinit instead of __init Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 1/9] scripts/modpost: check for bad refernces in .pci.fixups area Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 2/9] x86/quirks: move PCI fixup hooks from __init to __devinit Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 3/9] pci/quirks: " Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 4/9] alpha: " Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 5/9] arm: " Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 6/9] frv: " Sebastian Andrzej Siewior
2012-06-03 18:48 ` [PATCH 7/9] mips: " Sebastian Andrzej Siewior
2012-06-14 16:39   ` Myron Stowe
2012-06-15 16:33     ` Bjorn Helgaas
2012-06-15 16:38       ` Ralf Baechle
2012-06-15 21:13         ` Bjorn Helgaas
2012-06-16  8:50           ` Sebastian Andrzej Siewior
2012-06-16 18:45             ` Bjorn Helgaas
2012-06-03 18:48 ` [PATCH 8/9] powerpc: " Sebastian Andrzej Siewior
2012-06-06  5:28   ` Benjamin Herrenschmidt
2012-06-03 18:48 ` [PATCH 9/9] sh: " Sebastian Andrzej Siewior
2012-06-04  1:12 ` Annotate PCI fixups with __devinit instead of __init Bjorn Helgaas
2012-06-12  1:27   ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).