* [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
@ 2020-09-02 14:06 YueHaibing
2020-09-02 14:24 ` Suman Anna
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: YueHaibing @ 2020-09-02 14:06 UTC (permalink / raw)
To: ohad, bjorn.andersson, s-anna, mathieu.poirier
Cc: linux-remoteproc, linux-kernel, YueHaibing
In case of error, the function devm_ioremap_wc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: 87218f96c21a ("remoteproc: k3-dsp: Add support for C71x DSPs")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
index 9011e477290c..f373df35d7d0 100644
--- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
@@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
resource_size(res));
- if (IS_ERR(kproc->mem[i].cpu_addr)) {
+ if (!kproc->mem[i].cpu_addr) {
dev_err(dev, "failed to map %s memory\n",
data->mems[i].name);
- return PTR_ERR(kproc->mem[i].cpu_addr);
+ return -EBUSY;
}
kproc->mem[i].bus_addr = res->start;
kproc->mem[i].dev_addr = data->mems[i].dev_addr;
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
2020-09-02 14:06 [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() YueHaibing
@ 2020-09-02 14:24 ` Suman Anna
2020-09-02 16:59 ` Mathieu Poirier
2020-09-05 12:25 ` [PATCH v2 " YueHaibing
2 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2020-09-02 14:24 UTC (permalink / raw)
To: YueHaibing, ohad, bjorn.andersson, mathieu.poirier
Cc: linux-remoteproc, linux-kernel
On 9/2/20 9:06 AM, YueHaibing wrote:
> In case of error, the function devm_ioremap_wc() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
Thanks for the fix.
>
> Fixes: 87218f96c21a ("remoteproc: k3-dsp: Add support for C71x DSPs")
This should instead be
Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
With that,
Acked-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> index 9011e477290c..f373df35d7d0 100644
> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> @@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
>
> kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
> resource_size(res));
> - if (IS_ERR(kproc->mem[i].cpu_addr)) {
> + if (!kproc->mem[i].cpu_addr) {
> dev_err(dev, "failed to map %s memory\n",
> data->mems[i].name);
> - return PTR_ERR(kproc->mem[i].cpu_addr);
> + return -EBUSY;
> }
> kproc->mem[i].bus_addr = res->start;
> kproc->mem[i].dev_addr = data->mems[i].dev_addr;
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
2020-09-02 14:06 [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() YueHaibing
2020-09-02 14:24 ` Suman Anna
@ 2020-09-02 16:59 ` Mathieu Poirier
2020-09-04 15:44 ` Suman Anna
2020-09-05 12:25 ` [PATCH v2 " YueHaibing
2 siblings, 1 reply; 7+ messages in thread
From: Mathieu Poirier @ 2020-09-02 16:59 UTC (permalink / raw)
To: YueHaibing; +Cc: ohad, bjorn.andersson, s-anna, linux-remoteproc, linux-kernel
On Wed, Sep 02, 2020 at 10:06:14PM +0800, YueHaibing wrote:
> In case of error, the function devm_ioremap_wc() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Fixes: 87218f96c21a ("remoteproc: k3-dsp: Add support for C71x DSPs")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> index 9011e477290c..f373df35d7d0 100644
> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> @@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
>
> kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
> resource_size(res));
> - if (IS_ERR(kproc->mem[i].cpu_addr)) {
> + if (!kproc->mem[i].cpu_addr) {
> dev_err(dev, "failed to map %s memory\n",
> data->mems[i].name);
> - return PTR_ERR(kproc->mem[i].cpu_addr);
> + return -EBUSY;
Shouldn't this be -ENOMEM?
> }
> kproc->mem[i].bus_addr = res->start;
> kproc->mem[i].dev_addr = data->mems[i].dev_addr;
> --
> 2.17.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
2020-09-02 16:59 ` Mathieu Poirier
@ 2020-09-04 15:44 ` Suman Anna
0 siblings, 0 replies; 7+ messages in thread
From: Suman Anna @ 2020-09-04 15:44 UTC (permalink / raw)
To: Mathieu Poirier, YueHaibing
Cc: ohad, bjorn.andersson, linux-remoteproc, linux-kernel
On 9/2/20 11:59 AM, Mathieu Poirier wrote:
> On Wed, Sep 02, 2020 at 10:06:14PM +0800, YueHaibing wrote:
>> In case of error, the function devm_ioremap_wc() returns NULL pointer
>> not ERR_PTR(). The IS_ERR() test in the return value check should be
>> replaced with NULL test.
>>
>> Fixes: 87218f96c21a ("remoteproc: k3-dsp: Add support for C71x DSPs")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>> drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
>> index 9011e477290c..f373df35d7d0 100644
>> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
>> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
>> @@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
>>
>> kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
>> resource_size(res));
>> - if (IS_ERR(kproc->mem[i].cpu_addr)) {
>> + if (!kproc->mem[i].cpu_addr) {
>> dev_err(dev, "failed to map %s memory\n",
>> data->mems[i].name);
>> - return PTR_ERR(kproc->mem[i].cpu_addr);
>> + return -EBUSY;
>
> Shouldn't this be -ENOMEM?
Indeed, thanks for catching it.
I will fix these same issues on the K3 R5F driver for v4.
regards
Suman
>
>> }
>> kproc->mem[i].bus_addr = res->start;
>> kproc->mem[i].dev_addr = data->mems[i].dev_addr;
>> --
>> 2.17.1
>>
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
2020-09-02 14:06 [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() YueHaibing
2020-09-02 14:24 ` Suman Anna
2020-09-02 16:59 ` Mathieu Poirier
@ 2020-09-05 12:25 ` YueHaibing
2020-09-10 19:50 ` Mathieu Poirier
2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
2 siblings, 2 replies; 7+ messages in thread
From: YueHaibing @ 2020-09-05 12:25 UTC (permalink / raw)
To: ohad, bjorn.andersson, s-anna, mathieu.poirier
Cc: linux-remoteproc, linux-kernel, YueHaibing
In case of error, the function devm_ioremap_wc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Suman Anna <s-anna@ti.com>
---
v2: return ENOMEM instead of EBUSY, use corret Fixes tag
---
drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
index 9011e477290c..f373df35d7d0 100644
--- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
@@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
resource_size(res));
- if (IS_ERR(kproc->mem[i].cpu_addr)) {
+ if (!kproc->mem[i].cpu_addr) {
dev_err(dev, "failed to map %s memory\n",
data->mems[i].name);
- return PTR_ERR(kproc->mem[i].cpu_addr);
+ return -ENOMEM;
}
kproc->mem[i].bus_addr = res->start;
kproc->mem[i].dev_addr = data->mems[i].dev_addr;
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
2020-09-05 12:25 ` [PATCH v2 " YueHaibing
@ 2020-09-10 19:50 ` Mathieu Poirier
2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
1 sibling, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2020-09-10 19:50 UTC (permalink / raw)
To: YueHaibing; +Cc: ohad, bjorn.andersson, s-anna, linux-remoteproc, linux-kernel
On Sat, Sep 05, 2020 at 08:25:03PM +0800, YueHaibing wrote:
> In case of error, the function devm_ioremap_wc() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
> v2: return ENOMEM instead of EBUSY, use corret Fixes tag
> ---
> drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> index 9011e477290c..f373df35d7d0 100644
> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> @@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
>
> kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
> resource_size(res));
> - if (IS_ERR(kproc->mem[i].cpu_addr)) {
> + if (!kproc->mem[i].cpu_addr) {
> dev_err(dev, "failed to map %s memory\n",
> data->mems[i].name);
> - return PTR_ERR(kproc->mem[i].cpu_addr);
> + return -ENOMEM;
> }
> kproc->mem[i].bus_addr = res->start;
> kproc->mem[i].dev_addr = data->mems[i].dev_addr;
> --
> 2.17.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
2020-09-05 12:25 ` [PATCH v2 " YueHaibing
2020-09-10 19:50 ` Mathieu Poirier
@ 2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
1 sibling, 0 replies; 7+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-11-18 14:30 UTC (permalink / raw)
To: YueHaibing; +Cc: linux-remoteproc
Hello:
This patch was applied to andersson/remoteproc.git (refs/heads/for-next):
On Sat, 5 Sep 2020 20:25:03 +0800 you wrote:
> In case of error, the function devm_ioremap_wc() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Acked-by: Suman Anna <s-anna@ti.com>
>
> [...]
Here is the summary with links:
- [v2,-next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()
https://git.kernel.org/andersson/remoteproc/c/9b3b3c9531e8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-11-18 14:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 14:06 [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() YueHaibing
2020-09-02 14:24 ` Suman Anna
2020-09-02 16:59 ` Mathieu Poirier
2020-09-04 15:44 ` Suman Anna
2020-09-05 12:25 ` [PATCH v2 " YueHaibing
2020-09-10 19:50 ` Mathieu Poirier
2020-11-18 14:30 ` patchwork-bot+linux-remoteproc
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.