Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1913033ybl; Thu, 30 Jan 2020 08:12:30 -0800 (PST) X-Google-Smtp-Source: APXvYqy1UeP8tIS1orYq+B7SdsZyL2TQNSXIgXo5nPiAA86o9jfzd4m1oNhg5su39x1KlyaSzS2q X-Received: by 2002:aca:62c4:: with SMTP id w187mr3434337oib.38.1580400750079; Thu, 30 Jan 2020 08:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580400750; cv=none; d=google.com; s=arc-20160816; b=UDxb4kZACaDFdcGRG4A2sFKEqAgpHcVBMLJ1L86MLJ9clW7xWQDJTRF+4vGSjOVDuM 1sEUaa0sV3dYjwsF33nWypAwF5qlqoYf9sE2MCAoZqhaaYQMVc18My7b9Guxxr8B77Dt nFx4YUUM/O5aG1TbicvoM8CymTHwcvkurEf7+mJqqsq7TEgtkHudHQXhj7lYSywGl8IE 3N7USUBsfpDP+Lky5h6V7jq5n9ueFPcC1RXiUnwfRx59KIxoLwYi0xZrtBrBV7uawfBg tpqSnB2vnJTeg7ocOcXLccUv2GG7TidIJp6+N94nhc9vB1KVGwOWL5hxVLjGxi+TzLG0 G8UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gJegaF/2BtMkE3wbQDGNWIgkQsP+NVDH54Ixz6J/GXI=; b=AL4x8oDDsbrbmyQQ7v550tDpqhAhZdsvb8Ld1xH1jYQ5l+oK3U+t9o38957YzXnbRI pkKZA/vp6kuvGmZmRbPBV6GMxFJrARd3oDMk1oKSCfvIzDlJXiUPtlHRyzVKTQZh/kwW uc542Vh/FGUrzIXCwZpkAcMO5tiw/XVMPOw4J0/sqvYRwSVrBudtDjokIycjTLLQGvoi L5ODffjEHmtAmjRIgk6MuH2tkV7IY7rwHOlWVpBSpwgJBZzRTsxRyUiBid6u/c91OLem wMEtFWh1B2Z1qa4zcL5UeVtr51o5OTRWr9nyunSorDpEVglaBtShlRS5fuTSGHp5SxLs cItg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UgE87oUO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si3323745otk.218.2020.01.30.08.12.17; Thu, 30 Jan 2020 08:12:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UgE87oUO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbgA3QJO (ORCPT + 99 others); Thu, 30 Jan 2020 11:09:14 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:32781 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727469AbgA3QJO (ORCPT ); Thu, 30 Jan 2020 11:09:14 -0500 Received: by mail-lj1-f195.google.com with SMTP id y6so3988367lji.0; Thu, 30 Jan 2020 08:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gJegaF/2BtMkE3wbQDGNWIgkQsP+NVDH54Ixz6J/GXI=; b=UgE87oUO9lToM8ordqu/WcxSlYgKFPUk2g9vXCndltpuznlU0N+brMPh4dkT5aYPaM VzTlWFkDD/SiM6MeagHuL5u1k7XkFlVmF4Rz1K2y8tMsVkzDrfMyBJV9hC6LbWRfkBEo MvehNnoj2bWEClxl+ylwKmJm+Km+MjsXEPYnCyBYL9P8xLkdIfypHuiuublrpuMUSosm 54Xew2EZptrYci0VdTWPx5qjSB+n9Zz0+GLNyGWRN+1FDiBIGAXN/bEl9yK8vt7GMfBi WsquWX1Xy3kncsbQ4s+ET5e2smiCUFWKyYoF2IlyeH/MuCtkWqWVT14bHNqeMN4Zq7hM sMVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gJegaF/2BtMkE3wbQDGNWIgkQsP+NVDH54Ixz6J/GXI=; b=RhT4L9W0n9wjeVFzJRxcu3of25TqlfPFMzWzL0qMgYn+Xetr8eNtjH5JYbZchbFwfd sLLn5fG6uiGvTNwgqldFauTXyohx7EETuT0QF6MCGFgxnW0Lk/387LZli/7D7BTYxqNh +8n2p+Ho+pwyjkVl2DyGSw3GyYNh6hkRryPR4h5MP/yrjfdad0vPwo/r3R5DCAYtHo9l is4hXPkqAeXNZ9JlcLRU6KWJRBLbhL/3fOEzbURyIAdKJkRjZ+nps9fNP9e4Uya3KHYl BBflJeRLpopdnLLjeeRWCVDAp0tPv2KHtoOUU6+E6ns2hUPfwhnIQI5U2LLYatEmIXZZ 9NZg== X-Gm-Message-State: APjAAAWJA9kSUIEjwPm+WLAhfZLbtH74NMrQW40C+SuwpDvf2UjZO3MS 8Ick8AaVm85jlEmuY+WsFdN2/w3p X-Received: by 2002:a2e:865a:: with SMTP id i26mr3372290ljj.236.1580400551632; Thu, 30 Jan 2020 08:09:11 -0800 (PST) Received: from [192.168.2.145] (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.googlemail.com with ESMTPSA id n13sm3199453lji.91.2020.01.30.08.09.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jan 2020 08:09:11 -0800 (PST) Subject: Re: [PATCH v6 10/16] dmaengine: tegra-apb: Remove assumptions about unavailable runtime PM To: Jon Hunter , Laxman Dewangan , Vinod Koul , Dan Williams , Thierry Reding , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200130043804.32243-1-digetx@gmail.com> <20200130043804.32243-11-digetx@gmail.com> <24ca0a86-032f-2686-4dd2-6e4c5cf60223@nvidia.com> From: Dmitry Osipenko Message-ID: <742415f3-8ef5-415d-e34d-eebd893235cb@gmail.com> Date: Thu, 30 Jan 2020 19:09:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <24ca0a86-032f-2686-4dd2-6e4c5cf60223@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 30.01.2020 17:09, Jon Hunter пишет: > > On 30/01/2020 04:37, Dmitry Osipenko wrote: >> The runtime PM is always available on all Tegra SoCs since the commit >> 40b2bb1b132a ("ARM: tegra: enforce PM requirement"), so there is no >> need to handle the case of unavailable RPM in the code anymore. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/dma/tegra20-apb-dma.c | 10 +--------- >> 1 file changed, 1 insertion(+), 9 deletions(-) >> >> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c >> index 7158bd3145c4..22b88ccff05d 100644 >> --- a/drivers/dma/tegra20-apb-dma.c >> +++ b/drivers/dma/tegra20-apb-dma.c >> @@ -1429,11 +1429,8 @@ static int tegra_dma_probe(struct platform_device *pdev) >> spin_lock_init(&tdma->global_lock); >> >> pm_runtime_enable(&pdev->dev); >> - if (!pm_runtime_enabled(&pdev->dev)) >> - ret = tegra_dma_runtime_resume(&pdev->dev); >> - else >> - ret = pm_runtime_get_sync(&pdev->dev); >> >> + ret = pm_runtime_get_sync(&pdev->dev); >> if (ret < 0) >> goto err_pm_disable; >> >> @@ -1546,8 +1543,6 @@ static int tegra_dma_probe(struct platform_device *pdev) >> >> err_pm_disable: >> pm_runtime_disable(&pdev->dev); >> - if (!pm_runtime_status_suspended(&pdev->dev)) >> - tegra_dma_runtime_suspend(&pdev->dev); >> >> return ret; >> } >> @@ -1557,10 +1552,7 @@ static int tegra_dma_remove(struct platform_device *pdev) >> struct tegra_dma *tdma = platform_get_drvdata(pdev); >> >> dma_async_device_unregister(&tdma->dma_dev); >> - >> pm_runtime_disable(&pdev->dev); >> - if (!pm_runtime_status_suspended(&pdev->dev)) >> - tegra_dma_runtime_suspend(&pdev->dev); >> >> return 0; >> } > > I wonder if we need to make the pm_runtime_put a pm_runtime_put_sync or > call pm_runtime_barrier() here, to ensure it has called the callback > when freeing the channel? Otherwise this is fine. The explicit RPM syncing shouldn't be needed because pm_runtime_disable() takes care of doing that for us, please take a look at: https://elixir.bootlin.com/linux/v5.5/source/drivers/base/power/runtime.c#L1360