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

From: Conley Lee
Date: Mon Jan 10 2022 - 02:52:44 EST


On 01/09/22 at 09:45下午, Corentin Labbe wrote:
> Date: Sun, 9 Jan 2022 21:45:01 +0100
> From: Corentin Labbe <clabbe.montjoie@xxxxxxxxx>
> To: conleylee@xxxxxxxxxxx
> Cc: davem@xxxxxxxxxxxxx, mripard@xxxxxxxxxx, wens@xxxxxxxx,
> jernej.skrabec@xxxxxxxxx, netdev@xxxxxxxxxxxxxxx,
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-sunxi@xxxxxxxxxxxxxxx,
> linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1] sun4i-emac.c: enable emac tx dma
>
> Le Sun, Jan 09, 2022 at 05:17:55PM +0800, conleylee@xxxxxxxxxxx a écrit :
> > From: conley <conleylee@xxxxxxxxxxx>
> >
> > 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@xxxxxxxxxx>.