Skip to content

Commit 7ec1bd3

Browse files
potinlaiamboar
authored andcommitted
soc: aspeed: socinfo: Mask table entries for accurate SoC ID matching
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: e0218dc ("soc: aspeed: Add soc info driver") Signed-off-by: Potin Lai <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Andrew Jeffery <[email protected]>
1 parent 6de23f8 commit 7ec1bd3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/soc/aspeed/aspeed-socinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static const char *siliconid_to_name(u32 siliconid)
3939
unsigned int i;
4040

4141
for (i = 0 ; i < ARRAY_SIZE(rev_table) ; ++i) {
42-
if (rev_table[i].id == id)
42+
if ((rev_table[i].id & 0xff00ffff) == id)
4343
return rev_table[i].name;
4444
}
4545

0 commit comments

Comments
 (0)