From: Conor Dooley <conor.dooley@microchip.com>
To: Minda Chen <minda.chen@starfivetech.com>
Cc: "Daire McNamara" <daire.mcnamara@microchip.com>,
"Conor Dooley" <conor@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Emil Renner Berthing" <emil.renner.berthing@canonical.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org,
"Pali Rohár" <pali@kernel.org>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Mason Huo" <mason.huo@starfivetech.com>,
"Leyfoon Tan" <leyfoon.tan@starfivetech.com>,
"Kevin Xie" <kevin.xie@starfivetech.com>
Subject: Re: [PATCH v4 08/11] PCI: microchip: Move IRQ init functions to pcie-plda-host.c
Date: Fri, 25 Aug 2023 13:09:13 +0100 [thread overview]
Message-ID: <20230825-sip-pentagon-e1760dcfce58@wendy> (raw)
In-Reply-To: <20230825090129.65721-9-minda.chen@starfivetech.com>
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
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@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);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-08-25 12:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 9:01 [PATCH v4 0/11] Refactoring Microchip PCIe driver and add StarFive PCIe Minda Chen
2023-08-25 9:01 ` [PATCH v4 01/11] dt-bindings: PCI: Add PLDA XpressRICH PCIe host common properties Minda Chen
2023-08-25 9:01 ` [PATCH v4 02/11] PCI: microchip: Move pcie-microchip-host.c to plda directory Minda Chen
2023-08-25 9:01 ` [PATCH v4 03/11] PCI: microchip: Move PLDA IP register macros to pcie-plda.h Minda Chen
2023-08-25 9:01 ` [PATCH v4 04/11] PCI: microchip: Rename data structure and functions Minda Chen
2023-08-25 9:01 ` [PATCH v4 05/11] PCI: plda: Move the common functions to pcie-plda-host.c Minda Chen
2023-08-25 9:01 ` [PATCH v4 06/11] PCI: plda: Add event interrupt codes and IRQ domain ops Minda Chen
2023-08-25 9:01 ` [PATCH v4 07/11] PCI: microchip: Rename IRQ init function Minda Chen
2023-08-25 11:56 ` Conor Dooley
2023-08-25 12:05 ` Conor Dooley
2023-09-01 3:55 ` Minda Chen
2023-08-25 9:01 ` [PATCH v4 08/11] PCI: microchip: Move IRQ init functions to pcie-plda-host.c Minda Chen
2023-08-25 12:09 ` Conor Dooley [this message]
2023-09-01 3:57 ` Minda Chen
2023-08-25 9:01 ` [PATCH v4 09/11] dt-bindings: PCI: Add StarFive JH7110 PCIe controller Minda Chen
2023-08-25 9:01 ` [PATCH v4 10/11] PCI: starfive: Add " Minda Chen
2023-08-25 9:01 ` [PATCH v4 11/11] riscv: dts: starfive: add PCIe dts configuration for JH7110 Minda Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230825-sip-pentagon-e1760dcfce58@wendy \
--to=conor.dooley@microchip.com \
--cc=aou@eecs.berkeley.edu \
--cc=bhelgaas@google.com \
--cc=conor@kernel.org \
--cc=daire.mcnamara@microchip.com \
--cc=devicetree@vger.kernel.org \
--cc=emil.renner.berthing@canonical.com \
--cc=kevin.xie@starfivetech.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kw@linux.com \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mason.huo@starfivetech.com \
--cc=minda.chen@starfivetech.com \
--cc=p.zabel@pengutronix.de \
--cc=pali@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).