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: 40785 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1AF4C24493 for ; Thu, 13 Nov 2014 16:27:38 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id bs8sf1945523wib.4 for ; Thu, 13 Nov 2014 08:27:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:subject:from:to:cc:date :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=5NDoeNrZSlR8SK+erbuAIqIigoxdVwa31YBLPCJZ0qo=; b=faJCucnOKar/2x9P//zxvxnzyYo3RHs8ROwX2RI50k2bmR6+fGDahaoL6uP89au6uP FrrgRiO2GoCNTR01q6wsHBKZRt7RpySjLuiPrkbtibPtQY0M6zVOlhxRmcqTYyga62BA 1RBhQtGVLUnfVcrX85X3auQEWmqgsV08oai8rtAYugM7d+scbBoY7Yfa5ZjUTB72cafb jx5OsthYbGm7Kzix9iq4/oUTlfMZA8TCxcYje7MUQOaXI5Jx59gatvdZlwP0+9aKBPBk H0TOaCiR0uHK1tWwKXfuPZDcsVPGllIz6o/nR3c9ev/umA/5pnIIjdFqIdRbBaF+4XFK UY0w== X-Gm-Message-State: ALoCoQm/fN9w1hNOhrNHZ8le2dGJWyUVkm+zyMXZhHjVVKvF9mCVyewa6pAjUQiTO8fpHyb4MFGN X-Received: by 10.180.182.195 with SMTP id eg3mr132288wic.1.1415896057397; Thu, 13 Nov 2014 08:27:37 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.5 with SMTP id w5ls870589law.71.gmail; Thu, 13 Nov 2014 08:27:37 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr3305968laa.71.1415896057128; Thu, 13 Nov 2014 08:27:37 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id mj1si39056607lbc.40.2014.11.13.08.27.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 08:27:37 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id 10so11366666lbg.14 for ; Thu, 13 Nov 2014 08:27:37 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr3339246lal.29.1415896056916; Thu, 13 Nov 2014 08:27:36 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp617295lbc; Thu, 13 Nov 2014 08:27:36 -0800 (PST) X-Received: by 10.70.136.164 with SMTP id qb4mr3931145pdb.36.1415896055257; Thu, 13 Nov 2014 08:27:35 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba1si25901873pbd.216.2014.11.13.08.27.34 for ; Thu, 13 Nov 2014 08:27:35 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754021AbaKMQ1c (ORCPT + 26 others); Thu, 13 Nov 2014 11:27:32 -0500 Received: from smarthost01d.mail.zen.net.uk ([212.23.1.7]:55721 "EHLO smarthost01d.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928AbaKMQ1b (ORCPT ); Thu, 13 Nov 2014 11:27:31 -0500 X-Greylist: delayed 22075 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Nov 2014 11:27:31 EST 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@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] Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tixy@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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))