* [PATCH v4 1/1] net: axienet: Move reset before 64-bit DMA detection
@ 2023-06-22 19:22 Maxim Kochetkov
2023-06-22 20:32 ` Jakub Kicinski
2023-06-24 22:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Maxim Kochetkov @ 2023-06-22 19:22 UTC (permalink / raw)
To: netdev
Cc: Maxim Kochetkov, Robert Hancock, Radhey Shyam Pandey,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Michal Simek, Andre Przywara, linux-arm-kernel, linux-kernel
64-bit DMA detection will fail if axienet was started before (by boot
loader, boot ROM, etc). In this state axienet will not start properly.
XAXIDMA_TX_CDESC_OFFSET + 4 register (MM2S_CURDESC_MSB) is used to detect
64-bit DMA capability here. But datasheet says: When DMACR.RS is 1
(axienet is in enabled state), CURDESC_PTR becomes Read Only (RO) and
is used to fetch the first descriptor. So iowrite32()/ioread32() trick
to this register to detect 64-bit DMA will not work.
So move axienet reset before 64-bit DMA detection.
Fixes: f735c40ed93c ("net: axienet: Autodetect 64-bit DMA capability")
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Reviewed-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
---
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 3e310b55bce2..734822321e0a 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -2042,6 +2042,11 @@ static int axienet_probe(struct platform_device *pdev)
goto cleanup_clk;
}
+ /* Reset core now that clocks are enabled, prior to accessing MDIO */
+ ret = __axienet_device_reset(lp);
+ if (ret)
+ goto cleanup_clk;
+
/* Autodetect the need for 64-bit DMA pointers.
* When the IP is configured for a bus width bigger than 32 bits,
* writing the MSB registers is mandatory, even if they are all 0.
@@ -2096,11 +2101,6 @@ static int axienet_probe(struct platform_device *pdev)
lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD;
lp->coalesce_usec_tx = XAXIDMA_DFT_TX_USEC;
- /* Reset core now that clocks are enabled, prior to accessing MDIO */
- ret = __axienet_device_reset(lp);
- if (ret)
- goto cleanup_clk;
-
ret = axienet_mdio_setup(lp);
if (ret)
dev_warn(&pdev->dev,
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v4 1/1] net: axienet: Move reset before 64-bit DMA detection
2023-06-22 19:22 [PATCH v4 1/1] net: axienet: Move reset before 64-bit DMA detection Maxim Kochetkov
@ 2023-06-22 20:32 ` Jakub Kicinski
2023-06-24 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-06-22 20:32 UTC (permalink / raw)
To: Maxim Kochetkov
Cc: netdev, Robert Hancock, Radhey Shyam Pandey, David S. Miller,
Eric Dumazet, Paolo Abeni, Michal Simek, Andre Przywara,
linux-arm-kernel, linux-kernel
On Thu, 22 Jun 2023 22:22:45 +0300 Maxim Kochetkov wrote:
> 64-bit DMA detection will fail if axienet was started before (by boot
> loader, boot ROM, etc). In this state axienet will not start properly.
> XAXIDMA_TX_CDESC_OFFSET + 4 register (MM2S_CURDESC_MSB) is used to detect
> 64-bit DMA capability here. But datasheet says: When DMACR.RS is 1
> (axienet is in enabled state), CURDESC_PTR becomes Read Only (RO) and
> is used to fetch the first descriptor. So iowrite32()/ioread32() trick
> to this register to detect 64-bit DMA will not work.
> So move axienet reset before 64-bit DMA detection.
>
> Fixes: f735c40ed93c ("net: axienet: Autodetect 64-bit DMA capability")
> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
> Reviewed-by: Robert Hancock <robert.hancock@calian.com>
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Quoting documentation:
Resending after review
~~~~~~~~~~~~~~~~~~~~~~
Allow at least 24 hours to pass between postings. This will ensure reviewers
from all geographical locations have a chance to chime in. Do not wait
too long (weeks) between postings either as it will make it harder for reviewers
to recall all the context.
Make sure you address all the feedback in your new posting. Do not post a new
version of the code if the discussion about the previous version is still
ongoing, unless directly instructed by a reviewer.
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#resending-after-review
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4 1/1] net: axienet: Move reset before 64-bit DMA detection
2023-06-22 19:22 [PATCH v4 1/1] net: axienet: Move reset before 64-bit DMA detection Maxim Kochetkov
2023-06-22 20:32 ` Jakub Kicinski
@ 2023-06-24 22:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-06-24 22:50 UTC (permalink / raw)
To: Maxim Kochetkov
Cc: netdev, robert.hancock, radhey.shyam.pandey, davem, edumazet,
kuba, pabeni, michal.simek, andre.przywara, linux-arm-kernel,
linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 22 Jun 2023 22:22:45 +0300 you wrote:
> 64-bit DMA detection will fail if axienet was started before (by boot
> loader, boot ROM, etc). In this state axienet will not start properly.
> XAXIDMA_TX_CDESC_OFFSET + 4 register (MM2S_CURDESC_MSB) is used to detect
> 64-bit DMA capability here. But datasheet says: When DMACR.RS is 1
> (axienet is in enabled state), CURDESC_PTR becomes Read Only (RO) and
> is used to fetch the first descriptor. So iowrite32()/ioread32() trick
> to this register to detect 64-bit DMA will not work.
> So move axienet reset before 64-bit DMA detection.
>
> [...]
Here is the summary with links:
- [v4,1/1] net: axienet: Move reset before 64-bit DMA detection
https://git.kernel.org/netdev/net/c/f1bc9fc4a06d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-24 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22 19:22 [PATCH v4 1/1] net: axienet: Move reset before 64-bit DMA detection Maxim Kochetkov
2023-06-22 20:32 ` Jakub Kicinski
2023-06-24 22:50 ` patchwork-bot+netdevbpf
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).