Re: [PATCH v2 2/4] PCI: Revert to the original speed after PCIe failed link retraining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 22 Aug 2024, Ilpo Järvinen wrote:

> > linux-pcie-failed-link-retrain-fail-unclamp.diff
> > Index: linux-macro/drivers/pci/quirks.c
> > ===================================================================
> > --- linux-macro.orig/drivers/pci/quirks.c
> > +++ linux-macro/drivers/pci/quirks.c
> > @@ -100,6 +106,9 @@ bool pcie_failed_link_retrain(struct pci
> >  
> >  		if (pcie_retrain_link(dev, false)) {
> >  			pci_info(dev, "retraining failed\n");
> > +			pcie_capability_write_word(dev, PCI_EXP_LNKCTL2,
> > +						   oldlnkctl2);
> > +			pcie_retrain_link(dev, false);
> 
> Hi again all,
> 
> While rebasing the bandwidth controller patches, I revisited this line and 
> realized using false for use_lt is not optimal here.
> 
> It would definitely seem better to use LT (true) in this case because it 
> likely results in much shorter wait. In hotplug cases w/o a peer device, 
> DLLLA will just make the wait last until the timeout, whereas LT would 
> short-circuit the training almost right away I think (mostly guessing with 
> limited knowledge about LTSSM). We are no longer even expecting the link 
> to come up at this point so using DLLLA seems illogical.

 Good point, I haven't given this part much thought and just pasted the 
same call to `pcie_retrain_link' as above.  At worst we'll hit the same 
timeout, but as you write we don't expect DLLLA to ever come up at this 
point and LT may come down long before the timeout (and if it oscillates 
and we probe at the wrong moments, then we'll hit the timeout anyway).

> Do you agree?

 I do.  Thank you for your suggestion, I have posted v3 now with your
suggested update only.

  Maciej




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux