From patchwork Thu Jan 2 22:04:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8481C3276F for ; Thu, 2 Jan 2020 22:11:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A221C21D7D for ; Thu, 2 Jan 2020 22:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003096; bh=NXLY67IDTMu6Jlymy/bPZRDp/GZiSr3IJHRem+6GoO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iEekmgRNtjEX4B5jI5GAqMJu035gHIBxK2rxn2L0hQXhS3qszL7DTQdkUY4LfZ5X4 DPAqw5SVo3k561rOV1JvLfqCfVgsVibKJCD78Ub+AJcek1Px2rO7NgOulSxAgwpAV0 A9+RIdYby9+VNuAMUUo9+GPqQm+Rxcx2KjzLvsGE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbgABWLf (ORCPT ); Thu, 2 Jan 2020 17:11:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727142AbgABWLd (ORCPT ); Thu, 2 Jan 2020 17:11:33 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 82A5821D7D; Thu, 2 Jan 2020 22:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003093; bh=NXLY67IDTMu6Jlymy/bPZRDp/GZiSr3IJHRem+6GoO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mVdZzZDZR7wH2EnbUH8NZE4/DcUVM4VfYd6Xkf8cMKirRBIe+C3BFevELsqc90im+ 82UvDCkfkFK5bOxv7bGVOYBilZmAfHbBWaO/bID9fsJFMI/a5tU//gRG+VFQN6XPpe Z9riFut5G+fe3plMTBITBwWHkC1LXtmkBv7Z/Rek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Graumann , Radhey Shyam Pandey , Vinod Koul , Sasha Levin Subject: [PATCH 5.4 017/191] dmaengine: xilinx_dma: Clear desc_pendingcount in xilinx_dma_reset Date: Thu, 2 Jan 2020 23:04:59 +0100 Message-Id: <20200102215831.673206199@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicholas Graumann [ Upstream commit 8a631a5a0f7d4a4a24dba8587d5d9152be0871cc ] Whenever we reset the channel, we need to clear desc_pendingcount along with desc_submitcount. Otherwise when a new transaction is submitted, the irq coalesce level could be programmed to an incorrect value in the axidma case. This behavior can be observed when terminating pending transactions with xilinx_dma_terminate_all() and then submitting new transactions without releasing and requesting the channel. Signed-off-by: Nicholas Graumann Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1571150904-3988-8-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/xilinx/xilinx_dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 5d56f1e4d332..43acba2a1c0e 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -1433,6 +1433,7 @@ static int xilinx_dma_reset(struct xilinx_dma_chan *chan) chan->err = false; chan->idle = true; + chan->desc_pendingcount = 0; chan->desc_submitcount = 0; return err;