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

Merge branch 'pci/controller/xilinx-cpm'

- Free IRQ domain in probe error path to avoid leaking it (Thippeswamy
Havalige)

- Add DT .compatible "xlnx,versal-cpm5nc-host" and driver support for
Versal Net CPM5NC Root Port controller (Thippeswamy Havalige)

- Add driver support for CPM5_HOST1 (Thippeswamy Havalige)

* pci/controller/xilinx-cpm:
PCI: xilinx-cpm: Add cpm_csr register mapping for CPM5_HOST1 variant
PCI: xilinx-cpm: Add support for Versal Net CPM5NC Root Port controller
dt-bindings: PCI: xilinx-cpm: Add compatible string for CPM5NC Versal Net host
PCI: xilinx-cpm: Fix IRQ domain leak in error path of probe

+38 -16
+1
Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml
··· 18 18 - xlnx,versal-cpm-host-1.00 19 19 - xlnx,versal-cpm5-host 20 20 - xlnx,versal-cpm5-host1 21 + - xlnx,versal-cpm5nc-host 21 22 22 23 reg: 23 24 items:
+37 -16
drivers/pci/controller/pcie-xilinx-cpm.c
··· 84 84 CPM, 85 85 CPM5, 86 86 CPM5_HOST1, 87 + CPM5NC_HOST, 87 88 }; 88 89 89 90 /** ··· 479 478 { 480 479 const struct xilinx_cpm_variant *variant = port->variant; 481 480 481 + if (variant->version == CPM5NC_HOST) 482 + return; 483 + 482 484 if (cpm_pcie_link_up(port)) 483 485 dev_info(port->dev, "PCIe Link is UP\n"); 484 486 else ··· 542 538 if (IS_ERR(port->cfg)) 543 539 return PTR_ERR(port->cfg); 544 540 545 - if (port->variant->version == CPM5) { 541 + if (port->variant->version == CPM5 || 542 + port->variant->version == CPM5_HOST1) { 546 543 port->reg_base = devm_platform_ioremap_resource_byname(pdev, 547 544 "cpm_csr"); 548 545 if (IS_ERR(port->reg_base)) ··· 583 578 584 579 port->dev = dev; 585 580 586 - err = xilinx_cpm_pcie_init_irq_domain(port); 587 - if (err) 588 - return err; 581 + port->variant = of_device_get_match_data(dev); 582 + 583 + if (port->variant->version != CPM5NC_HOST) { 584 + err = xilinx_cpm_pcie_init_irq_domain(port); 585 + if (err) 586 + return err; 587 + } 589 588 590 589 bus = resource_list_first_type(&bridge->windows, IORESOURCE_BUS); 591 - if (!bus) 592 - return -ENODEV; 593 - 594 - port->variant = of_device_get_match_data(dev); 590 + if (!bus) { 591 + err = -ENODEV; 592 + goto err_free_irq_domains; 593 + } 595 594 596 595 err = xilinx_cpm_pcie_parse_dt(port, bus->res); 597 596 if (err) { 598 597 dev_err(dev, "Parsing DT failed\n"); 599 - goto err_parse_dt; 598 + goto err_free_irq_domains; 600 599 } 601 600 602 601 xilinx_cpm_pcie_init_port(port); 603 602 604 - err = xilinx_cpm_setup_irq(port); 605 - if (err) { 606 - dev_err(dev, "Failed to set up interrupts\n"); 607 - goto err_setup_irq; 603 + if (port->variant->version != CPM5NC_HOST) { 604 + err = xilinx_cpm_setup_irq(port); 605 + if (err) { 606 + dev_err(dev, "Failed to set up interrupts\n"); 607 + goto err_setup_irq; 608 + } 608 609 } 609 610 610 611 bridge->sysdata = port->cfg; ··· 623 612 return 0; 624 613 625 614 err_host_bridge: 626 - xilinx_cpm_free_interrupts(port); 615 + if (port->variant->version != CPM5NC_HOST) 616 + xilinx_cpm_free_interrupts(port); 627 617 err_setup_irq: 628 618 pci_ecam_free(port->cfg); 629 - err_parse_dt: 630 - xilinx_cpm_free_irq_domains(port); 619 + err_free_irq_domains: 620 + if (port->variant->version != CPM5NC_HOST) 621 + xilinx_cpm_free_irq_domains(port); 631 622 return err; 632 623 } 633 624 ··· 652 639 .ir_enable = XILINX_CPM_PCIE1_IR_ENABLE, 653 640 }; 654 641 642 + static const struct xilinx_cpm_variant cpm5n_host = { 643 + .version = CPM5NC_HOST, 644 + }; 645 + 655 646 static const struct of_device_id xilinx_cpm_pcie_of_match[] = { 656 647 { 657 648 .compatible = "xlnx,versal-cpm-host-1.00", ··· 668 651 { 669 652 .compatible = "xlnx,versal-cpm5-host1", 670 653 .data = &cpm5_host1, 654 + }, 655 + { 656 + .compatible = "xlnx,versal-cpm5nc-host", 657 + .data = &cpm5n_host, 671 658 }, 672 659 {} 673 660 };