remoteproc: imx_rproc: Use strstarts for "rsc-table" check
Subsystems (2)
PATCH 1/1 remoteproc: imx_rproc: Use strstarts for "rsc-table" check
The resource name may include an address suffix, for example:
rsc-table@1fff8000.
To handle such cases, use strstarts() instead of strcmp() when checking for "rsc-table".
--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/imx_rproc.c +1 -1
@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr; b++; }
Signature · 1 line
2.43.0
Quoted 8 lines · Shenwei Wang
The resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>
Good catch.
Quoted 8 lines · Shenwei Wang
The resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>---
Quoted 19 lines
drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/remoteproc/imx_rproc.c +1
-2@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr; b++; } --2.43.0
Quoted 7 lines · Shenwei Wang
The resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>
Quoted 17 lines
--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/remoteproc/imx_rproc.c +1
-1@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr; b++; }
Signature · 2 lines
Thx and BRs, Zhongqiu Han
Mathieu Poirier
maintainerQuoted 16 lines · Shenwei Wang
The resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/remoteproc/imx_rproc.c +0
-0
drivers/remoteproc/imx_rproc.c static int imx_rproc_addr_init(struct imx_rproc *priv, · line 698
Quoted 6 lines
drivers/remoteproc/imx_rproc.c +1
-1@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr;
Before applying this patch, I want to know how it ever worked before. How did DT with a suffix tested?
Quoted 5 lines
drivers/remoteproc/imx_rproc.c +0
-0b++; }Signature · 1 line
2.43.0
Quoted 23 lines
Subject: Re: [PATCH] remoteproc:
imx_rproc: Use strstarts for "rsc- table" checkQuoted 6 lines · Shenwei Wang
The resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Quoted 7 lines
Signed-off-by Shenwei Wang <[email protected]>--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/remoteproc/imx_rproc.cindex
3be8790c14a2..33f21ab24c92drivers/remoteproc/imx_rproc.c static int imx_rproc_addr_init(struct
Quoted 4 lines
100644
drivers/remoteproc/imx_rproc.c +0
-0@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct
imx_rproc*priv,
Quoted 9 lines
drivers/remoteproc/imx_rproc.c static int imx_rproc_addr_init(struct imx_rproc *priv, · line 698
Quoted 6 lines
drivers/remoteproc/imx_rproc.c +1
-1} priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr;Before applying this patch, I want to know how it ever worked before. How did DT with a suffix tested?
In Rob's v2 version[1], I gave my T-b in 2025-5-7, but I could not recall whether I did rpmsg test, seems I only did start/stop test from the issue Shenwei spotted.
[1] https://lore.kernel.org/linux-remoteproc/[email protected]/
Regards
Peng.
Quoted 6 lines
Quoted 6 lines
drivers/remoteproc/imx_rproc.c +0
-1b++; } --2.43.0
Hi Shenwei,
Quoted 5 lines
Subject: [PATCH] remoteproc:
imx_rproc: Use strstarts for "rsc-table" checkThe resource name may include an address suffix, for example:
rsc-table@1fff8000.
device_node->name does not contain the suffix "@xyz". device_node->full_name contains the name and "@xyz"
Do you see the device_node->name is rsc-table@1fff8000 in your test?
Regards
Peng.
Quoted 26 lines
To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/remoteproc/imx_rproc.cindex3be8790c14a2..33f21ab24c92100644drivers/remoteproc/imx_rproc.c +1
-1@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr; b++;}
--
2.43.0
Quoted 8 lines
Subject: RE: [PATCH] remoteproc:
imx_rproc: Use strstarts for "rsc- table" checkHi Shenwei,
Quoted 3 lines
Subject: [PATCH] remoteproc:
imx_rproc: Use strstarts for "rsc-table" check
Quoted 7 lines
Quoted 2 lines
The resource name may include an address suffix, for example:
rsc-table@1fff8000.
device_node->namedoes not contain the suffix "@xyz".device_node->full_namecontains the name and "@xyz"Do you see the
device_node->nameis rsc-table@1fff8000 in your test?
Ignore above. I use an old tree, just see this change "remoteproc: Use of_reserved_mem_region_* functions for "memory-region" use res to replace device_node.
Regards
Peng.
Quoted 31 lines
Regards
Peng.drivers/remoteproc/imx_rproc.c static int imx_rproc_addr_init(struct
Quoted 15 lines
To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/remoteproc/imx_rproc.cindex3be8790c14a2..33f21ab24c92100644drivers/remoteproc/imx_rproc.c +0
-0@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct
imx_rprocQuoted 11 lines
drivers/remoteproc/imx_rproc.c +1
-1*priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr; b++;}
--
2.43.0
Quoted 10 lines
Subject: [PATCH] remoteproc:
imx_rproc: Use strstarts for "rsc-table" checkThe resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>
With fixes tag added:
Quoted 11 lines · Shenwei Wang
The resource name may include an address suffix, for example:
rsc-table@1fff8000.To handle such cases, use
strstarts()instead ofstrcmp()when checking for "rsc-table".Signed-off-by Shenwei Wang <[email protected]>--- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied.
Thanks,
Mathieu
Quoted 16 lines
drivers/remoteproc/imx_rproc.c +1
-1@@ -694,7 +694,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, } priv->mem[b].sys_addr = res.start; priv->mem[b].size =resource_size (&res); -if (!strcmp (res.name,"rsc-table" )) +if (strstarts (res.name,"rsc-table" )) priv->rsc_table = priv->mem[b].cpu_addr; b++; }Signature · 1 line
2.43.0