From patchwork Tue Feb 14 15:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13140406 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 4A257C05027 for ; Tue, 14 Feb 2023 15:21:59 +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:References:In-Reply-To: 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: List-Owner; bh=PBnJotqMdcHc+SJA3c/ct9BNucNFC6MJE2rR4MAdeYk=; b=wibfPZIpAFHt4/ 9UEm4A7oIBShBlDWaYb+QTXGjsIP8Z+3IPv2WthbN2K77o5P6p/Aany4uEZ2BnbJMqT9CKbgnObWX Scf4BSdwdf8dAiBf91j+dGohC64Zk6RUvRgDYiPOizoL77NeGUQfMcDagnzZeilNrUaxOUQ9vDEDw xwLLQipFtP9fVDkL8z1BRprbrsTz+lt1Xwb1RUEh/oNmEPnJpGl3gMSbrIiBLgjLsqFih7eNvKCQs UGteOBVe3Pa4cA3w78quWCHNyAy/uljUc4TbABhqNtRDBmIlOU5VA+kP10EVFjInn4YHyjeEvSR+l nCwA+3zjFppRDstALyHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRx7B-002VWd-QK; Tue, 14 Feb 2023 15:21:05 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRx77-002VUB-LQ for linux-arm-kernel@lists.infradead.org; Tue, 14 Feb 2023 15:21:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1676388061; x=1707924061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qLhOvZL6ESJ8VOsLsLHiNb3s5VJ+t2td+m1FLHyK8zE=; b=sh5XeMFrNW627H3ibKTq+U2jQLnfXwU2HjZKV/p+0trsawVz59fo+55p 1Mk+ADBYqkpoh/TxE/Z9TpbO/cQSsapyPtjyYorqsPzk2p9fDqoFsc/gg i5/BHJc/B4LHd9OIhq7kmT+P4lHp4iuANekRpX3O7zSe6XGeNwJRstlBc JqhZmpGL5p+DjAckwNS3Gemt8XC3ViDiZp8eBS0sD21++ERZgOSIiQ5bN YJik+BzK5jpTLWk3ewJjRn2bkGcgccmTFjjkKx+D2WbckWf3f21rP/lzU gp7kcFTx8Pt9XITsPR2qDz8ipCh8LG8ks8XU87gsos4UUA20/gX5emV/7 A==; X-IronPort-AV: E=Sophos;i="5.97,296,1669100400"; d="scan'208";a="137131091" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Feb 2023 08:20:58 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 14 Feb 2023 08:20:55 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 14 Feb 2023 08:20:52 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea Subject: [PATCH 5/7] dmaengine: at_xdmac: do not enable all cyclic channels Date: Tue, 14 Feb 2023 17:18:25 +0200 Message-ID: <20230214151827.1050280-6-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230214151827.1050280-1-claudiu.beznea@microchip.com> References: <20230214151827.1050280-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230214_072101_829891_C5A12461 X-CRM114-Status: GOOD ( 10.41 ) 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 Do not global enable all the cyclic channels in at_xdmac_resume(). Instead save the global status in at_xdmac_suspend() and re-enable the cyclic channel only if it was active before suspend. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Claudiu Beznea --- drivers/dma/at_xdmac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 34c004a4b23c..96f1b69f8a75 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -246,6 +246,7 @@ struct at_xdmac { int irq; struct clk *clk; u32 save_gim; + u32 save_gs; struct dma_pool *at_xdmac_desc_pool; const struct at_xdmac_layout *layout; struct at_xdmac_chan chan[]; @@ -2162,6 +2163,7 @@ static int __maybe_unused atmel_xdmac_suspend(struct device *dev) } } atxdmac->save_gim = at_xdmac_read(atxdmac, AT_XDMAC_GIM); + atxdmac->save_gs = at_xdmac_read(atxdmac, AT_XDMAC_GS); at_xdmac_off(atxdmac, false); pm_runtime_mark_last_busy(atxdmac->dev); @@ -2224,7 +2226,8 @@ static int __maybe_unused atmel_xdmac_resume(struct device *dev) at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc); at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim); wmb(); - at_xdmac_write(atxdmac, AT_XDMAC_GE, atchan->mask); + if (atxdmac->save_gs & atchan->mask) + at_xdmac_write(atxdmac, AT_XDMAC_GE, atchan->mask); } }