hwmon: (max16065) Add chip access warning
Subsystems (2)
RFC PATCH 1/1 hwmon: (max16065) Add chip access warning
The chips supported by the max16065 driver should not be accessed using direct i2ctools commands. Add warning to driver documentation to alert users.
---
RFC: Do we want this kind of warning in driver documentation ?
Documentation/hwmon/max16065 | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Documentation/hwmon/max16065 +7 -0
@@ -62,6 +62,13 @@ can be safely used to identify the chip. You will have to instantiate the devices explicitly. Please see Documentation/i2c/instantiating-devices for details. +WARNING: Do not access chip registers using the i2cdump command, and do not use +any of the i2ctools commands on a command register (0xa5 to 0xac). The chips +supported by this driver interpret any access to a command register (including +read commands) as request to execute the command in question. This may result in +power loss, board resets, and/or Flash corruption. Worst case, your board may +turn into a brick. + Sysfs entries -------------
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH RFC] hwmon: (max16065) Add chip access
Quoted 6 lines · Guenter Roeck
The chips supported by the max16065 driver should not be accessed using direct i2ctools commands. Add warning to driver documentation to alert users.
Signed-off-by Guenter Roeck <[email protected]>---
RFC: Do we want this kind of warning in driver documentation ?
Sure, this can't hurt. Maybe we could add a section in i2c-tools' documentation as well, listing the dangerous chips, starting with this one? i2cdetect already has a note about the AT24RF08 for historical reasons, I wouldn't mind documenting the "dangerous" chips more prominently. Hopefully the list will stay short.
Quoted 12 lines
Documentation/hwmon/max16065 | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)Documentation/hwmon/max16065 +0
-0@@ -62,6 +62,13 @@ can be safely used to identify the chip. You will have to instantiate the devices explicitly. Please see Documentation/i2c/instantiating-devices for details.
Documentation/hwmon/max16065 can be safely used to identify the chip. You will have to instantiate · line 74
Quoted 10 lines
Documentation/hwmon/max16065 +7
-0+WARNING: Do not access chip registers using the i2cdump command, and do not use +any of the i2ctools commands on a command register (0xa5 to 0xac). The chips +supported by this driver interpret any access to a command register (including +read commands) as request to execute the command in question. This may result in +power loss, board resets, and/or Flash corruption. Worst case, your board may +turn into a brick. + Sysfs entries -------------
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH RFC] hwmon: (max16065) Add chip access
In reply to Guenter RoeckQuoted 8 lines · Jean Delvare
Quoted 6 lines · Guenter Roeck
The chips supported by the max16065 driver should not be accessed using direct i2ctools commands. Add warning to driver documentation to alert users.
Signed-off-by Guenter Roeck <[email protected]>---
RFC: Do we want this kind of warning in driver documentation ?
Quoted 6 lines
Sure, this can't hurt. Maybe we could add a section in i2c-tools' documentation as well, listing the dangerous chips, starting with this one? i2cdetect already has a note about the AT24RF08 for historical reasons, I wouldn't mind documenting the "dangerous" chips more prominently. Hopefully the list will stay short.
Hopefully yes. Many of the PMBus chips are potentially affected, though. They typically have a means to protect settings from overwrite, but if that is not enabled, one can be in hot water. Worst I have seen so far was to execute i2cdump on an eval board and it lost its configuration :(.
[ ... ]
Quoted 3 lines
Acked-by Jean Delvare <[email protected]>
Thanks for the review!
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH RFC] hwmon: (max16065) Add chip access
In reply to Guenter RoeckQuoted 15 lines · Guenter Roeck
Quoted 8 lines · Jean Delvare
Quoted 6 lines · Guenter Roeck
The chips supported by the max16065 driver should not be accessed using direct i2ctools commands. Add warning to driver documentation to alert users.
Signed-off-by Guenter Roeck <[email protected]>---
RFC: Do we want this kind of warning in driver documentation ?Quoted 6 lines
Sure, this can't hurt. Maybe we could add a section in i2c-tools' documentation as well, listing the dangerous chips, starting with this one? i2cdetect already has a note about the AT24RF08 for historical reasons, I wouldn't mind documenting the "dangerous" chips more prominently. Hopefully the list will stay short.
Quoted 4 lines
Hopefully yes. Many of the PMBus chips are potentially affected, though. They typically have a means to protect settings from overwrite, but if that is not enabled, one can be in hot water. Worst I have seen so far was to execute i2cdump on an eval board and it lost its configuration :(.
You are lucky. Back in 2002, worse a few lm-sensors users saw was their shiny new Thinkpad laptop tuned into a brick by sensors-detect (not even i2c-tools) due to what ended up being a state machine bug in the AT24RF08.)
Speaking of this... At which I2C addresses to these PMBus devices live? MAX16065/66 in particular but also other chips with similar problems. If these are addresses sensors-detect is probing, then it's only a matter of time before we get a report from a user hitting the problem.
Probably it's about time to let the kernel block user-space probing of specific I2C buses.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH RFC] hwmon: (max16065) Add chip access
In reply to Guenter RoeckQuoted 21 lines · Jean Delvare
Quoted 15 lines · Guenter Roeck
Quoted 8 lines · Jean Delvare
Quoted 6 lines · Guenter Roeck
The chips supported by the max16065 driver should not be accessed using direct i2ctools commands. Add warning to driver documentation to alert users.
Signed-off-by Guenter Roeck <[email protected]>---
RFC: Do we want this kind of warning in driver documentation ?Quoted 6 lines
Sure, this can't hurt. Maybe we could add a section in i2c-tools' documentation as well, listing the dangerous chips, starting with this one? i2cdetect already has a note about the AT24RF08 for historical reasons, I wouldn't mind documenting the "dangerous" chips more prominently. Hopefully the list will stay short.
Quoted 4 lines
Hopefully yes. Many of the PMBus chips are potentially affected, though. They typically have a means to protect settings from overwrite, but if that is not enabled, one can be in hot water. Worst I have seen so far was to execute i2cdump on an eval board and it lost its configuration :(.
Quoted 7 lines
You are lucky. Back in 2002, worse a few lm-sensors users saw was their shiny new Thinkpad laptop tuned into a brick by sensors-detect (not even i2c-tools) due to what ended up being a state machine bug in the AT24RF08.)
Speaking of this... At which I2C addresses to these PMBus devices live? MAX16065/66 in particular but also other chips with similar problems.
MAX16065/66 is not a PMBus device ... by default, it resides at 0x50..0x53 (possibly the worst address space available for such a device). That address can be overwritten by software to any valid address. It does not have an ID register, so it can not be auto-detected.
PMBus devices can unfortunately be at any valid address. Many chips use a set of resistors to set the address. Even those not using resistors can often be programmed by SW to any address.
Quoted 3 lines
If these are addresses sensors-detect is probing, then it's only a matter of time before we get a report from a user hitting the problem.
Might well be. Most don't react too badly on reads, though. I had the problem specifically with the Intersil chips. On those, the byte reads done by i2cdump on write-only command registers are accepted as write commands. This causes the chip configuration to be lost unless all writes are disabled/secured. Which was not the case on my eval board. Oops ...
Turning PMBus chips into bricks is actually quite simple - I managed to do it with several chips from multiple vendors. Since one has to do that on purpose or by being careless (as in my case ;), so I would not count that against the chips.
Quoted 2 lines
Probably it's about time to let the kernel block user-space probing of specific I2C buses.
Sounds like a good idea. This is one reason why we don't set I2C_CLASS_HWMON in our internal I2C adapter drivers.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH RFC] hwmon: (max16065) Add chip access
In reply to Guenter RoeckHi Guenter,
Quoted 11 lines · Guenter Roeck
Quoted 7 lines · Jean Delvare
You are lucky. Back in 2002, worse a few lm-sensors users saw was their shiny new Thinkpad laptop tuned into a brick by sensors-detect (not even i2c-tools) due to what ended up being a state machine bug in the AT24RF08.)
Speaking of this... At which I2C addresses to these PMBus devices live? MAX16065/66 in particular but also other chips with similar problems.
MAX16065/66 is not a PMBus device ... by default, it resides at 0x50..0x53 (possibly the worst address space available for such a device).
Indeed. We might have to stop probing these addresses completely in sensors-detect, too bad for the ADM1033/34. The detection currently only accesses registers 0x3d, 0x3e and 0x3f, hopefully it's OK for the MAX16065/66.
Quoted 2 lines
That address can be overwritten by software to any valid address. It does not have an ID register, so it can not be auto-detected.
I've seen many chips with this software address change feature, but I've rarely seen it used in practice. Such address changes are only needed in case of address collisions, and in this case you can't access the device in the first place without an alternative register access method or a switch or multiplexer on the I2C bus. In which case changing the address is no longer mandatory.
Quoted 3 lines
PMBus devices can unfortunately be at any valid address. Many chips use a set of resistors to set the address. Even those not using resistors can often be programmed by SW to any address.
We will have to address problems as they show up on a case by case basis then.
Quoted 4 lines
Quoted 2 lines
If these are addresses sensors-detect is probing, then it's only a matter of time before we get a report from a user hitting the problem.
Might well be. Most don't react too badly on reads, though.
The problem is that not all chips agree on what a register read is, due to the flexibility (or lack of standardization) of the I2C protocol. Thankfully PMBus devices should be implemented as SMBus slaves so they should follow the standard SMBus transactions. However in practice you found they don't always do.
Quoted 10 lines
I had the problem
specifically with the Intersil chips. On those, the byte reads done by i2cdump on write-only command registers are accepted as write commands. This causes the chip configuration to be lost unless all writes are disabled/secured. Which was not the case on my eval board. Oops ...Turning PMBus chips into bricks is actually quite simple - I managed to do it with several chips from multiple vendors. Since one has to do that on purpose or by being careless (as in my case ;), so I would not count that against the chips.
You can always blame anyone when this happens... the loose I2C specification, the chip manufacturer, Linux tools, yourself... It's really a combination of all these that leads to disasters, and only the last two we have a control over.
Quoted 5 lines
Quoted 2 lines
Probably it's about time to let the kernel block user-space probing of specific I2C buses.
Sounds like a good idea. This is one reason why we don't set
I2C_CLASS_HWMONin our internal I2C adapter drivers.
This doesn't currently protect you against sensors-detect, that's the problem. The lack of I2C_CLASS_HWMON only protects you against kernel hwmon drivers.
Some months ago I made sensors-detect more clever in which I2C adapters it accepts to probe by default. In particular, we skip I2C adapters on PCI multimedia controllers. However this is only an unreliable band aid, there's definitely room for improvement.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors