All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Robin Gong <yibin.gong@nxp.com>,
	vkoul@kernel.org, s.hauer@pengutronix.de,
	dan.j.williams@intel.com, gregkh@linuxfoundation.org,
	jslaby@suse.com
Cc: linux-serial@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com
Subject: Re: [PATCH v5 0/7] add virt-dma support for imx-sdma
Date: Tue, 26 Jun 2018 17:04:02 +0200	[thread overview]
Message-ID: <1530025442.9910.44.camel@pengutronix.de> (raw)
In-Reply-To: <1529427424-12321-1-git-send-email-yibin.gong@nxp.com>

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@pengutronix.de>

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(-)
> 

WARNING: multiple messages have this Message-ID (diff)
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 0/7] add virt-dma support for imx-sdma
Date: Tue, 26 Jun 2018 17:04:02 +0200	[thread overview]
Message-ID: <1530025442.9910.44.camel@pengutronix.de> (raw)
In-Reply-To: <1529427424-12321-1-git-send-email-yibin.gong@nxp.com>

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@pengutronix.de>

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(-)
> 

  parent reply	other threads:[~2018-06-26 15:04 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 16:56 [PATCH v5 0/7] add virt-dma support for imx-sdma Robin Gong
2018-06-19 16:56 ` Robin Gong
2018-06-22  1:12 ` Robin Gong
2018-06-22  1:12   ` Robin Gong
2018-06-22  1:12   ` Robin Gong
2018-06-22  6:14 ` Sascha Hauer
2018-06-22  6:14   ` Sascha Hauer
2018-06-22  6:14   ` Sascha Hauer
2018-06-26 15:04 ` Lucas Stach [this message]
2018-06-26 15:04   ` Lucas Stach
2018-06-27  1:18   ` Robin Gong
2018-06-27  1:18     ` Robin Gong
2018-06-27  1:18     ` Robin Gong
2018-07-02  2:32   ` Robin Gong
2018-07-02  2:32     ` Robin Gong
2018-07-02  2:32     ` Robin Gong
2018-07-02 13:17     ` Vinod
2018-07-02 13:17       ` Vinod
2018-07-02 13:17       ` Vinod
2018-07-03  2:57       ` Robin Gong
2018-07-03  2:57         ` Robin Gong
2018-07-03  2:57         ` Robin Gong
2018-06-19 16:56 [v5,1/7] tty: serial: imx: correct dma cookie status Robin Gong
2018-06-19 16:56 ` [PATCH v5 1/7] " Robin Gong
2018-06-19 16:56 ` Robin Gong
2018-06-19 16:56 ` Robin Gong
2018-06-19 16:56 [v5,2/7] dmaengine: imx-sdma: factor out a struct sdma_desc from struct sdma_channel Robin Gong
2018-06-19 16:56 ` [PATCH v5 2/7] " Robin Gong
2018-06-19 16:56 ` Robin Gong
2018-06-19 16:57 [v5,3/7] dmaengine: imx-sdma: add virt-dma support Robin Gong
2018-06-19 16:57 ` [PATCH v5 3/7] " Robin Gong
2018-06-19 16:57 ` Robin Gong
2018-06-19 16:57 [v5,4/7] dmaengine: imx-sdma: remove useless 'lock' and 'enabled' in 'struct sdma_channel' Robin Gong
2018-06-19 16:57 ` [PATCH v5 4/7] " Robin Gong
2018-06-19 16:57 ` Robin Gong
2018-06-19 16:57 [v5,5/7] dmaengine: imx-sdma: remove the maximum limitation for bd numbers Robin Gong
2018-06-19 16:57 ` [PATCH v5 5/7] " Robin Gong
2018-06-19 16:57 ` Robin Gong
2018-06-19 16:57 [v5,6/7] dmaengine: imx-sdma: add sdma_transfer_init to decrease code overlap Robin Gong
2018-06-19 16:57 ` [PATCH v5 6/7] " Robin Gong
2018-06-19 16:57 ` Robin Gong
2018-06-19 16:57 [v5,7/7] dmaengine: imx-sdma: alloclate bd memory from dma pool Robin Gong
2018-06-19 16:57 ` [PATCH v5 7/7] " Robin Gong
2018-06-19 16:57 ` Robin Gong
2018-06-26 19:22 [v5,1/7] tty: serial: imx: correct dma cookie status Uwe Kleine-König
2018-06-26 19:22 ` [PATCH v5 1/7] " Uwe Kleine-König
2018-06-26 19:22 ` Uwe Kleine-König
2018-06-29 11:03 [v5,1/7] " Vinod Koul
2018-06-29 11:03 ` [PATCH v5 1/7] " Vinod
2018-06-29 11:03 ` Vinod
2018-08-06 12:44 [v5,7/7] dmaengine: imx-sdma: alloclate bd memory from dma pool Lucas Stach
2018-08-06 12:44 ` [PATCH v5 7/7] " Lucas Stach
2018-08-06 12:44 ` Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530025442.9910.44.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=vkoul@kernel.org \
    --cc=yibin.gong@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.