Fix the AMD756 SMBus Controller hang
PATCH 1/1 Fix the AMD756 SMBus Controller hang
Hello
This patch seems to fix the hang of AMD756 SMBus controller. After certain ammount of bus transactions the controller refused to start new transactions and abort was not working. This patch is based on mine and Dieter Jurzitza's investigations.
Please apply.
Regards
Rudolf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-amd756.patch
Type: text/x-patch
Size: 424 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060606/29039c24/attachment-0001.bin
PATCH 1/1 Fix the AMD756 SMBus Controller hang
Hi Rudolf,
Quoted 11 lines
This patch seems to fix the hang of AMD756 SMBus controller. After certain ammount of bus transactions the controller refused to start new transactions and abort was not working. This patch is based on mine and Dieter Jurzitza's investigations.
Please apply.
drivers/i2c/busses/i2c-amd756.c line 128
Quoted 8 lines
drivers/i2c/busses/i2c-amd756.c +2
-0@@ -121,6 +121,8 @@ inb_p(SMB_HOST_DATA));/* Make sure the SMBus host is ready to start transmitting */ +/* And wait for the SMBus controller to settle down (avoids hang) */ +msleep (1 );if ((temp =inw_p (SMB_GLOBAL_STATUS )) & (GS_HST_STS |GS_SMB_STS )) {dev_dbg (&adap->dev,"SMBus busy (%04x). Waiting...\n" , temp); do {
I don't like it. This is basically doubling the amount of sleep time for all simple transactions. For HZ0, this means 10 ms of additional delay per transaction. For an EEPROM dump, this means 5 seconds instead of 2.5 seconds, this makes a big difference. This is true also for I2C/SMBus hardware monitoring chips with a large number of registers.
Given that the problem was only reported on one system by one user, it's quite a high price to pay, don't you think? I'd like this to be investigated further. Can we find other reports which could be related to the same problem? If not, why this one system has the problem when others don't? If we can understand that, maybe we can add the delay only when it is really needed, this would limit the impact of the change and make it more acceptable.
Rudolf, I also see that you alreay applied this change to lm_sensors CVS, with the mention "backport of 2.6". That's not the right way to do it, sorry. For one thing you can't technically backport something before it was accepted and applied. For another, non-critical fixes should really get some broad testing in 2.6 before being actually backported.
Thanks,
Signature · 1 line
Jean Delvare
PATCH 1/1 Fix the AMD756 SMBus Controller hang
In reply to Rudolf MarekHello all,
Quoted 6 lines
I don't like it. This is basically doubling the amount of sleep time for all simple transactions. For HZ0, this means 10 ms of additional delay per transaction. For an EEPROM dump, this means 5 seconds instead of 2.5 seconds, this makes a big difference. This is true also for I2C/SMBus hardware monitoring chips with a large number of registers.
Typical system has HZ 250 which is 4ms of wait. so like 1s all in all. But more likely there is aneed to read 30 registers every 2 seconds or so so it should be still enough.
Quoted 7 lines
Given that the problem was only reported on one system by one user, it's quite a high price to pay, don't you think? I'd like this to be investigated further. Can we find other reports which could be related to the same problem? If not, why this one system has the problem when others don't? If we can understand that, maybe we can add the delay only when it is really needed, this would limit the impact of the change and make it more acceptable.
Well we cannot detect it, nor we know more. We know that this fixes the problem. Given by cut & paste design of smbus controller it is likely to have this problem with others...
Quoted 6 lines
Rudolf, I also see that you alreay applied this change to
lm_sensorsCVS, with the mention "backport of 2.6". That's not the right way to do it, sorry. For one thing you can't technically backport something before it was accepted and applied. For another, non-critical fixes should really get some broad testing in 2.6 before being actually backported.
Well I consider it critical because the bus will stop working at all. The delay is anoying but "better safe than sorry"
Is anyone here with AMD southbridge for further testing?
Regards
Rudolf
PATCH 1/1 Fix the AMD756 SMBus Controller hang
In reply to Rudolf MarekQuoted 3 lines · Rudolf Marek
Well we cannot detect it, nor we know more. We know that this fixes the problem. Given by cut & paste design of smbus controller it is likely to have this problem with others...
Isn't this a case for a DMI-based blacklist, plus a "force a delay" parameter? If this is not a widespread problem, there is no reason to punish everyone who has a non-defective motherboard design...
Signature · 4 lines
"One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh
PATCH 1/1 Fix the AMD756 SMBus Controller hang
In reply to Rudolf MarekHello,
Quoted 3 lines
Isn't this a case for a DMI-based blacklist, plus a "force a delay" parameter? If this is not a widespread problem, there is no reason to punish everyone who has a non-defective motherboard design...
Yes maybe. We know that the bus problem is not in the bus itself but in the controller which is stuck. But yes, it might be due to some noise on certain designs...
Regards
Rudolf
PATCH 1/1 Fix the AMD756 SMBus Controller hang
In reply to Rudolf MarekDear all,
sorry for my delayed reply - I was out for holidays :-)). This is the reason why I did not report my latest findings yet and did not reply to Rudolf's inputs either.
As a matter of fact I would strongly support the statement of Jean - especially after I found that this very same patch did not work out the same for the latest kernel (2.6.11.X) that has been issued by SuSE.
My patch was just guessing - and for some (to me ...) unknown reason it partly worked. I would highly appreciate if someone could give me a pointer to something to read so I can better understand what i2c-amd756.c actually does and how it interacts with other drivers and how my patch influences what. I would highly appreciate if there was someone to help me if I have related questions and I would personally be very reluctant to push something like my patch upstream not knowing what it actually does and not being sure why it (partly) had helped.
So, I would be really happy if someone could tell me where to start with understanding how things interact here - I need something black and white to get a clue what is happening here. Then I'll keep you updated with my experiences.
Many thanks in advance,
take care
Dieter Jurzitza
Am Mittwoch, 7. Juni 2006 23:19 schrieb Rudolf Marek:
Quoted 4 lines
Hello all,
Quoted 2 lines
I don't like it. This is basically doubling the amount of sleep time for all simple transactions. For HZ0, this means 10 ms of
******
Signature · 14 lines
-----------------------------------------------------------
|
\
/\_/\ |
| ~x~ |/-----\ /
\ /- \_/
^^__ _ / _ ____ /
<??__ \- \_/ | |/ | |
|| || _| _| _| _|
if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------