[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZC1vpXRoHb3H2alF@orome>
Date: Wed, 5 Apr 2023 14:55:01 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Mikko Perttunen <cyndis@...si.fi>
Cc: Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Mikko Perttunen <mperttunen@...dia.com>,
linux-pci@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] PCI: tegra194: Handle errors in BPMP response
On Wed, Feb 08, 2023 at 04:27:35PM +0200, Mikko Perttunen wrote:
> From: Mikko Perttunen <mperttunen@...dia.com>
>
> 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@...dia.com>
> ---
> drivers/pci/controller/dwc/pcie-tegra194.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
Lorenzo asked whether the error check could be incorporated into
tegra_bpmp_transfer() in reply to an earlier version of this. It would
be possible, but I think it has the downside of loosing some context.
The end result would still be the same, but it would make it impossible
for the caller to distinguish between a failure of tegra_bpmp_transfer()
and a failure of the message transaction.
For example the cpufreq driver checks for msg.rx.ret == -BPMP_EINVAL and
if that's returned will mark the given cluster as not available. This is
special behavior that only makes sense within the context of cpufreq. It
wouldn't be possible to make these decisions if tegra_bpmp_transfer()
did some automated conversion and effectively rolled the message error
into the function return error.
So I think this will need to stay as-is to make sure we can handle these
errors correctly.
Acked-by: Thierry Reding <treding@...dia.com>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists