All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: linux-spi@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: stefan.wahren@i2se.com, broonie@kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	meghana.madhyastha@gmail.com, kernel@martin.sperl.org
Subject: [PATCH v4 3/4] spi/spi-bcm2835: Remove DMA transfer size cap
Date: Thu, 11 Apr 2019 18:42:34 +0200	[thread overview]
Message-ID: <20190411164235.49771-4-noralf@tronnes.org> (raw)
In-Reply-To: <20190411164235.49771-1-noralf@tronnes.org>

From: Meghana Madhyastha <meghana.madhyastha@gmail.com>

The spi core splits up transfers larger than ->max_dma_len now so we can
remove the upper bound on DMA transfers. Limit max_dma_len to 65532,
because the scatter gather segment is required to be a multiple of 4.

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/spi/spi-bcm2835.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 35aebdfd3b4e..caf33da01ac1 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -630,19 +630,6 @@ static bool bcm2835_spi_can_dma(struct spi_master *master,
 	if (tfr->len < BCM2835_SPI_DMA_MIN_LENGTH)
 		return false;
 
-	/* BCM2835_SPI_DLEN has defined a max transfer size as
-	 * 16 bit, so max is 65535
-	 * we can revisit this by using an alternative transfer
-	 * method - ideally this would get done without any more
-	 * interaction...
-	 */
-	if (tfr->len > 65535) {
-		dev_warn_once(&spi->dev,
-			      "transfer size of %d too big for dma-transfer\n",
-			      tfr->len);
-		return false;
-	}
-
 	/* return OK */
 	return true;
 }
@@ -707,7 +694,7 @@ static void bcm2835_dma_init(struct spi_master *master, struct device *dev)
 
 	/* all went well, so set can_dma */
 	master->can_dma = bcm2835_spi_can_dma;
-	master->max_dma_len = 65535; /* limitation by BCM2835_SPI_DLEN */
+	master->max_dma_len = 65532; /* limitation by BCM2835_SPI_DLEN */
 	/* need to do TX AND RX DMA, so we need dummy buffers */
 	master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX;
 
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-04-11 16:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 16:42 [PATCH v4 0/4] Chunk splitting of spi transfers Noralf Trønnes
2019-04-11 16:42 ` [PATCH v4 1/4] spi: Remove warning in spi_split_transfers_maxsize() Noralf Trønnes
     [not found] ` <20190411164235.49771-1-noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2019-04-11 16:42   ` [PATCH v4 2/4] spi: Split spi message into max_dma_len size chunks Noralf Trønnes
2019-04-11 18:18     ` Lukas Wunner
2019-04-11 21:02       ` Noralf Trønnes
2019-04-12  9:47         ` Mark Brown
     [not found]           ` <20190412094721.GE6909-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2019-04-12 10:03             ` kernel-TqfNSX0MhmxHKSADF0wUEw
2019-04-12 10:22               ` Mark Brown
2019-04-12 10:54           ` Lukas Wunner
2019-04-12 11:09             ` Mark Brown
2019-04-12 11:16               ` Lukas Wunner
2019-04-12 11:28                 ` Mark Brown
     [not found]                 ` <20190412111615.25iogtr6qwc5zbx7-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2019-04-12 11:34                   ` kernel-TqfNSX0MhmxHKSADF0wUEw
2019-04-12 10:46         ` Lukas Wunner
2019-04-12 11:46           ` Mark Brown
2019-04-11 20:39     ` Noralf Trønnes
     [not found]     ` <20190411164235.49771-3-noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2019-04-12  9:08       ` Mark Brown
2019-04-11 16:42 ` Noralf Trønnes [this message]
2019-04-11 16:42 ` [PATCH v4 4/4] drm/tinydrm: Remove chunk splitting in tinydrm_spi_transfer Noralf Trønnes

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=20190411164235.49771-4-noralf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@martin.sperl.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=meghana.madhyastha@gmail.com \
    --cc=stefan.wahren@i2se.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.