Commit 6bac9bc2 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang
Browse files

i2c: designware: ratelimit 'transfer when suspended' errors

There are two problems with dev_err() here. One: It is not ratelimited.
Two: We don't see which driver tried to transfer something with a
suspended adapter. Switch to dev_WARN_ONCE to fix both issues. Drawback
is that we don't see if multiple drivers are trying to transfer while
suspended. They need to be discovered one after the other now. This is
better than a high CPU load because a really broken driver might try to
resend endlessly.

Fixes: 27515415

 ("i2c: designware: Do not allow i2c_dw_xfer() calls while suspended")
Signed-off-by: default avatarWolfram Sang <>
Reported-by: default avatarskidnik <>
Acked-by: default avatarJarkko Nikula <>
Reviewed-by: default avatarAndy Shevchenko <>
Tested-by: default avatarskidnik <>
Signed-off-by: default avatarWolfram Sang <>
parent d386bb90
......@@ -426,8 +426,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
if (dev->suspended) {
dev_err(dev->dev, "Error %s call while suspended\n", __func__);
if (dev_WARN_ONCE(dev->dev, dev->suspended, "Transfer while suspended\n")) {
goto done_nolock;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment