[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230825-sip-pentagon-e1760dcfce58@wendy>
Date: Fri, 25 Aug 2023 13:09:13 +0100
From: Conor Dooley <conor.dooley@...rochip.com>
To: Minda Chen <minda.chen@...rfivetech.com>
CC: Daire McNamara <daire.mcnamara@...rochip.com>,
Conor Dooley <conor@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Emil Renner Berthing <emil.renner.berthing@...onical.com>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-riscv@...ts.infradead.org>, <linux-pci@...r.kernel.org>,
Pali Rohár <pali@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Philipp Zabel <p.zabel@...gutronix.de>,
Mason Huo <mason.huo@...rfivetech.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Kevin Xie <kevin.xie@...rfivetech.com>
Subject: Re: [PATCH v4 08/11] PCI: microchip: Move IRQ init functions to
pcie-plda-host.c
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@...rfivetech.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);
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists