Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2251399ybd; Mon, 24 Jun 2019 03:19:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMMTTvVxZGzxn7lm8sFl6BmCQa08bCjZr5wznWVl0D88qhfzTL5trOmVkHo2IH3mDSCfgo X-Received: by 2002:a65:510c:: with SMTP id f12mr31112670pgq.92.1561371570599; Mon, 24 Jun 2019 03:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371570; cv=none; d=google.com; s=arc-20160816; b=NSQSxEv7Il78+GeejFM66JD6aL2zaxBvkyuNXfL/Psw0pjAXwH4c7rndSmIWBuPngB 0yRj6KJhaZTTAprLdAG6RLc+32vpqqD1HVbBgEJH7J1NCp+aLY9+d5iMSrONRUL5dOZP D/eIj9ioZX1qoUrLQGXtWggVfiC3X5h4cUoGKAdfhaxpJgBRX3eVXRniqnOmrYI8pjfo +xQO8rkbuBgT9p94z34VvyuZkVX+qCEhzvcMbylyfAyLL3soXQSOsuAP+z4Yu1Bc7Tob OjhRdoKL/J3WwMZ18cIEyATNL6XEDkUSGzCIA5svBBtorsLu3UClYPmilWyyZdUI3reh e7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9BRRehrvPEB/LSbdubiwR6ZD0KPJTFs3n1eCCbaWoPo=; b=i3nEhd0t8CjsHxzeC+MiFkxvuFXop8Fs8qFM/+shPdvmTdItaFbaA+YLPUFksDtUuw fxFuM0Ce6wzfZo1mATLSF6loH22ezp+O6E0Mry3FSJbChU1cJv7tL9quYsW6POghYiTz GLvA8EOfI24meyMCqN/D/V1EYWJMbGw6gD7BhXni02TxAHsKa+3ZVuM4N1efvlfBK84e /ZNVetke6PtRMQUba6ZnxuhQBN9TtmBDNqrcS3CEnEKk94x+NleZFAP1lzRPd/SPdltX ksz9p1HflJq0wvgtVTt9dOKzcKbwe0Yut5K7WKAZQuv+7sWQtr0vI2t5TUEXEBYyCYlt zvvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S+IsMYwG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si10602600pjw.61.2019.06.24.03.19.15; Mon, 24 Jun 2019 03:19:30 -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=@kernel.org header.s=default header.b=S+IsMYwG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730593AbfFXKQF (ORCPT + 99 others); Mon, 24 Jun 2019 06:16:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729670AbfFXKQE (ORCPT ); Mon, 24 Jun 2019 06:16:04 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF8D9205ED; Mon, 24 Jun 2019 10:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371363; bh=6F0uQCMTnlWtg++gfb6hQFg+O79tkm8+jbu/aXD6iy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+IsMYwGVz1NtBOkYeSFfihKOPqlY4NEXotNZ5PGexyU+75Y1Lp8+VJQ+F7tc37en jf/NuvdOU6xukKLUTxnfURJLxFzurkQBZaQFsuAzJdnKOu0WCpK8D55RmRqLUUAgCc UQKji1eed6298ZjNzXhA+JN6DOc6OUHAPC/EyLiE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Long , Baolin Wang , Vinod Koul , Sasha Levin Subject: [PATCH 5.1 040/121] dmaengine: sprd: Fix the right place to configure 2-stage transfer Date: Mon, 24 Jun 2019 17:56:12 +0800 Message-Id: <20190624092322.847607054@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit c434e377dad1dec05cad1870ce21bc539e1e024f ] 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 Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/sprd-dma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index a01c23246632..01abed5cde49 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -911,6 +911,12 @@ sprd_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, 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 @@ sprd_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, } } - /* 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) { -- 2.20.1