diff mbox series

[5/5] PCI: tegra194: Handle errors in BPMP response

Message ID 20210915085517.1669675-5-mperttunen@nvidia.com (mailing list archive)
State New, archived
Delegated to: Lorenzo Pieralisi
Headers show
Series [1/5] thermal: tegra-bpmp: Handle errors in BPMP response | expand

Commit Message

Mikko Perttunen Sept. 15, 2021, 8:55 a.m. UTC
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/pci/controller/dwc/pcie-tegra194.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Thierry Reding Oct. 7, 2021, 6:21 p.m. UTC | #1
On Wed, Sep 15, 2021 at 11:55:17AM +0300, Mikko Perttunen wrote:
> 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/pci/controller/dwc/pcie-tegra194.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Acked-by: Thierry Reding <treding@nvidia.com>
Lorenzo Pieralisi Oct. 13, 2021, 12:59 p.m. UTC | #2
On Thu, Oct 07, 2021 at 08:21:11PM +0200, Thierry Reding wrote:
> On Wed, Sep 15, 2021 at 11:55:17AM +0300, Mikko Perttunen wrote:
> > 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/pci/controller/dwc/pcie-tegra194.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> Acked-by: Thierry Reding <treding@nvidia.com>

Hi Thierry,

can I pull this patch into the PCI tree ? Or if you want the series
to go via another tree:

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Lorenzo Pieralisi Nov. 29, 2021, 12:19 p.m. UTC | #3
On Wed, Oct 13, 2021 at 01:59:56PM +0100, Lorenzo Pieralisi wrote:
> On Thu, Oct 07, 2021 at 08:21:11PM +0200, Thierry Reding wrote:
> > On Wed, Sep 15, 2021 at 11:55:17AM +0300, Mikko Perttunen wrote:
> > > 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/pci/controller/dwc/pcie-tegra194.c | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > Acked-by: Thierry Reding <treding@nvidia.com>
> 
> Hi Thierry,
> 
> can I pull this patch into the PCI tree ? Or if you want the series
> to go via another tree:
> 
> Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Hi,

I would like to ask please how you want this series to be handled.

Thanks,
Lorenzo
Lorenzo Pieralisi Feb. 3, 2022, 12:22 p.m. UTC | #4
On Mon, Nov 29, 2021 at 12:19:18PM +0000, Lorenzo Pieralisi wrote:
> On Wed, Oct 13, 2021 at 01:59:56PM +0100, Lorenzo Pieralisi wrote:
> > On Thu, Oct 07, 2021 at 08:21:11PM +0200, Thierry Reding wrote:
> > > On Wed, Sep 15, 2021 at 11:55:17AM +0300, Mikko Perttunen wrote:
> > > > 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/pci/controller/dwc/pcie-tegra194.c | 9 ++++++++-
> > > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > 
> > > Acked-by: Thierry Reding <treding@nvidia.com>
> > 
> > Hi Thierry,
> > 
> > can I pull this patch into the PCI tree ? Or if you want the series
> > to go via another tree:
> > 
> > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> 
> Hi,
> 
> I would like to ask please how you want this series to be handled.

Should I apply this patch stand-alone ?

I will mark all other patches in this series as Not Applicable in
the PCI queue.

Thanks,
Lorenzo
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 904976913081..08afd2e72ec5 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1162,6 +1162,7 @@  static int tegra_pcie_bpmp_set_ctrl_state(struct tegra_pcie_dw *pcie,
 	struct mrq_uphy_response resp;
 	struct tegra_bpmp_message msg;
 	struct mrq_uphy_request req;
+	int err;
 
 	/* Controller-5 doesn't need to have its state set by BPMP-FW */
 	if (pcie->cid == 5)
@@ -1181,7 +1182,13 @@  static int tegra_pcie_bpmp_set_ctrl_state(struct tegra_pcie_dw *pcie,
 	msg.rx.data = &resp;
 	msg.rx.size = sizeof(resp);
 
-	return tegra_bpmp_transfer(pcie->bpmp, &msg);
+	err = tegra_bpmp_transfer(pcie->bpmp, &msg);
+	if (err)
+		return err;
+	if (msg.rx.ret)
+		return -EINVAL;
+
+	return 0;
 }
 
 static int tegra_pcie_bpmp_set_pll_state(struct tegra_pcie_dw *pcie,