All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
@ 2011-05-28  2:04 ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-28  2:04 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc
  Cc: Boojin Kim, Greg Kroah-Hartman, Kukjin Kim

From: Boojin Kim <boojin.kim@samsung.com>

This patch fixes the way of comparison for handling of two or more
clock sources for UART.

For example, if just only one clock source is defined even though
there are two clock sources for UART, the serial driver does not
set proper clock up. Of course, it is problem.

So this patch changes the condition of comparison to avoid useless
setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
selection of source clock is not required.

In addition, since the Exynos4210 has only one clock source for UART
this patch adds the flag into its common_init_uarts().

Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-exynos4/init.c                     |    1 +
 arch/arm/plat-samsung/include/plat/regs-serial.h |    2 ++
 drivers/tty/serial/s5pv210.c                     |    4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos4/init.c b/arch/arm/mach-exynos4/init.c
index cf91f50..a8a83e3 100644
--- a/arch/arm/mach-exynos4/init.c
+++ b/arch/arm/mach-exynos4/init.c
@@ -35,6 +35,7 @@ void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 			tcfg->clocks = exynos4_serial_clocks;
 			tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
 		}
+		tcfg->flags |= NO_NEED_CHECK_CLKSRC;
 	}
 
 	s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h
index 788837e..d2ef07f 100644
--- a/arch/arm/plat-samsung/include/plat/regs-serial.h
+++ b/arch/arm/plat-samsung/include/plat/regs-serial.h
@@ -224,6 +224,8 @@
 #define S5PV210_UFSTAT_RXMASK	(255<<0)
 #define S5PV210_UFSTAT_RXSHIFT	(0)
 
+#define NO_NEED_CHECK_CLKSRC	1
+
 #ifndef __ASSEMBLY__
 
 /* struct s3c24xx_uart_clksrc
diff --git a/drivers/tty/serial/s5pv210.c b/drivers/tty/serial/s5pv210.c
index 6ebccd7..453e5b7 100644
--- a/drivers/tty/serial/s5pv210.c
+++ b/drivers/tty/serial/s5pv210.c
@@ -31,7 +31,7 @@ static int s5pv210_serial_setsource(struct uart_port *port,
 	struct s3c2410_uartcfg *cfg = port->dev->platform_data;
 	unsigned long ucon = rd_regl(port, S3C2410_UCON);
 
-	if ((cfg->clocks_size) == 1)
+	if (cfg->flags & NO_NEED_CHECK_CLKSRC)
 		return 0;
 
 	if (strcmp(clk->name, "pclk") == 0)
@@ -56,7 +56,7 @@ static int s5pv210_serial_getsource(struct uart_port *port,
 
 	clk->divisor = 1;
 
-	if ((cfg->clocks_size) == 1)
+	if (cfg->flags & NO_NEED_CHECK_CLKSRC)
 		return 0;
 
 	switch (ucon & S5PV210_UCON_CLKMASK) {
-- 
1.7.4.4

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

* [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
@ 2011-05-28  2:04 ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-28  2:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Boojin Kim <boojin.kim@samsung.com>

This patch fixes the way of comparison for handling of two or more
clock sources for UART.

For example, if just only one clock source is defined even though
there are two clock sources for UART, the serial driver does not
set proper clock up. Of course, it is problem.

So this patch changes the condition of comparison to avoid useless
setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
selection of source clock is not required.

In addition, since the Exynos4210 has only one clock source for UART
this patch adds the flag into its common_init_uarts().

Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-exynos4/init.c                     |    1 +
 arch/arm/plat-samsung/include/plat/regs-serial.h |    2 ++
 drivers/tty/serial/s5pv210.c                     |    4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos4/init.c b/arch/arm/mach-exynos4/init.c
index cf91f50..a8a83e3 100644
--- a/arch/arm/mach-exynos4/init.c
+++ b/arch/arm/mach-exynos4/init.c
@@ -35,6 +35,7 @@ void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 			tcfg->clocks = exynos4_serial_clocks;
 			tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
 		}
+		tcfg->flags |= NO_NEED_CHECK_CLKSRC;
 	}
 
 	s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h
index 788837e..d2ef07f 100644
--- a/arch/arm/plat-samsung/include/plat/regs-serial.h
+++ b/arch/arm/plat-samsung/include/plat/regs-serial.h
@@ -224,6 +224,8 @@
 #define S5PV210_UFSTAT_RXMASK	(255<<0)
 #define S5PV210_UFSTAT_RXSHIFT	(0)
 
+#define NO_NEED_CHECK_CLKSRC	1
+
 #ifndef __ASSEMBLY__
 
 /* struct s3c24xx_uart_clksrc
diff --git a/drivers/tty/serial/s5pv210.c b/drivers/tty/serial/s5pv210.c
index 6ebccd7..453e5b7 100644
--- a/drivers/tty/serial/s5pv210.c
+++ b/drivers/tty/serial/s5pv210.c
@@ -31,7 +31,7 @@ static int s5pv210_serial_setsource(struct uart_port *port,
 	struct s3c2410_uartcfg *cfg = port->dev->platform_data;
 	unsigned long ucon = rd_regl(port, S3C2410_UCON);
 
-	if ((cfg->clocks_size) == 1)
+	if (cfg->flags & NO_NEED_CHECK_CLKSRC)
 		return 0;
 
 	if (strcmp(clk->name, "pclk") == 0)
@@ -56,7 +56,7 @@ static int s5pv210_serial_getsource(struct uart_port *port,
 
 	clk->divisor = 1;
 
-	if ((cfg->clocks_size) == 1)
+	if (cfg->flags & NO_NEED_CHECK_CLKSRC)
 		return 0;
 
 	switch (ucon & S5PV210_UCON_CLKMASK) {
-- 
1.7.4.4

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

* Re: [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
  2011-05-28  2:04 ` Kukjin Kim
@ 2011-05-28  9:39   ` Greg KH
  -1 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2011-05-28  9:39 UTC (permalink / raw)
  To: Kukjin Kim; +Cc: linux-arm-kernel, linux-samsung-soc, Boojin Kim

On Fri, May 27, 2011 at 07:04:03PM -0700, Kukjin Kim wrote:
> From: Boojin Kim <boojin.kim@samsung.com>
> 
> This patch fixes the way of comparison for handling of two or more
> clock sources for UART.
> 
> For example, if just only one clock source is defined even though
> there are two clock sources for UART, the serial driver does not
> set proper clock up. Of course, it is problem.
> 
> So this patch changes the condition of comparison to avoid useless
> setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
> selection of source clock is not required.
> 
> In addition, since the Exynos4210 has only one clock source for UART
> this patch adds the flag into its common_init_uarts().
> 
> Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
> Cc: Greg Kroah-Hartman <greg@kroah.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/mach-exynos4/init.c                     |    1 +
>  arch/arm/plat-samsung/include/plat/regs-serial.h |    2 ++
>  drivers/tty/serial/s5pv210.c                     |    4 ++--
>  3 files changed, 5 insertions(+), 2 deletions(-)

Is this needed in older kernels as well (like .39)?

thanks,

greg k-h

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

* [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
@ 2011-05-28  9:39   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2011-05-28  9:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 27, 2011 at 07:04:03PM -0700, Kukjin Kim wrote:
> From: Boojin Kim <boojin.kim@samsung.com>
> 
> This patch fixes the way of comparison for handling of two or more
> clock sources for UART.
> 
> For example, if just only one clock source is defined even though
> there are two clock sources for UART, the serial driver does not
> set proper clock up. Of course, it is problem.
> 
> So this patch changes the condition of comparison to avoid useless
> setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
> selection of source clock is not required.
> 
> In addition, since the Exynos4210 has only one clock source for UART
> this patch adds the flag into its common_init_uarts().
> 
> Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
> Cc: Greg Kroah-Hartman <greg@kroah.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/mach-exynos4/init.c                     |    1 +
>  arch/arm/plat-samsung/include/plat/regs-serial.h |    2 ++
>  drivers/tty/serial/s5pv210.c                     |    4 ++--
>  3 files changed, 5 insertions(+), 2 deletions(-)

Is this needed in older kernels as well (like .39)?

thanks,

greg k-h

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

* Re: [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
  2011-05-28  9:39   ` Greg KH
@ 2011-05-30  1:24     ` Kukjin Kim
  -1 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-30  1:24 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-arm-kernel, linux-samsung-soc, Boojin Kim

On 05/28/11 02:39, Greg KH wrote:
> On Fri, May 27, 2011 at 07:04:03PM -0700, Kukjin Kim wrote:
>> From: Boojin Kim<boojin.kim@samsung.com>
>>
>> This patch fixes the way of comparison for handling of two or more
>> clock sources for UART.
>>
>> For example, if just only one clock source is defined even though
>> there are two clock sources for UART, the serial driver does not
>> set proper clock up. Of course, it is problem.
>>
>> So this patch changes the condition of comparison to avoid useless
>> setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
>> selection of source clock is not required.
>>
>> In addition, since the Exynos4210 has only one clock source for UART
>> this patch adds the flag into its common_init_uarts().
>>
>> Signed-off-by: Boojin Kim<boojin.kim@samsung.com>
>> Cc: Greg Kroah-Hartman<greg@kroah.com>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
>> ---
>>   arch/arm/mach-exynos4/init.c                     |    1 +
>>   arch/arm/plat-samsung/include/plat/regs-serial.h |    2 ++
>>   drivers/tty/serial/s5pv210.c                     |    4 ++--
>>   3 files changed, 5 insertions(+), 2 deletions(-)
>
> Is this needed in older kernels as well (like .39)?
>
Hi, Greg :)

Yes, we need this on 2.6.39 but don't need on .38 because the comparison 
codes has been merged during 39 merge window.

Could you please apply this on next .39 stable?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

* [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
@ 2011-05-30  1:24     ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-30  1:24 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/28/11 02:39, Greg KH wrote:
> On Fri, May 27, 2011 at 07:04:03PM -0700, Kukjin Kim wrote:
>> From: Boojin Kim<boojin.kim@samsung.com>
>>
>> This patch fixes the way of comparison for handling of two or more
>> clock sources for UART.
>>
>> For example, if just only one clock source is defined even though
>> there are two clock sources for UART, the serial driver does not
>> set proper clock up. Of course, it is problem.
>>
>> So this patch changes the condition of comparison to avoid useless
>> setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
>> selection of source clock is not required.
>>
>> In addition, since the Exynos4210 has only one clock source for UART
>> this patch adds the flag into its common_init_uarts().
>>
>> Signed-off-by: Boojin Kim<boojin.kim@samsung.com>
>> Cc: Greg Kroah-Hartman<greg@kroah.com>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
>> ---
>>   arch/arm/mach-exynos4/init.c                     |    1 +
>>   arch/arm/plat-samsung/include/plat/regs-serial.h |    2 ++
>>   drivers/tty/serial/s5pv210.c                     |    4 ++--
>>   3 files changed, 5 insertions(+), 2 deletions(-)
>
> Is this needed in older kernels as well (like .39)?
>
Hi, Greg :)

Yes, we need this on 2.6.39 but don't need on .38 because the comparison 
codes has been merged during 39 merge window.

Could you please apply this on next .39 stable?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

end of thread, other threads:[~2011-05-30  1:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-28  2:04 [PATCH] ARM: SAMSUNG: serial: Fix on handling of one clock source for UART Kukjin Kim
2011-05-28  2:04 ` Kukjin Kim
2011-05-28  9:39 ` Greg KH
2011-05-28  9:39   ` Greg KH
2011-05-30  1:24   ` Kukjin Kim
2011-05-30  1:24     ` Kukjin Kim

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.