* [PATCH -next] memory: tegra186-emc: Fix error return code in tegra186_emc_probe()
@ 2021-09-27 7:51 Yang Yingliang
2021-09-27 8:52 ` Mikko Perttunen
0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2021-09-27 7:51 UTC (permalink / raw)
To: linux-kernel, linux-tegra; +Cc: krzysztof.kozlowski, mperttunen
Return the error code when command fails.
Fixes: 13324edbe926 ("memory: tegra186-emc: Handle errors in BPMP response")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/memory/tegra/tegra186-emc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
index abc0c2eeaab7..16351840b187 100644
--- a/drivers/memory/tegra/tegra186-emc.c
+++ b/drivers/memory/tegra/tegra186-emc.c
@@ -198,6 +198,7 @@ static int tegra186_emc_probe(struct platform_device *pdev)
goto put_bpmp;
}
if (msg.rx.ret < 0) {
+ err = msg.rx.ret;
dev_err(&pdev->dev, "EMC DVFS MRQ failed: %d (BPMP error code)\n", msg.rx.ret);
goto put_bpmp;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] memory: tegra186-emc: Fix error return code in tegra186_emc_probe()
2021-09-27 7:51 [PATCH -next] memory: tegra186-emc: Fix error return code in tegra186_emc_probe() Yang Yingliang
@ 2021-09-27 8:52 ` Mikko Perttunen
2021-09-28 0:59 ` Yang Yingliang
0 siblings, 1 reply; 3+ messages in thread
From: Mikko Perttunen @ 2021-09-27 8:52 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, linux-tegra; +Cc: krzysztof.kozlowski, mperttunen
On 9/27/21 10:51 AM, Yang Yingliang wrote:
> Return the error code when command fails.
>
> Fixes: 13324edbe926 ("memory: tegra186-emc: Handle errors in BPMP response")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/memory/tegra/tegra186-emc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
> index abc0c2eeaab7..16351840b187 100644
> --- a/drivers/memory/tegra/tegra186-emc.c
> +++ b/drivers/memory/tegra/tegra186-emc.c
> @@ -198,6 +198,7 @@ static int tegra186_emc_probe(struct platform_device *pdev)
> goto put_bpmp;
> }
> if (msg.rx.ret < 0) {
> + err = msg.rx.ret;
> dev_err(&pdev->dev, "EMC DVFS MRQ failed: %d (BPMP error code)\n", msg.rx.ret);
> goto put_bpmp;
> }
>
Good catch, but we shouldn't return msg.rx.ret since it is a BPMP error
code that doesn't necessarily map directly to a Linux error code. So we
should set err to something like -EINVAL instead. Please update, or if
you'd prefer, I can fix it.
Mikko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] memory: tegra186-emc: Fix error return code in tegra186_emc_probe()
2021-09-27 8:52 ` Mikko Perttunen
@ 2021-09-28 0:59 ` Yang Yingliang
0 siblings, 0 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-09-28 0:59 UTC (permalink / raw)
To: Mikko Perttunen, linux-kernel, linux-tegra
Cc: krzysztof.kozlowski, mperttunen
Hi,
On 2021/9/27 16:52, Mikko Perttunen wrote:
> On 9/27/21 10:51 AM, Yang Yingliang wrote:
>> Return the error code when command fails.
>>
>> Fixes: 13324edbe926 ("memory: tegra186-emc: Handle errors in BPMP
>> response")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>> drivers/memory/tegra/tegra186-emc.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/memory/tegra/tegra186-emc.c
>> b/drivers/memory/tegra/tegra186-emc.c
>> index abc0c2eeaab7..16351840b187 100644
>> --- a/drivers/memory/tegra/tegra186-emc.c
>> +++ b/drivers/memory/tegra/tegra186-emc.c
>> @@ -198,6 +198,7 @@ static int tegra186_emc_probe(struct
>> platform_device *pdev)
>> goto put_bpmp;
>> }
>> if (msg.rx.ret < 0) {
>> + err = msg.rx.ret;
>> dev_err(&pdev->dev, "EMC DVFS MRQ failed: %d (BPMP error
>> code)\n", msg.rx.ret);
>> goto put_bpmp;
>> }
>>
>
> Good catch, but we shouldn't return msg.rx.ret since it is a BPMP
> error code that doesn't necessarily map directly to a Linux error
> code. So we should set err to something like -EINVAL instead. Please
> update, or if you'd prefer, I can fix it.
I can send a v2 later.
>
> Mikko
> .
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-28 0:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 7:51 [PATCH -next] memory: tegra186-emc: Fix error return code in tegra186_emc_probe() Yang Yingliang
2021-09-27 8:52 ` Mikko Perttunen
2021-09-28 0:59 ` Yang Yingliang
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.