linux/drivers/hwmon/pmbus
Edward A. James 6dcf2fb5e8 hwmon: (pmbus/core) Prevent unintentional setting of page to 0xFF
The pmbus core may call read/write word data functions with a page value
of -1, intending to perform the operation without setting the page.
However, the read/write word data functions accept only unsigned 8-bit
page numbers, and therefore cannot check for negative page number to
avoid setting the page. This results in setting the page number to 0xFF.
This may result in errors or undefined behavior of some devices
(specifically the ir35221, which allows the page to be set to 0xFF,
but some subsequent operations to read registers may fail).

Switch the pmbus_set_page page parameter to an integer and perform the
check for negative page there. Make read/write functions consistent in
accepting an integer page number parameter.

Signed-off-by: Edward A. James <eajames@us.ibm.com>
Fixes: cbcdec6202 ("hwmon: (pmbus): Access word data for STATUS_WORD")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-29 18:35:54 -07:00
..
Kconfig hwmon: (pmbus) Add support for Texas Instruments tps53679 device 2017-08-30 18:01:08 -07:00
Makefile hwmon: (pmbus) Add support for Texas Instruments tps53679 device 2017-08-30 18:01:08 -07:00
adm1275.c driver: (adm1275) set the m,b and R coefficients correctly for power 2017-03-27 19:43:36 -07:00
ibm-cffps.c hwmon: (pmbus) Add IBM Common Form Factor (CFF) power supply driver 2017-08-29 18:06:18 -07:00
ir35221.c hwmon: (pmbus) Add client driver for IR35221 2017-06-11 17:08:19 -07:00
lm25066.c hwmon: (pmbus/lm25066) Add support for TI LM5066I 2017-08-30 06:31:13 -07:00
ltc2978.c hwmon: (ltc2978) Add support for LTM4675 2015-08-19 09:08:55 -07:00
ltc3815.c hwmon: (pmbus) Add client driver for LTC3815 2015-12-18 08:20:59 -08:00
max8688.c hwmon: (pmbus) Use BIT macro 2015-08-19 09:08:17 -07:00
max16064.c hwmon: (pmbus) Simplify remove functions 2012-03-18 18:27:46 -07:00
max20751.c hwmon: (pmbus) Add support for MAX20751 2015-08-09 13:44:27 -07:00
max34440.c hwmon: (pmbus) Use BIT macro 2015-08-19 09:08:17 -07:00
pmbus.c hwmon: (pmbus) move header file out of I2C realm 2017-06-11 17:08:19 -07:00
pmbus.h hwmon: (pmbus/core) Prevent unintentional setting of page to 0xFF 2017-10-29 18:35:54 -07:00
pmbus_core.c hwmon: (pmbus/core) Prevent unintentional setting of page to 0xFF 2017-10-29 18:35:54 -07:00
tps40422.c hwmon: (pmbus) Add tps40422 front-end driver 2014-08-04 07:01:38 -07:00
tps53679.c hwmon: (pmbus) Add support for Texas Instruments tps53679 device 2017-08-30 18:01:08 -07:00
ucd9000.c hwmon: (pmbus) move header file out of I2C realm 2017-06-11 17:08:19 -07:00
ucd9200.c hwmon: (pmbus) move header file out of I2C realm 2017-06-11 17:08:19 -07:00
zl6100.c hwmon: (pmbus) Use BIT macro 2015-08-19 09:08:17 -07:00