From patchwork Wed Oct 16 19:57:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11194077 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6472415AB for ; Wed, 16 Oct 2019 19:57:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E19A20854 for ; Wed, 16 Oct 2019 19:57:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Q5dT4a88"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="YOxOhnYl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E19A20854 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JZmp6WGgPzD9h10mFDniprsp5hZI7tmhNz2mEesPe4U=; b=Q5dT4a88sXFHKM p3fc/l+ISZEEGTIHkAcClXUJ6QAFPDxKSY8roC94N31SlUi2ouUFZKNte6s5SWlcB/9/x/yHgCT5f 8/TwIRp2VfqUmDQOx9uPANI5vDhJPBmGEAx1UN1ePZ2NZbl7XVLk4RNkLlvrAwH2/ZIi+tltYX2z5 CO/mHIagDMR2iMHpWgfAaRKjCqlI7E+oDyNcYC09mv04R5UPWNds4DQZmK1hdBF11Iyj6iMCYbxwT ezWGP7VCO2MWbG5o2ZK1Amt+riF7pXeyg+kA8twe8KoxUaZoOi+bkDOzDrj9B19h/A7ezcUuJOWeT 38F4ykQiweQBF4uMsdvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKpQN-0002R8-9i; Wed, 16 Oct 2019 19:57:35 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKpQJ-0002Q7-7z for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2019 19:57:32 +0000 Received: by mail-wr1-x441.google.com with SMTP id p4so13572290wrm.8 for ; Wed, 16 Oct 2019 12:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NG+1N8pqfTQP+Jc9hKyg5BqhDrJd8BVaVZCbMzcwzpQ=; b=YOxOhnYlgzS2Tk4VK481ftR03oNVQw/9Gepa5WfUSzlqM+BqFzjdDM+kWHO2jePcGR 1gDaEiYOejp+n93yW2HQFyRFRpAx7JDMeWoWz3Twfzv4Uhk8qXrU22BVHzR13vWuKqrK 2u/LkjnBoN7Ec2egjOnU/zC9SUKH+fi5FsSCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NG+1N8pqfTQP+Jc9hKyg5BqhDrJd8BVaVZCbMzcwzpQ=; b=tarH/y9/3AWdoEwB9YAlPdIclxuvkYn8YYvI/O6md3RyFokIa5XRYk1DSCHCSCnDjW N/mipHDQJngs0EaZN6jzYoJw3C8JFeom8EWINGHTvHMNnRRqMDZ7q+0FgwaxKygUe21T D24YIPBZGvwrdnM0/WZUorNifjfgTXk1WKySDghtgqhRgLN97QEObXsS7d8Li7udaBJT Ndyxa6M8D79OiiuwKJV+vprsqLzi20Srm2jXAJUGT9ezr832sdTg5Jw9PZAb+OAQwvSv cvJSRUi49o3NYbN8ZvQxwD3FxVmMfhgWC28Nxc1sQFgYM7JKgVEmmSuiexpYWmS67oun u6Kw== X-Gm-Message-State: APjAAAXmxDFI5uGodCpg4gt4YXHE+6ZGoS8JCJ9ypaN9QaYiXnaNoc9L 2q2JIKYhxiCSNffu8DdizxdAhA== X-Google-Smtp-Source: APXvYqzEDG6NFRpskcNp9TxpoXWvKld+9QHPgfTTWr0lWHp9luHTpO7e8V8TrlMGUFE74OMWti9u+w== X-Received: by 2002:adf:f90f:: with SMTP id b15mr4197296wrr.76.1571255848864; Wed, 16 Oct 2019 12:57:28 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id t13sm52362928wra.70.2019.10.16.12.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 12:57:28 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] spi: pxa2xx: Set controller->max_transfer_size in dma mode Date: Wed, 16 Oct 2019 21:57:21 +0200 Message-Id: <20191016195721.3714-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191016_125731_345088_4D00E380 X-CRM114-Status: GOOD ( 11.35 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Andy Shevchenko , Daniel Vetter , Robert Jarzmik , Haojian Zhuang , linux-spi@vger.kernel.org, =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Mark Brown , Sam Ravnborg , Daniel Mack Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In DMA mode we have a maximum transfer size, past that the driver falls back to PIO (see the check at the top of pxa2xx_spi_transfer_one). Falling back to PIO for big transfers defeats the point of a dma engine, hence set the max transfer size to inform spi clients that they need to do something smarter. This was uncovered by the drm_mipi_dbi spi panel code, which does large spi transfers, but stopped splitting them after: commit e143364b4c1774f68e923a5a0bb0fca28ac25888 Author: Noralf Trønnes Date: Fri Jul 19 17:59:10 2019 +0200 drm/tinydrm: Remove tinydrm_spi_max_transfer_size() After this commit the code relied on the spi core to split transfers into max dma-able blocks, which also papered over the PIO fallback issue. Fix this by setting the overall max transfer size to the DMA limit, but only when the controller runs in DMA mode. Fixes: e143364b4c17 ("drm/tinydrm: Remove tinydrm_spi_max_transfer_size()") Cc: Sam Ravnborg Cc: Noralf Trønnes Cc: Andy Shevchenko Reported-and-tested-by: Andy Shevchenko Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Cc: Mark Brown Cc: linux-arm-kernel@lists.infradead.org Cc: linux-spi@vger.kernel.org Signed-off-by: Daniel Vetter --- drivers/spi/spi-pxa2xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index bb6a14d1ab0f..f77201915033 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1707,6 +1707,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) } else { controller->can_dma = pxa2xx_spi_can_dma; controller->max_dma_len = MAX_DMA_LEN; + controller->max_transfer_size = MAX_DMA_LEN; } }