[PATCH v1] sun4i-emac.c: enable emac tx dma

Conley Lee conleylee at foxmail.com
Sun Jan 9 23:47:02 PST 2022


On 01/09/22 at 09:45下午, Corentin Labbe wrote:
> Date: Sun, 9 Jan 2022 21:45:01 +0100
> From: Corentin Labbe <clabbe.montjoie at gmail.com>
> To: conleylee at foxmail.com
> Cc: davem at davemloft.net, mripard at kernel.org, wens at csie.org,
>  jernej.skrabec at gmail.com, netdev at vger.kernel.org,
>  linux-arm-kernel at lists.infradead.org, linux-sunxi at lists.linux.dev,
>  linux-kernel at vger.kernel.org
> Subject: Re: [PATCH v1] sun4i-emac.c: enable emac tx dma
> 
> Le Sun, Jan 09, 2022 at 05:17:55PM +0800, conleylee at foxmail.com a écrit :
> > From: conley <conleylee at foxmail.com>
> > 
> > Hello
> > I am reading the R40 user manual and trying to create a new path to enable
> > emac tx dma channel. According to the figure 8-21(TX Operation Diagram),
> > I try to enable emac tx dma channel by the follow steps:
> > 1. enable tx dma mode
> > 2. set packet lengths
> > 2. move data from skb to tx fifo by using dma in xmit function.
> > 3. start transfer from tx fifo to phy in dma tx done callback
> > 
> > But it doesn't work. emac tx interrupt and dma finished interrupt are
> > raised, but no packets are transmitted (I test it by tcpdump).
> > Do you know how to configure the emac tx dma correctly? Thanks ~
> > 
> 
> Hello
> 
> Here are my thoughts to help you:
> - Your email is not a real patch, but an ask for help, so you should not use [ PATCH ] in the subject.
> - If it was a patch, "v1" is not necessary
> - Your patch below is doing too many unrelated different things, it is hard to see the DMA TX enable part
> - I think you could first send a preliminary patch which adds all EMAC_INT_CTL_TX_xxx which are already used by the driver (to reduce the diff)
> - Without the DTB change, it is hard to see the whole picture, did you correctly use the right dma number for an easy example.
> - Knowing also the board (and so PHY, modes etc...) could help
> - I think your priority should not to add TX, but to fix reported problems to your initial patch (build warnings/error https://marc.info/?l=linux-arm-kernel&m=164159846213585&w=2) since your work on TX will need to be applied after this.
> - For the previous point, always build test with at least 2 different 32/64 arch. And if possible a total different arch (like x86_64).
> 
> Anyway, I will try to test your patch on my a10 board
> 
> Regards
Thanks a lot for your help ~ I will submit an patch which add all
register related. By the way, the build warnings problems have been fixed
by Jakub Kicinski <kuba at kernel.org>.



More information about the linux-arm-kernel mailing list