diff mbox

[v4,3/3] i2c: mv64xxx: Fix bus hang on A0 version of the Armada XP SoCs

Message ID 1389112504-9931-4-git-send-email-gregory.clement@free-electrons.com
State Superseded
Headers show

Commit Message

Gregory CLEMENT Jan. 7, 2014, 4:35 p.m. UTC
The first variants of Armada XP SoCs (A0 stepping) have issues related
to the i2c controller which prevent to use the offload mechanism and
lead to a kernel hang during boot.

The driver now checks if offload the mechanism is tagged as broken
and enable it in the opposite case.

Cc: stable@vger.kernel.org
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/i2c/busses/i2c-mv64xxx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni Jan. 7, 2014, 10:17 p.m. UTC | #1
Dear Gregory CLEMENT,

On Tue,  7 Jan 2014 17:35:04 +0100, Gregory CLEMENT wrote:

>  	if (of_device_is_compatible(np, "marvell,mv78230-i2c")) {
> -		drv_data->offload_enabled = true;
>  		drv_data->errata_delay = true;
> +
> +		if (!of_find_property(np, "offload-broken", NULL))
> +			drv_data->offload_enabled = true;
>  	}

I think of_property_read_bool() is more appropriate than
of_find_property() in this situation, because offload-broken is indeed
a boolean property.

Something like:

		drv_data->offload_enable = !of_property_read_bool(np, "offload-broken");

Thanks!

Thomas
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 8be7e42aa4de..de819daa19e6 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -779,8 +779,10 @@  mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
 	 * Transaction Generator support and the errata fix.
 	 */
 	if (of_device_is_compatible(np, "marvell,mv78230-i2c")) {
-		drv_data->offload_enabled = true;
 		drv_data->errata_delay = true;
+
+		if (!of_find_property(np, "offload-broken", NULL))
+			drv_data->offload_enabled = true;
 	}
 
 out: