From patchwork Thu Apr 11 16:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 10896431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBAD11390 for ; Thu, 11 Apr 2019 16:43:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D66BA28D7B for ; Thu, 11 Apr 2019 16:43:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CADA528D84; Thu, 11 Apr 2019 16:43:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 811F728D88 for ; Thu, 11 Apr 2019 16:43:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 522CF89919; Thu, 11 Apr 2019 16:43:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id D12AE89915 for ; Thu, 11 Apr 2019 16:42:59 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:49732 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1hEcmw-0007LK-1I; Thu, 11 Apr 2019 18:42:58 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: linux-spi@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v4 3/4] spi/spi-bcm2835: Remove DMA transfer size cap Date: Thu, 11 Apr 2019 18:42:34 +0200 Message-Id: <20190411164235.49771-4-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190411164235.49771-1-noralf@tronnes.org> References: <20190411164235.49771-1-noralf@tronnes.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=vApEtAq5eR6HIro8BjCyMwhBiFvzodh44LJBX1/KZfM=; b=SDvfXwK7TFALG8wYWfYpDS+nlxMKcHxukZT9thx7BO7FXAaAmPKcXE9LxoWdUs9tMzr9pbttA0gFsO+YFV86xggSj9xRQ2m/DoDuE0Hqb71/wE59NZG22p44R/vC28hA3+ZRpGHkaMlf6ECRcyecJtTcau8PpoR4qQKnKG9VdazigFEp1G/ZcC7A0iWs4QQFT2z/dIC1L7m15aJj2MCOHzXHm+utTRj4quFqOouUXIxspOxM2X1KdnNYtBsXz3JR6KhTVFPJ9zVT7U+4afPzAW8K/UNadCuOGyl2WWuwew6y+VZmXAX1NnQBrNxhEQMXngBWGxEZn6pW5PypAUBVYA==; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stefan.wahren@i2se.com, broonie@kernel.org, linux-rpi-kernel@lists.infradead.org, meghana.madhyastha@gmail.com, kernel@martin.sperl.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Meghana Madhyastha 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 Signed-off-by: Noralf Trønnes --- 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;