linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: linux-mtd@lists.infradead.org
Cc: kernel@pengutronix.de, Boris Brezillon <bbrezillon@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Vinod Koul <vkoul@kernel.org>, NXP Linux Team <linux-imx@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Han Xu <han.xu@nxp.com>, Shawn Guo <shawnguo@kernel.org>
Subject: [PATCH 10/14] dma: mxs: Drop unnecessary flag
Date: Tue,  9 Apr 2019 13:34:17 +0200	[thread overview]
Message-ID: <20190409113421.3037-11-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20190409113421.3037-1-s.hauer@pengutronix.de>

The mxs dma driver insists on having the DMA_PREP_INTERRUPT flag set
on all but the first transfer. There's no need to let the user set this
flag, the driver can do it internally whenever it needs it. Drop
handling of this flag from the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/mxs-dma.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 22cc7f68ef6e..ce92a3626ea4 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -477,16 +477,16 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)
  *            ......
  *            ->device_prep_slave_sg(0);
  *            ......
- *            ->device_prep_slave_sg(DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+ *            ->device_prep_slave_sg(DMA_CTRL_ACK);
  *            ......
  *    [3] If there are more than two DMA commands in the DMA chain, the code
  *        should be:
  *            ......
  *            ->device_prep_slave_sg(0);                                // First
  *            ......
- *            ->device_prep_slave_sg(DMA_PREP_INTERRUPT [| DMA_CTRL_ACK]);
+ *            ->device_prep_slave_sg(DMA_CTRL_ACK]);
  *            ......
- *            ->device_prep_slave_sg(DMA_PREP_INTERRUPT | DMA_CTRL_ACK); // Last
+ *            ->device_prep_slave_sg(DMA_CTRL_ACK); // Last
  *            ......
  */
 static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
@@ -500,13 +500,12 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 	struct scatterlist *sg;
 	u32 i, j;
 	u32 *pio;
-	bool append = flags & DMA_PREP_INTERRUPT;
-	int idx = append ? mxs_chan->desc_count : 0;
+	int idx = 0;
 
-	if (mxs_chan->status == DMA_IN_PROGRESS && !append)
-		return NULL;
+	if (mxs_chan->status == DMA_IN_PROGRESS)
+		idx = mxs_chan->desc_count;
 
-	if (sg_len + (append ? idx : 0) > NUM_CCW) {
+	if (sg_len + idx > NUM_CCW) {
 		dev_err(mxs_dma->dma_device.dev,
 				"maximum number of sg exceeded: %d > %d\n",
 				sg_len, NUM_CCW);
@@ -520,7 +519,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 	 * If the sg is prepared with append flag set, the sg
 	 * will be appended to the last prepared sg.
 	 */
-	if (append) {
+	if (idx) {
 		BUG_ON(idx < 1);
 		ccw = &mxs_chan->ccw[idx - 1];
 		ccw->next = mxs_chan->ccw_phys + sizeof(*ccw) * idx;
-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2019-04-09 11:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 11:34 [PATCH v2 00/14] Implement exec_op for GPMI nand driver Sascha Hauer
2019-04-09 11:34 ` [PATCH 01/14] mtd: rawnand: export nand operation tracer Sascha Hauer
2019-04-17 10:22   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 02/14] mtd: rawnand: fsmc: Use nand_op_trace for operation tracing Sascha Hauer
2019-04-17 10:22   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 03/14] mtd: rawnand: gpmi: move all driver code into single file Sascha Hauer
2019-04-17 10:23   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 04/14] mtd: rawnand: gpmi: remove unused variable Sascha Hauer
2019-04-17 10:24   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 05/14] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
2019-04-17 10:24   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 06/14] mtd: rawnand: gpmi: read buf in nand_read_page_op Sascha Hauer
2019-04-17 10:25   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 07/14] mtd: rawnand: gpmi: remove unused parameters Sascha Hauer
2019-04-17 10:26   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 08/14] mtd: rawnand: gpmi: Drop unnecessary restoring of previous chipselection Sascha Hauer
2019-04-17 10:27   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 09/14] mtd: rawnand: gpmi: use runtime PM to manage clocks Sascha Hauer
2019-04-17 10:28   ` Miquel Raynal
2019-04-09 11:34 ` Sascha Hauer [this message]
2019-04-17  8:16   ` [PATCH 10/14] dma: mxs: Drop unnecessary flag Miquel Raynal
2019-04-23  5:21     ` Vinod Koul
2019-04-23  5:22   ` Vinod Koul
2019-04-09 11:34 ` [PATCH 11/14] mtd: rawnand: gpmi: drop " Sascha Hauer
2019-04-17 10:28   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 12/14] dma: mxs: Add header file to be shared with gpmi nand driver Sascha Hauer
2019-04-23  5:24   ` Vinod Koul
2019-04-09 11:34 ` [PATCH 13/14] dma: mxs: rename custom flag Sascha Hauer
2019-04-23  5:25   ` Vinod Koul
2019-04-09 11:34 ` [PATCH 14/14] mtd: rawnand: gpmi: Implement exec_op Sascha Hauer
2019-04-17 10:33   ` Miquel Raynal
2019-04-24  7:09     ` Sascha Hauer
2019-04-29  7:23       ` Miquel Raynal

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=20190409113421.3037-11-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=bbrezillon@kernel.org \
    --cc=festevam@gmail.com \
    --cc=han.xu@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=shawnguo@kernel.org \
    --cc=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).