From: "Pali Rohár" <pali@kernel.org>
To: "Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Bjorn Helgaas" <helgaas@kernel.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Rob Herring" <robh@kernel.org>,
"Andrew Murray" <amurray@thegoodpenguin.co.uk>,
"Marek Behún" <marek.behun@nic.cz>,
"Remi Pommarel" <repk@triplefau.lt>,
"Tomasz Maciej Nowak" <tmn505@gmail.com>,
Xogium <contact@xogium.me>
Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: aardvark: Indicate error in 'val' when config read fails
Date: Fri, 19 Jun 2020 12:56:18 +0200 [thread overview]
Message-ID: <20200619105618.aksoivu4gb5ex3s3@pali> (raw)
In-Reply-To: <20200601130315.18895-1-pali@kernel.org>
Hello Lorenzo! Could you please review this patch?
On Monday 01 June 2020 15:03:15 Pali Rohár wrote:
> Most callers of config read do not check for return value. But most of the
> ones that do, checks for error indication in 'val' variable.
>
> This patch updates error handling in advk_pcie_rd_conf() function. If PIO
> transfer fails then 'val' variable is set to 0xffffffff which indicates
> failture.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
I should add credit for Bjorn as he found this issue
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
> ---
> drivers/pci/controller/pci-aardvark.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
> index 53a4cfd7d377..783a7f1f2c44 100644
> --- a/drivers/pci/controller/pci-aardvark.c
> +++ b/drivers/pci/controller/pci-aardvark.c
> @@ -691,8 +691,10 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
> advk_writel(pcie, 1, PIO_START);
>
> ret = advk_pcie_wait_pio(pcie);
> - if (ret < 0)
> + if (ret < 0) {
> + *val = 0xffffffff;
> return PCIBIOS_SET_FAILED;
> + }
>
> advk_pcie_check_pio_status(pcie);
>
> --
> 2.20.1
>
next prev parent reply other threads:[~2020-06-19 10:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 13:03 [PATCH] PCI: aardvark: Indicate error in 'val' when config read fails Pali Rohár
2020-06-19 10:56 ` Pali Rohár [this message]
2020-07-07 13:53 ` Lorenzo Pieralisi
2020-07-07 14:02 ` Pali Rohár
2020-07-07 14:49 ` Lorenzo Pieralisi
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=20200619105618.aksoivu4gb5ex3s3@pali \
--to=pali@kernel.org \
--cc=amurray@thegoodpenguin.co.uk \
--cc=contact@xogium.me \
--cc=helgaas@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marek.behun@nic.cz \
--cc=repk@triplefau.lt \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=tmn505@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).