From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E98AC433FF for ; Sat, 3 Aug 2019 16:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61DC220679 for ; Sat, 3 Aug 2019 16:01:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=tronnes.org header.i=@tronnes.org header.b="XPUC40aD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387653AbfHCQBo (ORCPT ); Sat, 3 Aug 2019 12:01:44 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:33640 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387464AbfHCQBn (ORCPT ); Sat, 3 Aug 2019 12:01:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=FVVDDc3qcCOsDzVHjJvBttU1tFjf1MY/wUz+c8T/9Js=; b=XPUC40aDylcelt6AwUjRPrre7+jPfAoWRzu66fOZY7TSgGf1EfVFG+oRzEiX/PqNzam9vsvaZqQk5NqmEeXcg/HlVhujjuBsjohpTYiSvD655VJ78dFLXcw+j7KXdK4KcEMGbhgPimjredtCZLKeFDueAdDdswSgkIBr2MoTLxerJS+t+K1lHRrfBpgX1wSb40yYcmU5fhTOCbDHCmX1Iyp5NSxK2yigZdeFisifsJMcmLH1cOGNe5ClQdLc09wEeUEcLwJncZL66kZfBRlHOAoqOpERHqWYDUnJ42pvGFHISiLj5v3+nDSlumvjR1tp4RtFZVV/MHOqpiNgg5WPsA==; Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:53009 helo=[192.168.10.173]) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1htwTT-0003PB-E8; Sat, 03 Aug 2019 18:01:39 +0200 Subject: Re: [PATCH 00/10] Raspberry Pi SPI speedups To: Lukas Wunner , Mark Brown , Vinod Koul , Stefan Wahren , linux-spi@vger.kernel.org, dmaengine@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Cc: Eric Anholt , Nuno Sa , Martin Sperl , Robert Jarzmik , Florian Kauer , Florian Fainelli , Ray Jui , Scott Branden References: From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: <7e3eda3e-838a-fb08-b543-a3c576f11ea6@tronnes.org> Date: Sat, 3 Aug 2019 18:01:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Den 03.08.2019 12.10, skrev Lukas Wunner: > So far the BCM2835 SPI driver cannot cope with TX-only and RX-only > transfers (rx_buf or tx_buf is NULL) when using DMA: It relies on > the SPI core to convert them to full-duplex transfers by allocating > and DMA-mapping a dummy rx_buf or tx_buf. This costs performance. > > Resolve by pre-allocating reusable DMA descriptors which cyclically > clear the RX FIFO (for TX-only transfers) or zero-fill the TX FIFO > (for RX-only transfers). Patch [07/10] provides some numbers for > the achieved latency improvement and CPU time reduction with an > SPI Ethernet controller. SPI displays should see a similar speedup. > I've also made an effort to reduce peripheral and memory bus accesses. > > The series is meant to be applied on top of broonie/for-next. > It can be applied to Linus' current tree if commit > 8d8bef503658 ("spi: bcm2835: Fix 3-wire mode if DMA is enabled") > is cherry-picked from broonie's repo beforehand. > > Please review and test. Thank you. > Tested-by: Noralf Trønnes I've tested on a 320x240 RGB565 display, flipping 2 framebuffers as fast as possible. The buffers are 320x240x2=150kB which are maxsize split by spi-bcm2835. I see a small increase in speed from ~34.75 to ~35.55 fps using this series. Details: $ ~/libdrm/tests/modetest/modetest -M mi0283qt -s 31:320x240@RG16 -v setting mode 320x240-0Hz@RG16 on connectors 31, crtc 34 freq: 30.36Hz freq: 35.32Hz freq: 35.56Hz freq: 35.57Hz freq: 35.54Hz freq: 35.55Hz freq: 35.60Hz freq: 35.62Hz freq: 35.50Hz freq: 35.23Hz freq: 35.49Hz freq: 35.44Hz freq: 35.39Hz freq: 35.58Hz $ od --endian big -tu4 -An /sys/bus/spi/devices/spi0.0/of_node/spi-max-frequency 64000000 pi@pi2835:~$ tail -n +1 /sys/bus/spi/devices/spi0.0/statistics/* ==> /sys/bus/spi/devices/spi0.0/statistics/bytes <== 131644720 ==> /sys/bus/spi/devices/spi0.0/statistics/bytes_rx <== 2 ==> /sys/bus/spi/devices/spi0.0/statistics/bytes_tx <== 131644718 ==> /sys/bus/spi/devices/spi0.0/statistics/messages <== 5188 ==> /sys/bus/spi/devices/spi0.0/statistics/spi_sync <== 5188 ==> /sys/bus/spi/devices/spi0.0/statistics/spi_sync_immediate <== 5188 ==> /sys/bus/spi/devices/spi0.0/statistics/transfer_bytes_histo_0-1 <== 2609 ==> /sys/bus/spi/devices/spi0.0/statistics/transfer_bytes_histo_16384-32767 <== 857 ==> /sys/bus/spi/devices/spi0.0/statistics/transfer_bytes_histo_2-3 <== 5 ==> /sys/bus/spi/devices/spi0.0/statistics/transfer_bytes_histo_32768-65535 <== 1714 ==> /sys/bus/spi/devices/spi0.0/statistics/transfer_bytes_histo_4-7 <== 1717 ==> /sys/bus/spi/devices/spi0.0/statistics/transfer_bytes_histo_8-15 <== 2 ==> /sys/bus/spi/devices/spi0.0/statistics/transfers <== 6904 ==> /sys/bus/spi/devices/spi0.0/statistics/transfers_split_maxsize <== 857 Noralf.