Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: "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>,
	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: Tue, 7 Jul 2020 16:02:44 +0200
Message-ID: <20200707140244.uhmyoqd5mblz5ids@pali> (raw)
In-Reply-To: <20200707135311.GB17163@e121166-lin.cambridge.arm.com>

On Tuesday 07 July 2020 14:53:11 Lorenzo Pieralisi wrote:
> On Fri, Jun 19, 2020 at 12:56:18PM +0200, Pali Rohár wrote:
> > 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
> 
> Could you provide a lore archive link to the relevant
> discussion please ? I will apply it then.

Hello Lorenzo! Here is link to the Bjorn's email:
https://lore.kernel.org/linux-pci/20200528162604.GA323482@bjorn-Precision-5520/

> Lorenzo
> 
> > 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
> > > 

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 13:03 Pali Rohár
2020-06-19 10:56 ` Pali Rohár
2020-07-07 13:53   ` Lorenzo Pieralisi
2020-07-07 14:02     ` Pali Rohár [this message]
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=20200707140244.uhmyoqd5mblz5ids@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

Linux-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git