From: Mikko Perttunen <[email protected]>
[ Upstream commit c045ceb5a145d2a9a4bf33cbc55185ddf99f60ab ]
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/reset/tegra/reset-bpmp.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/reset/tegra/reset-bpmp.c b/drivers/reset/tegra/reset-bpmp.c
index 24d3395964cc4..4c5bba52b1059 100644
--- a/drivers/reset/tegra/reset-bpmp.c
+++ b/drivers/reset/tegra/reset-bpmp.c
@@ -20,6 +20,7 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
struct tegra_bpmp *bpmp = to_tegra_bpmp(rstc);
struct mrq_reset_request request;
struct tegra_bpmp_message msg;
+ int err;
memset(&request, 0, sizeof(request));
request.cmd = command;
@@ -30,7 +31,13 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
msg.tx.data = &request;
msg.tx.size = sizeof(request);
- return tegra_bpmp_transfer(bpmp, &msg);
+ err = tegra_bpmp_transfer(bpmp, &msg);
+ if (err)
+ return err;
+ if (msg.rx.ret)
+ return -EINVAL;
+
+ return 0;
}
static int tegra_bpmp_reset_module(struct reset_controller_dev *rstc,
--
2.33.0
On 15.11.2021 18.59, Greg Kroah-Hartman wrote:
> From: Mikko Perttunen <[email protected]>
>
> [ Upstream commit c045ceb5a145d2a9a4bf33cbc55185ddf99f60ab ]
>
> 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 <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]
> Signed-off-by: Philipp Zabel <[email protected]>
> Signed-off-by: Sasha Levin <[email protected]>
> ---
> ...
Can we drop this patch from all stable trees. A revert has been
submitted by Jon Hunter -- the reason is that the tegra-hda driver has a
(harmless) bug that was previously masked, but with this patch causes
the driver to fail to probe.
Thanks,
Mikko
On Mon, Nov 15, 2021 at 07:19:58PM +0200, Mikko Perttunen wrote:
>On 15.11.2021 18.59, Greg Kroah-Hartman wrote:
>>From: Mikko Perttunen <[email protected]>
>>
>>[ Upstream commit c045ceb5a145d2a9a4bf33cbc55185ddf99f60ab ]
>>
>>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 <[email protected]>
>>Link: https://lore.kernel.org/r/[email protected]
>>Signed-off-by: Philipp Zabel <[email protected]>
>>Signed-off-by: Sasha Levin <[email protected]>
>>---
>>...
>Can we drop this patch from all stable trees. A revert has been
>submitted by Jon Hunter -- the reason is that the tegra-hda driver has
>a (harmless) bug that was previously masked, but with this patch
>causes the driver to fail to probe.
I'll drop it, thanks!
--
Thanks,
Sasha