Skip to content

Commit 6fb9367

Browse files
l1kIngo Molnar
authored andcommitted
efi/cper: Fix endianness of PCIe class code
The CPER parser assumes that the class code is big endian, but at least on this edk2-derived Intel Purley platform it's little endian: efi: EFI v2.50 by EDK II BIOS ID:PLYDCRB1.86B.0119.R05.1701181843 DMI: Intel Corporation PURLEY/PURLEY, BIOS PLYDCRB1.86B.0119.R05.1701181843 01/18/2017 {1}[Hardware Error]: device_id: 0000:5d:00.0 {1}[Hardware Error]: slot: 0 {1}[Hardware Error]: secondary_bus: 0x5e {1}[Hardware Error]: vendor_id: 0x8086, device_id: 0x2030 {1}[Hardware Error]: class_code: 000406 ^^^^^^ (should be 060400) Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Dave Young <[email protected]> Cc: Jarkko Sakkinen <[email protected]> Cc: Jerry Snitselaar <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Lyude Paul <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Octavian Purdila <[email protected]> Cc: Peter Jones <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Scott Talbert <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent da0c9ea commit 6fb9367

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/cper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,
381381
printk("%s""vendor_id: 0x%04x, device_id: 0x%04x\n", pfx,
382382
pcie->device_id.vendor_id, pcie->device_id.device_id);
383383
p = pcie->device_id.class_code;
384-
printk("%s""class_code: %02x%02x%02x\n", pfx, p[0], p[1], p[2]);
384+
printk("%s""class_code: %02x%02x%02x\n", pfx, p[2], p[1], p[0]);
385385
}
386386
if (pcie->validation_bits & CPER_PCIE_VALID_SERIAL_NUMBER)
387387
printk("%s""serial number: 0x%04x, 0x%04x\n", pfx,

0 commit comments

Comments
 (0)