public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Mikko Perttunen <cyndis@kapsi.fi>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Mikko Perttunen" <mperttunen@nvidia.com>,
	linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] PCI: tegra194: Handle errors in BPMP response
Date: Wed, 5 Apr 2023 14:55:01 +0200	[thread overview]
Message-ID: <ZC1vpXRoHb3H2alF@orome> (raw)
In-Reply-To: <20230208142735.3218707-1-cyndis@kapsi.fi>

[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]

On Wed, Feb 08, 2023 at 04:27:35PM +0200, Mikko Perttunen wrote:
> From: Mikko Perttunen <mperttunen@nvidia.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@nvidia.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@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-04-05 12:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 14:27 [PATCH v2] PCI: tegra194: Handle errors in BPMP response Mikko Perttunen
2023-04-05 12:55 ` Thierry Reding [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZC1vpXRoHb3H2alF@orome \
    --to=thierry.reding@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=cyndis@kapsi.fi \
    --cc=jonathanh@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox