lkml.org 
[lkml]   [2020]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI: aardvark: Indicate error in 'val' when config read fails
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
>

\
 
 \ /
  Last update: 2020-06-19 12:57    [W:0.049 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site