[PATCH v4 08/11] PCI: microchip: Move IRQ init functions to pcie-plda-host.c
Conor Dooley
conor.dooley at microchip.com
Fri Aug 25 05:09:13 PDT 2023
Daire, can you look at this one too please?
On Fri, Aug 25, 2023 at 05:01:26PM +0800, Minda Chen wrote:
> Move IRQ init functions to pcie-plda-host.c.
> mc_handle_event() is merged to plda_handle_event().
> Set most of the IRQ functions to static in pcie-plda-host.c
>
> Signed-off-by: Minda Chen <minda.chen at starfivetech.com>
> -void plda_handle_event(struct irq_desc *desc)
> +static void plda_handle_event(struct irq_desc *desc)
> {
> struct plda_pcie_rp *port = irq_desc_get_handler_data(desc);
> struct irq_chip *chip = irq_desc_get_chip(desc);
> @@ -264,14 +268,18 @@ void plda_handle_event(struct irq_desc *desc)
>
> chained_irq_enter(chip, desc);
>
> - val = readl_relaxed(port->bridge_addr + ISTATUS_LOCAL);
> - origin = val;
> - val = val >> A_ATR_EVT_POST_ERR_SHIFT;
> - events |= val & 0xff;
> - if (origin & PM_MSI_INT_INTX_MASK)
> - events |= BIT(EVENT_PM_MSI_INT_INTX);
> - val = (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf;
> - events |= val << EVENT_PM_MSI_INT_MSI;
> + if (port->ops && port->ops->get_events) {
I still don't love the dancing here. Can you just always register a
callback?
Thanks,
Conor.
> + events = port->ops->get_events(port);
> + } else {
> + val = readl_relaxed(port->bridge_addr + ISTATUS_LOCAL);
> + origin = val;
> + val = val >> A_ATR_EVT_POST_ERR_SHIFT;
> + events |= val & 0xff;
> + if (origin & PM_MSI_INT_INTX_MASK)
> + events |= BIT(EVENT_PM_MSI_INT_INTX);
> + val = (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf;
> + events |= val << EVENT_PM_MSI_INT_MSI;
> + }
>
> for_each_set_bit(bit, &events, port->num_events)
> generic_handle_domain_irq(port->event_domain, bit);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230825/274656ce/attachment.sig>
More information about the linux-riscv
mailing list