Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f90bb153 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras
Browse files

[POWERPC] Make pci_read_irq_line the default



This patch reworks the way IRQs are fixed up on PCI for arch powerpc.

It makes pci_read_irq_line() called by default in the PCI code for
devices that are probed, and add an optional per-device fixup in
ppc_md for platforms that really need to correct what they obtain
from pci_read_irq_line().

It also removes ppc_md.irq_bus_setup which was only used by pSeries
and should not be needed anymore.

I've also removed the pSeries s7a workaround as it can't work with
the current interrupt code anyway. I'm trying to get one of these
machines working so I can test a proper fix for that problem.

I also haven't updated the old-style fixup code from 85xx_cds.c
because it's actually buggy :) It assigns pci_dev->irq hard coded
numbers which is no good with the new IRQ mapping code. It should
at least use irq_create_mapping(NULL, hard_coded_number); and possibly
also set_irq_type() to set them as level low.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 34ba8a5c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/errno.h>
#include <linux/bootmem.h>
#include <linux/irq.h>
#include <linux/list.h>

#include <asm/processor.h>
#include <asm/io.h>
@@ -1338,6 +1339,7 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
	struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
	unsigned long io_offset;
	struct resource *res;
	struct pci_dev *dev;
	int i;

	io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
@@ -1390,8 +1392,16 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
		}
	}

	/* Platform specific bus fixups */
	if (ppc_md.pcibios_fixup_bus)
		ppc_md.pcibios_fixup_bus(bus);

	/* Read default IRQs and fixup if necessary */
	list_for_each_entry(dev, &bus->devices, bus_list) {
		pci_read_irq_line(dev);
		if (ppc_md.pci_irq_fixup)
			ppc_md.pci_irq_fixup(dev);
	}
}

char __init *pcibios_setup(char *str)
+6 −2
Original line number Diff line number Diff line
@@ -1215,8 +1215,12 @@ static void __devinit do_bus_setup(struct pci_bus *bus)
	list_for_each_entry(dev, &bus->devices, bus_list)
		ppc_md.iommu_dev_setup(dev);

	if (ppc_md.irq_bus_setup)
		ppc_md.irq_bus_setup(bus);
	/* Read default IRQs and fixup if necessary */
	list_for_each_entry(dev, &bus->devices, bus_list) {
		pci_read_irq_line(dev);
		if (ppc_md.pci_irq_fixup)
			ppc_md.pci_irq_fixup(dev);
	}
}

void __devinit pcibios_fixup_bus(struct pci_bus *bus)
+0 −13
Original line number Diff line number Diff line
@@ -515,16 +515,6 @@ static int m82xx_pci_exclude_device(u_char bus, u_char devfn)
		return PCIBIOS_SUCCESSFUL;
}

static void
__init mpc82xx_pcibios_fixup(void)
{
	struct pci_dev *dev = NULL;

	for_each_pci_dev(dev) {
		pci_read_irq_line(dev);
	}
}

void __init add_bridge(struct device_node *np)
{
	int len;
@@ -597,9 +587,6 @@ static void __init mpc82xx_ads_setup_arch(void)
		add_bridge(np);

	of_node_put(np);
	ppc_md.pci_map_irq = NULL;
	ppc_md.pcibios_fixup = mpc82xx_pcibios_fixup;
	ppc_md.pcibios_fixup_bus = NULL;
#endif

#ifdef  CONFIG_ROOT_NFS
+0 −3
Original line number Diff line number Diff line
@@ -118,7 +118,4 @@ define_machine(mpc834x_itx) {
	.time_init		= mpc83xx_time_init,
	.calibrate_decr		= generic_calibrate_decr,
	.progress		= udbg_progress,
#ifdef CONFIG_PCI
	.pcibios_fixup		= mpc83xx_pcibios_fixup,
#endif
};
+0 −3
Original line number Diff line number Diff line
@@ -137,7 +137,4 @@ define_machine(mpc834x_sys) {
	.time_init		= mpc83xx_time_init,
	.calibrate_decr		= generic_calibrate_decr,
	.progress		= udbg_progress,
#ifdef CONFIG_PCI
	.pcibios_fixup		= mpc83xx_pcibios_fixup,
#endif
};
Loading