Re: [PATCH 01/17] PCI: Add concurrency safe clear_and_set variants for LNKCTL{,2}

From: Lukas Wunner
Date: Thu May 11 2023 - 16:07:17 EST


On Thu, May 11, 2023 at 10:58:40PM +0300, Ilpo Järvinen wrote:
> On Thu, 11 May 2023, Bjorn Helgaas wrote:
> > Many of these are ASPM-related updates that IMHO should not be in
> > drivers at all. Drivers should use PCI core interfaces so the core
> > doesn't get confused.
>
> Ah, yes. I forgot to mention it in the cover letter but I noticed that
> some of those seem to be workarounds for the cases where core refuses to
> disable ASPM. Some sites even explicit have a comment about that after
> the call to pci_disable_link_state():
[...]
> That kinda feels something that would want a force disable quirk that is
> reliable. There are quirks for some devices which try to disable it but
> could fail for reasons mentioned in that comment. (But I'd prefer to make
> another series out of it rather than putting it into this one.)

I'm wondering if it's worth cleaning up ASPM handling in drivers first
as the locking issue may then largely solve itself. The locking could
probably be kept internal to ASPM core code then.

Thanks,

Lukas