Linux PCI subsystem development
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,  LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] PCI: Use the correct bit in Link Training not active check
Date: Thu, 14 Mar 2024 13:39:24 +0200 (EET)	[thread overview]
Message-ID: <c4fe9080-245f-7089-84c1-bb47dcf2cd83@linux.intel.com> (raw)
In-Reply-To: <01666075-504d-a434-d039-2e25db931f23@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2874 bytes --]

On Wed, 6 Mar 2024, Ilpo Järvinen wrote:

> On Wed, 6 Mar 2024, Maciej W. Rozycki wrote:
> > On Mon, 4 Mar 2024, Ilpo Järvinen wrote:
> > 
> > > > > Since waiting for Data Link Layer Link Active bit is only used for the
> > > > > Target Speed quirk, this only impacts the case when the quirk attempts
> > > > > to restore speed to higher than 2.5 GT/s (The link is Up at that point
> > > > > so pcie_retrain_link() will fail).
> > > > 
> > > >  NAK.  It's used for both clamping and unclamping and it will break the 
> > > > workaround, because the whole point there is to wait until DLLA has been 
> > > > set.  Using LT is not reliable because it will oscillate in the failure 
> > > > case and seeing the bit clear does not mean link has been established.  
> > > 
> > > In pcie_retrain_link(), there are two calls into 
> > > pcie_wait_for_link_status() and the second one of them is meant to 
> > > implement the link-has-been-established check.
> > > 
> > > The first wait call comes from e7e39756363a ("PCI/ASPM: Avoid link 
> > > retraining race") and is just to ensure the link is not ongoing retraining 
> > > to make sure the latest configuration in captured as required by the 
> > > implementation note. LT being cleared is exactly what is wanted for that 
> > > check because it means that any earlier retraining has ended (a new one 
> > > might be starting but that doesn't matter, we saw it cleared so the new 
> > > configuration should be in effect for that instance of link retraining).
> > > 
> > > So my point is, the first check is not even meant to check that link has 
> > > been established.
> > 
> >  I see what you mean, and I now remember the note in the spec.  I had 
> > concerns about it, but did not do anything about it at that point.
> > 
> >  I think we still have no guarantee that LT will be clear at the point we 
> > set RL, because LT could get reasserted by hardware between our read and 
> > the setting of RL.
> >
> > IIUC that doesn't matter really, because the new link 
> > parameters will be taken into account regardless of whether retraining was
> > initiated by hardware in an attempt to do link recovery or triggered by 
> > software via RL.
> 
> I, too, was somewhat worried about having LT never clear for long enough 
> to successfully sample it during the wait but it's like you say, any new 
> link training should take account the new Target Speed which should 
> successfully bring the link up (assuming the quirk works in the first 
> place) and that should clear LT.

Hi,

One more point to add here, I started to wonder today why that use_lt 
parameter is needed at all for pcie_retrain_link()?

Once the Target Speed has been changed to 2.5GT/s which is what the quirk 
does before calling retraining, LT too should work "normally" after that.

-- 
 i.

  reply	other threads:[~2024-03-14 11:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 15:06 [PATCH 1/1] PCI: Use the correct bit in Link Training not active check Ilpo Järvinen
2024-03-01 17:22 ` Maciej W. Rozycki
2024-03-04 11:21   ` Ilpo Järvinen
2024-03-06 12:23     ` Maciej W. Rozycki
2024-03-06 15:44       ` Ilpo Järvinen
2024-03-14 11:39         ` Ilpo Järvinen [this message]
2024-03-14 21:58           ` Maciej W. Rozycki
2024-03-15  9:58             ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4fe9080-245f-7089-84c1-bb47dcf2cd83@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox