From patchwork Thu Dec 5 14:37:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 180893 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2056769ile; Thu, 5 Dec 2019 06:38:02 -0800 (PST) X-Received: by 2002:a05:651c:2011:: with SMTP id s17mr5500660ljo.43.1575556682606; Thu, 05 Dec 2019 06:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575556682; cv=none; d=google.com; s=arc-20160816; b=JmFvMb0zLG7A8sIkkvhgK/4enMncKNrALj+NcOk4ihGe5IhCdIW7YfwaZGXl6Fr0XG 1OvVp0/794Tb+ivUTp5zlb6yIdFd/MIw6AV2WtJo5dSw6XjVDtU6VBwj3VulFabm87/2 VgVEOc4Hg19YA1EO2eU/cAcOrFfzXYSNriD5CRh9I/+ILO/Rh70/4CoPNTn5Ni1Yg5OH DZaU+U0h2eu59mKtgwSoV/bj6oKfkk6PMq4n4tTp5RgKquWRmj+2CUc8ci6j00olN+zv ZJkatKLuDtp0wBxCy6OixNztH5sfVyKog8isV1YZ5DAJaR5/YBhfdl9g6elIrDPViy0S 2TYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LSrF1PZUXbppNkp6LXsmHrupmqPqLYDRsBF1XZV1SZg=; b=Gdn5YDS90S4mNe/FMZj0wSpMp2wIGsgl3nLgVopJuqhoD0I+7YsF8dLi6orL785TCQ hLnhd8pcfdi3MYfTwAFnPX+fDxIwNoY383qLJB8wdx/AtwhqpJ3DN8zYWYM6RpnfDeZc fCdIZ1U5CwIq8unDqWLA52718sZZ9hTuoZfWgA5+BRkh4c/DWueOyPTWHM7HEeS6o5Kd S/BUANrb8MgGWMRs144/JJULdrgXDZ9ZzIPpvUmKmy01lzfmGnBp8im0MimO9qEEo37c qgmD7cfqBEwBWNJ8mCne4QzMAR3ma9XHMdfOyQUsQbd+km3Tx4lKjf/L5WY2qSrbU2Dv GQJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sxN67uP4; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f17sor6532211lja.38.2019.12.05.06.38.02 for (Google Transport Security); Thu, 05 Dec 2019 06:38:02 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sxN67uP4; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LSrF1PZUXbppNkp6LXsmHrupmqPqLYDRsBF1XZV1SZg=; b=sxN67uP4loA2uHVs+iOAju81idbHAz9JP72QF6fKvTGIBFrU1Ua8i01zaU68+uf3r/ urNNV+Iz+exbXJ5FVf9/xL0wwVLxJjGMy26aTWthtKyBHeJBU5QpIlUOCXNIsTUcs+RI jiB7cRjBt+fPB+dm138tcJkjdDnnJQTJjor5aPFh5cLcVvaKvYoGabS5xUxT+xqe+XTR CiEWOrrv5UtBchNW0igsiGTTUPyx54CeEfWEr0YP0OE4UKZUp8E4o3mG9k61O8F4hSOG z2rSjx62rxmpyyqczRq84KZH7KyFgTOoApJxXSdZnwHiaqZKTxbYqLxQHf+MS3yi9UWl 126g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LSrF1PZUXbppNkp6LXsmHrupmqPqLYDRsBF1XZV1SZg=; b=T55LcrHlLBwQw7eA28WgXg1meJ94TsMvs/BbtNd+wn5O0g6IP09l6IQaP9BH8Ce4pM HyIujkV/7+fiFQnjeF5WhLx6GoeYMilsE5v0V2QdG1mdXu3eDz+ZmHlJxIMFyJbWw4k1 nPNl5M6WEfPeJSQ8W+cwUNh2RlP7kDBNkTh74qwIiMWn9P2E8CmSAg+jisFH5Lqqv6vO GaaHrYN5ImGMQ8xjAiXsUUBn57b7w5Rdu72zd0hqy1+Md+mV5CEJ8I0pKIy9xBwc/8WW cG3eDjO0KXU9G1Ae8n3muVWw2ZQeEN5EvJH9RY/RLGjXy7TSbsxl8MyJlfcce7t3IzP7 u4sQ== X-Gm-Message-State: APjAAAXeind0KP748XPUFC7K+WsJ1uYi40BnhLejhHadApi8vCyjEIR6 3bFJ+5HBgc6zSrUy2shUFQOGWcPSVquTxw== X-Google-Smtp-Source: APXvYqwS24lod+spv8JCEF1FwqJCKBEO1ZzNkv2x+NXiSPtPs2deTNm4TBwRmXyfhjEheQuZ3E/lQg== X-Received: by 2002:a05:651c:112d:: with SMTP id e13mr4993155ljo.99.1575556682219; Thu, 05 Dec 2019 06:38:02 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id q10sm5091294ljj.60.2019.12.05.06.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 06:38:01 -0800 (PST) From: Ulf Hansson To: Vinod Koul , dmaengine@vger.kernel.org Cc: Marek Szyprowski , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH 1/2] dmaengine: pl330: Drop boilerplate code for suspend/resume Date: Thu, 5 Dec 2019 15:37:45 +0100 Message-Id: <20191205143746.24873-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191205143746.24873-1-ulf.hansson@linaro.org> References: <20191205143746.24873-1-ulf.hansson@linaro.org> Let's drop the boilerplate code in the system suspend/resume callbacks and convert to use pm_runtime_force_suspend|resume(). This change also has a nice side effect, as pm_runtime_force_resume() may decide to leave the device in low power state, when that is feasible, thus avoiding to waste both time and energy during system resume. Signed-off-by: Ulf Hansson --- drivers/dma/pl330.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.17.1 Tested-by: Marek Szyprowski diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 6cce9ef61b29..8e01da157518 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2961,12 +2961,7 @@ static int __maybe_unused pl330_suspend(struct device *dev) { struct amba_device *pcdev = to_amba_device(dev); - pm_runtime_disable(dev); - - if (!pm_runtime_status_suspended(dev)) { - /* amba did not disable the clock */ - amba_pclk_disable(pcdev); - } + pm_runtime_force_suspend(dev); amba_pclk_unprepare(pcdev); return 0; @@ -2981,10 +2976,7 @@ static int __maybe_unused pl330_resume(struct device *dev) if (ret) return ret; - if (!pm_runtime_status_suspended(dev)) - ret = amba_pclk_enable(pcdev); - - pm_runtime_enable(dev); + pm_runtime_force_resume(dev); return ret; }