lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_E30BB769A8609EADCF03F1FDA7C0AF146205@qq.com>
Date:   Mon, 3 Jan 2022 20:21:25 +0800
From:   Conley Lee <conleylee@...mail.com>
To:     Corentin Labbe <clabbe.montjoie@...il.com>
Cc:     davem@...emloft.net, mripard@...nel.org, wens@...e.org,
        jernej.skrabec@...il.com, netdev@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6] sun4i-emac.c: add dma support

On 01/03/22 at 12:42下午, Corentin Labbe wrote:
> Date: Mon, 3 Jan 2022 12:42:58 +0100
> From: Corentin Labbe <clabbe.montjoie@...il.com>
> To: Conley Lee <conleylee@...mail.com>
> Cc: davem@...emloft.net, mripard@...nel.org, wens@...e.org,
>  jernej.skrabec@...il.com, netdev@...r.kernel.org,
>  linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
>  linux-kernel@...r.kernel.org
> Subject: Re: [PATCH v6] sun4i-emac.c: add dma support
> 
> Le Mon, Jan 03, 2022 at 10:55:04AM +0800, Conley Lee a écrit :
> > On 01/02/22 at 06:38下午, Corentin Labbe wrote:
> > > Date: Sun, 2 Jan 2022 18:38:51 +0100
> > > From: Corentin Labbe <clabbe.montjoie@...il.com>
> > > To: Conley Lee <conleylee@...mail.com>
> > > Cc: davem@...emloft.net, kuba@...nel.org, mripard@...nel.org,
> > >  wens@...e.org, netdev@...r.kernel.org,
> > >  linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
> > >  linux-sunxi@...ts.linux.dev, jernej.skrabec@...il.com
> > > Subject: Re: [PATCH v6] sun4i-emac.c: add dma support
> > > 
> > > Le Sat, Jan 01, 2022 at 03:09:01PM +0800, Conley Lee a écrit :
> > > > On 12/31/21 at 11:43上午, Corentin Labbe wrote:
> > > > > Date: Fri, 31 Dec 2021 11:43:53 +0100
> > > > > From: Corentin Labbe <clabbe.montjoie@...il.com>
> > > > > To: conleylee@...mail.com
> > > > > Cc: davem@...emloft.net, kuba@...nel.org, mripard@...nel.org,
> > > > >  wens@...e.org, netdev@...r.kernel.org,
> > > > >  linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
> > > > > Subject: Re: [PATCH v6] sun4i-emac.c: add dma support
> > > > > 
> > > > > Le Wed, Dec 29, 2021 at 09:43:51AM +0800, conleylee@...mail.com a écrit :
> > > > > > From: Conley Lee <conleylee@...mail.com>
> > > > > > 
> > > > > > Thanks for your review. Here is the new version for this patch.
> > > > > > 
> > > > > > This patch adds support for the emac rx dma present on sun4i. The emac
> > > > > > is able to move packets from rx fifo to RAM by using dma.
> > > > > > 
> > > > > > Change since v4.
> > > > > >   - rename sbk field to skb
> > > > > >   - rename alloc_emac_dma_req to emac_alloc_dma_req
> > > > > >   - using kzalloc(..., GPF_ATOMIC) in interrupt context to avoid
> > > > > >     sleeping
> > > > > >   - retry by using emac_inblk_32bit when emac_dma_inblk_32bit fails
> > > > > >   - fix some code style issues 
> > > > > > 
> > > > > > Change since v5.
> > > > > >   - fix some code style issue
> > > > > > 
> > > > > 
> > > > > Hello
> > > > > 
> > > > > I just tested this on a sun4i-a10-olinuxino-lime
> > > > > 
> > > > > I got:
> > > > > [    2.922812] sun4i-emac 1c0b000.ethernet (unnamed net_device) (uninitialized): get io resource from device: 0x1c0b000, size = 4096
> > > > > [    2.934512] sun4i-emac 1c0b000.ethernet (unnamed net_device) (uninitialized): failed to request dma channel. dma is disabled
> > > > > [    2.945740] sun4i-emac 1c0b000.ethernet (unnamed net_device) (uninitialized): configure dma failed. disable dma.
> > > > > [    2.957887] sun4i-emac 1c0b000.ethernet: eth0: at (ptrval), IRQ 19 MAC: 02:49:09:40:ab:3d
> > > > > 
> > > > > On which board did you test it and how ?
> > > > > 
> > > > > Regards
> > > > 
> > > > Sorry. I sent the email with text/html format. This email is an clean version.
> > > > 
> > > > In order to enable dma rx channel. `dmas` and `dma-names` properties
> > > > should be added to emac section in dts:
> > > > 
> > > > emac: ethernet@...b000 {
> > > > 	...
> > > > 	dmas = <&dma SUN4I_DMA_DEDICATED 7>;
> > > > 	dma-names = "rx";
> > > > 	...
> > > > }
> > > 
> > > Helo
> > > 
> > > Yes I figured that out. But you should have done a patch serie adding this.
> > > Your patch is now applied but it is a useless change without the dtb change.
> > > You should also probably update the driver binding (Documentation/devicetree/bindings/net/allwinner,sun4i-a10-emac.yaml) since you add new members to DT node.
> > > 
> > > Furthermore, why did you add RX only and not TX dma also ?
> > > 
> > > Probably it is too late since patch is applied but it is:
> > > Tested-by: Corentin Labbe <clabbe.montjoie@...il.com>
> > > Tested-on: sun4i-a10-olinuxino-lime
> > > 
> > > Regards
> > 
> > Thanks for your suggestion. I will submit a patch to add those changes
> > later. 
> > 
> > And the reason why I didn't add TX support is becasuse there is no any
> > public page to describe sun4i emac TX DMA register map. So, I don't known
> > how to enable TX DMA at hardware level. If you has any page or datasheet
> > about EMAC TX DMA, can you share with me ? Thanks.
> 
> Hello
> 
> You can find TX DMA info on the R40 Use manual (8.10.5.2 Register Name: EMAC_TX_MODE)
> 
> You should keep all people in CC when you answer to someone.
> 
> Regards

Haha, got it! I have been looking for the docs about emac register map
for a long time. You really help me a lot. I will submit a new patch to
add driver bidding and enable both RX and TX channels. Thanks ~

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ