On Thu, Sep 24, 2026 at 10:34 AM David Matlack <[email protected]> wrote: > > Reserve PCI_L1SS_CTL1 and PCI_L1SS_CTL2 with a single request, since > they are adjacent DWORDs, just as the old code allocated one two-DWORD > buffer for both. Skip the reservation entirely for devices without the > capability, which the previous code could not do because it allocated > the buffer through pci_add_ext_cap_save_buffer() before looking at > pdev->l1ss.
The last sentence needs rephrasing. The previous code didn't allocate a buffer for devices without L1SS either: _pci_add_cap_save_buffer() did its own pci_find_ext_capability() and returned 0 when the capability was absent. The explicit "if (!pdev->l1ss) return;" in this patch is required because pci_reserve_saved_cap() takes an offset, and l1ss + PCI_L1SS_CTL1 with l1ss == 0 would hit the WARN_ON for offsets below PCI_STD_HEADER_SIZEOF. - Josh Hilke
