[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y2e2p9wk.wl-maz@kernel.org>
Date: Thu, 01 Apr 2021 11:38:19 +0100
From: Marc Zyngier <maz@...nel.org>
To: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Frank Wunderlich <frank-w@...lic-files.de>,
Thierry Reding <treding@...dia.com>,
Thomas Gleixner <tglx@...utronix.de>,
Rob Herring <robh@...nel.org>, Will Deacon <will@...nel.org>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Michael Kelley <mikelley@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Ryder Lee <ryder.lee@...iatek.com>,
Marek Vasut <marek.vasut+renesas@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Michal Simek <michal.simek@...inx.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Bharat Kumar Gogada <bharatku@...inx.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-hyperv@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-renesas-soc@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH v3 03/14] PCI: rcar: Convert to MSI domains
On Thu, 01 Apr 2021 11:19:57 +0100,
Lorenzo Pieralisi <lorenzo.pieralisi@....com> wrote:
>
> On Tue, Mar 30, 2021 at 04:11:34PM +0100, Marc Zyngier wrote:
>
> [...]
>
> > +static void rcar_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
> > +{
> > + struct rcar_msi *msi = irq_data_get_irq_chip_data(data);
> > + unsigned long pa = virt_to_phys(msi);
> >
> > - hwirq = rcar_msi_alloc_region(msi, nvec);
> > - if (hwirq < 0)
> > - return -ENOSPC;
> > + /* Use the msi structure as the PA for the MSI doorbell */
> > + msg->address_lo = lower_32_bits(pa);
> > + msg->address_hi = upper_32_bits(pa);
>
> I don't think this change is aligned with the previous patch (is it ?),
> the PA address we are using here is different from the one programmed
> into the controller registers - either that or I am missing something,
> please let me know.
Err. You are right. This looks like a bad case of broken conflict
resolution on my part.
The following snippet should fix it. Let me know if you want me to
resend the whole thing or whether you are OK with applying this by
hand.
Thanks,
M.
diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
index f7331ad0d6dc..765cf2b45e24 100644
--- a/drivers/pci/controller/pcie-rcar-host.c
+++ b/drivers/pci/controller/pcie-rcar-host.c
@@ -573,11 +573,10 @@ static int rcar_msi_set_affinity(struct irq_data *d, const struct cpumask *mask,
static void rcar_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
{
struct rcar_msi *msi = irq_data_get_irq_chip_data(data);
- unsigned long pa = virt_to_phys(msi);
+ struct rcar_pcie *pcie = &msi_to_host(msi)->pcie;
- /* Use the msi structure as the PA for the MSI doorbell */
- msg->address_lo = lower_32_bits(pa);
- msg->address_hi = upper_32_bits(pa);
+ msg->address_lo = rcar_pci_read_reg(pcie, PCIEMSIALR) & ~MSIFE;
+ msg->address_hi = rcar_pci_read_reg(pcie, PCIEMSIAUR);
msg->data = data->hwirq;
}
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists