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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8A7DC433EF for ; Tue, 9 Nov 2021 05:52:14 +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 9583D6109F for ; Tue, 9 Nov 2021 05:52:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9583D6109F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BLrR1J2mAM9IWJaUa97FcNbjBRTRLlMPKz+p3hlRVHA=; b=2SnHi6QdbEkYLB TeCtgysMx1yGvvcn8w7XQq/evNkI9Wt62tr8DcE2l3CPwVc5ww2V+kySs2KACxT/KJLXkMmY68r1A A7SBfGlDNQ7yWr6G8kGem8q0E+rIXhO9qrcXIIU80GCw9Xuv17p8K3/c1aTtozClcuwdfdslzTaro xZvZXdgwLbTjScIYo/BnnSoguV8Pxl7jvPLfIGx7vjImsEv8W4kVxhc1f58g0Ufmjg053o81kCp0D 1ZBe7Ai0udb/NecG5rC6RSdkaOCFqHjpNXbTYY1yljOcGQLqrrkhxlM24Hs+33k+Gkf9LSXiZII7M EZQ5QPLsIWOzMVsyyK+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkK20-000l2S-WD; Tue, 09 Nov 2021 05:50:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkK1x-000l24-3B for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 05:50:50 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id ABB45610F7; Tue, 9 Nov 2021 05:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636437048; bh=7wrdFm6RXmCeAdIpuwIhaiDDfnkWbf0prf/NE/auG6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SWcwkwwOuRWxpUwx5oLLfgnruxI10Dj/1xdBUkCOvWtEQVVOXTkcFlencWpXw2QQL tsrE4ykafAy7yYPw65LaX6u3ULiwkHniVZY/P1zm0hTCY5GSdYpW9mNnnSyTAIsjQ2 KvnDz39VlTBWnwpJC3SOr0xoNPcJVPaFvakHkCH6yjMDCb/Ar+JDkzjs3H4HL6fc1I HGb//Gz44Fr98Pt8SCsubaVrHOR0lLBa/o1UIXTlsd/Nac1eg7xAUvc4UWuawfRyM5 fjg623QJQSGSW8IdBce5nHDGV1s/GSZfs8a66S/N1ExVa3uB58R/0f1/sMbfzWpROu RZdFu3tCZ8Kzg== Date: Tue, 9 Nov 2021 11:20:43 +0530 From: Vinod Koul To: Amelie Delaunay Cc: Maxime Coquelin , Alexandre Torgue , dmaengine@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , kernel test robot Subject: Re: [PATCH 1/1] dmaengine: stm32-dma: avoid 64-bit division in stm32_dma_get_max_width Message-ID: References: <20211103153312.41483-1-amelie.delaunay@foss.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211103153312.41483-1-amelie.delaunay@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211108_215049_179513_C5118E44 X-CRM114-Status: GOOD ( 13.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03-11-21, 16:33, Amelie Delaunay wrote: > From: Arnd Bergmann > > Using the % operator on a 64-bit variable is expensive and can > cause a link failure: > > arm-linux-gnueabi-ld: drivers/dma/stm32-dma.o: in function `stm32_dma_get_max_width': > stm32-dma.c:(.text+0x170): undefined reference to `__aeabi_uldivmod' > arm-linux-gnueabi-ld: drivers/dma/stm32-dma.o: in function `stm32_dma_set_xfer_param': > stm32-dma.c:(.text+0x1cd4): undefined reference to `__aeabi_uldivmod' > > As we know that we just want to check the alignment in > stm32_dma_get_max_width(), there is no need for a full division, and > using a simple mask is a faster replacement. > > Same in stm32_dma_set_xfer_param(), change this to only allow burst > transfers if the address is a multiple of the length. > stm32_dma_get_best_burst just after will take buf_len into account to fix > burst in case of misalignment. Applied, thanks -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel