diff mbox series

PCI: brcmstb: fix broken brcm_pcie_mdio_write() polling

Message ID 20240217133722.14391-1-wahrenst@gmx.net
State New
Headers show
Series PCI: brcmstb: fix broken brcm_pcie_mdio_write() polling | expand

Commit Message

Stefan Wahren Feb. 17, 2024, 1:37 p.m. UTC
From: Jonathan Bell <jonathan@raspberrypi.com>

MDIO_WR_DONE() tests bit 31, which is always 0 (==done) as
readw_poll_timeout_atomic does a 16-bit read. Replace with the readl
variant.

Fixes: ca5dcc76314d ("PCI: brcmstb: Replace status loops with read_poll_timeout_atomic()")
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/pci/controller/pcie-brcmstb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Florian Fainelli Feb. 17, 2024, 5:27 p.m. UTC | #1
On 2/17/2024 5:37 AM, Stefan Wahren wrote:
> From: Jonathan Bell <jonathan@raspberrypi.com>
> 
> MDIO_WR_DONE() tests bit 31, which is always 0 (==done) as
> readw_poll_timeout_atomic does a 16-bit read. Replace with the readl
> variant.
> 
> Fixes: ca5dcc76314d ("PCI: brcmstb: Replace status loops with read_poll_timeout_atomic()")
> Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Excellent catch! Not sure what the real world impact was.

Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
Stefan Wahren March 2, 2024, 9:45 a.m. UTC | #2
Hi,

Am 17.02.24 um 18:27 schrieb Florian Fainelli:
>
>
> On 2/17/2024 5:37 AM, Stefan Wahren wrote:
>> From: Jonathan Bell <jonathan@raspberrypi.com>
>>
>> MDIO_WR_DONE() tests bit 31, which is always 0 (==done) as
>> readw_poll_timeout_atomic does a 16-bit read. Replace with the readl
>> variant.
>>
>> Fixes: ca5dcc76314d ("PCI: brcmstb: Replace status loops with
>> read_poll_timeout_atomic()")
>> Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>
> Excellent catch! Not sure what the real world impact was.
>
> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
is there anything what prevents this patch from being applied?
Stefan Wahren March 7, 2024, 6:59 p.m. UTC | #3
Am 02.03.24 um 10:45 schrieb Stefan Wahren:
> Hi,
>
> Am 17.02.24 um 18:27 schrieb Florian Fainelli:
>>
>>
>> On 2/17/2024 5:37 AM, Stefan Wahren wrote:
>>> From: Jonathan Bell <jonathan@raspberrypi.com>
>>>
>>> MDIO_WR_DONE() tests bit 31, which is always 0 (==done) as
>>> readw_poll_timeout_atomic does a 16-bit read. Replace with the readl
>>> variant.
>>>
>>> Fixes: ca5dcc76314d ("PCI: brcmstb: Replace status loops with
>>> read_poll_timeout_atomic()")
>>> Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
>>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>>
>> Excellent catch! Not sure what the real world impact was.
>>
>> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
> is there anything what prevents this patch from being applied?
ping
Krzysztof Wilczyński March 9, 2024, 5:08 p.m. UTC | #4
Hello,

> MDIO_WR_DONE() tests bit 31, which is always 0 (==done) as
> readw_poll_timeout_atomic does a 16-bit read. Replace with the readl
> variant.

Applied to controller/broadcom, thank you!

[1/1] PCI: brcmstb: Fix broken brcm_pcie_mdio_write() polling
      https://git.kernel.org/pci/pci/c/48389d984332

	Krzysztof
Krzysztof Wilczyński March 9, 2024, 5:13 p.m. UTC | #5
Hello,

[...]
> > is there anything what prevents this patch from being applied?
> ping

Everything looks good!  Apologies for the delay.

	Krzysztof
diff mbox series

Patch

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 618e84402eb50..a7f05e0c4ac51 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -420,7 +420,7 @@  static int brcm_pcie_mdio_write(void __iomem *base, u8 port,
 	readl(base + PCIE_RC_DL_MDIO_ADDR);
 	writel(MDIO_DATA_DONE_MASK | wrdata, base + PCIE_RC_DL_MDIO_WR_DATA);

-	err = readw_poll_timeout_atomic(base + PCIE_RC_DL_MDIO_WR_DATA, data,
+	err = readl_poll_timeout_atomic(base + PCIE_RC_DL_MDIO_WR_DATA, data,
 					MDIO_WT_DONE(data), 10, 100);
 	return err;
 }