From patchwork Sat Jul 9 08:12:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 958872 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p698Cvis024400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 9 Jul 2011 08:13:18 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QfSeV-0000LZ-7V; Sat, 09 Jul 2011 08:12:39 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QfSeU-0002op-Rq; Sat, 09 Jul 2011 08:12:38 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QfSeQ-0002oW-FX for linux-arm-kernel@lists.infradead.org; Sat, 09 Jul 2011 08:12:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=pzAwd4yFWSDhCKYpacR3j1i4epznVMk2WhW/n7Okwfg=; b=a5fEXZZenFgs+EWgYep6TPkOartgQIvz5efAjL+wx4CN+IfGGK68a2eVdHMeTHxEnPzhZYwZ1e5/HhWTkk5Np6qyCpCPDOD5ZTK142TvnfftoMOC4vKtepB4c/Enjbg6D5B7lRWK8dNO8z/ajFwPwkmCsuw0q/6clfGZxRJrAk4=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QfSeH-00010x-4f; Sat, 09 Jul 2011 09:12:25 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.72) (envelope-from ) id 1QfSeF-0007tx-Qb; Sat, 09 Jul 2011 09:12:23 +0100 Date: Sat, 9 Jul 2011 09:12:23 +0100 From: Russell King - ARM Linux To: Nicolas Pitre Subject: Re: [PATCH 01/10] ARM: change ARM_DMA_ZONE_SIZE into a variable Message-ID: <20110709081223.GA30368@n2100.arm.linux.org.uk> References: <1309919442-20451-1-git-send-email-nicolas.pitre@linaro.org> <20110706230455.GZ8286@n2100.arm.linux.org.uk> <20110708121441.GD4812@n2100.arm.linux.org.uk> <20110708203045.GT4812@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110708203045.GT4812@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110709_041235_292284_31CAB635 X-CRM114-Status: GOOD ( 21.15 ) X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Jul 2011 08:13:23 +0000 (UTC) On Fri, Jul 08, 2011 at 09:30:45PM +0100, Russell King - ARM Linux wrote: > On Fri, Jul 08, 2011 at 01:14:41PM +0100, Russell King - ARM Linux wrote: > > It looks like ISA_DMA_THRESHOLD has become unused by most of the kernel, > > so yes, renaming it to "dma_zone_limit" would be more descriptive. We > > should probably make dma_supported() be out-of-line anyway (which then > > means that dma_zone_limit doesn't have to be exported to drivers) - and > > I think the DMA bounce stuff needs cleaning up in dma_set_mask(). > > ... and I now have a patch which does this, pending testing. Once > I've tested it I'll send it out. 8<----- From: Russell King ARM: dmabounce: simplify dma_set_mask() Simplify the dmabounce specific code in dma_set_mask(). We can just omit setting the dma mask if dmabounce is enabled (we will have already set dma mask via callbacks when the device is created in that case.) Signed-off-by: Russell King --- arch/arm/include/asm/dma-mapping.h | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 4ad2533..94662f4 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -133,18 +133,12 @@ static inline int dma_supported(struct device *dev, u64 mask) static inline int dma_set_mask(struct device *dev, u64 dma_mask) { -#ifdef CONFIG_DMABOUNCE - if (dev->archdata.dmabounce) { - if (dma_mask >= ISA_DMA_THRESHOLD) - return 0; - else - return -EIO; - } -#endif if (!dev->dma_mask || !dma_supported(dev, dma_mask)) return -EIO; +#ifndef CONFIG_DMABOUNCE *dev->dma_mask = dma_mask; +#endif return 0; }