[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250304151814.6xu7cbpwpqrvcad5@thinkpad>
Date: Tue, 4 Mar 2025 20:48:14 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Krzysztof Wilczyński <kw@...ux.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>, Fan Ni <nifan.cxl@...il.com>,
Shradha Todi <shradha.t@...sung.com>, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, lpieralisi@...nel.org,
robh@...nel.org, bhelgaas@...gle.com, jingoohan1@...il.com,
Jonathan.Cameron@...wei.com, a.manzanares@...sung.com,
pankaj.dubey@...sung.com, cassel@...nel.org, 18255117159@....com,
xueshuai@...ux.alibaba.com, renyu.zj@...ux.alibaba.com,
will@...nel.org, mark.rutland@....com
Subject: Re: [PATCH v7 3/5] Add debugfs based silicon debug support in DWC
+ Geert (who reported the regression in -next)
On Tue, Mar 04, 2025 at 04:46:47AM +0900, Krzysztof Wilczyński wrote:
> Hello,
>
> [...]
> > > +int dwc_pcie_debugfs_init(struct dw_pcie *pci)
> > > +{
> > > + char dirname[DWC_DEBUGFS_BUF_MAX];
> > > + struct device *dev = pci->dev;
> > > + struct debugfs_info *debugfs;
> > > + struct dentry *dir;
> > > + int ret;
> > > +
> > > + /* Create main directory for each platform driver */
> > > + snprintf(dirname, DWC_DEBUGFS_BUF_MAX, "dwc_pcie_%s", dev_name(dev));
> > > + dir = debugfs_create_dir(dirname, NULL);
> > > + debugfs = devm_kzalloc(dev, sizeof(*debugfs), GFP_KERNEL);
> > > + if (!debugfs)
> > > + return -ENOMEM;
> > > +
> > > + debugfs->debug_dir = dir;
> > > + pci->debugfs = debugfs;
> > > + ret = dwc_pcie_rasdes_debugfs_init(pci, dir);
> > > + if (ret)
> > > + dev_dbg(dev, "RASDES debugfs init failed\n");
> >
> > What will happen if ret != 0? still return 0?
>
> Given that callers of dwc_pcie_debugfs_init() check for errors,
> this probably should correctly bubble up any failure coming from
> dwc_pcie_rasdes_debugfs_init().
>
> I made updates to the code directly on the current branch, have a look:
>
> https://web.git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc&id=1ff54f4cbaed9ec6994844967c36cf7ada4cbe5e
>
> Let me know if this is OK with you.
>
If the SoC has no RASDES capability, then this call is bound to fail (which will
break existing platforms). I'd propose to return 0 if
dw_pcie_find_rasdes_capability() fails in addition to this change:
diff --git a/drivers/pci/controller/dwc/pcie-designware-debugfs.c b/drivers/pci/controller/dwc/pcie-designware-debugfs.c
index dca1e9999113..7277a21e30d5 100644
--- a/drivers/pci/controller/dwc/pcie-designware-debugfs.c
+++ b/drivers/pci/controller/dwc/pcie-designware-debugfs.c
@@ -471,7 +471,7 @@ static int dwc_pcie_rasdes_debugfs_init(struct dw_pcie *pci, struct dentry *dir)
ras_cap = dw_pcie_find_rasdes_capability(pci);
if (!ras_cap) {
dev_dbg(dev, "no RASDES capability available\n");
- return -ENODEV;
+ return 0;
}
rasdes_info = devm_kzalloc(dev, sizeof(*rasdes_info), GFP_KERNEL);
This will fix the regressions like the one reported by Geert:
https://lore.kernel.org/linux-pci/CAMuHMdWuCJAd-mCpCoseThureCKnnep4T-Z0h1_WJ1BOf2ZeDg@mail.gmail.com/
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists