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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pci-v4.14-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:

- fix endpoint "end of test" interrupt issue (introduced in v4.14-rc1)
(John Keeping)

- fix MIPS use-after-free map_irq() issue (introduced in v4.14-rc1)
(Lorenzo Pieralisi)

* tag 'pci-v4.14-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: endpoint: Use correct "end of test" interrupt
MIPS: PCI: Move map_irq() hooks out of initdata

+44 -43
+6 -6
arch/mips/ath79/pci.c
··· 22 22 #include "pci.h" 23 23 24 24 static int (*ath79_pci_plat_dev_init)(struct pci_dev *dev); 25 - static const struct ath79_pci_irq *ath79_pci_irq_map __initdata; 26 - static unsigned ath79_pci_nr_irqs __initdata; 25 + static const struct ath79_pci_irq *ath79_pci_irq_map; 26 + static unsigned ath79_pci_nr_irqs; 27 27 28 - static const struct ath79_pci_irq ar71xx_pci_irq_map[] __initconst = { 28 + static const struct ath79_pci_irq ar71xx_pci_irq_map[] = { 29 29 { 30 30 .slot = 17, 31 31 .pin = 1, ··· 41 41 } 42 42 }; 43 43 44 - static const struct ath79_pci_irq ar724x_pci_irq_map[] __initconst = { 44 + static const struct ath79_pci_irq ar724x_pci_irq_map[] = { 45 45 { 46 46 .slot = 0, 47 47 .pin = 1, ··· 49 49 } 50 50 }; 51 51 52 - static const struct ath79_pci_irq qca955x_pci_irq_map[] __initconst = { 52 + static const struct ath79_pci_irq qca955x_pci_irq_map[] = { 53 53 { 54 54 .bus = 0, 55 55 .slot = 0, ··· 64 64 }, 65 65 }; 66 66 67 - int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) 67 + int pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) 68 68 { 69 69 int irq = -1; 70 70 int i;
+1 -1
arch/mips/pci/fixup-capcella.c
··· 32 32 #define INTC PC104PLUS_INTC_IRQ 33 33 #define INTD PC104PLUS_INTD_IRQ 34 34 35 - static char irq_tab_capcella[][5] __initdata = { 35 + static char irq_tab_capcella[][5] = { 36 36 [11] = { -1, INT1, INT1, INT1, INT1 }, 37 37 [12] = { -1, INT2, INT2, INT2, INT2 }, 38 38 [14] = { -1, INTA, INTB, INTC, INTD }
+3 -3
arch/mips/pci/fixup-cobalt.c
··· 147 147 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, 148 148 qube_raq_via_board_id_fixup); 149 149 150 - static char irq_tab_qube1[] __initdata = { 150 + static char irq_tab_qube1[] = { 151 151 [COBALT_PCICONF_CPU] = 0, 152 152 [COBALT_PCICONF_ETH0] = QUBE1_ETH0_IRQ, 153 153 [COBALT_PCICONF_RAQSCSI] = SCSI_IRQ, ··· 156 156 [COBALT_PCICONF_ETH1] = 0 157 157 }; 158 158 159 - static char irq_tab_cobalt[] __initdata = { 159 + static char irq_tab_cobalt[] = { 160 160 [COBALT_PCICONF_CPU] = 0, 161 161 [COBALT_PCICONF_ETH0] = ETH0_IRQ, 162 162 [COBALT_PCICONF_RAQSCSI] = SCSI_IRQ, ··· 165 165 [COBALT_PCICONF_ETH1] = ETH1_IRQ 166 166 }; 167 167 168 - static char irq_tab_raq2[] __initdata = { 168 + static char irq_tab_raq2[] = { 169 169 [COBALT_PCICONF_CPU] = 0, 170 170 [COBALT_PCICONF_ETH0] = ETH0_IRQ, 171 171 [COBALT_PCICONF_RAQSCSI] = RAQ2_SCSI_IRQ,
+1 -1
arch/mips/pci/fixup-emma2rh.c
··· 43 43 */ 44 44 45 45 #define MAX_SLOT_NUM 10 46 - static unsigned char irq_map[][5] __initdata = { 46 + static unsigned char irq_map[][5] = { 47 47 [3] = {0, MARKEINS_PCI_IRQ_INTB, MARKEINS_PCI_IRQ_INTC, 48 48 MARKEINS_PCI_IRQ_INTD, 0,}, 49 49 [4] = {0, MARKEINS_PCI_IRQ_INTA, 0, 0, 0,},
+1 -1
arch/mips/pci/fixup-ip32.c
··· 21 21 #define INTB MACEPCI_SHARED0_IRQ 22 22 #define INTC MACEPCI_SHARED1_IRQ 23 23 #define INTD MACEPCI_SHARED2_IRQ 24 - static char irq_tab_mace[][5] __initdata = { 24 + static char irq_tab_mace[][5] = { 25 25 /* Dummy INT#A INT#B INT#C INT#D */ 26 26 {0, 0, 0, 0, 0}, /* This is placeholder row - never used */ 27 27 {0, SCSI0, SCSI0, SCSI0, SCSI0},
+1 -1
arch/mips/pci/fixup-jmr3927.c
··· 31 31 #include <asm/txx9/pci.h> 32 32 #include <asm/txx9/jmr3927.h> 33 33 34 - int __init jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 34 + int jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 35 35 { 36 36 unsigned char irq = pin; 37 37
+1 -1
arch/mips/pci/fixup-lemote2f.c
··· 30 30 #define PCID 7 31 31 32 32 /* all the pci device has the PCIA pin, check the datasheet. */ 33 - static char irq_tab[][5] __initdata = { 33 + static char irq_tab[][5] = { 34 34 /* INTA INTB INTC INTD */ 35 35 {0, 0, 0, 0, 0}, /* 11: Unused */ 36 36 {0, 0, 0, 0, 0}, /* 12: Unused */
+1 -1
arch/mips/pci/fixup-malta.c
··· 12 12 static char pci_irq[5] = { 13 13 }; 14 14 15 - static char irq_tab[][5] __initdata = { 15 + static char irq_tab[][5] = { 16 16 /* INTA INTB INTC INTD */ 17 17 {0, 0, 0, 0, 0 }, /* 0: GT64120 PCI bridge */ 18 18 {0, 0, 0, 0, 0 }, /* 1: Unused */
+2 -2
arch/mips/pci/fixup-mpc30x.c
··· 22 22 23 23 #include <asm/vr41xx/mpc30x.h> 24 24 25 - static const int internal_func_irqs[] __initconst = { 25 + static const int internal_func_irqs[] = { 26 26 VRC4173_CASCADE_IRQ, 27 27 VRC4173_AC97_IRQ, 28 28 VRC4173_USB_IRQ, 29 29 }; 30 30 31 - static const int irq_tab_mpc30x[] __initconst = { 31 + static const int irq_tab_mpc30x[] = { 32 32 [12] = VRC4173_PCMCIA1_IRQ, 33 33 [13] = VRC4173_PCMCIA2_IRQ, 34 34 [29] = MQ200_IRQ,
+3 -3
arch/mips/pci/fixup-pmcmsp.c
··· 47 47 48 48 #if defined(CONFIG_PMC_MSP7120_GW) 49 49 /* Garibaldi Board IRQ wiring to PCI slots */ 50 - static char irq_tab[][5] __initdata = { 50 + static char irq_tab[][5] = { 51 51 /* INTA INTB INTC INTD */ 52 52 {0, 0, 0, 0, 0 }, /* (AD[0]): Unused */ 53 53 {0, 0, 0, 0, 0 }, /* (AD[1]): Unused */ ··· 86 86 #elif defined(CONFIG_PMC_MSP7120_EVAL) 87 87 88 88 /* MSP7120 Eval Board IRQ wiring to PCI slots */ 89 - static char irq_tab[][5] __initdata = { 89 + static char irq_tab[][5] = { 90 90 /* INTA INTB INTC INTD */ 91 91 {0, 0, 0, 0, 0 }, /* (AD[0]): Unused */ 92 92 {0, 0, 0, 0, 0 }, /* (AD[1]): Unused */ ··· 125 125 #else 126 126 127 127 /* Unknown board -- don't assign any IRQs */ 128 - static char irq_tab[][5] __initdata = { 128 + static char irq_tab[][5] = { 129 129 /* INTA INTB INTC INTD */ 130 130 {0, 0, 0, 0, 0 }, /* (AD[0]): Unused */ 131 131 {0, 0, 0, 0, 0 }, /* (AD[1]): Unused */
+1 -1
arch/mips/pci/fixup-rbtx4927.c
··· 36 36 #include <asm/txx9/pci.h> 37 37 #include <asm/txx9/rbtx4927.h> 38 38 39 - int __init rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 39 + int rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 40 40 { 41 41 unsigned char irq = pin; 42 42
+1 -1
arch/mips/pci/fixup-rbtx4938.c
··· 13 13 #include <asm/txx9/pci.h> 14 14 #include <asm/txx9/rbtx4938.h> 15 15 16 - int __init rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 16 + int rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 17 17 { 18 18 int irq = tx4938_pcic1_map_irq(dev, slot); 19 19
+5 -5
arch/mips/pci/fixup-sni.c
··· 40 40 * seem to be a documentation error. At least on my RM200C the Cirrus 41 41 * Logic CL-GD5434 VGA is device 3. 42 42 */ 43 - static char irq_tab_rm200[8][5] __initdata = { 43 + static char irq_tab_rm200[8][5] = { 44 44 /* INTA INTB INTC INTD */ 45 45 { 0, 0, 0, 0, 0 }, /* EISA bridge */ 46 46 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */ ··· 57 57 * 58 58 * The VGA card is optional for RM300 systems. 59 59 */ 60 - static char irq_tab_rm300d[8][5] __initdata = { 60 + static char irq_tab_rm300d[8][5] = { 61 61 /* INTA INTB INTC INTD */ 62 62 { 0, 0, 0, 0, 0 }, /* EISA bridge */ 63 63 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */ ··· 69 69 { 0, INTD, INTA, INTB, INTC }, /* Slot 4 */ 70 70 }; 71 71 72 - static char irq_tab_rm300e[5][5] __initdata = { 72 + static char irq_tab_rm300e[5][5] = { 73 73 /* INTA INTB INTC INTD */ 74 74 { 0, 0, 0, 0, 0 }, /* HOST bridge */ 75 75 { SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */ ··· 96 96 #define INTC PCIT_IRQ_INTC 97 97 #define INTD PCIT_IRQ_INTD 98 98 99 - static char irq_tab_pcit[13][5] __initdata = { 99 + static char irq_tab_pcit[13][5] = { 100 100 /* INTA INTB INTC INTD */ 101 101 { 0, 0, 0, 0, 0 }, /* HOST bridge */ 102 102 { SCSI0, SCSI0, SCSI0, SCSI0, SCSI0 }, /* SCSI */ ··· 113 113 { 0, INTA, INTB, INTC, INTD }, /* Slot 5 */ 114 114 }; 115 115 116 - static char irq_tab_pcit_cplus[13][5] __initdata = { 116 + static char irq_tab_pcit_cplus[13][5] = { 117 117 /* INTA INTB INTC INTD */ 118 118 { 0, 0, 0, 0, 0 }, /* HOST bridge */ 119 119 { 0, INTB, INTC, INTD, INTA }, /* PCI Slot 9 */
+1 -2
arch/mips/pci/pci-octeon.c
··· 59 59 } s; 60 60 }; 61 61 62 - int (*octeon_pcibios_map_irq)(const struct pci_dev *dev, 63 - u8 slot, u8 pin); 62 + int (*octeon_pcibios_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); 64 63 enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID; 65 64 66 65 /**
+1 -1
arch/mips/pci/pci-tx4938.c
··· 112 112 return pciclk; 113 113 } 114 114 115 - int __init tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot) 115 + int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot) 116 116 { 117 117 if (get_tx4927_pcicptr(dev->bus->sysdata) == tx4938_pcic1ptr) { 118 118 switch (slot) {
+2 -2
arch/mips/pci/pci-tx4939.c
··· 48 48 ((pciclk + 50000) / 100000) % 10); 49 49 } 50 50 51 - int __init tx4939_pcic1_map_irq(const struct pci_dev *dev, u8 slot) 51 + int tx4939_pcic1_map_irq(const struct pci_dev *dev, u8 slot) 52 52 { 53 53 if (get_tx4927_pcicptr(dev->bus->sysdata) == tx4939_pcic1ptr) { 54 54 switch (slot) { ··· 68 68 return -1; 69 69 } 70 70 71 - int __init tx4939_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 71 + int tx4939_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 72 72 { 73 73 int irq = tx4939_pcic1_map_irq(dev, slot); 74 74
+1 -2
arch/mips/pci/pcie-octeon.c
··· 1464 1464 * as it goes through each bridge. 1465 1465 * Returns Interrupt number for the device 1466 1466 */ 1467 - int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev, 1468 - u8 slot, u8 pin) 1467 + int octeon_pcie_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 1469 1468 { 1470 1469 /* 1471 1470 * The EBH5600 board with the PCI to PCIe bridge mistakenly
+6 -2
arch/mips/txx9/generic/pci.c
··· 386 386 return 0; 387 387 } 388 388 389 - int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 389 + static int (*txx9_pci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin); 390 + int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 390 391 { 391 - return txx9_board_vec->pci_map_irq(dev, slot, pin); 392 + return txx9_pci_map_irq(dev, slot, pin); 392 393 } 393 394 394 395 char * (*txx9_board_pcibios_setup)(char *str) __initdata; ··· 425 424 txx9_pci_err_action = TXX9_PCI_ERR_IGNORE; 426 425 return NULL; 427 426 } 427 + 428 + txx9_pci_map_irq = txx9_board_vec->pci_map_irq; 429 + 428 430 return str; 429 431 }
+6 -7
drivers/pci/endpoint/functions/pci-epf-test.c
··· 251 251 return ret; 252 252 } 253 253 254 - static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test) 254 + static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test, u8 irq) 255 255 { 256 - u8 irq; 257 256 u8 msi_count; 258 257 struct pci_epf *epf = epf_test->epf; 259 258 struct pci_epc *epc = epf->epc; ··· 261 262 262 263 reg->status |= STATUS_IRQ_RAISED; 263 264 msi_count = pci_epc_get_msi(epc); 264 - irq = (reg->command & MSI_NUMBER_MASK) >> MSI_NUMBER_SHIFT; 265 265 if (irq > msi_count || msi_count <= 0) 266 266 pci_epc_raise_irq(epc, PCI_EPC_IRQ_LEGACY, 0); 267 267 else ··· 287 289 reg->command = 0; 288 290 reg->status = 0; 289 291 292 + irq = (command & MSI_NUMBER_MASK) >> MSI_NUMBER_SHIFT; 293 + 290 294 if (command & COMMAND_RAISE_LEGACY_IRQ) { 291 295 reg->status = STATUS_IRQ_RAISED; 292 296 pci_epc_raise_irq(epc, PCI_EPC_IRQ_LEGACY, 0); ··· 301 301 reg->status |= STATUS_WRITE_FAIL; 302 302 else 303 303 reg->status |= STATUS_WRITE_SUCCESS; 304 - pci_epf_test_raise_irq(epf_test); 304 + pci_epf_test_raise_irq(epf_test, irq); 305 305 goto reset_handler; 306 306 } 307 307 ··· 311 311 reg->status |= STATUS_READ_SUCCESS; 312 312 else 313 313 reg->status |= STATUS_READ_FAIL; 314 - pci_epf_test_raise_irq(epf_test); 314 + pci_epf_test_raise_irq(epf_test, irq); 315 315 goto reset_handler; 316 316 } 317 317 ··· 321 321 reg->status |= STATUS_COPY_SUCCESS; 322 322 else 323 323 reg->status |= STATUS_COPY_FAIL; 324 - pci_epf_test_raise_irq(epf_test); 324 + pci_epf_test_raise_irq(epf_test, irq); 325 325 goto reset_handler; 326 326 } 327 327 328 328 if (command & COMMAND_RAISE_MSI_IRQ) { 329 329 msi_count = pci_epc_get_msi(epc); 330 - irq = (command & MSI_NUMBER_MASK) >> MSI_NUMBER_SHIFT; 331 330 if (irq > msi_count || msi_count <= 0) 332 331 goto reset_handler; 333 332 reg->status = STATUS_IRQ_RAISED;