Skip to content

Commit ee1e3c4

Browse files
benhartcheathamweiny2
authored andcommitted
EINJ, CXL: Fix CXL device SBDF calculation
The SBDF of the target CXL 2.0 compliant root port is required to inject a CXL protocol error as per ACPI 6.5. The SBDF given has to be in the following format: 31 24 23 16 15 11 10 8 7 0 +-------------------------------------------------+ | segment | bus | device | function | reserved | +-------------------------------------------------+ The SBDF calculated in cxl_dport_get_sbdf() doesn't account for the reserved bits currently, causing the wrong SBDF to be used. Fix said calculation to properly shift the SBDF. Without this fix, error injection into CXL 2.0 root ports through the CXL debugfs interface (<debugfs>/cxl) is broken. Injection through the legacy interface (<debugfs>/apei/einj/) will still work because the SBDF is manually provided by the user. Fixes: 12fb28e ("EINJ: Add CXL error type support") Signed-off-by: Ben Cheatham <Benjamin.Cheatham@amd.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Tested-by: Srinivasulu Thanneeru <sthanneeru.opensrc@micron.com> Reviewed-by: Srinivasulu Thanneeru <sthanneeru.opensrc@micron.com> Link: https://patch.msgid.link/20240927163428.366557-1-Benjamin.Cheatham@amd.com Signed-off-by: Ira Weiny <ira.weiny@intel.com>
1 parent 9852d85 commit ee1e3c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/apei/einj-cxl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static int cxl_dport_get_sbdf(struct pci_dev *dport_dev, u64 *sbdf)
6363
seg = bridge->domain_nr;
6464

6565
bus = pbus->number;
66-
*sbdf = (seg << 24) | (bus << 16) | dport_dev->devfn;
66+
*sbdf = (seg << 24) | (bus << 16) | (dport_dev->devfn << 8);
6767

6868
return 0;
6969
}

0 commit comments

Comments
 (0)