[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240611172147.GA990220@bhelgaas>
Date: Tue, 11 Jun 2024 12:21:47 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Marc Zyngier <maz@...nel.org>
Cc: Manivannan Sadhasivam <mani@...nel.org>,
Jianjun Wang <jianjun.wang@...iatek.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Ryder Lee <ryder.lee@...iatek.com>, linux-pci@...r.kernel.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, jieyy.yang@...iatek.com,
chuanjia.liu@...iatek.com, qizhong.cheng@...iatek.com,
jian.yang@...iatek.com, jianguo.zhang@...iatek.com
Subject: Re: [PATCH v2 1/3] PCI: mediatek: Allocate MSI address with
dmam_alloc_coherent()
On Sun, Jun 09, 2024 at 01:32:38PM +0100, Marc Zyngier wrote:
> On Sat, 08 Jun 2024 10:01:52 +0100,
> Manivannan Sadhasivam <mani@...nel.org> wrote:
> >
> > On Mon, Dec 11, 2023 at 04:52:54PM +0800, Jianjun Wang wrote:
> > > Use dmam_alloc_coherent() to allocate the MSI address, instead of using
> > > virt_to_phys().
> >
> > What is the reason for this change? So now PCIE_MSI_VECTOR becomes unused?
>
> More importantly, this is yet another example of the DW reference
> driver nonsense, where memory is allocated for *MSI*, while the whole
> point of MSIs is that it is a write that doesn't target memory, making
> any form of RAM allocation absolutely pointless.
>
> This silly approach has been cargo-culted for years, and while I
> caught a few in my time, you can't beat copy-paste.
>
> IMO, this patch is only making things worse instead of fixing things.
Probably partly my fault. I think there are two pieces here:
1) allocating the MSI address
2) computing the PCI bus address
I don't know how to do 1), but I do encourage people not to use
virt_to_phys() for 2), since (in general) CPU physical addresses are
not the same as PCI bus addresses.
Powered by blists - more mailing lists