]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Add TLP Prefix reading to pcie_read_tlp_log()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 14 Jan 2025 17:08:39 +0000 (19:08 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 16 Jan 2025 18:04:38 +0000 (12:04 -0600)
commitad41ddeeac216417a52fbc1060577f3098f4e90e
tree61e1709b2aa1d87edcf6b3802db6248ff89357c2
parente5321ae10e1323359a5067a26dfe98b5f44cc5e6
PCI: Add TLP Prefix reading to pcie_read_tlp_log()

pcie_read_tlp_log() handles only 4 Header Log DWORDs but TLP Prefix Log
(PCIe r6.1 secs 7.8.4.12 & 7.9.14.13) may also be present.

Generalize pcie_read_tlp_log() and struct pcie_tlp_log to also handle TLP
Prefix Log. The relevant registers are formatted identically in AER and DPC
Capability, but has these variations:

  a) The offsets of TLP Prefix Log registers vary.

  b) DPC RP PIO TLP Prefix Log register can be < 4 DWORDs.

  c) AER TLP Prefix Log Present (PCIe r6.1 sec 7.8.4.7) can indicate Prefix
     Log is not present.

Therefore callers must pass the offset of the TLP Prefix Log register and
the entire length to pcie_read_tlp_log() to be able to read the correct
number of TLP Prefix DWORDs from the correct offset.

Link: https://lore.kernel.org/r/20250114170840.1633-8-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[bhelgaas: squash ternary fix from
https://lore.kernel.org/r/20250116172019.88116-1-colin.i.king@gmail.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/pci/pci.h
drivers/pci/pcie/aer.c
drivers/pci/pcie/dpc.c
drivers/pci/pcie/tlp.c
include/linux/aer.h
include/uapi/linux/pci_regs.h