From patchwork Tue Apr 9 18:39:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 16006 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7F6F277CA for ; Tue, 9 Apr 2013 18:40:20 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id ox1sf11929330veb.5 for ; Tue, 09 Apr 2013 11:40:03 -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=6ELGBS3K3rKYFxhDVR8+QqX2JKfsnnV0+XOD6Jxf8zQ=; b=LgvScwR24X9HThJbAl2xO14AcZu1Do7Ja0YLtbbz7Z9yUchhdDMnfEB2fmnzoxtxhW BHveRfztRzHNkrI8j05Tfdej7YblMUPmYlofH6Hm81cBmpMH6t/doy0JKeRpbPHeK/Kw COhBxbYdBOtKFnVNvWYRwk5QHSuyzF1AbozOoswqUxqerzZNiOAqNuuPQzMeZptY38SW Lc7KOUvE/9irx3e2c1m/Ll8mp2AQ/mqAQRt8TtT/QRxdt19tBejzHXYFpSLg5Ib8/l/e 1qeanwdFu6Q/mnVX48SxkUd035atGsqmI7Vxw7fj+YrU7a6BvUzQQ6dRVMrBBvV7I9/t /bFg== X-Received: by 10.236.154.6 with SMTP id g6mr12759545yhk.28.1365532803671; Tue, 09 Apr 2013 11:40:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.98.101 with SMTP id eh5ls3669748qeb.95.gmail; Tue, 09 Apr 2013 11:40:03 -0700 (PDT) X-Received: by 10.52.24.229 with SMTP id x5mr17266090vdf.84.1365532803476; Tue, 09 Apr 2013 11:40:03 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id k19si22377614vcu.14.2013.04.09.11.40.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 11:40:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id ha12so485146vcb.20 for ; Tue, 09 Apr 2013 11:40:03 -0700 (PDT) X-Received: by 10.52.65.147 with SMTP id x19mr17448628vds.27.1365532803281; Tue, 09 Apr 2013 11:40:03 -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 h8csp75256vez; Tue, 9 Apr 2013 11:40:02 -0700 (PDT) X-Received: by 10.194.178.100 with SMTP id cx4mr40758994wjc.47.1365532802336; Tue, 09 Apr 2013 11:40:02 -0700 (PDT) Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by mx.google.com with ESMTPS id gg10si11801045wjb.246.2013.04.09.11.40.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 11:40:02 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.51 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.51; Received: by mail-wg0-f51.google.com with SMTP id b12so7155885wgh.6 for ; Tue, 09 Apr 2013 11:40:02 -0700 (PDT) X-Received: by 10.180.77.10 with SMTP id o10mr21835899wiw.10.1365532801874; Tue, 09 Apr 2013 11:40:01 -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 g9sm30684863wix.1.2013.04.09.11.39.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 11:40:01 -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 6/8] dmaengine: ste_dma40: Move LCPA allocation and real-time config Date: Tue, 9 Apr 2013 19:39:41 +0100 Message-Id: <1365532783-27425-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365532783-27425-1-git-send-email-lee.jones@linaro.org> References: <1365532783-27425-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkn30xVoIoXrUliD4o5uz85WykuzFxB/JrqQ7q3zUnUEILWdXmuX63sQJ7rh2x6OiVk2I88 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 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 49d8c9d..c14db3e 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2464,18 +2464,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, @@ -2814,6 +2802,18 @@ static int d40_set_runtime_config(struct dma_chan *chan, d40_phy_cfg(cfg, &d40c->src_def_cfg, &d40c->dst_def_cfg, chan_is_logical(d40c)); + 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;