Message ID | 20230214151827.1050280-5-claudiu.beznea@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3038437wrn; Tue, 14 Feb 2023 07:22:51 -0800 (PST) X-Google-Smtp-Source: AK7set8LrOvfyEGor2vUb0DxlzcdngFZBqa93sYXImMXkkvpGmPyMoVyJTqFocgN1hC544QCWKRR X-Received: by 2002:a17:906:5dad:b0:8b1:2824:90d7 with SMTP id n13-20020a1709065dad00b008b1282490d7mr3560932ejv.16.1676388171106; Tue, 14 Feb 2023 07:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676388171; cv=none; d=google.com; s=arc-20160816; b=0U3auJ5Q7mue8zpg1yZuFfqJ0zG24M9D9vfE95VxHf30eSWwASDG8j+eWhnCWyFS3t w9YHlszpNpygEtMN0Rj06z2/KxbkdQTKzy4Hh0j50CkB03kh5hUCSmWKOUE5ix2tWPit HPWm+ZZYiCX3F/BABJbGC2sjnKQMFZSRbXipMUcc9g7aMFC2AL5MxGwHvyc0VPsqstIE I779kWZhYXISqoSHwbtBb+z2ev9e4wwUj3sFC0OSuQR7XtyEDmWl41xCQjkim9sJK0ay Do6oQgFPY+v3LZal3tGI13sdP4XKixtUI5asOlevzmObOWj7swEU+wHH1nuReSOkQZ6Q xxBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=alZZEDe9ISP2x2+7ypzcvd3y4aFOoub0myU5d+abfEY=; b=V/ID/jEcdaUHEEshxdOvO/3y5JXRSXgn8JEQNbtnYQJN4ZPBYNCEvTihS953IU2la0 zxNiLhGpF70vuARMzvMsuBK0KtBaYVU+RndTqCIdGSDZDkRu4KkMjS8lzlvW8n/H0VER SORLzcRoiTHdyTjHqpYa/ZGJuhInxmcrZR+mzPNKh0ee6Qpo1dqKdQLhdpFGVeXIYKrR MHywg5fpQIbp4HsV5J2D9yu5RqyaH7qlw31HldMrauJ6IJYQhOmjJyQSVi9O8hKSzSS5 rgK3LIk9t5o4dPlCdYQEoTQx/Bvl23UbsRU/V6jcuSP3PU3YbVa07pVJPCbQgLD4W0g9 eYCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=pfRUOKHQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f23-20020a1709063f5700b008692b15cca1si12278884ejj.603.2023.02.14.07.22.28; Tue, 14 Feb 2023 07:22:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=pfRUOKHQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232240AbjBNPVI (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Tue, 14 Feb 2023 10:21:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233431AbjBNPU5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Feb 2023 10:20:57 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0916D2A141; Tue, 14 Feb 2023 07:20:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1676388053; x=1707924053; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0CtvDEh2vlSrMf1WczKNd8+6RrD0e9Y436UeDqUellw=; b=pfRUOKHQKX+tVxisQumrN42a6dqImZ24tmJINh/FCfKmVVcY6NYt7ntK TCEUHZzo5RMibLsaYCCfJob9yx5DCxDJJwEmSO/PPzskXixDNQFJiLXzB jb9ZKj6Y0kdnrfv9l+BnWDbYZcgQBj5FYixp7rhz3+9VsjFTPOUPSq2yt QjLm33iBNWFsEP/ZBYKFvzPjY0fgoHRxlhTtsRpCfk3v6J1bZsOYhGoxg il1e9TrwuNpZt/7sxJO0gYzkw+34G2OSU9wj7uI7lYUh/ArTkFiQ1VATq onc8ERjRXNzZYt7t8UgKqwyRT1I8ZFRBQepo5jOVqV7YiXmNQSmJwdRVs A==; X-IronPort-AV: E=Sophos;i="5.97,296,1669100400"; d="scan'208";a="196877741" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Feb 2023 08:20:53 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) 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:52 -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:49 -0700 From: Claudiu Beznea <claudiu.beznea@microchip.com> To: <ludovic.desroches@microchip.com>, <tudor.ambarus@linaro.org>, <vkoul@kernel.org>, <nicolas.ferre@microchip.com> CC: <linux-arm-kernel@lists.infradead.org>, <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Claudiu Beznea <claudiu.beznea@microchip.com> Subject: [PATCH 4/7] dmaengine: at_xdmac: restore the content of grws register Date: Tue, 14 Feb 2023 17:18:24 +0200 Message-ID: <20230214151827.1050280-5-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757820402799613246?= X-GMAIL-MSGID: =?utf-8?q?1757820402799613246?= |
Series |
dmaengine: at_xdmac: fixes for suspend/resume
|
|
Commit Message
Claudiu Beznea
Feb. 14, 2023, 3:18 p.m. UTC
In case the system suspends to a deep sleep state where power to DMA
controller is cut-off we need to restore the content of GRWS register.
This is a write only register and writing bit X tells the controller
to suspend read and write requests for channel X. Thus set GRWS before
restoring the content of GE (Global Enable) regiter.
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
drivers/dma/at_xdmac.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index fa1e2e0da02f..34c004a4b23c 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -2211,6 +2211,15 @@ static int __maybe_unused atmel_xdmac_resume(struct device *dev) return ret; at_xdmac_device_resume_internal(atchan); } + + /* + * We may resume from a deep sleep state where power + * to DMA controller is cut-off. Thus, restore the + * suspend state of channels set though dmaengine API. + */ + else if (at_xdmac_chan_is_paused(atchan)) + at_xdmac_device_pause_set(atxdmac, atchan); + at_xdmac_chan_write(atchan, AT_XDMAC_CNDA, atchan->save_cnda); at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc); at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim);