[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241124131701.yrb4bkhwigcux6b4@thinkpad>
Date: Sun, 24 Nov 2024 18:47:01 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Niklas Cassel <cassel@...nel.org>
Cc: Frank Li <Frank.Li@....com>,
Krzysztof Wilczyński <kw@...ux.com>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
imx@...ts.linux.dev, dlemoal@...nel.org, maz@...nel.org,
tglx@...utronix.de, jdmason@...zu.us
Subject: Re: [PATCH v8 2/6] PCI: endpoint: Add RC-to-EP doorbell support
using platform MSI controller
On Sun, Nov 24, 2024 at 10:56:38AM +0100, Niklas Cassel wrote:
>
>
> On 24 November 2024 08:11:00 CET, Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org> wrote:
> >On Sat, Nov 16, 2024 at 09:40:42AM -0500, Frank Li wrote:
> >> +static int pci_epc_alloc_doorbell(struct pci_epc *epc, struct pci_epf *epf)
> >> +{
> >> + struct device *dev = epc->dev.parent;
> >> + u16 num_db = epf->num_db;
> >> + int i = 0;
> >> + int ret;
> >> +
> >> + guard(mutex)(&epc->lock);
> >> +
> >> + ret = platform_device_msi_init_and_alloc_irqs(dev, num_db, pci_epc_write_msi_msg);
> >> + if (ret) {
> >> + dev_err(dev, "Failed to allocate MSI, may miss 'msi-parent' at your DTS\n");
> >
> >No need to mention 'msi-parent'. Just 'Failed to allocate MSI' is enough.
>
> If you look at the existing pcie_ep device tree nodes for all SoCs, you will see that it is very rare to see an EP node which specifies msi-parent.
>
> I guess that makes sense, since before this series, AFAICT, msi-parent was completely unused, so there was no need for an EP node to specify it.
>
> I'm okay to change the error print as you suggested, but in that case I really think that we should add a comment above the check, something suggestive like:
>
> /*
> * The pcie_ep DT node has to specify
> * 'msi-parent' for EP doorbell support to work.
> * Right now only GIC ITS is supported.
> * If you have GIC ITS and reached this print,
> * perhaps you are missing 'msi-parent' in DT?
> */
Looks good to me (except that the comment needs to fit 80 columns) :)
- Mani
> if (ret) {
> dev_err(dev, "Failed to allocate MSI\n");
> return -ENODEV;
> }
>
>
> Kind regards,
> Niklas
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists