From patchwork Thu Nov 13 16:27:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst (Tixy)" X-Patchwork-Id: 5299101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9BCEAC11AC for ; Thu, 13 Nov 2014 16:30:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4374201F4 for ; Thu, 13 Nov 2014 16:30:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD3C8201F2 for ; Thu, 13 Nov 2014 16:30:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoxFY-0006ic-Qj; Thu, 13 Nov 2014 16:28:00 +0000 Received: from smarthost01d.mail.zen.net.uk ([212.23.1.7]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoxFR-0006T0-Mx for linux-arm-kernel@lists.infradead.org; Thu, 13 Nov 2014 16:27:55 +0000 Received: from [82.69.122.217] (helo=linaro1) by smarthost01d.mail.zen.net.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XoxF2-0008bZ-4o; Thu, 13 Nov 2014 16:27:28 +0000 Message-ID: <1415896047.1787.4.camel@linaro.org> Subject: [PATCH] dmaengine: pl330: Fix linker error "undefined reference to `__aeabi_uldivmod'" From: "Jon Medhurst (Tixy)" To: Vinod Koul , dmaengine@vger.kernel.org Date: Thu, 13 Nov 2014 16:27:27 +0000 X-Mailer: Evolution 3.12.7-1 Mime-Version: 1.0 X-Originating-smarthost01d-IP: [82.69.122.217] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141113_082754_116407_2A051B8D X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 32-bit ARM kernels may have a 64-bit dma_addr_t but have no implementation of the compiler helper for 64-bit unsigned division, therefore the use of the modulo operator in pl330_prep_dma_memcpy causes the link error "undefined reference to `__aeabi_uldivmod'" As the burst value is always a power of two we can fix the problem, and make the code more efficient, by replacing "% burst" with "& (burst-1)". Reported-by: kbuild test robot Signed-off-by: Jon Medhurst Acked-by: Arnd Bergmann --- Vinod. I haven't added a 'Fixes:' line because I was unsure if the patch in linux-next is part of a stable branch or if the SHA1 might change before hitting mainline. If it stable then the line should be... Fixes: 63369d0a96dc ("dmaengine: pl330: Align DMA memcpy operations to MFIFO width") drivers/dma/pl330.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 38c9617..52c4c62 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2464,11 +2464,8 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, * parameters because our DMA programming algorithm doesn't cope with * transfers which straddle an entry in the DMA device's MFIFO. */ - while (burst > 1) { - if (!((src | dst | len) % burst)) - break; + while ((src | dst | len) & (burst - 1)) burst /= 2; - } desc->rqcfg.brst_size = 0; while (burst != (1 << desc->rqcfg.brst_size))