mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: fix return value check of MRQ_STRAP
The return value of tegra_bpmp_transfer() API is only for a low level wire-protocol errors. When checking BPMP-FW response to MRQ_STRAP request, the return value in the MRQ response payload need to be checked. Bug 3744064 Bug 3317279 Signed-off-by: Timo Alho <talho@nvidia.com> Change-Id: I165431a5d2ed5a09965eb84b7ee09766bb09d091 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2859267 Reviewed-by: Divya Singhatwaria <dsinghatwari@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Tested-by: Divya Singhatwaria <dsinghatwari@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7ba33f3dec
commit
3ff15b69de
@@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_TEGRA_BPMP
|
#ifdef CONFIG_TEGRA_BPMP
|
||||||
#include <soc/tegra/bpmp.h>
|
#include <soc/tegra/bpmp.h>
|
||||||
|
#include <soc/tegra/bpmp-abi.h>
|
||||||
#endif /* CONFIG_TEGRA_BPMP */
|
#endif /* CONFIG_TEGRA_BPMP */
|
||||||
|
|
||||||
#include <uapi/linux/nvgpu.h>
|
#include <uapi/linux/nvgpu.h>
|
||||||
@@ -360,7 +361,16 @@ int ga10b_tegra_static_pg_control(struct device *dev, struct tegra_bpmp *bpmp,
|
|||||||
msg.tx.size = sizeof(*req);
|
msg.tx.size = sizeof(*req);
|
||||||
|
|
||||||
err = tegra_bpmp_transfer(bpmp, &msg);
|
err = tegra_bpmp_transfer(bpmp, &msg);
|
||||||
return err;
|
|
||||||
|
if (msg.rx.ret == -BPMP_EINVAL) {
|
||||||
|
return -EINVAL;
|
||||||
|
} else if (msg.rx.ret == -BPMP_ENODEV) {
|
||||||
|
return -ENODEV;
|
||||||
|
} else if (msg.rx.ret == -BPMP_EACCES) {
|
||||||
|
return -EPERM;
|
||||||
|
} else {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -473,11 +483,29 @@ static int ga10b_tegra_unrailgate(struct device *dev)
|
|||||||
unsigned long max_rate;
|
unsigned long max_rate;
|
||||||
long rate;
|
long rate;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_TEGRA_BPMP)
|
#if defined(CONFIG_TEGRA_BPMP)
|
||||||
|
struct gk20a *g = get_gk20a(dev);
|
||||||
|
|
||||||
ret = ga10b_tegra_bpmp_mrq_set(dev);
|
ret = ga10b_tegra_bpmp_mrq_set(dev);
|
||||||
if (ret != 0)
|
if (ret == -EINVAL) {
|
||||||
|
nvgpu_err(g, "MRQ incorrect parameters");
|
||||||
return ret;
|
return ret;
|
||||||
|
} else if (ret == -ENODEV) {
|
||||||
|
nvgpu_log_info(g, "MRQ is not supported by BPMP-FW");
|
||||||
|
/*
|
||||||
|
* reset the return value to 0
|
||||||
|
* as the control can go forward
|
||||||
|
*/
|
||||||
|
ret = 0;
|
||||||
|
} else if (ret == -EPERM) {
|
||||||
|
nvgpu_log_info(g, "MRQ not permitted");
|
||||||
|
/*
|
||||||
|
* reset the return value to 0
|
||||||
|
* as the control can go forward
|
||||||
|
*/
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Setting clk controls */
|
/* Setting clk controls */
|
||||||
|
|||||||
Reference in New Issue
Block a user