RE: [PATCH v5 0/7] add virt-dma support for imx-sdma

From: Robin Gong
Date: Tue Jun 26 2018 - 21:18:21 EST


Thanks Lucas. Let's wait for comments from Vinod.

-----Original Message-----
From: Lucas Stach [mailto:l.stach@xxxxxxxxxxxxxx]
Sent: 2018å6æ26æ 23:04
To: Robin Gong <yibin.gong@xxxxxxx>; vkoul@xxxxxxxxxx; s.hauer@xxxxxxxxxxxxxx; dan.j.williams@xxxxxxxxx; gregkh@xxxxxxxxxxxxxxxxxxx; jslaby@xxxxxxxx
Cc: linux-serial@xxxxxxxxxxxxxxx; dmaengine@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; dl-linux-imx <linux-imx@xxxxxxx>
Subject: Re: [PATCH v5 0/7] add virt-dma support for imx-sdma

Hi Robin,

I've tested this whole series with the SDMA being used for SPI, UART and SSI with no regressions spotted. As this should cover most common use-cases, I think this series is good to go in.

Tested-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>

Regards,
Lucas

Am Mittwoch, den 20.06.2018, 00:56 +0800 schrieb Robin Gong:
> The legacy sdma driver has below limitations or drawbacks:
> Â 1. Hardcode the max BDs number as "PAGE_SIZE / sizeof(*)", and alloc
> ÂÂÂÂÂone page size for one channel regardless of only few BDs needed
> ÂÂÂÂÂmost time. But in few cases, the max PAGE_SIZE maybe not enough.
> Â 2. One SDMA channel can't stop immediatley once channel disabled
> which
> ÂÂÂÂÂmeans SDMA interrupt may come in after this channel
> terminated.There
> ÂÂÂÂÂare some patches for this corner case such as commit
> "2746e2c389f9",
> ÂÂÂÂÂbut not cover non-cyclic.
>
> The common virt-dma overcomes the above limitations. It can alloc bd
> dynamically and free bd once this tx transfer done. No memory wasted
> or maximum limititation here, only depends on how many memory can be
> requested from kernel. For No.2, such issue can be workaround by
> checking if there is available descript("sdmac->desc") now once the
> unwanted interrupt coming. At last the common virt-dma is easier for sdma driver maintain.
>
> Change from v4:
> Â 1. identify lockdep issue which caused by allocate memory with
> ÂÂÂÂÂ'GFP_KERNEL', change to 'GFP_NOWAIT' instead so that lockdep
> ÂÂÂÂÂignore check. That also make sense since Audio/uart driver may
> ÂÂÂÂÂcall dma function after spin_lock_irqsave()...
> Â 2. use dma pool instead for bd description allocated,since audio
> ÂÂÂÂÂdriver may call dma_terminate_all in irq. Please refer to 7/7.
> Â 3. remove 7/7 serial patch in v4, since lockdep issued fixed by No.1
>
> Change from v3:
> Â 1. add two uart patches which impacted by this patchset.
> Â 2. unlock 'vc.lock' before cyclic dma callback and lock again after
> ÂÂÂÂÂit because some driver such as uart will call dmaengine_tx_status
> ÂÂÂÂÂwhich will acquire 'vc.lock' again and dead lock comes out.
> Â 3. remove 'Revert commit' stuff since that patch is not wrong and
> ÂÂÂÂÂcombine two patch into one patch as Sascha's comment.
>
> Change from v2:
> Â 1. include Sascha's patch to make the main patch easier to review.
> ÂÂÂÂÂThanks Sacha.
> Â 2. remove useless 'desc'/'chan' in struct sdma_channe.
>
> Change from v1:
> Â 1. split v1 patch into 5 patches.
> Â 2. remove some unnecessary condition check.
> Â 3. remove unnecessary 'pending' list.
>
> Robin Gong (6):
> Â tty: serial: imx: correct dma cookie status
> Â dmaengine: imx-sdma: add virt-dma support
> Â dmaengine: imx-sdma: remove useless 'lock' and 'enabled' in 'struct
> ÂÂÂÂsdma_channel'
> Â dmaengine: imx-sdma: remove the maximum limitation for bd numbers
> Â dmaengine: imx-sdma: add sdma_transfer_init to decrease code overlap
> Â dmaengine: imx-sdma: alloclate bd memory from dma pool
>
> Sascha Hauer (1):
> Â dmaengine: imx-sdma: factor out a struct sdma_desc from struct
> ÂÂÂÂsdma_channel
>
> Âdrivers/dma/KconfigÂÂÂÂÂÂ|ÂÂÂ1 +
> Âdrivers/dma/imx-sdma.cÂÂÂ| 400
> +++++++++++++++++++++++++++--------------------
> Âdrivers/tty/serial/imx.c |ÂÂÂ2 +-
> Â3 files changed, 235 insertions(+), 168 deletions(-)
>