Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031212AbbKEBqM (ORCPT ); Wed, 4 Nov 2015 20:46:12 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:61161 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753044AbbKEBqK (ORCPT ); Wed, 4 Nov 2015 20:46:10 -0500 From: "Rafael J. Wysocki" To: Kevin Hilman , Vinod Koul Cc: Jon Hunter , Laxman Dewangan , Stephen Warren , Thierry Reding , Alexandre Courbot , dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage Date: Thu, 05 Nov 2015 03:15:18 +0100 Message-ID: <1564097.buIA8Wdn8f@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <7hvb9hr98g.fsf@deeprootsystems.com> References: <1444983957-18691-1-git-send-email-jonathanh@nvidia.com> <20151104083438.GJ12910@localhost> <7hvb9hr98g.fsf@deeprootsystems.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2352 Lines: 59 On Wednesday, November 04, 2015 08:59:43 AM Kevin Hilman wrote: > Vinod Koul writes: > > > On Tue, Nov 03, 2015 at 01:25:09PM -0800, Kevin Hilman 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. > > > > + Rafael > > > > This is contrariry to what I see, If my driver is runtime suspended and on > > suspend, it gets runtime resumed and then suspended > > Since I was late to the thread, can you explain what kind of driver and > on what bus type you're seeing this behavior? > > It could be that your bus-type is doing something, but I don't think it > should be the PM core. Right. Bus types do that, the core doesn't. The ACPI PM domain does that too for some devices. So Vinod, more details, please. Thanks, Rafael -- 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/