* [U-Boot] [PATCH] rockchip: rk3399: Add missing sentinel in syscon
@ 2017-04-10 1:53 Eric Gao
2017-04-11 2:13 ` Kever Yang
0 siblings, 1 reply; 3+ messages in thread
From: Eric Gao @ 2017-04-10 1:53 UTC (permalink / raw)
To: u-boot
when enable PMIC rk808,the system will halt at very
early stage,log is shown as bellow.
INFO: plat_rockchip_pmu_init(1211): pd status 3e
INFO: BL31: Initializing runtime services
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x200000
INFO: SPSR = 0x3c9
time 44561b, 0 (<<----Just stop here)
It's caused by the absence of "{ }" in syscon_rk3399.c
,which will lead to memory overflow like below.According
to Sysmap file ,we can find the function buck_get_value
of rk808 is just follow the compatible struct,the pointer
"of_match" point to "buck_get_value",but it is not a
struct and don't have member of compatible, In this case,
system crash. So,on the face, it looks like that rk808 is
guilty.but he is really innocent.
while (of_match->compatible) { <<----------
if (!strcmp(of_match->compatible, compat)) {
*of_idp = of_match;
return 0;
}
of_match++;
}
Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
---
arch/arm/mach-rockchip/rk3399/syscon_rk3399.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c b/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
index d32985b..74d4552 100644
--- a/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
@@ -14,6 +14,7 @@ static const struct udevice_id rk3399_syscon_ids[] = {
{ .compatible = "rockchip,rk3399-pmugrf", .data = ROCKCHIP_SYSCON_PMUGRF },
{ .compatible = "rockchip,rk3399-pmusgrf", .data = ROCKCHIP_SYSCON_PMUSGRF },
{ .compatible = "rockchip,rk3399-cic", .data = ROCKCHIP_SYSCON_CIC },
+ { }
};
U_BOOT_DRIVER(syscon_rk3399) = {
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] rockchip: rk3399: Add missing sentinel in syscon
2017-04-10 1:53 [U-Boot] [PATCH] rockchip: rk3399: Add missing sentinel in syscon Eric Gao
@ 2017-04-11 2:13 ` Kever Yang
2017-04-14 10:15 ` Simon Glass
0 siblings, 1 reply; 3+ messages in thread
From: Kever Yang @ 2017-04-11 2:13 UTC (permalink / raw)
To: u-boot
Hi Eric,
On 04/10/2017 09:53 AM, Eric Gao wrote:
> when enable PMIC rk808,the system will halt at very
> early stage,log is shown as bellow.
>
> INFO: plat_rockchip_pmu_init(1211): pd status 3e
> INFO: BL31: Initializing runtime services
> INFO: BL31: Preparing for EL3 exit to normal world
> INFO: Entry point address = 0x200000
> INFO: SPSR = 0x3c9
> time 44561b, 0 (<<----Just stop here)
>
> It's caused by the absence of "{ }" in syscon_rk3399.c
> ,which will lead to memory overflow like below.According
> to Sysmap file ,we can find the function buck_get_value
> of rk808 is just follow the compatible struct,the pointer
> "of_match" point to "buck_get_value",but it is not a
> struct and don't have member of compatible, In this case,
> system crash. So,on the face, it looks like that rk808 is
> guilty.but he is really innocent.
>
> while (of_match->compatible) { <<----------
> if (!strcmp(of_match->compatible, compat)) {
> *of_idp = of_match;
> return 0;
> }
> of_match++;
> }
>
> Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
> ---
>
> arch/arm/mach-rockchip/rk3399/syscon_rk3399.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c b/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
> index d32985b..74d4552 100644
> --- a/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
> +++ b/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
> @@ -14,6 +14,7 @@ static const struct udevice_id rk3399_syscon_ids[] = {
> { .compatible = "rockchip,rk3399-pmugrf", .data = ROCKCHIP_SYSCON_PMUGRF },
> { .compatible = "rockchip,rk3399-pmusgrf", .data = ROCKCHIP_SYSCON_PMUSGRF },
> { .compatible = "rockchip,rk3399-cic", .data = ROCKCHIP_SYSCON_CIC },
> + { }
> };
>
> U_BOOT_DRIVER(syscon_rk3399) = {
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] rockchip: rk3399: Add missing sentinel in syscon
2017-04-11 2:13 ` Kever Yang
@ 2017-04-14 10:15 ` Simon Glass
0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2017-04-14 10:15 UTC (permalink / raw)
To: u-boot
On 10 April 2017 at 20:13, Kever Yang <kever.yang@rock-chips.com> wrote:
> Hi Eric,
>
>
>
> On 04/10/2017 09:53 AM, Eric Gao wrote:
>>
>> when enable PMIC rk808,the system will halt at very
>> early stage,log is shown as bellow.
>>
>> INFO: plat_rockchip_pmu_init(1211): pd status 3e
>> INFO: BL31: Initializing runtime services
>> INFO: BL31: Preparing for EL3 exit to normal world
>> INFO: Entry point address = 0x200000
>> INFO: SPSR = 0x3c9
>> time 44561b, 0 (<<----Just stop here)
>>
>> It's caused by the absence of "{ }" in syscon_rk3399.c
>> ,which will lead to memory overflow like below.According
>> to Sysmap file ,we can find the function buck_get_value
>> of rk808 is just follow the compatible struct,the pointer
>> "of_match" point to "buck_get_value",but it is not a
>> struct and don't have member of compatible, In this case,
>> system crash. So,on the face, it looks like that rk808 is
>> guilty.but he is really innocent.
>>
>> while (of_match->compatible) { <<----------
>> if (!strcmp(of_match->compatible, compat)) {
>> *of_idp = of_match;
>> return 0;
>> }
>> of_match++;
>> }
>>
>> Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
>> ---
>>
>> arch/arm/mach-rockchip/rk3399/syscon_rk3399.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
>> b/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
>> index d32985b..74d4552 100644
>> --- a/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
>> +++ b/arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
>> @@ -14,6 +14,7 @@ static const struct udevice_id rk3399_syscon_ids[] = {
>> { .compatible = "rockchip,rk3399-pmugrf", .data =
>> ROCKCHIP_SYSCON_PMUGRF },
>> { .compatible = "rockchip,rk3399-pmusgrf", .data =
>> ROCKCHIP_SYSCON_PMUSGRF },
>> { .compatible = "rockchip,rk3399-cic", .data = ROCKCHIP_SYSCON_CIC
>> },
>> + { }
>> };
>> U_BOOT_DRIVER(syscon_rk3399) = {
>
>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> Tested-by: Kever Yang <kever.yang@rock-chips.com>
>
> Thanks,
> - Kever
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Applied to u-boot-rockchip, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-14 10:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 1:53 [U-Boot] [PATCH] rockchip: rk3399: Add missing sentinel in syscon Eric Gao
2017-04-11 2:13 ` Kever Yang
2017-04-14 10:15 ` Simon Glass
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.