Skip to content

Commit

Permalink
ARM: footbridge: fix PCI interrupt mapping
Browse files Browse the repository at this point in the history
Since commit 30fdfb9 ("PCI: Add a call to pci_assign_irq() in
pci_device_probe()"), the PCI code will call the IRQ mapping function
whenever a PCI driver is probed. If these are marked as __init, this
causes an oops if a PCI driver is loaded or bound after the kernel has
initialised.

Fixes: 30fdfb9 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
  • Loading branch information
Russell King committed Mar 25, 2021
1 parent 45c2f70 commit 30e3b4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-footbridge/cats-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
#include <asm/mach-types.h>

/* cats host-specific stuff */
static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };

static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin)
{
return 0;
}

static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (dev->irq >= 255)
return -1; /* not a valid interrupt. */
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-footbridge/ebsa285-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <asm/mach/pci.h>
#include <asm/mach-types.h>

static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };

static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/netwinder-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* We now use the slot ID instead of the device identifiers to select
* which interrupt is routed where.
*/
static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
switch (slot) {
case 0: /* host bridge */
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/mach-footbridge/personal-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
#include <asm/mach/pci.h>
#include <asm/mach-types.h>

static int irqmap_personal_server[] __initdata = {
static int irqmap_personal_server[] = {
IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0,
IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI
};

static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot,
u8 pin)
static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
unsigned char line;

Expand Down

0 comments on commit 30e3b4f

Please sign in to comment.