Skip to content

Commit c045ceb

Browse files
cyndispH5
authored andcommitted
reset: tegra-bpmp: 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Zabel <[email protected]>
1 parent 4af1607 commit c045ceb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/reset/tegra/reset-bpmp.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
2020
struct tegra_bpmp *bpmp = to_tegra_bpmp(rstc);
2121
struct mrq_reset_request request;
2222
struct tegra_bpmp_message msg;
23+
int err;
2324

2425
memset(&request, 0, sizeof(request));
2526
request.cmd = command;
@@ -30,7 +31,13 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
3031
msg.tx.data = &request;
3132
msg.tx.size = sizeof(request);
3233

33-
return tegra_bpmp_transfer(bpmp, &msg);
34+
err = tegra_bpmp_transfer(bpmp, &msg);
35+
if (err)
36+
return err;
37+
if (msg.rx.ret)
38+
return -EINVAL;
39+
40+
return 0;
3441
}
3542

3643
static int tegra_bpmp_reset_module(struct reset_controller_dev *rstc,

0 commit comments

Comments
 (0)