Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI hotplug: cpqphp: use config space PCI interrupt pin encoding

This patch changes cpqphp to use interrupt pin values just as they
come from PCI config space, i.e., 1=INTA, ..., 4=INTD.

pcibios_set_irq_routing() takes pin arguments in the range 0=INTA, ...,
3=INTD, so we'll adjust the pin just before calling it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Bjorn Helgaas and committed by
Jesse Barnes
98d3333a 23a36002

+3 -3
+2 -2
drivers/pci/hotplug/cpqphp_ctrl.c
··· 2604 2604 for (cloop = 0; cloop < 4; cloop++) { 2605 2605 if (irqs.valid_INT & (0x01 << cloop)) { 2606 2606 rc = cpqhp_set_irq(func->bus, func->device, 2607 - 0x0A + cloop, irqs.interrupt[cloop]); 2607 + cloop + 1, irqs.interrupt[cloop]); 2608 2608 if (rc) 2609 2609 goto free_and_out; 2610 2610 } ··· 2945 2945 } 2946 2946 2947 2947 if (!behind_bridge) { 2948 - rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ); 2948 + rc = cpqhp_set_irq(func->bus, func->device, temp_byte, IRQ); 2949 2949 if (rc) 2950 2950 return 1; 2951 2951 } else {
+1 -1
drivers/pci/hotplug/cpqphp_pci.c
··· 171 171 fakebus->number = bus_num; 172 172 dbg("%s: dev %d, bus %d, pin %d, num %d\n", 173 173 __func__, dev_num, bus_num, int_pin, irq_num); 174 - rc = pcibios_set_irq_routing(fakedev, int_pin - 0x0a, irq_num); 174 + rc = pcibios_set_irq_routing(fakedev, int_pin - 1, irq_num); 175 175 kfree(fakedev); 176 176 kfree(fakebus); 177 177 dbg("%s: rc %d\n", __func__, rc);