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.12-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:

- fix PCI_ENDPOINT build error (merged for v4.12)

- fix Switchtec driver (merged for v4.12)

- fix imx6 config read timeouts, fallout from changing to non-postable
reads

- add PM "needs_resume" flag for i915 suspend issue

* tag 'pci-v4.12-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI/PM: Add needs_resume flag to avoid suspend complete optimization
PCI: imx6: Fix config read timeout handling
switchtec: Fix minor bug with partition ID register
switchtec: Use new cdev_device_add() helper function
PCI: endpoint: Make PCI_ENDPOINT depend on HAS_DMA

+44 -14
+30 -3
drivers/pci/dwc/pci-imx6.c
··· 252 252 static int imx6q_pcie_abort_handler(unsigned long addr, 253 253 unsigned int fsr, struct pt_regs *regs) 254 254 { 255 - return 0; 255 + unsigned long pc = instruction_pointer(regs); 256 + unsigned long instr = *(unsigned long *)pc; 257 + int reg = (instr >> 12) & 15; 258 + 259 + /* 260 + * If the instruction being executed was a read, 261 + * make it look like it read all-ones. 262 + */ 263 + if ((instr & 0x0c100000) == 0x04100000) { 264 + unsigned long val; 265 + 266 + if (instr & 0x00400000) 267 + val = 255; 268 + else 269 + val = -1; 270 + 271 + regs->uregs[reg] = val; 272 + regs->ARM_pc += 4; 273 + return 0; 274 + } 275 + 276 + if ((instr & 0x0e100090) == 0x00100090) { 277 + regs->uregs[reg] = -1; 278 + regs->ARM_pc += 4; 279 + return 0; 280 + } 281 + 282 + return 1; 256 283 } 257 284 258 285 static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) ··· 846 819 * we can install the handler here without risking it 847 820 * accessing some uninitialized driver state. 848 821 */ 849 - hook_fault_code(16 + 6, imx6q_pcie_abort_handler, SIGBUS, 0, 850 - "imprecise external abort"); 822 + hook_fault_code(8, imx6q_pcie_abort_handler, SIGBUS, 0, 823 + "external abort on non-linefetch"); 851 824 852 825 return platform_driver_register(&imx6_pcie_driver); 853 826 }
+1
drivers/pci/endpoint/Kconfig
··· 6 6 7 7 config PCI_ENDPOINT 8 8 bool "PCI Endpoint Support" 9 + depends on HAS_DMA 9 10 help 10 11 Enable this configuration option to support configurable PCI 11 12 endpoint. This should be enabled if the platform has a PCI
+2 -1
drivers/pci/pci.c
··· 2144 2144 2145 2145 if (!pm_runtime_suspended(dev) 2146 2146 || pci_target_state(pci_dev) != pci_dev->current_state 2147 - || platform_pci_need_resume(pci_dev)) 2147 + || platform_pci_need_resume(pci_dev) 2148 + || (pci_dev->dev_flags & PCI_DEV_FLAGS_NEEDS_RESUME)) 2148 2149 return false; 2149 2150 2150 2151 /*
+6 -10
drivers/pci/switch/switchtec.c
··· 1291 1291 cdev = &stdev->cdev; 1292 1292 cdev_init(cdev, &switchtec_fops); 1293 1293 cdev->owner = THIS_MODULE; 1294 - cdev->kobj.parent = &dev->kobj; 1295 1294 1296 1295 return stdev; 1297 1296 ··· 1441 1442 stdev->mmio_sys_info = stdev->mmio + SWITCHTEC_GAS_SYS_INFO_OFFSET; 1442 1443 stdev->mmio_flash_info = stdev->mmio + SWITCHTEC_GAS_FLASH_INFO_OFFSET; 1443 1444 stdev->mmio_ntb = stdev->mmio + SWITCHTEC_GAS_NTB_OFFSET; 1444 - stdev->partition = ioread8(&stdev->mmio_ntb->partition_id); 1445 + stdev->partition = ioread8(&stdev->mmio_sys_info->partition_id); 1445 1446 stdev->partition_count = ioread8(&stdev->mmio_ntb->partition_count); 1446 1447 stdev->mmio_part_cfg_all = stdev->mmio + SWITCHTEC_GAS_PART_CFG_OFFSET; 1447 1448 stdev->mmio_part_cfg = &stdev->mmio_part_cfg_all[stdev->partition]; 1448 1449 stdev->mmio_pff_csr = stdev->mmio + SWITCHTEC_GAS_PFF_CSR_OFFSET; 1450 + 1451 + if (stdev->partition_count < 1) 1452 + stdev->partition_count = 1; 1449 1453 1450 1454 init_pff(stdev); 1451 1455 ··· 1481 1479 SWITCHTEC_EVENT_EN_IRQ, 1482 1480 &stdev->mmio_part_cfg->mrpc_comp_hdr); 1483 1481 1484 - rc = cdev_add(&stdev->cdev, stdev->dev.devt, 1); 1485 - if (rc) 1486 - goto err_put; 1487 - 1488 - rc = device_add(&stdev->dev); 1482 + rc = cdev_device_add(&stdev->cdev, &stdev->dev); 1489 1483 if (rc) 1490 1484 goto err_devadd; 1491 1485 ··· 1490 1492 return 0; 1491 1493 1492 1494 err_devadd: 1493 - cdev_del(&stdev->cdev); 1494 1495 stdev_kill(stdev); 1495 1496 err_put: 1496 1497 ida_simple_remove(&switchtec_minor_ida, MINOR(stdev->dev.devt)); ··· 1503 1506 1504 1507 pci_set_drvdata(pdev, NULL); 1505 1508 1506 - device_del(&stdev->dev); 1507 - cdev_del(&stdev->cdev); 1509 + cdev_device_del(&stdev->cdev, &stdev->dev); 1508 1510 ida_simple_remove(&switchtec_minor_ida, MINOR(stdev->dev.devt)); 1509 1511 dev_info(&stdev->dev, "unregistered.\n"); 1510 1512
+5
include/linux/pci.h
··· 183 183 PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT = (__force pci_dev_flags_t) (1 << 9), 184 184 /* Do not use FLR even if device advertises PCI_AF_CAP */ 185 185 PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), 186 + /* 187 + * Resume before calling the driver's system suspend hooks, disabling 188 + * the direct_complete optimization. 189 + */ 190 + PCI_DEV_FLAGS_NEEDS_RESUME = (__force pci_dev_flags_t) (1 << 11), 186 191 }; 187 192 188 193 enum pci_irq_reroute_variant {