* [PATCH] serial: samsung: move clock deactivation below uart registration
@ 2013-12-04 23:54 Heiko Stübner
2013-12-10 13:52 ` Tomasz Figa
2014-01-21 14:26 ` Heiko Stübner
0 siblings, 2 replies; 4+ messages in thread
From: Heiko Stübner @ 2013-12-04 23:54 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, linux-serial, linux-kernel, linux-samsung-soc,
Kukjin Kim, Chander Kashyap
Commit 60e93575476f (serial: samsung: enable clock before clearing pending
interrupts during init) added handling of the controller clock during init.
On most systems this clock is also one of the baud_clock sources and
possibly used by the earlycon and thus already enabled by the bootloader.
Therefore a gap exists between s3c24xx_serial_init_port disabling the
clock and an attached console reenabling it, making the transition from
earlycon to regular console possibly hang the system - as seen on my
S3C2442 based Freerunner today.
Therefore move the disabling of the clock from s3c24xx_serial_init_port
below the uart port registration, effectively creating an overlap and
keeping the clock running non-stop if the console wants to grab this port.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
drivers/tty/serial/samsung.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c1af04d..9cd706d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1209,7 +1209,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
/* reset the fifos (and setup the uart) */
s3c24xx_serial_resetport(port, cfg);
- clk_disable_unprepare(ourport->clk);
return 0;
}
@@ -1287,6 +1286,13 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
platform_set_drvdata(pdev, &ourport->port);
+ /*
+ * Deactivate the clock enabled in s3c24xx_serial_init_port here,
+ * so that a potential re-enablement through the pm-callback overlaps
+ * and keeps the clock enabled in this case.
+ */
+ clk_disable_unprepare(ourport->clk);
+
#ifdef CONFIG_SAMSUNG_CLOCK
ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
if (ret < 0)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: samsung: move clock deactivation below uart registration
2013-12-04 23:54 [PATCH] serial: samsung: move clock deactivation below uart registration Heiko Stübner
@ 2013-12-10 13:52 ` Tomasz Figa
2014-01-21 14:26 ` Heiko Stübner
1 sibling, 0 replies; 4+ messages in thread
From: Tomasz Figa @ 2013-12-10 13:52 UTC (permalink / raw)
To: Heiko Stübner
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel,
linux-samsung-soc, Kukjin Kim, Chander Kashyap
Hi Heiko,
On Thursday 05 of December 2013 00:54:38 Heiko Stübner wrote:
> Commit 60e93575476f (serial: samsung: enable clock before clearing pending
> interrupts during init) added handling of the controller clock during init.
>
> On most systems this clock is also one of the baud_clock sources and
> possibly used by the earlycon and thus already enabled by the bootloader.
>
> Therefore a gap exists between s3c24xx_serial_init_port disabling the
> clock and an attached console reenabling it, making the transition from
> earlycon to regular console possibly hang the system - as seen on my
> S3C2442 based Freerunner today.
>
> Therefore move the disabling of the clock from s3c24xx_serial_init_port
> below the uart port registration, effectively creating an overlap and
> keeping the clock running non-stop if the console wants to grab this port.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> drivers/tty/serial/samsung.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Makes sense.
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Best regards,
Tomasz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: samsung: move clock deactivation below uart registration
2013-12-04 23:54 [PATCH] serial: samsung: move clock deactivation below uart registration Heiko Stübner
2013-12-10 13:52 ` Tomasz Figa
@ 2014-01-21 14:26 ` Heiko Stübner
2014-01-21 17:24 ` Greg Kroah-Hartman
1 sibling, 1 reply; 4+ messages in thread
From: Heiko Stübner @ 2014-01-21 14:26 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, linux-serial, linux-kernel, linux-samsung-soc,
Kukjin Kim, Chander Kashyap
Hi Greg,
just wanted to ask about the state of this patch. I can see it in your branch
named "fixes" [0] but it seems it hasn't made its way into the kernel neither
during the 3.13-rcs or with your 3.14-pull [1].
Thanks
Heiko
[0] https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/log/?h=fixes
[1]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bcee63488ece9a0fca8be19951428a7b41001e66
Am Donnerstag, 5. Dezember 2013, 00:54:38 schrieb Heiko Stübner:
> Commit 60e93575476f (serial: samsung: enable clock before clearing pending
> interrupts during init) added handling of the controller clock during init.
>
> On most systems this clock is also one of the baud_clock sources and
> possibly used by the earlycon and thus already enabled by the bootloader.
>
> Therefore a gap exists between s3c24xx_serial_init_port disabling the
> clock and an attached console reenabling it, making the transition from
> earlycon to regular console possibly hang the system - as seen on my
> S3C2442 based Freerunner today.
>
> Therefore move the disabling of the clock from s3c24xx_serial_init_port
> below the uart port registration, effectively creating an overlap and
> keeping the clock running non-stop if the console wants to grab this port.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> drivers/tty/serial/samsung.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c1af04d..9cd706d 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -1209,7 +1209,6 @@ static int s3c24xx_serial_init_port(struct
> s3c24xx_uart_port *ourport,
>
> /* reset the fifos (and setup the uart) */
> s3c24xx_serial_resetport(port, cfg);
> - clk_disable_unprepare(ourport->clk);
> return 0;
> }
>
> @@ -1287,6 +1286,13 @@ static int s3c24xx_serial_probe(struct
> platform_device *pdev) uart_add_one_port(&s3c24xx_uart_drv,
> &ourport->port);
> platform_set_drvdata(pdev, &ourport->port);
>
> + /*
> + * Deactivate the clock enabled in s3c24xx_serial_init_port here,
> + * so that a potential re-enablement through the pm-callback overlaps
> + * and keeps the clock enabled in this case.
> + */
> + clk_disable_unprepare(ourport->clk);
> +
> #ifdef CONFIG_SAMSUNG_CLOCK
> ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
> if (ret < 0)
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: samsung: move clock deactivation below uart registration
2014-01-21 14:26 ` Heiko Stübner
@ 2014-01-21 17:24 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2014-01-21 17:24 UTC (permalink / raw)
To: Heiko Stübner
Cc: Jiri Slaby, linux-serial, linux-kernel, linux-samsung-soc,
Kukjin Kim, Chander Kashyap
On Tue, Jan 21, 2014 at 03:26:42PM +0100, Heiko Stübner wrote:
> Hi Greg,
>
> just wanted to ask about the state of this patch. I can see it in your branch
> named "fixes" [0] but it seems it hasn't made its way into the kernel neither
> during the 3.13-rcs or with your 3.14-pull [1].
>
>
> Thanks
> Heiko
>
>
> [0] https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/log/?h=fixes
> [1]
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bcee63488ece9a0fca8be19951428a7b41001e66
Ah crap, I missed this, sorry, I'll get it to Linus in time for
3.14-final, sorry about that.
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-21 17:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 23:54 [PATCH] serial: samsung: move clock deactivation below uart registration Heiko Stübner
2013-12-10 13:52 ` Tomasz Figa
2014-01-21 14:26 ` Heiko Stübner
2014-01-21 17:24 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).