Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1311048pxb; Fri, 20 Nov 2020 06:37:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIqVnu1tY2PZsg82QRRJrkWY//lnKF/3P5l1nO0VLahPC78mZ2Ng00TdKoa1HX+0SGLRnb X-Received: by 2002:a05:6402:1714:: with SMTP id y20mr35624295edu.306.1605883070578; Fri, 20 Nov 2020 06:37:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605883070; cv=none; d=google.com; s=arc-20160816; b=L2i3PzTFzHnreXhaDR6Qf1G1LXZdM6ax//FmUpUKGhYXLsvmsi5reNrgqLR5ObpT93 L9tdnZI7EGKbPIL11jAXFiHfG1oYy94JkR7vaoSGur9Cgd8X8UeETizuiXUsjaIY6HgY A0CSdhye6/LMaaKhP0OLuSt+ukVEj3ofz/0XVhsMUJi67UWhxJDyi/1Lm1FcpZcEydq0 NihSntu4xhEBXH812uSBj9+oN6Mvkn/7UN5B+PusvYWYR4z6TjIshAWofBqK39lZH1gB zhV+OUmsl+GmG5tQxo2veCQXf7Tz6kJE12Xa5VPusSSWbiLa+Bu5RM20QsVm3UIhWfgn Sq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2CM4NCa/CuP7klYZNKzVeHsDDN4tvYCHKHpkT+tePN8=; b=CXsyCkfcp3CeJT68EigV2Y15nU+c76A4PgzOj5q78rjic80Ntuctb2Y196k1Oq2FSz CD+0C0lakGkLCIBx0oMu+mAbRcV0Ig/UF+qvNUoQKA69QYJxsayyLmj4LPVtoJ6GAyaj b3dSs+YtbPFfviwDXxJnkZWsmFgXU25MsK9roL+9M2mTsLlS9+QSW1kvHcnsZjoHeXkh sMB8jpDCXyT5SZtpurhcKpNJToxO02WBrQpRp1ZAABXa7CMYMAVy5G/JN7lkHFip408i AII1TBknWo9gIvOuNaU9EEziIN3jbAVtwo5/qPjDmzi8pAAjjoFSnc3+AuDP26XYNvtg fbxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=HKy1giFa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m28si1997221edb.246.2020.11.20.06.37.27; Fri, 20 Nov 2020 06:37:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=HKy1giFa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727867AbgKTOdo (ORCPT + 99 others); Fri, 20 Nov 2020 09:33:44 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:51274 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726255AbgKTOdn (ORCPT ); Fri, 20 Nov 2020 09:33:43 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AKEW42p018604; Fri, 20 Nov 2020 15:33:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=2CM4NCa/CuP7klYZNKzVeHsDDN4tvYCHKHpkT+tePN8=; b=HKy1giFa6V4VB353LW3+rD6EdT20SS3QdDPJeyB5Ur3qFqZtuspzMPzSni43wUu7Wy3z DVSnLKhmauuYb+25mXBug6kG2U/Ac1JmkCQNkXwFELbJeE56MEqLOdeEdcWOfNaXP2Am XE7KrnFIO3fod+aYY8ZaKpZJ8LUeYot1oL3pZQYEEnomfqm1jncLU90G0MWYFQwM2RHS 3Xfo+zTO83v7jLLYRw77+xaTpr2HzA3hnU16KjWL9YaCmlYo3TJXCxVKahEqw1ZwqBQ4 9mQ0x/bwkciixr22uMk8PYNRBhC/VhCv0AUHtvd+ta9eIzodugIDNNW6FISTul3Hjh/z fw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34t70h7n0e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Nov 2020 15:33:29 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A38F010002A; Fri, 20 Nov 2020 15:33:28 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 970A92777DE; Fri, 20 Nov 2020 15:33:28 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 20 Nov 2020 15:33:28 +0100 From: Amelie Delaunay To: Vinod Koul , Dan Williams , Maxime Coquelin , Alexandre Torgue CC: , , , , Amelie Delaunay , Pierre-Yves MORDRET Subject: [PATCH 2/4] dmaengine: stm32-dma: clean channel configuration when channel is freed Date: Fri, 20 Nov 2020 15:33:18 +0100 Message-ID: <20201120143320.30367-3-amelie.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201120143320.30367-1-amelie.delaunay@st.com> References: <20201120143320.30367-1-amelie.delaunay@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-20_07:2020-11-20,2020-11-20 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When dma_channel_release is called, it means that the channel won't be used anymore with the configuration it had. To ensure a future client can safely use the channel after it has been released, clean the configuration done when channel was requested. Signed-off-by: Amelie Delaunay --- drivers/dma/stm32-dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 55a6bd381219..62501e5d9e9d 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -1220,6 +1220,8 @@ static void stm32_dma_free_chan_resources(struct dma_chan *c) pm_runtime_put(dmadev->ddev.dev); vchan_free_chan_resources(to_virt_chan(c)); + stm32_dma_clear_reg(&chan->chan_reg); + chan->threshold = 0; } static void stm32_dma_desc_free(struct virt_dma_desc *vdesc) -- 2.17.1