]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: aspeed: socinfo: Mask table entries for accurate SoC ID matching
authorPotin Lai <potin.lai.pt@gmail.com>
Thu, 22 Jan 2026 08:37:56 +0000 (16:37 +0800)
committerAndrew Jeffery <andrew@codeconstruct.com.au>
Sun, 22 Feb 2026 23:13:21 +0000 (09:43 +1030)
The siliconid_to_name() function currently masks the input silicon ID
with 0xff00ffff, but compares it against unmasked table entries. This
causes matching to fail if the table entries contain non-zero values in
the bits covered by the mask (bits 16-23).

Update the logic to apply the 0xff00ffff mask to the table entries
during comparison. This ensures that only the relevant model and
revision bits are considered, providing a consistent match across
different manufacturing batches.

[arj: Add Fixes: tag, fix 'soninfo' typo, clarify function reference]

Fixes: e0218dca5787 ("soc: aspeed: Add soc info driver")
Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
Link: https://patch.msgid.link/20260122-soc_aspeed_name_fix-v1-1-33a847f2581c@gmail.com
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
drivers/soc/aspeed/aspeed-socinfo.c

index 5e34e01ad26de653e4c0d96daed16acd271cffb3..fb8fde94b6513b22ad6c28cf3cbf17d89e60b6a6 100644 (file)
@@ -39,7 +39,7 @@ static const char *siliconid_to_name(u32 siliconid)
        unsigned int i;
 
        for (i = 0 ; i < ARRAY_SIZE(rev_table) ; ++i) {
-               if (rev_table[i].id == id)
+               if ((rev_table[i].id & 0xff00ffff) == id)
                        return rev_table[i].name;
        }