From mboxrd@z Thu Jan 1 00:00:00 1970 From: kernel@martin.sperl.org Subject: Re: [PATCH 3/3] spi: bcm2835: add module parameter to configure minimum length for dma Date: Sun, 24 Mar 2019 09:52:15 +0100 Message-ID: <51785E57-E503-439B-AC68-90AA265D51A4@martin.sperl.org> References: <20190224162311.23899-1-kernel@martin.sperl.org> <20190224162311.23899-3-kernel@martin.sperl.org> <146076124.93355.1551035437078@email.ionos.de> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Eric Anholt , Mark Brown , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org To: Stefan Wahren Return-path: In-Reply-To: <146076124.93355.1551035437078@email.ionos.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-spi.vger.kernel.org > On 24.02.2019, at 20:10, Stefan Wahren wrote: > > Hi Martin, > >> kernel@martin.sperl.org hat am 24. Februar 2019 um 17:23 geschrieben: >> >> >> From: Martin Sperl >> >> Allow setting the length of the transfer at which dma is used by >> setting a module parameter. > > please provide the motivation of this change. As we provide control over the selection of polling vs. interrupt mode we should - for consistency - also provide control over selection of DMA mode. DMA mapping is quite expensive and with higher SPI clock speeds it may be more economic CPU wise to run in polling mode instead of DMA mode. Also DMA mode has one specific difference to Polling mode: there is no idle clock cycle between bytes transferred. This may have negative impact when transferring lots of bytes to some mcus without SPI buffers at the fastest possible clock speed, where it helps when there is a gap after each byte. Martin 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 15F71C43381 for ; Sun, 24 Mar 2019 08:52:43 +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 D6E582147A for ; Sun, 24 Mar 2019 08:52:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kzveKnVm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6E582147A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=martin.sperl.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.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:To:References:Message-Id:Date: In-Reply-To:From:Mime-Version:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g/dVubPaEa72FmpCmtKTBZ8zMp38TSrz479FBKXTvFQ=; b=kzveKnVmD5BO12 aQlNICYUTCqoflx7sQboNLa49CN8ZPlSqydgzkGuC3a/1Xc71bPabZX4IHcdF4Mw2jN/yCyxS4ImW KUYCyGeoTLOluUhhholsKfJq66Zg7sAcSMA1Y1usOcBpDjNJnT7bgcO5DcC8ejPejW3c1uLjXz+y8 6koFZCw6whJg0v6AzPv6I/3YKrybTKH9tXXmKmK0A8npS5uNHjKyeNsy9vjNgTpKGuF2dfZeO/Wyr 5hVHHqx+ZF8wtGHkJKLjlzsXQJZ+jK6Ovs9P2ou9ts6tQcdfa2EKQY+URV8Af4ArvQz7exS+Ozpzh 6WCGQwLlY3zM/6sg2nUA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7yrs-000403-IQ; Sun, 24 Mar 2019 08:52:36 +0000 Received: from 212-186-180-163.static.upcbusiness.at ([212.186.180.163] helo=cgate.sperl.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7yrn-0003yd-BO; Sun, 24 Mar 2019 08:52:33 +0000 Received: from msmac.intern.sperl.org (account martin@sperl.org [10.10.10.11] verified) by sperl.org (CommuniGate Pro SMTP 6.2.1 _community_) with ESMTPSA id 7759401; Sun, 24 Mar 2019 08:52:13 +0000 Subject: Re: [PATCH 3/3] spi: bcm2835: add module parameter to configure minimum length for dma Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: kernel@martin.sperl.org X-Priority: 3 In-Reply-To: <146076124.93355.1551035437078@email.ionos.de> Date: Sun, 24 Mar 2019 09:52:15 +0100 Message-Id: <51785E57-E503-439B-AC68-90AA265D51A4@martin.sperl.org> References: <20190224162311.23899-1-kernel@martin.sperl.org> <20190224162311.23899-3-kernel@martin.sperl.org> <146076124.93355.1551035437078@email.ionos.de> To: Stefan Wahren X-Mailer: Apple Mail (2.3124) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190324_015231_563951_112358E3 X-CRM114-Status: UNSURE ( 7.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Anholt , Mark Brown , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org > On 24.02.2019, at 20:10, Stefan Wahren wrote: > > Hi Martin, > >> kernel@martin.sperl.org hat am 24. Februar 2019 um 17:23 geschrieben: >> >> >> From: Martin Sperl >> >> Allow setting the length of the transfer at which dma is used by >> setting a module parameter. > > please provide the motivation of this change. As we provide control over the selection of polling vs. interrupt mode we should - for consistency - also provide control over selection of DMA mode. DMA mapping is quite expensive and with higher SPI clock speeds it may be more economic CPU wise to run in polling mode instead of DMA mode. Also DMA mode has one specific difference to Polling mode: there is no idle clock cycle between bytes transferred. This may have negative impact when transferring lots of bytes to some mcus without SPI buffers at the fastest possible clock speed, where it helps when there is a gap after each byte. Martin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel