Skip to contentSkip to conversation

hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E

PATCH Applied Tomáš Pecka 2 participants 2 messages Apr 20, 2023 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E

The bit flags in pmbus_driver_info functionality for YM-2151E chip were joined with a comma operator instead of a bitwise OR. This means that the last constant PMBUS_HAVE_IIN was not OR-ed with the other PM_BUS_HAVE_* constants for this page but it initialized the next element of the func array (which was not accessed from anywhere because of the number of pages).

However, there is no need for setting PMBUS_HAVE_IIN in the 5Vsb page because this command does not seem to be paged. Obviously, the device only has one IIN sensor, so it doesn't make sense to query it again from the second page.

Fixes 1734b4135a62 ("hwmon: Add driver for fsp-3y PSUs and PDUs")
---
 drivers/hwmon/pmbus/fsp-3y.c | 1 -
 1 file changed, 1 deletion(-)
drivers/hwmon/pmbus/fsp-3y.c +0 -1
index aec294cc72d1..c7469d2cdedc 100644
@@ -180,7 +180,6 @@ static struct pmbus_driver_info fsp3y_info[] = {
 			PMBUS_HAVE_FAN12,
 		.func[YM2151_PAGE_5VSB_LOG] =
 			PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT,
-			PMBUS_HAVE_IIN,
 		.read_word_data = fsp3y_read_word_data,
 		.read_byte_data = fsp3y_read_byte_data,
 	},
Signature · 1 line
2.40.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Tomáš Pecka

The bit flags in pmbus_driver_info functionality for YM-2151E chip were joined with a comma operator instead of a bitwise OR. This means that the last constant PMBUS_HAVE_IIN was not OR-ed with the other PM_BUS_HAVE_* constants for this page but it initialized the next element of the func array (which was not accessed from anywhere because of the number of pages).

Quoted 8 lines

However, there is no need for setting PMBUS_HAVE_IIN in the 5Vsb page because this command does not seem to be paged. Obviously, the device only has one IIN sensor, so it doesn't make sense to query it again from the second page.

Fixes 1734b4135a62 ("hwmon: Add driver for fsp-3y PSUs and PDUs")

FWIW, adding both Co-developed-by: and Signed-off-by: tags doesn't make sense since Signed-off-by: implies Co-developed-by:. I'll drop the first tag.

Quoted 1 line

Applied.

Thanks,
Guenter

Quoted 16 lines
---
 drivers/hwmon/pmbus/fsp-3y.c | 1 -
 1 file changed, 1 deletion(-)
drivers/hwmon/pmbus/fsp-3y.c +0 -1
index aec294cc72d1..c7469d2cdedc 100644
@@ -180,7 +180,6 @@ static struct pmbus_driver_info fsp3y_info[] = {
 			PMBUS_HAVE_FAN12,
 		.func[YM2151_PAGE_5VSB_LOG] =
 			PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT,
-			PMBUS_HAVE_IIN,
 		.read_word_data = fsp3y_read_word_data,
 		.read_byte_data = fsp3y_read_byte_data,
 	},