Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3431162imu; Sun, 11 Nov 2018 14:58:00 -0800 (PST) X-Google-Smtp-Source: AJdET5c1TKPDQuzvLqWlXAiM/DItoPD4Hzy17ac1WSLbp14sBA/KSF57xYWZWwmU/OiMvmfC1ieq X-Received: by 2002:a65:41c2:: with SMTP id b2mr15245656pgq.67.1541977080176; Sun, 11 Nov 2018 14:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977080; cv=none; d=google.com; s=arc-20160816; b=mdY6pPDferuZ9VVmgm13glGD83yO0ZWq3Px79aj94xRPEeio0Qix/URXULV3XFx7HA TTkZyKohXb7Anfiex7fjYjJTbsiBOiOquP2zxqpUbyJodahK8DDZvp2BV7hYoSkfw19x Tcn+aL6IltP3lKVQVB3nAaVeJBsr/GLy0UmZQRxK3V80eVZMZGkQP4c0V6u5zi89Lw+Y fM2gl9hroMp+O++tBBu60dLh5V23EnUGhB+9qu3ctzqi+w5q4vTKFdZe/yOSNEtacjUQ vwS1SaeGSDk9wrfCKoxKAa3TJSbvvw/5iIvj+iFY7gYG3MoDCHgKUOWpD81Zw2IxKQil u3ew== 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=TobKZt28u/u1aMvc1SCrPcI07p5WshT9/ZCFWJG8Akc=; b=JMQGHjDZnp78Gyod9ZXDN4G+WnhraFgpxfZqQCh5XNWqneahz0yrMgCiMUvFmVXhVa LYcVCd0hgzdecsk4PLFratH6wPuNekI0PPVgNgFB7ihO5gCoNunpI8++MWoT9ORY3lPD oeNc+FEP7v1Z6pgKBZ2LvYFOk6jc1UhCF+Wfh0ZqmiVlkFkeTAkEUu/jIXhppjbYKjjA vU5YTiOX9iRtGHLoAEw6mBBuCdmMNAGdHR2HkFS0UocItTBV678X1yZ5BoFUI84sa/iA +mIquRF51fiAoStGpkKMDVdXVAd8I3t0hpW185o/vRbnoAhNLuQTn3kw5qgLyIqyw1bE 6U1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gm9hsxHQ; 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 y11-v6si15444754plp.415.2018.11.11.14.57.45; Sun, 11 Nov 2018 14:58:00 -0800 (PST) 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=gm9hsxHQ; 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 S2403850AbeKLIWp (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403775AbeKLIWk (ORCPT ); Mon, 12 Nov 2018 03:22:40 -0500 Received: from localhost (unknown [206.108.79.134]) (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 B9D91223D8; Sun, 11 Nov 2018 22:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975563; bh=iruh8JKe+2QWe2ox8e371IVGqv5Bx/Zm9Njie6QZhrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gm9hsxHQKGBAqwRmXamaIm3DlzUOvtkTj8tAPIAyPBsLxPjngqxzAWBSu3+rTfYBy iSKLPpcmOSG6nVT76NJjgfIJo+K3tlpVpHzGAFseSEUZ7wW+nTUT5o8WZWbOmSz1LG RT+JV2fF85TmMuymv926M1Bqy/xXcoCZwFvS1xUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Yves MORDRET , Hugues Fruchet , Vinod Koul , "Joel Fernandes (Google)" Subject: [PATCH 4.14 130/222] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode Date: Sun, 11 Nov 2018 14:23:47 -0800 Message-Id: <20181111221659.229602970@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pierre Yves MORDRET commit e57cb3b3f10d005410f09d4598cc6d62b833f2b0 upstream. When in cyclic mode, the configuration is updated after having started the DMA hardware (STM32_DMA_SCR_EN) leading to incomplete configuration of SMxAR registers. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Hugues Fruchet Signed-off-by: Vinod Koul Cc: "Joel Fernandes (Google)" Signed-off-by: Greg Kroah-Hartman --- drivers/dma/stm32-dma.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -429,6 +429,8 @@ static void stm32_dma_dump_reg(struct st dev_dbg(chan2dev(chan), "SFCR: 0x%08x\n", sfcr); } +static void stm32_dma_configure_next_sg(struct stm32_dma_chan *chan); + static void stm32_dma_start_transfer(struct stm32_dma_chan *chan) { struct stm32_dma_device *dmadev = stm32_dma_get_dev(chan); @@ -471,6 +473,9 @@ static void stm32_dma_start_transfer(str if (status) stm32_dma_irq_clear(chan, status); + if (chan->desc->cyclic) + stm32_dma_configure_next_sg(chan); + stm32_dma_dump_reg(chan); /* Start DMA */ @@ -564,8 +569,7 @@ static void stm32_dma_issue_pending(stru if (vchan_issue_pending(&chan->vchan) && !chan->desc && !chan->busy) { dev_dbg(chan2dev(chan), "vchan %p: issued\n", &chan->vchan); stm32_dma_start_transfer(chan); - if (chan->desc->cyclic) - stm32_dma_configure_next_sg(chan); + } spin_unlock_irqrestore(&chan->vchan.lock, flags); }