linux/drivers/hwmon/pmbus
Titus Rwantare 6b6e2e8fd0 hwmon: (pmbus) Initialise page count in pmbus_identify()
The `pmbus_identify()` function fails to correctly determine the number
of supported pages on PMBus devices. This occurs because `info->pages`
is implicitly zero-initialised, and `pmbus_set_page()` does not perform
writes to the page register if `info->pages` is not yet initialised.
Without this patch, `info->pages` is always set to the maximum after
scanning.

This patch initialises `info->pages` to `PMBUS_PAGES` before the probing
loop, enabling `pmbus_set_page()` writes to make it out onto the bus
correctly identifying the number of pages. `PMBUS_PAGES` seemed like a
reasonable non-zero number because that's the current result of the
identification process.

Testing was done with a PMBus device in QEMU.

Signed-off-by: Titus Rwantare <titusr@google.com>
Fixes: 442aba7872 ("hwmon: PMBus device driver")
Link: https://lore.kernel.org/r/20250227222455.2583468-1-titusr@google.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:27:22 -08:00
..
Kconfig hwmon: (pmbus/max15301) Add support for MAX15303 2025-01-08 09:17:49 -08:00
Makefile hwmon: (pmbus/crps) Add Intel CRPS185 power supply 2024-12-18 07:14:58 -08:00
acbel-fsg032.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
adm1266.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
adm1275.c hwmon: (pmbus/adm1275) add adm1273 support 2025-01-07 09:08:10 -08:00
adp1050.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
bel-pfe.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
bpa-rs600.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
crps.c hwmon: (pmbus/crps) Add Intel CRPS185 power supply 2024-12-18 07:14:58 -08:00
delta-ahe50dc-fan.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dps920ab.c hwmon: pmbus: dps920ab: Add ability to instantiate through i2c 2025-01-13 08:57:06 -08:00
fsp-3y.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ibm-cffps.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
inspur-ipsps.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ir35221.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ir36021.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ir38064.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
irps5401.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
isl68137.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
lm25066.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
lt7182s.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ltc2978.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ltc3815.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ltc4286.c hwmon: (pmbus/ltc4286) Drop unused i2c device ids 2024-07-10 07:11:34 -07:00
max8688.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
max15301.c hwmon: (pmbus/max15301) Add support for MAX15303 2025-01-08 09:17:49 -08:00
max16064.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
max16601.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
max20730.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
max20751.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
max31785.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
max34440.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp2856.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp2888.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp2891.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp2975.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp2993.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp5023.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp5920.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp5990.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mp9941.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mpq7932.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
mpq8785.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pim4328.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pli1209bc.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pm6764tr.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pmbus.c hwmon: (pmbus) Initialise page count in pmbus_identify() 2025-03-02 08:27:22 -08:00
pmbus.h hwmon: (pmbus/core) improve handling of write protected regulators 2024-12-14 08:00:44 -08:00
pmbus_core.c hwmon: (pmbus/core) Add PMBUS_REVISION in debugfs 2024-12-16 10:44:36 -08:00
pxe1610.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
q54sj108a2.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
stpddc60.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
tda38640.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
tps546d24.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
tps25990.c hwmon: (pmbus/tps25990) Add initial support 2024-12-14 08:00:44 -08:00
tps40422.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
tps53679.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ucd9000.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
ucd9200.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xdp710.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xdpe152c4.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xdpe12284.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
zl6100.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00