linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe()
@ 2021-03-08 13:56 'Wei Yongjun
  2021-03-08 14:49 ` Krzysztof Wilczyński
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: 'Wei Yongjun @ 2021-03-08 13:56 UTC (permalink / raw)
  To: weiyongjun1, Nicolas Saenz Julienne, Lorenzo Pieralisi,
	Bjorn Helgaas, Florian Fainelli, bcm-kernel-feedback-list,
	Philipp Zabel, Rafał Miłecki
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-pci, kernel-janitors,
	Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return negative error code -ENODEV from the unsupported revision
error handling case instead of 0, as done elsewhere in this function.

Fixes: 0cdfaceb9889 ("PCI: brcmstb: support BCM4908 with external PERST# signal controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pci/controller/pcie-brcmstb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index e330e6811f0b..69c999222cc8 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1296,6 +1296,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
 	pcie->hw_rev = readl(pcie->base + PCIE_MISC_REVISION);
 	if (pcie->type == BCM4908 && pcie->hw_rev >= BRCM_PCIE_HW_REV_3_20) {
 		dev_err(pcie->dev, "hardware revision with unsupported PERST# setup\n");
+		ret = -ENODEV;
 		goto fail;
 	}
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe()
  2021-03-08 13:56 [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe() 'Wei Yongjun
@ 2021-03-08 14:49 ` Krzysztof Wilczyński
  2021-03-08 16:34 ` Florian Fainelli
  2021-03-22 17:50 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Wilczyński @ 2021-03-08 14:49 UTC (permalink / raw)
  To: 'Wei Yongjun
  Cc: Nicolas Saenz Julienne, Lorenzo Pieralisi, Bjorn Helgaas,
	Florian Fainelli, bcm-kernel-feedback-list, Philipp Zabel,
	Rafał Miłecki, linux-rpi-kernel, linux-arm-kernel,
	linux-pci, kernel-janitors, Hulk Robot

Hi,

[...]
>  	if (pcie->type == BCM4908 && pcie->hw_rev >= BRCM_PCIE_HW_REV_3_20) {
>  		dev_err(pcie->dev, "hardware revision with unsupported PERST# setup\n");
> +		ret = -ENODEV;
>  		goto fail;
[...]

Nice catch!

Reviewed-by: Krzysztof Wilczyński <kw@linux.com>

Thank you!

Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe()
  2021-03-08 13:56 [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe() 'Wei Yongjun
  2021-03-08 14:49 ` Krzysztof Wilczyński
@ 2021-03-08 16:34 ` Florian Fainelli
  2021-03-22 17:50 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-03-08 16:34 UTC (permalink / raw)
  To: 'Wei Yongjun, Nicolas Saenz Julienne, Lorenzo Pieralisi,
	Bjorn Helgaas, bcm-kernel-feedback-list, Philipp Zabel,
	Rafał Miłecki
  Cc: linux-rpi-kernel, linux-arm-kernel, linux-pci, kernel-janitors,
	Hulk Robot



On 3/8/2021 5:56 AM, 'Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return negative error code -ENODEV from the unsupported revision
> error handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 0cdfaceb9889 ("PCI: brcmstb: support BCM4908 with external PERST# signal controller")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe()
  2021-03-08 13:56 [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe() 'Wei Yongjun
  2021-03-08 14:49 ` Krzysztof Wilczyński
  2021-03-08 16:34 ` Florian Fainelli
@ 2021-03-22 17:50 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2021-03-22 17:50 UTC (permalink / raw)
  To: Nicolas Saenz Julienne, 'Wei Yongjun,
	Rafał Miłecki, Philipp Zabel, bcm-kernel-feedback-list,
	Bjorn Helgaas, Florian Fainelli
  Cc: Lorenzo Pieralisi, linux-rpi-kernel, linux-arm-kernel,
	Hulk Robot, kernel-janitors, linux-pci

On Mon, 8 Mar 2021 13:56:19 +0000, 'Wei Yongjun wrote:
> Fix to return negative error code -ENODEV from the unsupported revision
> error handling case instead of 0, as done elsewhere in this function.

Applied to pci/brcmstb, thanks!

[1/1] PCI: brcmstb: Fix error return code in brcm_pcie_probe()
      https://git.kernel.org/lpieralisi/pci/c/b5d9209d50

Thanks,
Lorenzo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-22 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 13:56 [PATCH -next] PCI: brcmstb: Fix error return code in brcm_pcie_probe() 'Wei Yongjun
2021-03-08 14:49 ` Krzysztof Wilczyński
2021-03-08 16:34 ` Florian Fainelli
2021-03-22 17:50 ` Lorenzo Pieralisi

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).