From patchwork Mon Apr 8 15:23:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15983 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 72EEA23900 for ; Mon, 8 Apr 2013 15:23:59 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id d4sf5821293eek.11 for ; Mon, 08 Apr 2013 08:23:43 -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=XOYeUDEIheKd/g5s8/8S7/aterHZOZbfCAdWl1KPVQM=; b=GopLgm2MHmHFEoKaqWDuorIs94KnCsGwk6W0b+5F9gyZ2G3UfGoTW0YhhgTYD0JeV0 7BFYSe/+mrdfSaNv7x5lLhy5xp0M8ResPF78v85sFOEJSOczjlh13YpHeScAXM3PDMxr c3d304PbRcFagqJ4r3Blqwl1vYnsqpbBq5PhPO5YOIZGfCDG04odxYVunXTjYpg4q0PY rOOro1KAbPZXQOr5gHcjD3TGQmvlPIFhvjQIhwEy1AiqQ1L6oF/jqewDwMtBi2HnvxJw PufYJRBj08nhTVlmtjVDB80vMSNW6fmD9ku5LHC6H+ilvVUzX/4stZ4QUbHGcsDPDdZi GdLA== X-Received: by 10.180.104.98 with SMTP id gd2mr3540691wib.0.1365434623419; Mon, 08 Apr 2013 08:23:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.109.47 with SMTP id hp15ls921334wib.33.canary; Mon, 08 Apr 2013 08:23:43 -0700 (PDT) X-Received: by 10.180.90.41 with SMTP id bt9mr13705692wib.19.1365434623364; Mon, 08 Apr 2013 08:23:43 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id p14si4922323wie.67.2013.04.08.08.23.43 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:23:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jz10so5431168veb.5 for ; Mon, 08 Apr 2013 08:23:42 -0700 (PDT) X-Received: by 10.52.21.212 with SMTP id x20mr13646015vde.106.1365434622257; Mon, 08 Apr 2013 08:23:42 -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.58.85.136 with SMTP id h8csp23486vez; Mon, 8 Apr 2013 08:23:41 -0700 (PDT) X-Received: by 10.180.72.228 with SMTP id g4mr13808306wiv.22.1365434620655; Mon, 08 Apr 2013 08:23:40 -0700 (PDT) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [2a00:1450:400c:c05::22b]) by mx.google.com with ESMTPS id w10si9922771wjy.30.2013.04.08.08.23.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:23:40 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22b is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22b; Received: by mail-wi0-f171.google.com with SMTP id hn17so2689682wib.4 for ; Mon, 08 Apr 2013 08:23:38 -0700 (PDT) X-Received: by 10.180.181.40 with SMTP id dt8mr13779072wic.17.1365434618200; Mon, 08 Apr 2013 08:23:38 -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 ESMTPS id j4sm20277893wiz.10.2013.04.08.08.23.36 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 08:23:37 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones , Vinod Koul , Dan Williams , Per Forlin Subject: [PATCH 5/5] dmaengine: ste_dma40: Move LCPA allocation and real-time config Date: Mon, 8 Apr 2013 16:23:11 +0100 Message-Id: <1365434591-21569-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365434591-21569-1-git-send-email-lee.jones@linaro.org> References: <1365434591-21569-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlUUf2uipTDS1F5bN291IyIXQ7F1oCdjw+zdaYUdTQOM2mQoSEIZZZrrwkDnhBs7ZvNWC6q X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 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: , There are various pieces of configuration which do not need to happen until after a channel is allocated. Here we move some of these so they're dealt with when it's time to configure the channel, rather than allocate it. Cc: Vinod Koul Cc: Dan Williams Cc: Per Forlin Signed-off-by: Lee Jones --- drivers/dma/ste_dma40.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 3543ea4..8a71bf6 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2472,18 +2472,6 @@ static int d40_alloc_chan_resources(struct dma_chan *chan) pm_runtime_get_sync(d40c->base->dev); - d40_set_prio_realtime(d40c); - - if (chan_is_logical(d40c)) { - if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) - d40c->lcpa = d40c->base->lcpa_base + - d40c->dma_cfg.src_dev_type * D40_LCPA_CHAN_SIZE; - else - d40c->lcpa = d40c->base->lcpa_base + - d40c->dma_cfg.dst_dev_type * - D40_LCPA_CHAN_SIZE + D40_LCPA_CHAN_DST_DELTA; - } - dev_dbg(chan2dev(d40c), "allocated %s channel (phy %d%s)\n", chan_is_logical(d40c) ? "logical" : "physical", d40c->phy_chan->num, @@ -2830,6 +2818,18 @@ static int d40_set_runtime_config(struct dma_chan *chan, d40_phy_cfg(cfg, &d40c->src_def_cfg, &d40c->dst_def_cfg, false); + d40_set_prio_realtime(d40c); + + if (chan_is_logical(d40c)) { + if (cfg->dir == STEDMA40_PERIPH_TO_MEM) + d40c->lcpa = d40c->base->lcpa_base + + cfg->src_dev_type * D40_LCPA_CHAN_SIZE; + else + d40c->lcpa = d40c->base->lcpa_base + + cfg->dst_dev_type * + D40_LCPA_CHAN_SIZE + D40_LCPA_CHAN_DST_DELTA; + } + /* These settings will take precedence later */ d40c->runtime_addr = config_addr; d40c->runtime_direction = config->direction;