All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: mv64xxx: Fix locked bus when offload is selected but not used on a message
@ 2014-02-07 10:55 ` Gregory CLEMENT
  0 siblings, 0 replies; 44+ messages in thread
From: Gregory CLEMENT @ 2014-02-07 10:55 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, Jason Cooper, Andrew Lunn, Gregory CLEMENT
  Cc: Thomas Petazzoni, Ezequiel Garcia, Sebastian Hesselbarth,
	linux-arm-kernel, Kevin Hilman, stable

Offload can be used only on regular transactions and for 1 to byte
transfers. In the other cases we switch back to usual work flow.

In this case we need to call mv64xxx_i2c_prepare_for_io() as this
function is not used when we try to use offloading.

This commit adds this missing call when offloading have failed in the
MV64XXX_I2C_ACTION_OFFLOAD_SEND_START case.

This fix the timeout seen when the the i2c driver try to access an
address where the device is absent on the Armada XP bases board.

Cc: stable@vger.kernel.org # v3.12+
Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support)

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/i2c/busses/i2c-mv64xxx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index b8c5187b9ee0..a1700c62d955 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -461,8 +461,15 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
 	case MV64XXX_I2C_ACTION_OFFLOAD_SEND_START:
 		if (!mv64xxx_i2c_offload_msg(drv_data))
 			break;
-		else
+		else {
 			drv_data->action = MV64XXX_I2C_ACTION_SEND_START;
+			/*
+			 * Switch to the standard path, so we finally need to
+			 * prepare the io that have not been done in
+			 * mv64xxx_i2c_execute_msg
+			 */
+			mv64xxx_i2c_prepare_for_io(drv_data, drv_data->msgs);
+		}
 		/* FALLTHRU */
 	case MV64XXX_I2C_ACTION_SEND_START:
 		writel(drv_data->cntl_bits | MV64XXX_I2C_REG_CONTROL_START,
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2014-03-10 16:25 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 10:55 [PATCH] i2c: mv64xxx: Fix locked bus when offload is selected but not used on a message Gregory CLEMENT
2014-02-07 10:55 ` Gregory CLEMENT
2014-02-07 15:09 ` Jason Cooper
2014-02-07 15:09   ` Jason Cooper
2014-02-07 15:18   ` Gregory CLEMENT
2014-02-07 15:18     ` Gregory CLEMENT
     [not found]   ` <20140207150958.GY8533-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2014-02-07 18:09     ` Kevin Hilman
2014-02-07 18:09       ` Kevin Hilman
2014-02-07 18:13       ` Jason Cooper
2014-02-07 18:13         ` Jason Cooper
     [not found] ` <1391770588-1344-1-git-send-email-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-02-08 17:01   ` Jason Cooper
2014-02-08 17:01     ` Jason Cooper
2014-02-13  9:41 ` Wolfram Sang
2014-02-13  9:41   ` Wolfram Sang
2014-02-13 14:23   ` Gregory CLEMENT
2014-02-13 14:23     ` Gregory CLEMENT
2014-02-13 20:36   ` [PATCH 0/5] mv64xxx updates Wolfram Sang
2014-02-13 20:36     ` Wolfram Sang
     [not found]     ` <1392323793-4125-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-02-13 20:36       ` [PATCH 1/5] i2c: mv64xxx: put offload check into offload prepare function Wolfram Sang
2014-02-13 20:36         ` Wolfram Sang
     [not found]         ` <1392323793-4125-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-02-14 11:38           ` Gregory CLEMENT
2014-02-14 11:38             ` Gregory CLEMENT
2014-02-13 20:36       ` [PATCH 2/5] i2c: mv64xxx: refactor message start to ensure proper initialization Wolfram Sang
2014-02-13 20:36         ` Wolfram Sang
     [not found]         ` <1392323793-4125-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-02-14 11:39           ` Gregory CLEMENT
2014-02-14 11:39             ` Gregory CLEMENT
     [not found]             ` <52FE0056.2030706-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-02-15 14:44               ` Wolfram Sang
2014-02-15 14:44                 ` Wolfram Sang
2014-02-13 20:36       ` [PATCH 3/5] i2c: mv64xxx: refactor send_start Wolfram Sang
2014-02-13 20:36         ` Wolfram Sang
     [not found]         ` <1392323793-4125-4-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-02-14 11:42           ` Gregory CLEMENT
2014-02-14 11:42             ` Gregory CLEMENT
2014-02-13 20:36       ` [PATCH 4/5] i2c: mv64xxx: directly call send_start when initializing transfer Wolfram Sang
2014-02-13 20:36         ` Wolfram Sang
2014-02-13 20:36       ` [PATCH 5/5] i2c: mv64xxx: refactor initialization for new msgs Wolfram Sang
2014-02-13 20:36         ` Wolfram Sang
2014-02-13 20:41       ` [PATCH 0/5] mv64xxx updates Gregory CLEMENT
2014-02-13 20:41         ` Gregory CLEMENT
     [not found]         ` <52FD2E0C.10609-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-03-10 16:25           ` Wolfram Sang
2014-03-10 16:25             ` Wolfram Sang
2014-02-13 20:51       ` Thomas Petazzoni
2014-02-13 20:51         ` Thomas Petazzoni
2014-02-18 11:29         ` Maxime Ripard
2014-02-18 11:29           ` Maxime Ripard

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.