From patchwork Sat Sep 29 05:49:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10620629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A7A515A6 for ; Sat, 29 Sep 2018 05:50:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BDC32AFA4 for ; Sat, 29 Sep 2018 05:50:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EE2F2AFF5; Sat, 29 Sep 2018 05:50:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC50E2AFA4 for ; Sat, 29 Sep 2018 05:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727528AbeI2MRQ (ORCPT ); Sat, 29 Sep 2018 08:17:16 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45380 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727393AbeI2MRQ (ORCPT ); Sat, 29 Sep 2018 08:17:16 -0400 Received: by mail-pg1-f193.google.com with SMTP id t70-v6so5864954pgd.12 for ; Fri, 28 Sep 2018 22:50:12 -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=VKu6Lyuuq1HCg2vjK0SKqBKedEZKBAaQkFejaBLFPf0=; b=Qb2H0IiXPCuD8odQfq1Yamo/SKGFNg2b7kL6xEAWg3+elPiIo4YbrXHFPwc3cSSSfb q5M3wEb87m24TQLVuaaEphVnaC/QLNnL+kolsOklPoVk6MvA7pYqVwOf67gY4YrNAfoy rUtJiy++oR54JMpkDsSVi0K12BLUvfCetQB+I= 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=VKu6Lyuuq1HCg2vjK0SKqBKedEZKBAaQkFejaBLFPf0=; b=cvGaIt7BMhxLBuWzSH14LnhsnbonTo4kxc4AUqw1RbgGU15KqoHDUl/OGOkwDl8PnB nhHD7l+gPHXXjZCfhQZ+irUVcyxlv56GKDivTaEcX2A8jWgagQ8TV+/5Qn1yl+H8A+Bq KRQ3cici5EL3lyTzwGvHBwdyO5pvbtGNqh9W28J0AphHwnP4ARo86NYa0jBeLopZB64K BobQ4cAQZ2pAeZuALzvE0cJMaHk8cmKoWh0pLz6uUUHzC9rpugUKRz5J9T7bosnIds97 xlXQf3MN1sFHT6WIp4VOFsXI28kc3L9x85XWV4pJ3GatewqW94j8m3dViRpH9mmfT2dq GgdA== X-Gm-Message-State: ABuFfoivi71thg+ipDq7qXiVxJS9IuyTgqieAEHmebuMZTh0rlswoXZk gF4xiNSBP2zBzFCzPQxP5AGLTw== X-Google-Smtp-Source: ACcGV62p0TnV0Ef3aU3Sb3L6W68nW4G+RXzxp5MCaDUMdkRK8A6Xn5DbjYLFWZ99MOi5QAf51kfc3Q== X-Received: by 2002:a62:c42:: with SMTP id u63-v6mr1737797pfi.43.1538200212273; Fri, 28 Sep 2018 22:50:12 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id i80-v6sm11118049pfi.87.2018.09.28.22.50.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Sep 2018 22:50:11 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org, eric.long@spreadtrum.com Cc: broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] dmaengine: sprd: Set cur_desc as NULL when free or terminate one dma channel Date: Sat, 29 Sep 2018 13:49:02 +0800 Message-Id: <3a42dff7df19aa14d61b95f81ff22a7e16939ecd.1538199697.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Long It will be failed to start one new transfer if the channel started one none interrupt transfer before, since we will only set the schan->cur_desc as NULL depending on the transfer interrupt now. Thus we should set schan->cur_desc as NULL when free or terminate one dma channel to avoid this issue. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index e6a74dc..1b39661 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -439,6 +439,7 @@ static void sprd_dma_stop(struct sprd_dma_chn *schan) sprd_dma_stop_and_disable(schan); sprd_dma_unset_uid(schan); sprd_dma_clear_int(schan); + schan->cur_desc = NULL; } static bool sprd_dma_check_trans_done(struct sprd_dma_desc *sdesc,