[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4bf967a6-0918-d074-58bb-f0aebf6ceeb6@linux.intel.com>
Date: Mon, 1 Dec 2025 18:48:45 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: "Maciej W. Rozycki" <macro@...am.me.uk>
cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Matthew W Carlis <mattc@...estorage.com>,
ALOK TIWARI <alok.a.tiwari@...cle.com>, ashishk@...estorage.com,
msaggi@...estorage.com, sconnor@...estorage.com,
Lukas Wunner <lukas@...ner.de>, Jiwei <jiwei.sun.bj@...com>,
guojinhui.liam@...edance.com, ahuang12@...ovo.com, sunjw10@...ovo.com,
linux-pci@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PCI: Always lift 2.5GT/s restriction in PCIe failed link
retraining
On Mon, 1 Dec 2025, Maciej W. Rozycki wrote:
> On Mon, 1 Dec 2025, Ilpo Järvinen wrote:
>
> > > + pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap);
> > > + if ((lnkctl2 & PCI_EXP_LNKCTL2_TLS) == PCI_EXP_LNKCTL2_TLS_2_5GT &&
> > > + (lnkcap & PCI_EXP_LNKCAP_SLS) != PCI_EXP_LNKCAP_SLS_2_5GB) {
> >
> > I'm trying to recall, if there was some particular reason why
> > ->supported_speeds couldn't be used in this function. It would avoid the
> > need to read LinkCap at all.
>
> Thanks for the hint. There's probably none and it's just me missing some
> of the zillion bits and pieces. I'll wait a couple of days for any other
> people to chime in and respin with this update included if everyone is
> otherwise happy to proceed with this update.
>
> > > + if (ret)
> > > + goto err;
> > > }
> > >
> > > return ret;
> >
> > return 0;
>
> It can still return -ENOTTY if neither of the two latter conditionals
> matched, meaning the quirk was not applicable after all. ISTR you had
> issues with the structure of this code before; I am not sure if it can
> be made any better in a reasonable way. It is not a failure per se, so
> the newly-added common error path does not apply. This is the case for:
> "Return an error if retraining was not needed[...]" from the introductory
> comment.
>
> Shall I add a comment above the return statement referring to this?
I think it's fine as is, I just didn't review with enough context to
notice what it was initialized to (the usual thing when adding a
rollback path is to forget to change the normal path to return 0, thus
"auto commenting" it without checking enough, I'm sorry about that).
--
i.
Powered by blists - more mailing lists