Re: [PATCH v18 11/13] PCI: Cache PCI DSN into pci_dev->dsn during probe
| Newsgroups | org.kernel.vger.linux-cxl,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
> Subsequent CXL error-reporting code paths need to log the PCI Device > Serial Number (DSN) as part of trace events emitted from interrupt or > panic context. Computing the DSN there via pci_get_dsn() requires PCI > configuration space reads, which are slow, can fail when the link is > down or frozen, and may not be safe in some contexts. > > Add a u64 dsn field to struct pci_dev and populate it from pci_get_dsn() > during pci_init_capabilities() at probe time via pci_dsn_init(). Only > write dev->dsn when the read succeeds. The zero initial value from > pci_dev allocation already represents 'no DSN available.' > > pci_get_dsn() is not modified because it remains a pure config-space read > with no side effects on pci_dev. The cache is written exclusively by > pci_dsn_init() at probe time. > > Signed-off-by: Terry Bowman <[email protected]> Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11