All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>
Cc: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Laxman Dewangan
	<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Courbot
	<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage
Date: Wed, 4 Nov 2015 14:04:38 +0530	[thread overview]
Message-ID: <20151104083438.GJ12910@localhost> (raw)
In-Reply-To: <7hvb9iai8a.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>

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

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Kevin Hilman <khilman@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	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: Wed, 4 Nov 2015 14:04:38 +0530	[thread overview]
Message-ID: <20151104083438.GJ12910@localhost> (raw)
In-Reply-To: <7hvb9iai8a.fsf@deeprootsystems.com>

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

-- 
~Vinod

  parent reply	other threads:[~2015-11-04  8:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  8:25 [PATCH 0/6] dmaengine: tegra-apb: Various updates Jon Hunter
2015-10-16  8:25 ` Jon Hunter
2015-10-16  8:25 ` [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage Jon Hunter
2015-10-16  8:25   ` Jon Hunter
     [not found]   ` <1444983957-18691-2-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-28  7:03     ` Vinod Koul
2015-10-28  7:03       ` Vinod Koul
     [not found]       ` <20151028070345.GF3041-bQVUxfxUtC13uc1i7fC1zK2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2015-10-28 13:32         ` Jon Hunter
2015-10-28 13:32           ` Jon Hunter
2015-10-29  1:57           ` Vinod Koul
2015-11-03 16:23             ` Jon Hunter
2015-11-03 16:23               ` Jon Hunter
     [not found]               ` <5638DF7E.9080700-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-11-03 21:25                 ` Kevin Hilman
2015-11-03 21:25                   ` Kevin Hilman
     [not found]                   ` <7hvb9iai8a.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2015-11-04  8:34                     ` Vinod Koul [this message]
2015-11-04  8:34                       ` Vinod Koul
2015-11-04 16:59                       ` Kevin Hilman
     [not found]                         ` <7hvb9hr98g.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2015-11-05  2:15                           ` Rafael J. Wysocki
2015-11-05  2:15                             ` Rafael J. Wysocki
     [not found]                             ` <1564097.buIA8Wdn8f-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2015-11-05 12:17                               ` Vinod Koul
2015-11-05 12:17                                 ` Vinod Koul
2015-10-16  8:25 ` [PATCH 2/6] dmaengine: tegra-apb: Use dev_get_drvdata() Jon Hunter
2015-10-16  8:25   ` Jon Hunter
2015-10-16  8:25 ` [PATCH 3/6] dmaengine: tegra-apb: Save and restore word count Jon Hunter
2015-10-16  8:25   ` Jon Hunter
     [not found] ` <1444983957-18691-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-16  8:25   ` [PATCH 4/6] dmaengine: tegra-apb: Only save channel state for those in use Jon Hunter
2015-10-16  8:25     ` Jon Hunter
2015-10-16  8:25 ` [PATCH 5/6] dmaengine: tegra-apb: Update driver to use GFP_NOWAIT Jon Hunter
2015-10-16  8:25   ` Jon Hunter
2015-10-16  8:25 ` [PATCH 6/6] dmaengine: tegra-apb: Disable interrupts on removal Jon Hunter
2015-10-16  8:25   ` Jon Hunter
2015-10-16  8:53   ` Lars-Peter Clausen
     [not found]     ` <5620BB0E.9040400-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2015-10-16  9:29       ` Jon Hunter
2015-10-16  9:29         ` Jon Hunter
     [not found]         ` <5620C383.3060104-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-10-16 10:40           ` Lars-Peter Clausen
2015-10-16 10:40             ` Lars-Peter Clausen
2015-10-16 10:57             ` Jon Hunter
2015-10-16 10:57               ` Jon Hunter
2015-10-28  6:53               ` Vinod Koul
     [not found]                 ` <20151028065339.GE3041-bQVUxfxUtC13uc1i7fC1zK2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2015-10-28 13:34                   ` Jon Hunter
2015-10-28 13:34                     ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151104083438.GJ12910@localhost \
    --to=vinod.koul-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.