From patchwork Wed May 4 16:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie Delaunay X-Patchwork-Id: 12838148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2DC0C433F5 for ; Wed, 4 May 2022 16:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=njxLI7CzwKyATU+/7Hp4Z2MAyZZv34H5asnuH1etFKk=; b=3EIGtj43hRxcUu NsnPn3RQ/FY+AbvR8+oQCg7RPPJilg+7ITLI8p30El/NbMAtxoL/p6y7OtekC4R9whn/rgbJ6rcGI E2ZGtlHgiJ03yCxLNeLG81mgADYU8mPjIdfko/2jaGuiL8wTgPPVjM5kbTrwDqYDHJT8SdXvwGZTz 5ZL4FtZNUNUC9b0iSesSz8rr1F2VG2ldvENA0nUByF2mCWejr3/jxSm+Q8rZtGceG7R/m670h9ap/ tQ4JmqnhENNWrJ1MgATb5Z0Fq7sGAWNGWaQfVclUv0HPNZ0jfcttNqhw4g5ZSIeGmqesI5PimC/+0 kPv0VNryHM3Mh3NlwV8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmHh3-00BcIk-Fm; Wed, 04 May 2022 16:17:37 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmHgz-00BcGd-Np for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 16:17:35 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 244EYIqN015912; Wed, 4 May 2022 18:17:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=sBpm4BsKn7kHWShYVnazfKsSoeqIvIDBc5BHKKJkurM=; b=fDJXWKIVgQuAOM6DGjLpQja5wIndzgbp9ocAcJj/IFfRk88Az3FBa8V0Li/1QZlgDlIG pYgFhC7SX2rxvOd84hV6O2RTe9yLCiHTCy76GKhxxGTBRqKUvvGxPlYE2x5K0PsPaxKU 27JlBfTIkXBnDGmlR+U/PI40UnFr2B5rGW/GbKX/U86tiknr9mHA3wLd7oG/PBv7Evin Lt263lXOd20W7/pU2V4haeF0n767H/Vq0PFvFG02fGKYHtNWvMoVbTR0qjHrFQCENM30 XoP3HIqablvDBXfppWNnw2gK8KWcFwQpx5RGiflkYzihwPsplZeXnqI9WBTdzn1tgNGv vQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3frvf0n78x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 May 2022 18:17:26 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C2B15100034; Wed, 4 May 2022 18:17:25 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BC49D22D18A; Wed, 4 May 2022 18:17:25 +0200 (CEST) Received: from localhost (10.75.127.44) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Wed, 4 May 2022 18:17:24 +0200 From: Amelie Delaunay To: Vinod Koul , Maxime Coquelin , Alexandre Torgue CC: , , , , Amelie Delaunay Subject: [PATCH] dmaengine: stm32-dmamux: avoid reset of dmamux if used by coprocessor Date: Wed, 4 May 2022 18:17:24 +0200 Message-ID: <20220504161724.123180-1-amelie.delaunay@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-04_04,2022-05-04_02,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_091734_113040_F1E2E591 X-CRM114-Status: GOOD ( 21.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org One of the two DMA controllers managed by the DMAMUX can be used by the coprocessor. It is defined in the device tree with dma-masters. When the two DMA controllers are used by the main CPU, dma-masters = <&dma1, &dma2>; is specified in the device tree. When one of the controllers is used by coprocessor (so not managed by Linux), dma-masters = <&dma1>; is specified in the device tree. In this case, Linux driver must not reset the DMAMUX, because it could have been configured by the coprocessor to use the second DMA controller. count is the number of DMA controllers defined in dma-masters property. Reset only if resets property is found and valid in device tree, and if the two DMA controllers are under Linux control. Signed-off-by: Amelie Delaunay --- drivers/dma/stm32-dmamux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c index d5d55732adba..eee0c5aa5fb5 100644 --- a/drivers/dma/stm32-dmamux.c +++ b/drivers/dma/stm32-dmamux.c @@ -267,7 +267,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev) ret = PTR_ERR(rst); if (ret == -EPROBE_DEFER) goto err_clk; - } else { + } else if (count > 1) { /* Don't reset if there is only one dma-master */ reset_control_assert(rst); udelay(2); reset_control_deassert(rst);