All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: shawnguo@kernel.org
Cc: kernel@pengutronix.de, linux-imx@nxp.com,
	cniedermaier@dh-electronics.com,
	linux-arm-kernel@lists.infradead.org, anson.huang@nxp.com,
	Fabio Estevam <festevam@gmail.com>,
	stable@vger.kernel.org
Subject: [PATCH] ARM: imx: cpuidle-imx6sx: Restrict the SW2ISO increase to i.MX6SX
Date: Thu,  2 May 2019 08:30:20 -0300	[thread overview]
Message-ID: <20190502113020.8642-1-festevam@gmail.com> (raw)

Since commit 1e434b703248 ("ARM: imx: update the cpu power up timing
setting on i.mx6sx") some characters loss is noticed on i.MX6ULL UART
as reported by Christoph Niedermaier.

The intention of such commit was to increase the SW2ISO field for i.MX6SX
only, but since cpuidle-imx6sx is also used on i.MX6UL/i.MX6ULL this caused
unintended side effects on other SoCs.

Fix this problem by keeping the original SW2ISO value for i.MX6UL/i.MX6ULL
and only increase SW2ISO in the i.MX6SX case.

Cc: stable@vger.kernel.org
Fixes: 1e434b703248 ("ARM: imx: update the cpu power up timing setting on i.mx6sx")
Reported-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/cpuidle-imx6sx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c
index fd0053e47a15..57cb9c763222 100644
--- a/arch/arm/mach-imx/cpuidle-imx6sx.c
+++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
@@ -15,6 +15,7 @@
 
 #include "common.h"
 #include "cpuidle.h"
+#include "hardware.h"
 
 static int imx6sx_idle_finish(unsigned long val)
 {
@@ -99,8 +100,12 @@ static struct cpuidle_driver imx6sx_cpuidle_driver = {
 	.safe_state_index = 0,
 };
 
+#define SW2ISO_ORIGINAL		0x2
+#define SW2ISO_IMX6SX		0xf
 int __init imx6sx_cpuidle_init(void)
 {
+	u32 sw2iso = SW2ISO_ORIGINAL;
+
 	imx6_set_int_mem_clk_lpm(true);
 	imx6_enable_rbc(false);
 	imx_gpc_set_l2_mem_power_in_lpm(false);
@@ -110,7 +115,9 @@ int __init imx6sx_cpuidle_init(void)
 	 * except for power up sw2iso which need to be
 	 * larger than LDO ramp up time.
 	 */
-	imx_gpc_set_arm_power_up_timing(0xf, 1);
+	if (cpu_is_imx6sx())
+		sw2iso = SW2ISO_IMX6SX;
+	imx_gpc_set_arm_power_up_timing(sw2iso, 1);
 	imx_gpc_set_arm_power_down_timing(1, 1);
 
 	return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Fabio Estevam <festevam@gmail.com>
To: shawnguo@kernel.org
Cc: cniedermaier@dh-electronics.com, anson.huang@nxp.com,
	stable@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de,
	Fabio Estevam <festevam@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: cpuidle-imx6sx: Restrict the SW2ISO increase to i.MX6SX
Date: Thu,  2 May 2019 08:30:20 -0300	[thread overview]
Message-ID: <20190502113020.8642-1-festevam@gmail.com> (raw)

Since commit 1e434b703248 ("ARM: imx: update the cpu power up timing
setting on i.mx6sx") some characters loss is noticed on i.MX6ULL UART
as reported by Christoph Niedermaier.

The intention of such commit was to increase the SW2ISO field for i.MX6SX
only, but since cpuidle-imx6sx is also used on i.MX6UL/i.MX6ULL this caused
unintended side effects on other SoCs.

Fix this problem by keeping the original SW2ISO value for i.MX6UL/i.MX6ULL
and only increase SW2ISO in the i.MX6SX case.

Cc: stable@vger.kernel.org
Fixes: 1e434b703248 ("ARM: imx: update the cpu power up timing setting on i.mx6sx")
Reported-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/cpuidle-imx6sx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c
index fd0053e47a15..57cb9c763222 100644
--- a/arch/arm/mach-imx/cpuidle-imx6sx.c
+++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
@@ -15,6 +15,7 @@
 
 #include "common.h"
 #include "cpuidle.h"
+#include "hardware.h"
 
 static int imx6sx_idle_finish(unsigned long val)
 {
@@ -99,8 +100,12 @@ static struct cpuidle_driver imx6sx_cpuidle_driver = {
 	.safe_state_index = 0,
 };
 
+#define SW2ISO_ORIGINAL		0x2
+#define SW2ISO_IMX6SX		0xf
 int __init imx6sx_cpuidle_init(void)
 {
+	u32 sw2iso = SW2ISO_ORIGINAL;
+
 	imx6_set_int_mem_clk_lpm(true);
 	imx6_enable_rbc(false);
 	imx_gpc_set_l2_mem_power_in_lpm(false);
@@ -110,7 +115,9 @@ int __init imx6sx_cpuidle_init(void)
 	 * except for power up sw2iso which need to be
 	 * larger than LDO ramp up time.
 	 */
-	imx_gpc_set_arm_power_up_timing(0xf, 1);
+	if (cpu_is_imx6sx())
+		sw2iso = SW2ISO_IMX6SX;
+	imx_gpc_set_arm_power_up_timing(sw2iso, 1);
 	imx_gpc_set_arm_power_down_timing(1, 1);
 
 	return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-05-02 11:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 11:30 Fabio Estevam [this message]
2019-05-02 11:30 ` [PATCH] ARM: imx: cpuidle-imx6sx: Restrict the SW2ISO increase to i.MX6SX Fabio Estevam
2019-05-02 12:13 ` Sébastien Szymanski
2019-05-02 12:13   ` Sébastien Szymanski
     [not found] ` <20190502122645.C5FD52081C@mail.kernel.org>
2019-05-02 12:33   ` Fabio Estevam
2019-05-02 12:54     ` Fabio Estevam
2019-05-13  3:01       ` Shawn Guo
2019-05-03  8:23 ` [PATCH] ARM: imx: cpuidle-imx6sx: Restrict the SW2ISO increase to i.MX6SX [Klartext] Christoph Niedermaier
2019-05-03  8:23   ` Christoph Niedermaier

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=20190502113020.8642-1-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=anson.huang@nxp.com \
    --cc=cniedermaier@dh-electronics.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=shawnguo@kernel.org \
    --cc=stable@vger.kernel.org \
    /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.