Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1566915imm; Fri, 28 Sep 2018 22:52:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV60LMT6qi8MXVcl2gpCQrs3NYapGUzpUMGXU7oWiFMG93xxcmi6qEHLN4WqbkDPrrYBryefZ X-Received: by 2002:a62:cf04:: with SMTP id b4-v6mr1739136pfg.224.1538200324660; Fri, 28 Sep 2018 22:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538200324; cv=none; d=google.com; s=arc-20160816; b=fZGx0quWTYgM4yzXiRXW71sDN5nJM4WsvuljZ8DmlxEoDAqSnMOFdDpuIYpU/bbeVO E2G1fewxTqSIGyDX1J48EJJCe9snx+xWUFV3823ZG0Le7RWXw/vJ8CLhtGzWqaumqlGo 05A29D9CyQxLMKTA+kc4WA+7/TO8f5j0MoOIiFgbfB/8ynmgoWZh1bGIWT+kJQkBs11A +e6ScAqbGImigfSZW4j2fYugp3JTgwYMDk+LUlFQEpNXdlvPjTbM2j0MkPQKuTMdK3NM JbivFLPRBRTFcAg2vdQCNf1wU9gu1ylYQg0BF+8eVe5/3WWQP0dZ65mF7SlOZDZ6iNFP NC+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=VKu6Lyuuq1HCg2vjK0SKqBKedEZKBAaQkFejaBLFPf0=; b=uhATgTB+a8QKMTE/In0Kt+au9Gyqh674phyUC/SZaCqJmcDC1pEYqYoO3MtcSr2XDH mvg+A+/I2fPdE3PW1sisjmMCgToMEgnqx4hruS4RE+0bu4gS7jHyAGNnlcP+FYHT6Ruz SOEoUsiignugKiFoTAsPkN/EUtjRh/iUVqf/iYqr4iKkKTRBZ3gG2yA26yyjs/8zJSo/ 1V5btvsMkvwMrVZgVdsSKUY3QhsxKrNFxAUv8V7zhY1ZiASzkcsll54zcp7/1p+Z97Dn sfwrnANKdK715sD/63PWJ7XfreeVgYotGgQmCt5QNqa7DRg6B6lJ+Hchjxmdnd1OAJNl BiVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qb2H0IiX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6-v6si6326410pll.385.2018.09.28.22.51.50; Fri, 28 Sep 2018 22:52:04 -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=@linaro.org header.s=google header.b=Qb2H0IiX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727574AbeI2MRS (ORCPT + 99 others); Sat, 29 Sep 2018 08:17:18 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36550 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbeI2MRQ (ORCPT ); Sat, 29 Sep 2018 08:17:16 -0400 Received: by mail-pf1-f194.google.com with SMTP id b7-v6so5679253pfo.3 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=ZWW/12uDNaNO6n2fZ14w3n54F3WfNUdegKb0QZdB4Nb1ZTr5VDVoV0Y6mHYyZsICV4 9vCOfYRWH5OB0HPtvM3HFVRcoU7nx1qtsQqnJc4W3fcCn9qyfsQbjcUlwbwRYWPjE3qu xvC8Ir6gsjHV/AFk6zc9HJqXRyVtFTB3cRWOrb88+qz/lI3UiO2Ywp/F04GM8t4kIlmb C3ejOiOEmT3KVbUEdFAkbVYct2pesoYuX8/pk0/YyK8SCBurxfDtMBgqPnMXIsq1YFvM 6YKP+e7O7OAgN08YNGIijdv+oPmITSuoi5/FnjjtOxNtUaS8uRsZly97qWTD6hu+Y+vc 4QxQ== X-Gm-Message-State: ABuFfoj6cD5gRZ9NGgJqweSgxfbkxxwQz9dPPYCPQf6fst/RWZ2lE+tc eXel2ULePgY9wWzGSc2HreP06w== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 1.7.9.5