Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258523
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage |
| Date | 2015-10-29 03:00 +0100 |
| Message-ID | <qoKFs-2aD-3@gated-at.bofh.it> (permalink) |
| References | <qk8yK-FP-7@gated-at.bofh.it> <qk8yL-FP-23@gated-at.bofh.it> <qot1U-7VJ-9@gated-at.bofh.it> <qoz7k-3cS-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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:
> >> @@ -1182,14 +1182,11 @@ static int tegra_dma_alloc_chan_resources(struct dma_chan *dc)
> >> {
> >> struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
> >> struct tegra_dma *tdma = tdc->tdma;
> >> - int ret;
> >>
> >> dma_cookie_init(&tdc->dma_chan);
> >> tdc->config_init = false;
> >> - ret = clk_prepare_enable(tdma->dma_clk);
> >> - if (ret < 0)
> >> - dev_err(tdc2dev(tdc), "clk_prepare_enable failed: %d\n", ret);
> >> - return ret;
> >> +
> >> + return pm_runtime_get_sync(tdma->dev);
> >
> > Alloc channel is supposed to return number of descriptors allocated and if
> > pm_runtime_get_sync() returns postive values we get wrong return!
>
> Yes I will fix. I assume that returning 0 is allowed if no descriptors
> are allocated here. So much for correcting rpm usage ;-)
Yes 0 is allowed...
> >> static int tegra_dma_pm_suspend(struct device *dev)
> >> {
> >> struct tegra_dma *tdma = dev_get_drvdata(dev);
> >> - int i;
> >> - int ret;
> >> + int i, ret;
> >>
> >> /* 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
--
~Vinod
--
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/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage Vinod Koul <vinod.koul@intel.com> - 2015-10-28 08:10 +0100
Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage Jon Hunter <jonathanh@nvidia.com> - 2015-10-28 14:40 +0100
Re: [PATCH 1/6] dmaengine: tegra-apb: Correct runtime-pm usage Vinod Koul <vinod.koul@intel.com> - 2015-10-29 03:00 +0100
csiph-web