lkml.org 
[lkml]   [2023]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v9 11/20] PCI: microchip: Add num_events field to struct plda_pcie_rp
    Date
    The event num is different in other platform. For re-use
    interrupt process codes, replace with variable.

    Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
    Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
    ---
    drivers/pci/controller/plda/pcie-microchip-host.c | 7 ++++---
    drivers/pci/controller/plda/pcie-plda.h | 1 +
    2 files changed, 5 insertions(+), 3 deletions(-)

    diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c
    index 5a20d5a03d36..1799455989ac 100644
    --- a/drivers/pci/controller/plda/pcie-microchip-host.c
    +++ b/drivers/pci/controller/plda/pcie-microchip-host.c
    @@ -649,7 +649,7 @@ static void plda_handle_event(struct irq_desc *desc)

    events = mc_get_events(port);

    - for_each_set_bit(bit, &events, NUM_EVENTS)
    + for_each_set_bit(bit, &events, port->num_events)
    generic_handle_domain_irq(port->event_domain, bit);

    chained_irq_exit(chip, desc);
    @@ -812,7 +812,7 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port)
    return -EINVAL;
    }

    - port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS,
    + port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events,
    &mc_event_domain_ops, port);
    if (!port->event_domain) {
    dev_err(dev, "failed to get event domain\n");
    @@ -915,7 +915,7 @@ static int plda_init_interrupts(struct platform_device *pdev, struct plda_pcie_r
    if (irq < 0)
    return -ENODEV;

    - for (i = 0; i < NUM_EVENTS; i++) {
    + for (i = 0; i < port->num_events; i++) {
    event_irq = irq_create_mapping(port->event_domain, i);
    if (!event_irq) {
    dev_err(dev, "failed to map hwirq %d\n", i);
    @@ -1007,6 +1007,7 @@ static int mc_host_probe(struct platform_device *pdev)

    bridge_base_addr = port->axi_base_addr + MC_PCIE_BRIDGE_ADDR;
    plda->bridge_addr = bridge_base_addr;
    + plda->num_events = NUM_EVENTS;

    /* Allow enabling MSI by disabling MSI-X */
    val = readl(bridge_base_addr + PCIE_PCI_IRQ_DW0);
    diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h
    index 3deefd35fa5a..e3d35cef9894 100644
    --- a/drivers/pci/controller/plda/pcie-plda.h
    +++ b/drivers/pci/controller/plda/pcie-plda.h
    @@ -118,6 +118,7 @@ struct plda_pcie_rp {
    raw_spinlock_t lock;
    struct plda_msi msi;
    void __iomem *bridge_addr;
    + int num_events;
    };

    void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index,
    --
    2.17.1
    \
     
     \ /
      Last update: 2023-10-20 12:45    [W:4.081 / U:0.352 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site