Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp730960rdb; Fri, 22 Dec 2023 03:28:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxIbjqx9sA5jN865JveSNbdZg2BD3E0yEBNoWN537/RznJs8veS1JaWwE2Fp90Ogph21Kl X-Received: by 2002:a17:90a:ad90:b0:28b:94f3:39cb with SMTP id s16-20020a17090aad9000b0028b94f339cbmr782214pjq.45.1703244494390; Fri, 22 Dec 2023 03:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703244494; cv=none; d=google.com; s=arc-20160816; b=MctHZuDZbBFrnj5CcmELok32jowGCZ3NWwe97SG9AeT4Nad+C60fsD5gr85tnI2OWM K12e9oq/xSw01Gvn870wKExUmaVZQt7Y0nwSVnnQEONmBJS/Hg+cS7rOCF5q6UQiPup2 o7E9i0w2FapNioOppksb7G94UiG1+WDubQvIuj/1kjoJFBgqEHDUMpVMXo49w3uf9MSe fbyBZ7w5k9uFE5NlEuZBa0/zilQ22NGyo1MiSScnbHARQLRvC5KoWF8DsV0pGzbfZ6b7 TMvsSuC6yPI+mhL/8oj1NOichI+IqkbHNB+3usUNpQYscCcWVbIpbSFFmzZE1wgN6IZT ts9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=ivjbPbeT1CQ7mAqBf29WTR7tPoIaDlGn9PEEu+lJ53s=; fh=zgzHV65DKnrUpgHiselshH9xv6nmPvca/3SIMVtE2OM=; b=Yh6vWw8hyFBQ1xVfawRA91sUeZn+Kd5KQz0hWjnuCiNJ95s0x+mLj8pgT7K2i4r3rz GYG6Ubao1cE6nBj7Fucm+EjsJG86WVshChSWtCQr0iH2SXQJXCdzlXE83uQsquKd2yW0 M4QTQoGnbnc19rNkMDoHS3xG1YJzi/Lsj+OePkcNAK3rGjqgt4Q1BCfwXMEOgLJm8k5T aLjpPzSPIL3VlSLV+rM4pbKtD6z+O3b284KK/fg13qsoZD18HsIQ9v3avBjvY0TX7/sD Lv6yvNfOahGFHfnGl58WcLnKem2oWt/mJLPwGIhML7BRmBixG3nr3SD3wHgmPC2NOrOl 6K4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9660-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9660-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f1-20020a17090ab40100b0028b036dda8fsi6458493pjr.187.2023.12.22.03.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 03:28:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9660-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9660-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9660-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 03D43286FDD for ; Fri, 22 Dec 2023 11:28:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4314A1775B; Fri, 22 Dec 2023 11:28:09 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9996C17730; Fri, 22 Dec 2023 11:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 3BMBRbqR014972; Fri, 22 Dec 2023 19:27:37 +0800 (+08) (envelope-from Kaiwei.Liu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx07.spreadtrum.com [10.0.1.12]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4SxPxn6z72z2QTSsR; Fri, 22 Dec 2023 19:21:17 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx07.spreadtrum.com (10.0.1.12) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 22 Dec 2023 19:27:35 +0800 From: Kaiwei Liu To: Vinod Koul , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , kaiwei liu , Wenming Wu Subject: [PATCH V2 1/2] dmaengine: sprd: delete enable operation in probe Date: Fri, 22 Dec 2023 19:27:14 +0800 Message-ID: <20231222112714.9660-1-kaiwei.liu@unisoc.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx07.spreadtrum.com (10.0.1.12) X-MAIL:SHSQR01.spreadtrum.com 3BMBRbqR014972 From: "kaiwei.liu" In the probe of dma, it will allocate device memory and do some initalization settings. All operations are only at the software level. Furthermore, The current dma driver is applicable to two DMA devices in different power domain. For some scenes, one of the domain is power off and when you probe, enable the dma with the domain power off may cause crash. For example, one case is for audio co-processor and DMA serves for it, dma's power domain is off during initialization since audio is not used at that time, so we can not read/write DMA's register for this kind of cases. Signed-off-by: kaiwei.liu --- Change in V2: -Fix typo in subject line -Fix patches disjoint error -modify commit message -move pm_runtime_enable function before dma_async_device_register --- drivers/dma/sprd-dma.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 3f54ff37c5e0..cb48731d70b2 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -1203,16 +1203,9 @@ static int sprd_dma_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, sdev); - ret = sprd_dma_enable(sdev); - if (ret) - return ret; - pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); - - ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) - goto err_rpm; + pm_runtime_get_noresume(&pdev->dev); ret = dma_async_device_register(&sdev->dma_dev); if (ret < 0) { @@ -1226,7 +1219,7 @@ static int sprd_dma_probe(struct platform_device *pdev) if (ret) goto err_of_register; - pm_runtime_put(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); return 0; err_of_register: @@ -1234,8 +1227,6 @@ static int sprd_dma_probe(struct platform_device *pdev) err_register: pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); -err_rpm: - sprd_dma_disable(sdev); return ret; } -- 2.17.1