From patchwork Wed May 15 09:51:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16924 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A470A2396C for ; Wed, 15 May 2013 09:53:03 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id t59sf2269230yho.5 for ; Wed, 15 May 2013 02:52:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=+9gcO0783W9Kc53PtEZGIJJXpDxZl47eVMx/SequQJ4=; b=gy90PG2PGVw0R35UocYtNkt497St8vVv2b6szM1Qqv/NAsZqphndW+Pu1eZwXOa58u N1uvfuufGIKXeD1sdY7cFBjMiv49zzH9EdFizDH7AjUwg6/7yHSsxMIiTEQG9Dsiy9sI v4bH2egk2fz6zUG75J9Xl7PMwXQxWOGwY314WAob3r8wA1z4WyWpzvvrpHGVAkMxZS9X KW+Hzi8Ivi2MT6tbSNvze3YDOnikZWFeOruTZl0sXL9k10sNwNTDuhNKZebWtKphZC9s PzsY1LG/GmPFL41b9XWdncAjGaFMg+Q3KzdmekyiT8SCo8sHL6qs+HYazGex6y3VXEW+ d+7g== X-Received: by 10.224.200.202 with SMTP id ex10mr23010178qab.8.1368611547083; Wed, 15 May 2013 02:52:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.9 with SMTP id m9ls568665qej.55.gmail; Wed, 15 May 2013 02:52:27 -0700 (PDT) X-Received: by 10.52.68.205 with SMTP id y13mr20005825vdt.33.1368611546949; Wed, 15 May 2013 02:52:26 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id zp6si1033184vdb.67.2013.05.15.02.52.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id kw10so1647400vcb.28 for ; Wed, 15 May 2013 02:52:26 -0700 (PDT) X-Received: by 10.52.36.115 with SMTP id p19mr3326287vdj.8.1368611546796; Wed, 15 May 2013 02:52:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp11322vcb; Wed, 15 May 2013 02:52:26 -0700 (PDT) X-Received: by 10.194.161.166 with SMTP id xt6mr2782793wjb.28.1368611545667; Wed, 15 May 2013 02:52:25 -0700 (PDT) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [2a00:1450:400c:c00::233]) by mx.google.com with ESMTPS id j2si571614wiv.83.2013.05.15.02.52.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:25 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::233 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::233; Received: by mail-wg0-f51.google.com with SMTP id b13so1353082wgh.6 for ; Wed, 15 May 2013 02:52:25 -0700 (PDT) X-Received: by 10.180.198.49 with SMTP id iz17mr13202637wic.19.1368611545196; Wed, 15 May 2013 02:52:25 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id q13sm2898210wie.8.2013.05.15.02.52.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 02:52:24 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, balbi@ti.com, linux-usb@vger.kernel.org, linux-crypto@vger.kernel.org, davem@davemloft.net, herbert@gondor.apana.org.au, vinod.koul@intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones Subject: [PATCH 07/39] dmaengine: ste_dma40: Only use addresses passed as configuration information Date: Wed, 15 May 2013 10:51:30 +0100 Message-Id: <1368611522-9984-8-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> References: <1368611522-9984-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQk7p8/RalZ72vcH43zkl26o2BBI9S6lBn7/P2u75Mgo7+H0sQhlnnyjnBGWrdrgme0lf4vX X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Addresses are passed in from the client's driver via the invocation of dmaengine_slave_config(), so there's no need to fetch them from platform data too, hardwired or otherwise. This is a great step forward, as it elevates a large burden from platform data in the way of a look-up table. Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 51 ++++++++++------------------------------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index ba84df8..57a127e 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -1774,22 +1774,6 @@ static int d40_validate_conf(struct d40_chan *d40c, res = -EINVAL; } - if (conf->dir == STEDMA40_MEM_TO_PERIPH && - d40c->base->plat_data->dev_tx[conf->dev_type] == 0 && - d40c->runtime_addr == 0) { - chan_err(d40c, "Invalid TX channel address (%d)\n", - conf->dev_type); - res = -EINVAL; - } - - if (conf->dir == STEDMA40_PERIPH_TO_MEM && - d40c->base->plat_data->dev_rx[conf->dev_type] == 0 && - d40c->runtime_addr == 0) { - chan_err(d40c, "Invalid RX channel address (%d)\n", - conf->dev_type); - res = -EINVAL; - } - if (conf->dir == STEDMA40_PERIPH_TO_PERIPH) { /* * DMAC HW supports it. Will be added to this driver, @@ -2327,14 +2311,10 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, if (sg_next(&sg_src[sg_len - 1]) == sg_src) desc->cyclic = true; - if (direction != DMA_TRANS_NONE) { - dma_addr_t dev_addr = d40_get_dev_addr(chan, direction); - - if (direction == DMA_DEV_TO_MEM) - src_dev_addr = dev_addr; - else if (direction == DMA_MEM_TO_DEV) - dst_dev_addr = dev_addr; - } + if (direction == DMA_DEV_TO_MEM) + src_dev_addr = chan->runtime_addr; + else if (direction == DMA_MEM_TO_DEV) + dst_dev_addr = chan->runtime_addr; if (chan_is_logical(chan)) ret = d40_prep_sg_log(chan, desc, sg_src, sg_dst, @@ -2782,15 +2762,8 @@ static int d40_set_runtime_config(struct dma_chan *chan, dst_maxburst = config->dst_maxburst; if (config->direction == DMA_DEV_TO_MEM) { - dma_addr_t dev_addr_rx = - d40c->base->plat_data->dev_rx[cfg->dev_type]; - config_addr = config->src_addr; - if (dev_addr_rx) - dev_dbg(d40c->base->dev, - "channel has a pre-wired RX address %08x " - "overriding with %08x\n", - dev_addr_rx, config_addr); + if (cfg->dir != STEDMA40_PERIPH_TO_MEM) dev_dbg(d40c->base->dev, "channel was not configured for peripheral " @@ -2805,15 +2778,8 @@ static int d40_set_runtime_config(struct dma_chan *chan, dst_maxburst = src_maxburst; } else if (config->direction == DMA_MEM_TO_DEV) { - dma_addr_t dev_addr_tx = - d40c->base->plat_data->dev_tx[cfg->dev_type]; - config_addr = config->dst_addr; - if (dev_addr_tx) - dev_dbg(d40c->base->dev, - "channel has a pre-wired TX address %08x " - "overriding with %08x\n", - dev_addr_tx, config_addr); + if (cfg->dir != STEDMA40_MEM_TO_PERIPH) dev_dbg(d40c->base->dev, "channel was not configured for memory " @@ -2833,6 +2799,11 @@ static int d40_set_runtime_config(struct dma_chan *chan, return -EINVAL; } + if (config_addr <= 0) { + dev_err(d40c->base->dev, "no address supplied\n"); + return -EINVAL; + } + if (src_maxburst * src_addr_width != dst_maxburst * dst_addr_width) { dev_err(d40c->base->dev, "src/dst width/maxburst mismatch: %d*%d != %d*%d\n",