From patchwork Mon Apr 15 12:15:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 162194 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2850435jan; Mon, 15 Apr 2019 05:15:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi7R2Zutua1mEzsCMDXc8dC2Uaf9tSuF9BV09jppVUZ1LpXimARPJQdM3T5Ug+bqy4WV1s X-Received: by 2002:a63:3d85:: with SMTP id k127mr69849384pga.152.1555330545498; Mon, 15 Apr 2019 05:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555330545; cv=none; d=google.com; s=arc-20160816; b=Sgi0C1RcewiUPSzBENq/GgYvSgsUSwSNEKzriq/fWGc09v95fRk+hCKu/yxbHOROSc GwHS3deYRnqRl0nGScqFB8cICVQjNd73LOWPsx6t4WwI/i3vS/diriVObczOtdDwxT2d 414Q1XxQoLWmWR3eAp28t2WZ0XN7WIy7MEr4ogPxKRHVgrAhGcFJIJgdRE+N98AKCqXY dnyzDjUFU0PVm3VfzCgBKDUSjCudrf/as4JmC8YVU9M9/U2p4pNfKA3/GgYv6OOv6aO0 KJVJHjQhhdPUjNMrwuPA7d9TRONGV5rJy3zcgcuIWgn3VEug9tiO/eZXPSMUyjRE6bgg hVeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=OLZzLqUboevMo/zGKOZIE23Q23oS2GeJKEJKfaBooIQ=; b=ktx3Js8nlBcDDe2NOmCPqYsqsRo3zg2pTZiu75EpTa5uBBVnh0aGZny9DG0+eetwW1 TtZHiMxZpcIhJnOJgvUufIxZL1QsRV11JfY4eceHuAYakfNdPvJH61ZxxCNfkQVtGYsN pGWMcMyiU+Its5VsBCk1ZKP+UqrAezpZeGA3estGV66Mnu9QSlpvM8sUQ4WsJg98YSKz 3TCMXeHMxoUcX5oYumXzxig5lXMEF0gx1blW3xl/HGS2d6WIz7Va6Tfxzv7NyrNP1yEb r6cn5A71Lp15srHU43LPYZNwpe2dGQqJHjxOhHBI0ZfEdZlxw2Cj2FvvqvjO14029E6A jqSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SYRkR298; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si30048649pgi.372.2019.04.15.05.15.45; Mon, 15 Apr 2019 05:15:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SYRkR298; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727547AbfDOMPo (ORCPT + 30 others); Mon, 15 Apr 2019 08:15:44 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39824 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727517AbfDOMPh (ORCPT ); Mon, 15 Apr 2019 08:15:37 -0400 Received: by mail-pf1-f194.google.com with SMTP id i17so8504010pfo.6 for ; Mon, 15 Apr 2019 05:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=OLZzLqUboevMo/zGKOZIE23Q23oS2GeJKEJKfaBooIQ=; b=SYRkR298A05uhWDzh3IUYZxWHo6jbGm4Y12GyENCpC0LW3h39lL+yHnRPlVBfvq0nv luuqBV0yEWf3bYy8ktE9+x3k+80S3LAYhP3slKw1pXNeX+vqzSbtjqk+QXhBX9CFyi57 m9LxZzhQJUgifPk+56jRx0Tyuyi+vlAcB/W1hVdasAOAdzxFj2CoipBJ1UGJ72wgBKXX NLC0zIlPNIWrEDIQB73d7HImzT5QSdZrBU3Itnco6IwleZlnrkvWRUaZ5r/ux7WMuto2 gom2m98f2ucsoSixQcKZsWM8IY+1q97kd+OgW2t+0FIMtg4XPzZoBL/cyl5WQovKAQHx JTaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=OLZzLqUboevMo/zGKOZIE23Q23oS2GeJKEJKfaBooIQ=; b=bq/GknLD83udrm366mTcsHCfXErBnoaBcgCz3Vcz58ow1ZFaBLRhOJIeJLU3syq2DX zHfjYmATJ73CBRN2S4j1KIoiyULBzHU+L0BNRgl0FZR3/v6MWka5i3aF1waYWLPuQ2d1 Oo4S+Jbw0gSRoYYRZiSWywM2Nt7PIWClXaXeGmsosEgRj0dMKqPtDAv5VhpM0W5UzNna wz1nf8m3nV5j/vhFz/0zgyOyTl59lJSKHP362ArDE40cnCblyxviwMKHV6NzZiZVzGW4 wejC8/sf/lPkuiNnmzFvxQ4O2+uLZ8zDQyrlwbqRkuC3sRyuC9oRM4+GaBxVkw9Htmoz 63Rg== X-Gm-Message-State: APjAAAVFcmLSrV9N5N6WLtF5hv7fBZxOutgmY520R8LPTcopWK2HclGO 49WMsqiuSNQBK4BkThi5kaSuJg== X-Received: by 2002:aa7:8251:: with SMTP id e17mr57741476pfn.147.1555330537319; Mon, 15 Apr 2019 05:15:37 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id 6sm64157155pfj.95.2019.04.15.05.15.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Apr 2019 05:15:36 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] dmaengine: sprd: Fix the right place to configure 2-stage transfer Date: Mon, 15 Apr 2019 20:15:00 +0800 Message-Id: <8fe45a4139ba57eb014d921b6988e43f7fe07b11.1555330115.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Long Move the 2-stage configuration before configuring the link-list mode, since we will use some 2-stage configuration to fill the link-list configuration. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.7.9.5 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index a64271e..cc9c24d 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -911,6 +911,12 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan, schan->linklist.virt_addr = 0; } + /* Set channel mode and trigger mode for 2-stage transfer */ + schan->chn_mode = + (flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK; + schan->trg_mode = + (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK; + sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT); if (!sdesc) return NULL; @@ -944,12 +950,6 @@ static int sprd_dma_fill_linklist_desc(struct dma_chan *chan, } } - /* Set channel mode and trigger mode for 2-stage transfer */ - schan->chn_mode = - (flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK; - schan->trg_mode = - (flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK; - ret = sprd_dma_fill_desc(chan, &sdesc->chn_hw, 0, 0, src, dst, len, dir, flags, slave_cfg); if (ret) {