All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@armlinux.org.uk>
To: Andrew Jackson <Andrew.Jackson@arm.com>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] i2c: designware: report short transfers
Date: Fri, 18 Nov 2016 19:40:04 +0000	[thread overview]
Message-ID: <E1c7p12-0000R0-S8@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20161118193542.GO1041@n2100.armlinux.org.uk>

Rather than reporting success for a short transfer due to interrupt
latency, report an error both to the caller, as well as to the kernel
log.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/i2c/busses/i2c-designware-core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 9703fe392543..c53058d6139c 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -758,7 +758,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 	}
 
 	/* no error */
-	if (likely(!dev->cmd_err)) {
+	if (likely(!dev->cmd_err && !dev->status)) {
 		ret = num;
 		goto done;
 	}
@@ -768,6 +768,11 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 		ret = i2c_dw_handle_tx_abort(dev);
 		goto done;
 	}
+
+	if (dev->status)
+		dev_err(dev->dev,
+			"transfer terminated early - interrupt latency too high?\n");
+
 	ret = -EIO;
 
 done:
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: rmk+kernel@armlinux.org.uk (Russell King)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] i2c: designware: report short transfers
Date: Fri, 18 Nov 2016 19:40:04 +0000	[thread overview]
Message-ID: <E1c7p12-0000R0-S8@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20161118193542.GO1041@n2100.armlinux.org.uk>

Rather than reporting success for a short transfer due to interrupt
latency, report an error both to the caller, as well as to the kernel
log.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/i2c/busses/i2c-designware-core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 9703fe392543..c53058d6139c 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -758,7 +758,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 	}
 
 	/* no error */
-	if (likely(!dev->cmd_err)) {
+	if (likely(!dev->cmd_err && !dev->status)) {
 		ret = num;
 		goto done;
 	}
@@ -768,6 +768,11 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 		ret = i2c_dw_handle_tx_abort(dev);
 		goto done;
 	}
+
+	if (dev->status)
+		dev_err(dev->dev,
+			"transfer terminated early - interrupt latency too high?\n");
+
 	ret = -EIO;
 
 done:
-- 
2.7.4

  reply	other threads:[~2016-11-18 19:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 19:35 [BUG] i2c-designware silently fails on long transfers Russell King - ARM Linux
2016-11-18 19:35 ` Russell King - ARM Linux
2016-11-18 19:40 ` Russell King [this message]
2016-11-18 19:40   ` [PATCH 1/2] i2c: designware: report short transfers Russell King
2016-11-21 10:32   ` Mika Westerberg
2016-11-21 10:32     ` Mika Westerberg
2016-11-23 14:13     ` Jarkko Nikula
2016-11-23 14:13       ` Jarkko Nikula
2016-11-24 15:18   ` Wolfram Sang
2016-11-24 15:18     ` Wolfram Sang
2016-11-18 19:40 ` [PATCH 2/2] i2c: designware: fix rx fifo depth tracking Russell King
2016-11-18 19:40   ` Russell King
2016-11-21 10:40   ` Mika Westerberg
2016-11-21 10:40     ` Mika Westerberg
2016-11-23 14:13     ` Jarkko Nikula
2016-11-23 14:13       ` Jarkko Nikula
2016-11-24 15:18   ` Wolfram Sang
2016-11-24 15:18     ` Wolfram Sang
2016-11-21 10:29 ` [BUG] i2c-designware silently fails on long transfers Mika Westerberg
2016-11-21 10:29   ` Mika Westerberg
2016-11-21 10:43   ` Russell King - ARM Linux
2016-11-21 10:43     ` Russell King - ARM Linux
2016-11-21 11:09     ` Mika Westerberg
2016-11-21 11:09       ` Mika Westerberg
2016-11-21 11:21     ` Liviu Dudau
2016-11-21 11:21       ` Liviu Dudau
2016-11-21 11:36       ` Russell King - ARM Linux
2016-11-21 11:36         ` Russell King - ARM Linux
2016-11-21 12:11     ` Robin Murphy
2016-11-21 12:11       ` Robin Murphy

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=E1c7p12-0000R0-S8@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=Andrew.Jackson@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.