soc/tegra: Changes for v4.15-rc1
Contains a fix to the generic power domain driver to properly report errors propagated from BPMP. -----BEGIN PGP SIGNATURE----- iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlnp4ZETHHRyZWRpbmdA bnZpZGlhLmNvbQAKCRDdI6zXfz6zoS8BEAC4HLNmOcPaVa82NqYEH0xlTohw2I4k Jcpe73eRN+JACzljRLXeJ+aL9FYBaroPEZ2Rs/pWsbVWva/W6VAN9hXVaStkgFGx hWXbSfGEPRQDbn58zg0ZZa4kCGMfYbFLh3HPM/HAkEqkYmWCLVMsd43adkI8P+Kg Cyec8mrC29VlVWMRZ223NiBHcqShZOnFgo4ZlyNtNczpUNhmw0OVnRKyqtpNxC7w OGzZXU7Vcgz7W5iqOmvZ1G5VY9+hhwW317TiPWJTpOQku3KzB8zr5dvY0+vud6cz oJQVge8m7vjY4Qdh9V96AynWC5yCZOYVEMr2JZqbTmiSGeefIvU0VQ+cX+fYTwWD 37V7b5j7+TROa1mZkIezqyy1zbgolY/DGoC403g/zT3SzEs3YUaOtdPOez+F1eJT 9pmZdX1SUDJmeG/piuG1J8Rhh01RUFNLnchy+Vc7d3/RrjHmj26RceKhiuqx8+K4 NpiOHcz9wdXszeZYSsjiAci8SLWlGOPcHtpIoYc0VjBxAoPXzXeESC6236pMyqGw VNdoz37CI5RTkCSAQmPd21M4nbydvGqgaMZ2FdWSzeRdYbKSen6Chk3rV0YbuHbF 2gjHmoJBi8/rQXZVYR5ea8ZJYy9NrC0siola0Z+imH8arMAHeakBVVpvCJvRymZ3 wdx1Q0gsMIpdww== =tkiA -----END PGP SIGNATURE----- Merge tag 'tegra-for-4.15-soc' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers Pull "soc/tegra: Changes for v4.15-rc1" from Thierry Reding: Contains a fix to the generic power domain driver to properly report errors propagated from BPMP. * tag 'tegra-for-4.15-soc' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: bpmp: Check BPMP response return code
This commit is contained in:
commit
4e53097313
|
@ -42,6 +42,7 @@ static int tegra_bpmp_powergate_set_state(struct tegra_bpmp *bpmp,
|
|||
{
|
||||
struct mrq_pg_request request;
|
||||
struct tegra_bpmp_message msg;
|
||||
int err;
|
||||
|
||||
memset(&request, 0, sizeof(request));
|
||||
request.cmd = CMD_PG_SET_STATE;
|
||||
|
@ -53,7 +54,13 @@ static int tegra_bpmp_powergate_set_state(struct tegra_bpmp *bpmp,
|
|||
msg.tx.data = &request;
|
||||
msg.tx.size = sizeof(request);
|
||||
|
||||
return tegra_bpmp_transfer(bpmp, &msg);
|
||||
err = tegra_bpmp_transfer(bpmp, &msg);
|
||||
if (err < 0)
|
||||
return err;
|
||||
else if (msg.rx.ret < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_bpmp_powergate_get_state(struct tegra_bpmp *bpmp,
|
||||
|
@ -80,6 +87,8 @@ static int tegra_bpmp_powergate_get_state(struct tegra_bpmp *bpmp,
|
|||
err = tegra_bpmp_transfer(bpmp, &msg);
|
||||
if (err < 0)
|
||||
return PG_STATE_OFF;
|
||||
else if (msg.rx.ret < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return response.get_state.state;
|
||||
}
|
||||
|
@ -106,6 +115,8 @@ static int tegra_bpmp_powergate_get_max_id(struct tegra_bpmp *bpmp)
|
|||
err = tegra_bpmp_transfer(bpmp, &msg);
|
||||
if (err < 0)
|
||||
return err;
|
||||
else if (msg.rx.ret < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return response.get_max_id.max_id;
|
||||
}
|
||||
|
@ -132,7 +143,7 @@ static char *tegra_bpmp_powergate_get_name(struct tegra_bpmp *bpmp,
|
|||
msg.rx.size = sizeof(response);
|
||||
|
||||
err = tegra_bpmp_transfer(bpmp, &msg);
|
||||
if (err < 0)
|
||||
if (err < 0 || msg.rx.ret < 0)
|
||||
return NULL;
|
||||
|
||||
return kstrdup(response.get_name.name, GFP_KERNEL);
|
||||
|
|
Loading…
Reference in New Issue