Re: [PATCH 2/5] reset: tegra-bpmp: Handle errors in BPMP response

From
Jon Hunter <jonathanh@nvidia.com>
Date
2021-10-28 11:54:42
Also in
linux-pci, linux-pm, lkml
Reply to
Mikko Perttunen, 2021-09-15
Hi Philipp,

On 15/09/2021 09:55, Mikko Perttunen wrote:
quoted hunk ↗ jump to hunk
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 <mperttunen@nvidia.com>
---
  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 24d3395964cc..4c5bba52b105 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,

I see that you have pulled this into the mainline for v5.15. Unfortunately, this is causing a regression for the Tegra HDA controller. We need to fix the Tegra HDA driver but this is too late now for v5.15 and so we need to revert this change for v5.15. Sorry about this, but I did not expect this to be pulled in so late.

Jon

-- 
nvpublic
Thread (20 messages) 20 messages, 9 authors, last reply 2022-02-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help