diff mbox

[U-Boot] rockchip: rk8xx: allocate priv structure for driver

Message ID 1493967056-4537-1-git-send-email-kever.yang@rock-chips.com
State Accepted
Commit 7c1fb0a794791c7fea3d0d37f4f54d6ce9177e6f
Delegated to: Simon Glass
Headers show

Commit Message

Kever Yang May 5, 2017, 6:50 a.m. UTC
The rk8xx_priv structure need to allocate for driver, or else
it will cause data abort when CPU access it.

This is a bug fix for below patch set:
https://www.mail-archive.com/u-boot@lists.denx.de/msg247345.html

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 drivers/power/pmic/rk8xx.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jacob Chen May 7, 2017, 11:02 a.m. UTC | #1
Hi,


2017-05-05 14:50 GMT+08:00 Kever Yang <kever.yang@rock-chips.com>:
> The rk8xx_priv structure need to allocate for driver, or else
> it will cause data abort when CPU access it.
>
> This is a bug fix for below patch set:
> https://www.mail-archive.com/u-boot@lists.denx.de/msg247345.html
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  drivers/power/pmic/rk8xx.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
> index 394e2ff..850c66f 100644
> --- a/drivers/power/pmic/rk8xx.c
> +++ b/drivers/power/pmic/rk8xx.c
> @@ -113,6 +113,7 @@ U_BOOT_DRIVER(pmic_rk8xx) = {
>  #if CONFIG_IS_ENABLED(PMIC_CHILDREN)
>         .bind = rk8xx_bind,
>  #endif
> +       .priv_auto_alloc_size   = sizeof(struct rk8xx_priv),
>         .probe = rk8xx_probe,
>         .ops = &rk8xx_ops,
>  };
> --
> 1.9.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot

Sorry for mistakes, Tested-by: Jacob Chen <jacob2.chen@rock-chips.com>.
Simon Glass May 14, 2017, 9:13 a.m. UTC | #2
On 5 May 2017 at 00:50, Kever Yang <kever.yang@rock-chips.com> wrote:
> The rk8xx_priv structure need to allocate for driver, or else
> it will cause data abort when CPU access it.
>
> This is a bug fix for below patch set:
> https://www.mail-archive.com/u-boot@lists.denx.de/msg247345.html
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  drivers/power/pmic/rk8xx.c | 1 +
>  1 file changed, 1 insertion(+)
>

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass May 24, 2017, 12:48 a.m. UTC | #3
On 5 May 2017 at 00:50, Kever Yang <kever.yang@rock-chips.com> wrote:
> The rk8xx_priv structure need to allocate for driver, or else
> it will cause data abort when CPU access it.
>
> This is a bug fix for below patch set:
> https://www.mail-archive.com/u-boot@lists.denx.de/msg247345.html
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  drivers/power/pmic/rk8xx.c | 1 +
>  1 file changed, 1 insertion(+)
>

Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-rockchip, thanks!
diff mbox

Patch

diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
index 394e2ff..850c66f 100644
--- a/drivers/power/pmic/rk8xx.c
+++ b/drivers/power/pmic/rk8xx.c
@@ -113,6 +113,7 @@  U_BOOT_DRIVER(pmic_rk8xx) = {
 #if CONFIG_IS_ENABLED(PMIC_CHILDREN)
 	.bind = rk8xx_bind,
 #endif
+	.priv_auto_alloc_size   = sizeof(struct rk8xx_priv),
 	.probe = rk8xx_probe,
 	.ops = &rk8xx_ops,
 };