From: Mikko Perttunen Date: Wed, 15 Sep 2021 08:55:15 +0000 (+0300) Subject: memory: tegra186-emc: Handle errors in BPMP response X-Git-Tag: v5.16-rc1~124^2~22^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13324edbe9269e6fbca4d0f5146b18ef8478c958;p=thirdparty%2Fkernel%2Flinux.git memory: tegra186-emc: Handle errors in BPMP response The return value from tegra_bpmp_transfer indicates the success or failure of the IPC transaction with BPMP. If the transaction succeeded, we also need to check the actual command's result code. Add code to do this. Signed-off-by: Mikko Perttunen Link: https://lore.kernel.org/r/20210915085517.1669675-3-mperttunen@nvidia.com Signed-off-by: Krzysztof Kozlowski --- diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c index d65e7c2a580b6..abc0c2eeaab70 100644 --- a/drivers/memory/tegra/tegra186-emc.c +++ b/drivers/memory/tegra/tegra186-emc.c @@ -197,6 +197,10 @@ static int tegra186_emc_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to EMC DVFS pairs: %d\n", err); goto put_bpmp; } + if (msg.rx.ret < 0) { + dev_err(&pdev->dev, "EMC DVFS MRQ failed: %d (BPMP error code)\n", msg.rx.ret); + goto put_bpmp; + } emc->debugfs.min_rate = ULONG_MAX; emc->debugfs.max_rate = 0;