[PATCH] ARM: OMAP4: hwmod: Fix SOFTRESET logic for OMAP4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 01142519ffc0734436f26b01aeed37a915dece05 upstream.

Upstream commit 313a76ee11cda6700548afe68499ef174a240688,
(2c64388e8bde7f654167ac2dca485e9545dd6915 in linux-stable branch linux-3.4.y)
"ARM: OMAP2+: hwmod: Fix SOFTRESET logic" introduced softreset bit cleaning
right after set one. It is caused L3 error for OMAP4 ISS because ISS register
write occurs when ISS reset process is in progress.
Avoid this situation by cleaning softreset bit later, when reset process
is successfully finished.

Signed-off-by: Illia Smyrnov <illia.smyrnov@xxxxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
 This patch is for linux-3.4.y linux-stable branch.

 arch/arm/mach-omap2/omap_hwmod.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index bb7ed98..64be1c7 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1452,11 +1452,6 @@ static int _ocp_softreset(struct omap_hwmod *oh)
 		goto dis_opt_clks;
 
 	_write_sysconfig(v, oh);
-	ret = _clear_softreset(oh, &v);
-	if (ret)
-		goto dis_opt_clks;
-
-	_write_sysconfig(v, oh);
 
 	if (oh->class->sysc->srst_udelay)
 		udelay(oh->class->sysc->srst_udelay);
@@ -1474,19 +1469,26 @@ static int _ocp_softreset(struct omap_hwmod *oh)
 				  MAX_MODULE_SOFTRESET_WAIT, c);
 	}
 
-	if (c == MAX_MODULE_SOFTRESET_WAIT)
+	if (c == MAX_MODULE_SOFTRESET_WAIT) {
 		pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",
 			   oh->name, MAX_MODULE_SOFTRESET_WAIT);
-	else
+		ret = -ETIMEDOUT;
+		goto dis_opt_clks;
+	} else {
 		pr_debug("omap_hwmod: %s: softreset in %d usec\n", oh->name, c);
+	}
+
+	ret = _clear_softreset(oh, &v);
+	if (ret)
+		goto dis_opt_clks;
+
+	_write_sysconfig(v, oh);
 
 	/*
 	 * XXX add _HWMOD_STATE_WEDGED for modules that don't come back from
 	 * _wait_target_ready() or _reset()
 	 */
 
-	ret = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
-
 dis_opt_clks:
 	if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
 		_disable_optional_clocks(oh);
-- 
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]