* [PATCH] ARM: EXYNOS: Fix low level debug support
@ 2013-07-13 9:57 Yadwinder Singh Brar
2013-07-22 11:23 ` Thomas Abraham
0 siblings, 1 reply; 6+ messages in thread
From: Yadwinder Singh Brar @ 2013-07-13 9:57 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 iotable_init tries to map UART again which is already mapped by
debug_ll_io_init() call in exynos_init_io() within same virtal address range as
requested later.
This issue seems to be occured after :
commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
This patch moves S3C_UART iodesc(in iodesc_list) inside CONFIG_DEBUG_LL check.
Tested on 4412 and 5250 smdks.
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
---
arch/arm/mach-exynos/common.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 164685b..7f0591f 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -150,11 +150,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,
@@ -185,6 +180,14 @@ static struct map_desc exynos4_iodesc[] __initdata = {
.length = SZ_4K,
.type = MT_DEVICE,
},
+#ifndef CONFIG_DEBUG_LL
+ {
+ .virtual = (unsigned long)S3C_VA_UART,
+ .pfn = __phys_to_pfn(EXYNOS4_PA_UART),
+ .length = SZ_512K,
+ .type = MT_DEVICE,
+ },
+#endif
};
static struct map_desc exynos4_iodesc0[] __initdata = {
@@ -268,21 +271,26 @@ static struct map_desc exynos5_iodesc[] __initdata = {
.pfn = __phys_to_pfn(EXYNOS5_PA_PMU),
.length = SZ_64K,
.type = MT_DEVICE,
- }, {
+ },
+#ifndef CONFIG_DEBUG_LL
+ {
.virtual = (unsigned long)S3C_VA_UART,
.pfn = __phys_to_pfn(EXYNOS5_PA_UART),
.length = SZ_512K,
.type = MT_DEVICE,
},
+#endif
};
static struct map_desc exynos5440_iodesc0[] __initdata = {
+#ifndef CONFIG_DEBUG_LL
{
.virtual = (unsigned long)S3C_VA_UART,
.pfn = __phys_to_pfn(EXYNOS5440_PA_UART0),
.length = SZ_512K,
.type = MT_DEVICE,
},
+#endif
};
void exynos4_restart(enum reboot_mode mode, const char *cmd)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: EXYNOS: Fix low level debug support
2013-07-13 9:57 [PATCH] ARM: EXYNOS: Fix low level debug support Yadwinder Singh Brar
@ 2013-07-22 11:23 ` Thomas Abraham
2013-07-22 11:57 ` Yadwinder Singh Brar
2013-07-22 13:07 ` Tomasz Figa
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Abraham @ 2013-07-22 11:23 UTC (permalink / raw)
To: Yadwinder Singh Brar
Cc: kgene, linux-samsung-soc, arnd, olof, dianders, t.figa,
yadi.brar01
On 13 July 2013 04:57, Yadwinder Singh Brar <yadi.brar@samsung.com> 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 iotable_init tries to map UART again which is already mapped by
> debug_ll_io_init() call in exynos_init_io() within same virtal address range as
> requested later.
debug_ll_io_init ioremaps debug uart address space with 4KB size
whereas the exynos_init_io() function ioremaps a single 512KB memory
size for all the four uart ports which envelops the mapping created by
debug_ll_io_init. This is caught as a kernel bug.
>
> This issue seems to be occured after :
> commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
> ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
>
> This patch moves S3C_UART iodesc(in iodesc_list) inside CONFIG_DEBUG_LL check.
Instead of moving, all the such iodesc entries for UART controller can
be removed for all Samsung SoC's now since the Samsung uart driver
does a ioremap during probe and any needed iomapping for earlyprintk
is handled by debug_ll_io_init().
>
> Tested on 4412 and 5250 smdks.
>
> Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
> ---
> arch/arm/mach-exynos/common.c | 20 ++++++++++++++------
> 1 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
> index 164685b..7f0591f 100644
> --- a/arch/arm/mach-exynos/common.c
> +++ b/arch/arm/mach-exynos/common.c
> @@ -150,11 +150,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,
> @@ -185,6 +180,14 @@ static struct map_desc exynos4_iodesc[] __initdata = {
> .length = SZ_4K,
> .type = MT_DEVICE,
> },
> +#ifndef CONFIG_DEBUG_LL
> + {
> + .virtual = (unsigned long)S3C_VA_UART,
> + .pfn = __phys_to_pfn(EXYNOS4_PA_UART),
> + .length = SZ_512K,
> + .type = MT_DEVICE,
> + },
> +#endif
> };
>
> static struct map_desc exynos4_iodesc0[] __initdata = {
> @@ -268,21 +271,26 @@ static struct map_desc exynos5_iodesc[] __initdata = {
> .pfn = __phys_to_pfn(EXYNOS5_PA_PMU),
> .length = SZ_64K,
> .type = MT_DEVICE,
> - }, {
> + },
> +#ifndef CONFIG_DEBUG_LL
> + {
> .virtual = (unsigned long)S3C_VA_UART,
> .pfn = __phys_to_pfn(EXYNOS5_PA_UART),
> .length = SZ_512K,
> .type = MT_DEVICE,
> },
> +#endif
> };
>
> static struct map_desc exynos5440_iodesc0[] __initdata = {
> +#ifndef CONFIG_DEBUG_LL
> {
> .virtual = (unsigned long)S3C_VA_UART,
> .pfn = __phys_to_pfn(EXYNOS5440_PA_UART0),
> .length = SZ_512K,
> .type = MT_DEVICE,
> },
> +#endif
> };
>
> void exynos4_restart(enum reboot_mode mode, const char *cmd)
> --
> 1.7.0.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: EXYNOS: Fix low level debug support
2013-07-22 11:23 ` Thomas Abraham
@ 2013-07-22 11:57 ` Yadwinder Singh Brar
2013-07-22 13:07 ` Tomasz Figa
1 sibling, 0 replies; 6+ messages in thread
From: Yadwinder Singh Brar @ 2013-07-22 11:57 UTC (permalink / raw)
To: Thomas Abraham
Cc: Yadwinder Singh Brar, kgene, linux-samsung-soc, arnd, olof,
Doug Anderson, Tomasz Figa
Hi Thomas,
On Mon, Jul 22, 2013 at 4:53 PM, Thomas Abraham
<thomas.abraham@linaro.org> wrote:
> On 13 July 2013 04:57, Yadwinder Singh Brar <yadi.brar@samsung.com> 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 iotable_init tries to map UART again which is already mapped by
>> debug_ll_io_init() call in exynos_init_io() within same virtal address range as
>> requested later.
>
> debug_ll_io_init ioremaps debug uart address space with 4KB size
> whereas the exynos_init_io() function ioremaps a single 512KB memory
> size for all the four uart ports which envelops the mapping created by
> debug_ll_io_init. This is caught as a kernel bug.
>
Exactly !
>>
>> This issue seems to be occured after :
>> commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
>> ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
>>
>> This patch moves S3C_UART iodesc(in iodesc_list) inside CONFIG_DEBUG_LL check.
>
> Instead of moving, all the such iodesc entries for UART controller can
> be removed for all Samsung SoC's now since the Samsung uart driver
> does a ioremap during probe and any needed iomapping for earlyprintk
> is handled by debug_ll_io_init().
>
Ok, will do it.
TBH I was not sure about removing completely.
Thanks for review.
Regards,
Yadwinder
>>
>> Tested on 4412 and 5250 smdks.
>>
>> Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
>> ---
>> arch/arm/mach-exynos/common.c | 20 ++++++++++++++------
>> 1 files changed, 14 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
>> index 164685b..7f0591f 100644
>> --- a/arch/arm/mach-exynos/common.c
>> +++ b/arch/arm/mach-exynos/common.c
>> @@ -150,11 +150,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,
>> @@ -185,6 +180,14 @@ static struct map_desc exynos4_iodesc[] __initdata = {
>> .length = SZ_4K,
>> .type = MT_DEVICE,
>> },
>> +#ifndef CONFIG_DEBUG_LL
>> + {
>> + .virtual = (unsigned long)S3C_VA_UART,
>> + .pfn = __phys_to_pfn(EXYNOS4_PA_UART),
>> + .length = SZ_512K,
>> + .type = MT_DEVICE,
>> + },
>> +#endif
>> };
>>
>> static struct map_desc exynos4_iodesc0[] __initdata = {
>> @@ -268,21 +271,26 @@ static struct map_desc exynos5_iodesc[] __initdata = {
>> .pfn = __phys_to_pfn(EXYNOS5_PA_PMU),
>> .length = SZ_64K,
>> .type = MT_DEVICE,
>> - }, {
>> + },
>> +#ifndef CONFIG_DEBUG_LL
>> + {
>> .virtual = (unsigned long)S3C_VA_UART,
>> .pfn = __phys_to_pfn(EXYNOS5_PA_UART),
>> .length = SZ_512K,
>> .type = MT_DEVICE,
>> },
>> +#endif
>> };
>>
>> static struct map_desc exynos5440_iodesc0[] __initdata = {
>> +#ifndef CONFIG_DEBUG_LL
>> {
>> .virtual = (unsigned long)S3C_VA_UART,
>> .pfn = __phys_to_pfn(EXYNOS5440_PA_UART0),
>> .length = SZ_512K,
>> .type = MT_DEVICE,
>> },
>> +#endif
>> };
>>
>> void exynos4_restart(enum reboot_mode mode, const char *cmd)
>> --
>> 1.7.0.4
>>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: EXYNOS: Fix low level debug support
2013-07-22 11:23 ` Thomas Abraham
2013-07-22 11:57 ` Yadwinder Singh Brar
@ 2013-07-22 13:07 ` Tomasz Figa
2013-07-23 7:34 ` Yadwinder Singh Brar
1 sibling, 1 reply; 6+ messages in thread
From: Tomasz Figa @ 2013-07-22 13:07 UTC (permalink / raw)
To: Thomas Abraham
Cc: Yadwinder Singh Brar, kgene, linux-samsung-soc, arnd, olof,
dianders, yadi.brar01
On Monday 22 of July 2013 06:23:06 Thomas Abraham wrote:
> On 13 July 2013 04:57, Yadwinder Singh Brar <yadi.brar@samsung.com>
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 iotable_init tries to map UART again which is already
> > mapped by debug_ll_io_init() call in exynos_init_io() within same
> > virtal address range as requested later.
>
> debug_ll_io_init ioremaps debug uart address space with 4KB size
> whereas the exynos_init_io() function ioremaps a single 512KB memory
> size for all the four uart ports which envelops the mapping created by
> debug_ll_io_init. This is caught as a kernel bug.
Right.
> > This issue seems to be occured after :
> > commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
> > ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
> >
> > This patch moves S3C_UART iodesc(in iodesc_list) inside CONFIG_DEBUG_LL
> > check.
> Instead of moving, all the such iodesc entries for UART controller can
> be removed for all Samsung SoC's now since the Samsung uart driver
> does a ioremap during probe and any needed iomapping for earlyprintk
> is handled by debug_ll_io_init().
Yes. This mapping should not be here, but...
If you look at plat-samsung/pm.c, there is a debugging code that relies on
presence of this mapping. So until this gets fixed/removed (I'm working on
it right now), I'd suggest keeping Yadwinder's solution.
The only problem is that the code in pm.c expects _all_ UARTs to be mapped
(see s3c_pm_resture_uarts() and co.), so in case of DEBUG_LL enabled,
something must be done ensure that rest of the ports are mapped.
I'm going to completely rework Samsung PM code in some time, so this
problem will go away, but this must be fixed in 3.11.
Best regards,
Tomasz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: EXYNOS: Fix low level debug support
2013-07-22 13:07 ` Tomasz Figa
@ 2013-07-23 7:34 ` Yadwinder Singh Brar
2013-07-23 7:45 ` Tomasz Figa
0 siblings, 1 reply; 6+ messages in thread
From: Yadwinder Singh Brar @ 2013-07-23 7:34 UTC (permalink / raw)
To: Tomasz Figa
Cc: Thomas Abraham, Yadwinder Singh Brar, kgene, linux-samsung-soc,
Arnd Bergmann, Olof Johansson, Doug Anderson
On Mon, Jul 22, 2013 at 6:37 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> On Monday 22 of July 2013 06:23:06 Thomas Abraham wrote:
>> On 13 July 2013 04:57, Yadwinder Singh Brar <yadi.brar@samsung.com>
> 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 iotable_init tries to map UART again which is already
>> > mapped by debug_ll_io_init() call in exynos_init_io() within same
>> > virtal address range as requested later.
>>
>> debug_ll_io_init ioremaps debug uart address space with 4KB size
>> whereas the exynos_init_io() function ioremaps a single 512KB memory
>> size for all the four uart ports which envelops the mapping created by
>> debug_ll_io_init. This is caught as a kernel bug.
>
> Right.
>
>> > This issue seems to be occured after :
>> > commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
>> > ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
>> >
>> > This patch moves S3C_UART iodesc(in iodesc_list) inside CONFIG_DEBUG_LL
>> > check.
>> Instead of moving, all the such iodesc entries for UART controller can
>> be removed for all Samsung SoC's now since the Samsung uart driver
>> does a ioremap during probe and any needed iomapping for earlyprintk
>> is handled by debug_ll_io_init().
>
> Yes. This mapping should not be here, but...
>
> If you look at plat-samsung/pm.c, there is a debugging code that relies on
> presence of this mapping.
Thanks for pointing this, I completely missed it.
>So until this gets fixed/removed (I'm working on
> it right now), I'd suggest keeping Yadwinder's solution.
>
But that debugging code is under "CONFIG_SAMSUNG_PM_DEBUG"
and SAMSUNG_PM_DEBUG selects DEBUG_LL also.
So the problem you stated below will their always when ever it will
enter that code
> The only problem is that the code in pm.c expects _all_ UARTs to be mapped
> (see s3c_pm_resture_uarts() and co.), so in case of DEBUG_LL enabled,
> something must be done ensure that rest of the ports are mapped.
>
how about fixing this problem with something like below:
saving only mapped/configured UART's registers.
8<--------------------------------------------------------------------------------------------------------
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index ea36136..34a7371 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -102,10 +102,8 @@ static void s3c_pm_save_uart(unsigned int uart, struct pm_u
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, save);
}
static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
8<----------------------------------------------------------------------------------------------------------
> I'm going to completely rework Samsung PM code in some time, so this
> problem will go away, but this must be fixed in 3.11.
>
Yes, it will be helpful if we have it fixed.
Regards,
Yadwinder
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: EXYNOS: Fix low level debug support
2013-07-23 7:34 ` Yadwinder Singh Brar
@ 2013-07-23 7:45 ` Tomasz Figa
0 siblings, 0 replies; 6+ messages in thread
From: Tomasz Figa @ 2013-07-23 7:45 UTC (permalink / raw)
To: Yadwinder Singh Brar
Cc: Tomasz Figa, Thomas Abraham, Yadwinder Singh Brar, kgene,
linux-samsung-soc, Arnd Bergmann, Olof Johansson, Doug Anderson
On Tuesday 23 of July 2013 13:04:58 Yadwinder Singh Brar wrote:
> On Mon, Jul 22, 2013 at 6:37 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> > On Monday 22 of July 2013 06:23:06 Thomas Abraham wrote:
> >> On 13 July 2013 04:57, Yadwinder Singh Brar <yadi.brar@samsung.com>
> >
> > 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 iotable_init tries to map UART again which is already
> >> > mapped by debug_ll_io_init() call in exynos_init_io() within same
> >> > virtal address range as requested later.
> >>
> >> debug_ll_io_init ioremaps debug uart address space with 4KB size
> >> whereas the exynos_init_io() function ioremaps a single 512KB memory
> >> size for all the four uart ports which envelops the mapping created
> >> by
> >> debug_ll_io_init. This is caught as a kernel bug.
> >
> > Right.
> >
> >> > This issue seems to be occured after :
> >> > commit ee4de5d99aeac44f4507b7538b2b3faedc5205b9
> >> > ARM: 7781/1: mmu: Add debug_ll_io_init() mappings to early mappings
> >> >
> >> > This patch moves S3C_UART iodesc(in iodesc_list) inside
> >> > CONFIG_DEBUG_LL
> >> > check.
> >>
> >> Instead of moving, all the such iodesc entries for UART controller
> >> can
> >> be removed for all Samsung SoC's now since the Samsung uart driver
> >> does a ioremap during probe and any needed iomapping for earlyprintk
> >> is handled by debug_ll_io_init().
> >
> > Yes. This mapping should not be here, but...
> >
> > If you look at plat-samsung/pm.c, there is a debugging code that
> > relies on presence of this mapping.
>
> Thanks for pointing this, I completely missed it.
>
> >So until this gets fixed/removed (I'm working on
> >
> > it right now), I'd suggest keeping Yadwinder's solution.
>
> But that debugging code is under "CONFIG_SAMSUNG_PM_DEBUG"
> and SAMSUNG_PM_DEBUG selects DEBUG_LL also.
> So the problem you stated below will their always when ever it will
> enter that code
Makes sense.
> > The only problem is that the code in pm.c expects _all_ UARTs to be
> > mapped (see s3c_pm_resture_uarts() and co.), so in case of DEBUG_LL
> > enabled, something must be done ensure that rest of the ports are
> > mapped.
> how about fixing this problem with something like below:
> saving only mapped/configured UART's registers.
>
> 8<----------------------------------------------------------------------
> ---------------------------------- diff --git
> a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index
> ea36136..34a7371 100644
> --- a/arch/arm/plat-samsung/pm.c
> +++ b/arch/arm/plat-samsung/pm.c
> @@ -102,10 +102,8 @@ static void s3c_pm_save_uart(unsigned int uart,
> struct pm_u 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, save);
> }
>
> static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save
> *save)
>
> 8<----------------------------------------------------------------------
> ------------------------------------
Looks good to me.
Best regards,
Tomasz
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-07-23 7:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-13 9:57 [PATCH] ARM: EXYNOS: Fix low level debug support Yadwinder Singh Brar
2013-07-22 11:23 ` Thomas Abraham
2013-07-22 11:57 ` Yadwinder Singh Brar
2013-07-22 13:07 ` Tomasz Figa
2013-07-23 7:34 ` Yadwinder Singh Brar
2013-07-23 7:45 ` Tomasz Figa
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.