Linux Samsung SOC development
 help / color / mirror / Atom feed
* [v2 PATCH 0/2] EXYNOS: Fix low level debug support
@ 2013-07-14 12:46 Yadwinder Singh Brar
  2013-07-14 12:46 ` [PATCH 2/2] ARM: " Yadwinder Singh Brar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yadwinder Singh Brar @ 2013-07-14 12:46 UTC (permalink / raw)
  To: kgene
  Cc: linux-samsung-soc, arnd, olof, dianders, thomas.abraham, t.figa,
	yadi.brar01, Yadwinder Singh Brar

Presently, using exynos_defconfig with CONFIG_DEBUG_LL and CONFIG_EARLY_PRINTK
on, kernel is not booting, we are getting following:

[    0.000000] ------------[ cut here ]------------
[    0.000000] kernel BUG at mm/vmalloc.c:1134!
[    0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.11.0-rc1 #633
[    0.000000] task: c052ec48 ti: c0524000 task.ti: c0524000
[    0.000000] PC is at vm_area_add_early+0x54/0x94
[    0.000000] LR is at add_static_vm_early+0xc/0x60

Its because exynos[4/5]_map_io() function ioremaps a single 512KB memory
size for all the four uart ports which envelopes the mapping created by
debug_ll_io_init(), called earlier in exynos_init_io().

This issue seems to be occured after :
commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings

This series removes static iodesc entries for UART controller for all Samsung
SoC's and modifies pm debug code to save/restore only the selected debug uart
registers.

changes since v1:
- removed uart iodesc entires instead of just moving inside CONFIG_DEBUG_LL
  check, as suggested by Thomas Abraham.
- Fixed the possible issue after removing uart entries pointed by Tomasz Figa.

Tested doing suspend/resume on smdk5250.

Yadwinder Singh Brar (2):
  ARM: SAMSUNG: pm: Save/restore only selected uart's registers
  ARM: EXYNOS: Fix low level debug support

 arch/arm/mach-exynos/common.c |   26 --------------------------
 arch/arm/plat-samsung/pm.c    |   14 +++-----------
 2 files changed, 3 insertions(+), 37 deletions(-)

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

* [PATCH 2/2] ARM: EXYNOS: Fix low level debug support
  2013-07-14 12:46 [v2 PATCH 0/2] EXYNOS: Fix low level debug support Yadwinder Singh Brar
@ 2013-07-14 12:46 ` Yadwinder Singh Brar
  2013-07-14 12:47 ` [PATCH 1/2] ARM: SAMSUNG: pm: Save/restore only selected uart's registers Yadwinder Singh Brar
  2013-07-24  8:01 ` [v2 PATCH 0/2] EXYNOS: Fix low level debug support Kukjin Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Yadwinder Singh Brar @ 2013-07-14 12:46 UTC (permalink / raw)
  To: kgene
  Cc: linux-samsung-soc, arnd, olof, dianders, thomas.abraham, t.figa,
	yadi.brar01, Yadwinder Singh Brar

Presently, using exynos_defconfig with CONFIG_DEBUG_LL and CONFIG_EARLY_PRIN
on, kernel is not booting, we are getting following:

[    0.000000] ------------[ cut here ]------------
[    0.000000] kernel BUG at mm/vmalloc.c:1134!
[    0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.11.0-rc1 #633
[    0.000000] task: c052ec48 ti: c0524000 task.ti: c0524000
[    0.000000] PC is at vm_area_add_early+0x54/0x94
[    0.000000] LR is at add_static_vm_early+0xc/0x60

Its because exynos[4/5]_map_io() function ioremaps a single 512KB memory
size for all the four uart ports which envelopes the mapping created by
debug_ll_io_init(), called earlier in exynos_init_io().

This patch removes iodesc entries for UART controller for all Samsung SoC's,
since now the Samsung uart driver does a ioremap during probe and any needed
iomapping for earlyprintk will be handled by debug_ll_io_init().

Tested on smdk4412 and smdk5250.

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
---
 arch/arm/mach-exynos/common.c |   26 --------------------------
 1 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 164685b..ba95e5d 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -58,7 +58,6 @@ static const char name_exynos5440[] = "EXYNOS5440";
 
 static void exynos4_map_io(void);
 static void exynos5_map_io(void);
-static void exynos5440_map_io(void);
 static int exynos_init(void);
 
 static struct cpu_table cpu_ids[] __initdata = {
@@ -95,7 +94,6 @@ static struct cpu_table cpu_ids[] __initdata = {
 	}, {
 		.idcode		= EXYNOS5440_SOC_ID,
 		.idmask		= EXYNOS5_SOC_MASK,
-		.map_io		= exynos5440_map_io,
 		.init		= exynos_init,
 		.name		= name_exynos5440,
 	},
@@ -150,11 +148,6 @@ static struct map_desc exynos4_iodesc[] __initdata = {
 		.length		= SZ_64K,
 		.type		= MT_DEVICE,
 	}, {
-		.virtual	= (unsigned long)S3C_VA_UART,
-		.pfn		= __phys_to_pfn(EXYNOS4_PA_UART),
-		.length		= SZ_512K,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)S5P_VA_CMU,
 		.pfn		= __phys_to_pfn(EXYNOS4_PA_CMU),
 		.length		= SZ_128K,
@@ -268,20 +261,6 @@ static struct map_desc exynos5_iodesc[] __initdata = {
 		.pfn		= __phys_to_pfn(EXYNOS5_PA_PMU),
 		.length		= SZ_64K,
 		.type		= MT_DEVICE,
-	}, {
-		.virtual	= (unsigned long)S3C_VA_UART,
-		.pfn		= __phys_to_pfn(EXYNOS5_PA_UART),
-		.length		= SZ_512K,
-		.type		= MT_DEVICE,
-	},
-};
-
-static struct map_desc exynos5440_iodesc0[] __initdata = {
-	{
-		.virtual	= (unsigned long)S3C_VA_UART,
-		.pfn		= __phys_to_pfn(EXYNOS5440_PA_UART0),
-		.length		= SZ_512K,
-		.type		= MT_DEVICE,
 	},
 };
 
@@ -388,11 +367,6 @@ static void __init exynos5_map_io(void)
 		iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc));
 }
 
-static void __init exynos5440_map_io(void)
-{
-	iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
-}
-
 void __init exynos_init_time(void)
 {
 	of_clk_init(NULL);
-- 
1.7.0.4

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

* [PATCH 1/2] ARM: SAMSUNG: pm: Save/restore only selected uart's registers
  2013-07-14 12:46 [v2 PATCH 0/2] EXYNOS: Fix low level debug support Yadwinder Singh Brar
  2013-07-14 12:46 ` [PATCH 2/2] ARM: " Yadwinder Singh Brar
@ 2013-07-14 12:47 ` Yadwinder Singh Brar
  2013-07-24  8:01 ` [v2 PATCH 0/2] EXYNOS: Fix low level debug support Kukjin Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Yadwinder Singh Brar @ 2013-07-14 12:47 UTC (permalink / raw)
  To: kgene
  Cc: linux-samsung-soc, arnd, olof, dianders, thomas.abraham, t.figa,
	yadi.brar01, Yadwinder Singh Brar

Basically this code gets executed only during debugging i.e when DEBUG_LL &
SAMSUNG_PM_DEBUG is on, so required only for UART used for debugging.
Since we are removing static iodesc entries for UARTs, so now only the selected
(CONFIG_DEBUG_S3C_UART) UART will be ioremapped by the debug_ll_io_init() for
DEBUG_LL, so save/restore uart registers only for selected uart.

Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
---
 arch/arm/plat-samsung/pm.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index ea36136..d0c2301 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -80,7 +80,7 @@ unsigned char pm_uart_udivslot;
 
 #ifdef CONFIG_SAMSUNG_PM_DEBUG
 
-static struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
+static struct pm_uart_save uart_save;
 
 static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
 {
@@ -101,11 +101,7 @@ static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
 
 static void s3c_pm_save_uarts(void)
 {
-	struct pm_uart_save *save = uart_save;
-	unsigned int uart;
-
-	for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++)
-		s3c_pm_save_uart(uart, save);
+	s3c_pm_save_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
 }
 
 static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
@@ -126,11 +122,7 @@ static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
 
 static void s3c_pm_restore_uarts(void)
 {
-	struct pm_uart_save *save = uart_save;
-	unsigned int uart;
-
-	for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++)
-		s3c_pm_restore_uart(uart, save);
+	s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
 }
 #else
 static void s3c_pm_save_uarts(void) { }
-- 
1.7.0.4

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

* RE: [v2 PATCH 0/2] EXYNOS: Fix low level debug support
  2013-07-14 12:46 [v2 PATCH 0/2] EXYNOS: Fix low level debug support Yadwinder Singh Brar
  2013-07-14 12:46 ` [PATCH 2/2] ARM: " Yadwinder Singh Brar
  2013-07-14 12:47 ` [PATCH 1/2] ARM: SAMSUNG: pm: Save/restore only selected uart's registers Yadwinder Singh Brar
@ 2013-07-24  8:01 ` Kukjin Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Kukjin Kim @ 2013-07-24  8:01 UTC (permalink / raw)
  To: 'Yadwinder Singh Brar'
  Cc: linux-samsung-soc, arnd, olof, dianders, thomas.abraham, t.figa,
	yadi.brar01

Yadwinder Singh Brar wrote:
> 
> Presently, using exynos_defconfig with CONFIG_DEBUG_LL and
> CONFIG_EARLY_PRINTK
> on, kernel is not booting, we are getting following:
> 
> [    0.000000] ------------[ cut here ]------------
> [    0.000000] kernel BUG at mm/vmalloc.c:1134!
> [    0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
> [    0.000000] Modules linked in:
> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 3.11.0-rc1 #633
> [    0.000000] task: c052ec48 ti: c0524000 task.ti: c0524000
> [    0.000000] PC is at vm_area_add_early+0x54/0x94
> [    0.000000] LR is at add_static_vm_early+0xc/0x60
> 
> Its because exynos[4/5]_map_io() function ioremaps a single 512KB memory
> size for all the four uart ports which envelopes the mapping created by
> debug_ll_io_init(), called earlier in exynos_init_io().
> 
> This issue seems to be occured after :
> commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
> ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
> 
> This series removes static iodesc entries for UART controller for all
> Samsung
> SoC's and modifies pm debug code to save/restore only the selected debug
> uart
> registers.
> 
> changes since v1:
> - removed uart iodesc entires instead of just moving inside
> CONFIG_DEBUG_LL
>   check, as suggested by Thomas Abraham.
> - Fixed the possible issue after removing uart entries pointed by Tomasz
> Figa.
> 
> Tested doing suspend/resume on smdk5250.
> 
> Yadwinder Singh Brar (2):
>   ARM: SAMSUNG: pm: Save/restore only selected uart's registers
>   ARM: EXYNOS: Fix low level debug support
> 
>  arch/arm/mach-exynos/common.c |   26 --------------------------
>  arch/arm/plat-samsung/pm.c    |   14 +++-----------
>  2 files changed, 3 insertions(+), 37 deletions(-)

This series looks good to me, applied into -fixes.

Just note, I was looking at the static iodesc for UART because of booting
problem ;)

Anyway, thanks,
Kukjin

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

end of thread, other threads:[~2013-07-24  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-14 12:46 [v2 PATCH 0/2] EXYNOS: Fix low level debug support Yadwinder Singh Brar
2013-07-14 12:46 ` [PATCH 2/2] ARM: " Yadwinder Singh Brar
2013-07-14 12:47 ` [PATCH 1/2] ARM: SAMSUNG: pm: Save/restore only selected uart's registers Yadwinder Singh Brar
2013-07-24  8:01 ` [v2 PATCH 0/2] EXYNOS: Fix low level debug support Kukjin Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox