diff mbox series

[01/11] gpio: imx_rgpio2p: Move 8ulp_data to data section

Message ID 20241203-imx91-v1-1-48d2eaa4519e@nxp.com
State Accepted
Commit 4af5084a3b8e97067b836179667c6d838084faea
Delegated to: Fabio Estevam
Headers show
Series imx: add i.MX91 and 11x11-EVK support | expand

Commit Message

Peng Fan Dec. 3, 2024, 3:42 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

have_dual_base is set to false, so the 8ulp_data will be put in BSS
section which conflicts with the area of u-boot.dtb which padded just
after u-boot-nodtb.bin. So move 8ulp_data to data section to avoid
its content being corrupted by dtb.

Fixes: 51cfa66f2c4 ("gpio: imx_rgpio2p: support one address")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/gpio/imx_rgpio2p.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Fabio Estevam Dec. 3, 2024, 6:27 p.m. UTC | #1
On Tue, Dec 3, 2024 at 11:37 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> have_dual_base is set to false, so the 8ulp_data will be put in BSS
> section which conflicts with the area of u-boot.dtb which padded just
> after u-boot-nodtb.bin. So move 8ulp_data to data section to avoid
> its content being corrupted by dtb.
...
> -static struct imx_rgpio2p_soc_data imx8ulp_data = {
> +static struct imx_rgpio2p_soc_data imx8ulp_data __section(".data") = {
>         .have_dual_base = false,

Isn't it the same kind of problem that was discussed before?

https://lore.kernel.org/all/20241017034507.GJ4959@bill-the-cat/
Peng Fan Dec. 4, 2024, 1:06 a.m. UTC | #2
> Subject: Re: [PATCH 01/11] gpio: imx_rgpio2p: Move 8ulp_data to data
> section
> 
> On Tue, Dec 3, 2024 at 11:37 AM Peng Fan (OSS)
> <peng.fan@oss.nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > have_dual_base is set to false, so the 8ulp_data will be put in BSS
> > section which conflicts with the area of u-boot.dtb which padded just
> > after u-boot-nodtb.bin. So move 8ulp_data to data section to avoid
> its
> > content being corrupted by dtb.
> ...
> > -static struct imx_rgpio2p_soc_data imx8ulp_data = {
> > +static struct imx_rgpio2p_soc_data imx8ulp_data __section(".data")
> =
> > +{
> >         .have_dual_base = false,
> 
> Isn't it the same kind of problem that was discussed before?

It is different case here. Here the imx8ulp_data is not a local variable.
It could not be dynamically allocated.

Thanks,
Peng.

> 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> lore.kernel.org%2Fall%2F20241017034507.GJ4959%40bill-the-
> cat%2F&data=05%7C02%7Cpeng.fan%40nxp.com%7C8832a4f253ce4f
> 5f58bf08dd13c83e1b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0
> %7C0%7C638688472963187297%7CUnknown%7CTWFpbGZsb3d8eyJ
> FbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkF
> OIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=sZJoC%2B
> VY5lKRwobq0H62MauDk%2FI82OEQZxsW2OxaQPo%3D&reserved=0
Fabio Estevam Dec. 9, 2024, 12:24 p.m. UTC | #3
On Tue, Dec 3, 2024 at 11:37 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> have_dual_base is set to false, so the 8ulp_data will be put in BSS
> section which conflicts with the area of u-boot.dtb which padded just
> after u-boot-nodtb.bin. So move 8ulp_data to data section to avoid
> its content being corrupted by dtb.
>
> Fixes: 51cfa66f2c4 ("gpio: imx_rgpio2p: support one address")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Applied all to u-boot-imx/next, thanks.
diff mbox series

Patch

diff --git a/drivers/gpio/imx_rgpio2p.c b/drivers/gpio/imx_rgpio2p.c
index fc1d418315c560f2e794fb383d3764d98d482b39..7cf178f8a485224e6314a66d9c82e0c2a5776cd5 100644
--- a/drivers/gpio/imx_rgpio2p.c
+++ b/drivers/gpio/imx_rgpio2p.c
@@ -231,7 +231,7 @@  static struct imx_rgpio2p_soc_data imx7ulp_data = {
 	.have_dual_base = true,
 };
 
-static struct imx_rgpio2p_soc_data imx8ulp_data = {
+static struct imx_rgpio2p_soc_data imx8ulp_data __section(".data") = {
 	.have_dual_base = false,
 };