From patchwork Mon May 6 07:28:32 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: 163388 Delivered-To: patch@linaro.org Received: by 2002:a92:3d95:0:0:0:0:0 with SMTP id k21csp1538933ilf; Mon, 6 May 2019 00:29:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqz74ywC85ntRQQ3u3XDkHkNtZhsgxUqe3Gc9uHBuX4wUmyt35vd1/PBnjePGNQ+PCw9kFol X-Received: by 2002:a62:544:: with SMTP id 65mr31184628pff.46.1557127750336; Mon, 06 May 2019 00:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557127750; cv=none; d=google.com; s=arc-20160816; b=LvJcEny4bijcVwd9NaK8C6m3RtP+6z0nF16MvDnchE8EqX9Sq9YTCOpnwhuMxGgZlt Ih10VaN+ipXr31/x2Z57PGy+/63LBY/9r0g5YKZhLYUAr2Mbu0w2fe5cOo/zVExJGmVp l9BLgnKR21wr7pXsKVkjrOthjAKqe9YLnsQczOgzF0nGwB3IxnXI2Bo37XXcfGU80C39 71+XHpuoLG6v+K3NK6b2zBgUsPifTL6RqCFyFHmxE5Cv1klFc/wVrBlO+HNXeZi1yF/B iGLDZmpczOghC7Cq/qUUMHvWZkE1ViF+YWaEI1SD8pyJwcYp9fpol7hFWzX62qlgu6Vt EjeA== 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=f7WxjUUjnOPlZM9+bRj5MrZBRrYrZS5QSjQsKajsB4c=; b=tbCOTLgA1WtX5PD6eifjkCbebbvEknNCq4d8dyTaxg5j8Pd+zzuH5opLyFsl8KZ8au cegI5Fzvak69OZNyNouTYx/QqHHE8LZwM8GJ/PAzaOe1i+r5Vz6i9lizb9+MCYRQKT40 2JmWKo+R3ZqPDhDQmK4G1KE3XReDQ2EwXbmV0S2eaV6pnBBwQtHS6RnLQiDl2q+ZKoY/ MVtpWTs0ItJ2ieJlbGiPykt4N7GsiqfshFpTVedJd9ZjjIE45uMxv9yH+YsO5bzTe1I/ cerM9IERxHMDyqpKorajl1ueTuYH0RWDgfJfUsjbkFkUxXTfZuMM8lmokCRUyleDb//t wxmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fczeMukF; 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 a128si7261539pgc.242.2019.05.06.00.29.09; Mon, 06 May 2019 00:29:10 -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=fczeMukF; 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 S1726466AbfEFH3I (ORCPT + 30 others); Mon, 6 May 2019 03:29:08 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39814 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbfEFH3H (ORCPT ); Mon, 6 May 2019 03:29:07 -0400 Received: by mail-pg1-f193.google.com with SMTP id w22so4718156pgi.6 for ; Mon, 06 May 2019 00:29:07 -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=f7WxjUUjnOPlZM9+bRj5MrZBRrYrZS5QSjQsKajsB4c=; b=fczeMukFRjRRR+1aDX01a1Sr2mHi7DtR4Gtz1E36ZgvfNGRxI7VHRp63sJWk5xuUVd o0Wb7seFcinpcZpharAZaaHr5ZZGvvzOMV9ME0H6FOdjrsnB9mbgM93u5eeuFSKsbI6j NYjZlaRe0WtRif1binGpkerwbW13qWMjK1tvAo/3YmkGInyZMpD9Y32gNvCyAB646HIy Z6vrWTbuSTDgmZ2BDBFp/TwHbNsDAHuQJYFoyyKd2YCECrvm4levP/dICyXtI8vJfDDQ OxWW8Ms0qtuB4MaRHjZs4uGlgrQRnwXpWURKM/IG96X4PBlpNiPvTTlbvE622E9RtDPk X/YA== 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=f7WxjUUjnOPlZM9+bRj5MrZBRrYrZS5QSjQsKajsB4c=; b=k26I4U2tXB1suramoQWErCbLUfshV3CYBXE25RL0rvyMG+wiScIo1rK8BcelGItKCg bJNyI/oKM6q3VxRH2siw//k15YMbJf6VquzpoOEAJgHei1iIz6ikTezKgyiXL1N4OgVS lk2+B38zqOyLCz8JLWZnSxiNj0eYTsAJUEYT7OgRJWj3OEa6FMUBNbFCao5BQto78vN9 gCkYn715b8rtL+QxblRtcXigJFjPl4KzaYYImCMv3c+zbTOLTyWiBIhkvLRy7gKymixW 1pWsRfGPRuBgVs/dwdy+5e+BOn5JKbIqQhLhe5j97HjC8O6BmWhOIMuM22PZyycmBOm8 uvSA== X-Gm-Message-State: APjAAAXLR2vLfuCR4vci86WDa/BZ9UluY+JMzUV6k4JgLpeDZVliaBEo j9xK361G/EHswL0CbhcWlIC+2g/6hb62ww== X-Received: by 2002:a63:e451:: with SMTP id i17mr30530636pgk.312.1557127746838; Mon, 06 May 2019 00:29:06 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.29.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:29:06 -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, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] dmaengine: sprd: Fix the right place to configure 2-stage transfer Date: Mon, 6 May 2019 15:28:32 +0800 Message-Id: <7eb64b3319cfa1859f2912398700d4204553c028.1557127239.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 a01c232..01abed5 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) {