From: Guenter Roeck <linux@roeck-us.net>
To: Wolfram Sang <wsa@kernel.org>
Cc: Jean Delvare <khali@linux-fr.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 0/2] i2c: smbus: Handle stuck alerts
Date: Mon, 10 Jan 2022 09:28:55 -0800 [thread overview]
Message-ID: <20220110172857.2980523-1-linux@roeck-us.net> (raw)
While playing with SMBus alert functionality, I noticed the following
messages if alert was active on more than once device.
smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0
smbus_alert 3-000c: no driver alert()!
or:
smbus_alert 3-000c: SMBALERT# from dev 0x28, flag 0
This is seen if multiple devices assert alert at the same time and at least
one of them does not or not correctly implement SMBus arbitration.
Once it starts, this message repeats forever at high rate.
Worst case, the problem turn resulted in system crashes after a while.
The following two patches fix the problem for me. The first patch
aborts the endless loop in smbus_alert() if no handler is found
for an alert address. The second patch sends alerts to all devices
with alert handler if that situation is observed.
I split the changes into two patches since I figured that the first patch
might be easier to accept. However, both patches are really needed to
fix the problem for good.
Note that there is one situation which is not addressed by this set of
patches: If the corrupted address points to yet another device with alert
handler on the same bus, the alert handler of that device will be called.
If it is not a source of the alert, we are back to the original problem.
I do not know how to address this case.
----------------------------------------------------------------
Guenter Roeck (2):
i2c: smbus: Improve handling of stuck alerts
i2c: smbus: Send alert notifications to all devices if source not found
drivers/i2c/i2c-smbus.c | 64 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 58 insertions(+), 6 deletions(-)
next reply other threads:[~2022-01-10 17:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 17:28 Guenter Roeck [this message]
2022-01-10 17:28 ` [PATCH 1/2] i2c: smbus: Improve handling of stuck alerts Guenter Roeck
2024-07-28 20:01 ` Wolfram Sang
2024-07-29 7:49 ` Wolfram Sang
2022-01-10 17:28 ` [PATCH 2/2] i2c: smbus: Send alert notifications to all devices if source not found Guenter Roeck
2024-07-28 20:04 ` Wolfram Sang
2024-07-29 0:31 ` Guenter Roeck
2024-07-29 7:57 ` Wolfram Sang
2024-07-29 14:23 ` Guenter Roeck
2024-07-29 18:36 ` Wolfram Sang
2024-07-29 18:44 ` Guenter Roeck
2024-07-29 20:52 ` Wolfram Sang
2024-07-29 21:39 ` Guenter Roeck
2024-06-12 17:49 ` [PATCH 0/2] i2c: smbus: Handle stuck alerts Guenter Roeck
2024-06-12 20:21 ` Wolfram Sang
2024-06-12 20:29 ` Guenter Roeck
2024-07-28 19:59 ` Wolfram Sang
2024-07-29 0:31 ` Guenter Roeck
2024-07-29 8:04 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220110172857.2980523-1-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=khali@linux-fr.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).