PCI: aardvark: Indicate error in 'val' when config read fails
Subsystems (3)
Pali Rohár
maintainerPATCH 1/1 PCI: aardvark: Indicate error in 'val' when config read fails
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.
--- drivers/pci/controller/pci-aardvark.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/pci-aardvark.c +3 -1
@@ -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);
Signature · 1 line
2.20.1
Pali Rohár
maintainerHello Lorenzo! Could you please review this patch?
Quoted 8 lines · 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 to0xffffffffwhich indicates failture.Signed-off-by Pali Rohár <[email protected]>
I should add credit for Bjorn as he found this issue
Quoted 23 lines
--- drivers/pci/controller/pci-aardvark.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pci/controller/pci-aardvark.c +3
-1@@ -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);Signature · 1 line
2.20.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 6 lines · Pali Rohár
Hello Lorenzo! Could you please review this patch?
Quoted 3 lines · 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.
Quoted 7 lines
Quoted 5 lines
This patch updates error handling in
advk_pcie_rd_conf()function. If PIO transfer fails then 'val' variable is set to0xffffffffwhich indicates failture.Signed-off-by Pali Rohár <[email protected]>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.
Lorenzo
Quoted 25 lines
Reported-by Bjorn Helgaas <[email protected]>Quoted 23 lines
--- drivers/pci/controller/pci-aardvark.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pci/controller/pci-aardvark.c +3
-1@@ -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);Signature · 1 line
2.20.1
Pali Rohár
maintainerQuoted 11 lines · On Tuesday 07 July 2020 14:53:11 Lorenzo Pieralisi wrote:
Quoted 10 lines · Pali Rohár
Hello Lorenzo! Could you please review this patch?
Quoted 7 lines · 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 to0xffffffffwhich indicates failture.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Pali Rohár <[email protected]>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/
Quoted 27 lines
Lorenzo
Quoted 25 lines
Reported-by Bjorn Helgaas <[email protected]>Quoted 23 lines
--- drivers/pci/controller/pci-aardvark.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pci/controller/pci-aardvark.c +3
-1@@ -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);Signature · 1 line
2.20.1
Lorenzo Pieralisi
AppliedQuoted 14 lines · Pali Rohár
Quoted 13 lines · On Tuesday 07 July 2020 14:53:11 Lorenzo Pieralisi wrote:
Quoted 12 lines · Pali Rohár
Hello Lorenzo! Could you please review this patch?
Quoted 8 lines · 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 to0xffffffffwhich indicates failture.Signed-off-by Pali Rohár <[email protected]>
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
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/
Thanks applied to pci/aardvark.
Lorenzo
Quoted 27 lines
Quoted 27 lines
Lorenzo
Quoted 25 lines
Reported-by Bjorn Helgaas <[email protected]>Quoted 23 lines
--- drivers/pci/controller/pci-aardvark.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pci/controller/pci-aardvark.c +3
-1@@ -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);Signature · 1 line
2.20.1