From patchwork Tue Nov 6 05:01:34 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: 10669631 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 6B2BF1709 for ; Tue, 6 Nov 2018 05:02:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B18429B9F for ; Tue, 6 Nov 2018 05:02:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F6E72A0A7; Tue, 6 Nov 2018 05:02:36 +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 2509129B9F for ; Tue, 6 Nov 2018 05:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729860AbeKFOZe (ORCPT ); Tue, 6 Nov 2018 09:25:34 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37301 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729859AbeKFOZe (ORCPT ); Tue, 6 Nov 2018 09:25:34 -0500 Received: by mail-pg1-f194.google.com with SMTP id c10-v6so5268187pgq.4 for ; Mon, 05 Nov 2018 21:02:12 -0800 (PST) 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=P5pOzBEPVvT+v94DFEU22LAsgxhHRTt6Ea6meOS+GbP+YI+0kE5s7mOwEVDwpyE7GE xN8AUVPCtu0UPYvze/fOUyRJ8UmOOoHj2pvwkgho1DdT03DyfSEbj8aXIt9cpvE48ju9 mG0ZWl+bbahRA3mvPwY8FbjEg1MpxHMbhmdKM= 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=MrkTsPs75rKDx1+InuZ/F2hPrDoPcXQyNNDTi3FZB25jMqLX74wVVff9reyqidReTw zpVQJAGEvaMaZD/Pigkhb4uemBZlyD6BSstMURYf+RA+VfWaU5S7rYYjDFRQ3vy/1ig4 lXK9IdixaBEhqUi+bGNVXtJUhtsH/zvsq5yFQN/6fqsJYdbjEUKRIvBcru2jO7QP8zfI tGqXiI3wCDqklWNpx3OXH32Gwv//KcFzdVUkGgd5VhsqfJacAiT2QJ3D3KMT07E0ZuF3 JK9gzmblHL0YqoW0Nla6xdp6RZ9hzanLxTL/+6Kymrak4DbY1Hkk9SC7sFPdd7c0zMFS 6Tjw== X-Gm-Message-State: AGRZ1gKe4NTdap1VOQfyHWHEEowfhyN+naexu8neQ1mWF0o0xHYpZtjT 1mrUacNeuGUR/wIojs5D8Bwv7SU9LYg8cQ== X-Google-Smtp-Source: AJdET5e3MgGqFde5O0+CD/ST5M95yfejt8EPaczM6rLk2T3feF/XQXr1rjzQDcTnC48CURkzU9uhPA== X-Received: by 2002:a63:d655:: with SMTP id d21mr13363464pgj.280.1541480531978; Mon, 05 Nov 2018 21:02:11 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id o7-v6sm55735416pfb.23.2018.11.05.21.02.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 21:02:11 -0800 (PST) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org, eric.long@unisoc.com Cc: broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 4/7] dmaengine: sprd: Set cur_desc as NULL when free or terminate one dma channel Date: Tue, 6 Nov 2018 13:01:34 +0800 Message-Id: <4b13aba73775582aa570212a1dccc6c511031de6.1541480353.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,