Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756090AbbKCVZP (ORCPT ); Tue, 3 Nov 2015 16:25:15 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35830 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755968AbbKCVZM (ORCPT ); Tue, 3 Nov 2015 16:25:12 -0500 From: Kevin Hilman To: Jon Hunter Cc: Vinod Koul , Laxman Dewangan , Stephen Warren , Thierry Reding , Alexandre Courbot , , , Subject: Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage References: <1444983957-18691-1-git-send-email-jonathanh@nvidia.com> <1444983957-18691-2-git-send-email-jonathanh@nvidia.com> <20151028070345.GF3041@vkoul-mobl.iind.intel.com> <5630CE5C.7070201@nvidia.com> <20151029015709.GE18368@vkoul-mobl.iind.intel.com> <5638DF7E.9080700@nvidia.com> Date: Tue, 03 Nov 2015 13:25:09 -0800 In-Reply-To: <5638DF7E.9080700@nvidia.com> (Jon Hunter's message of "Tue, 3 Nov 2015 16:23:26 +0000") Message-ID: <7hvb9iai8a.fsf@deeprootsystems.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1829 Lines: 48 Jon Hunter writes: > On 29/10/15 01:57, Vinod Koul wrote: >> On Wed, Oct 28, 2015 at 01:32:12PM +0000, Jon Hunter wrote: >>> >>> On 28/10/15 07:03, Vinod Koul wrote: >>>> On Fri, Oct 16, 2015 at 09:25:52AM +0100, Jon Hunter wrote: [...] >>>>> /* Enable clock before accessing register */ >>>>> - ret = tegra_dma_runtime_resume(dev); >>>>> + ret = pm_runtime_get_sync(dev); >>>> >>>> If you are runtime suspended then core will runtime resume you before >>>> invoking suspend, so why do we need this >>> >>> Is this change now in the mainline? Do you have commit ID for that? >>> >>> I recall the last time we discussed this that Rafael said that they were >>> going to do that, but he said as a rule of thumb if you need to resume >>> it, resume it [0]. >> >> IIRC this has been always the behaviour, at least I see this when I test the >> devices > > I have been doing some testing today and if the DMA is runtime > suspended, then I don't see it runtime resumed before suspend is called. > > Can you elborate on "at least I see this when I test the devices"? What > are you looking at? Are you using kernel function tracers in some way? The PM core does a _get_noresume()[1] which tries to prevent runtime suspends *during* a system suspend. However, the PM core should not be doing an actual runtime resume of the device, so if the device is already runtime suspended, it will not be runtime resumed by the core, so if the driver needs it to be runtime resumed, it needs to do it itself. Kevin [1] c.f. drivers/base/power/main.c::device_prepare() -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/