From: Narayanan G <narayanan.gopalakrishnan@stericsson.com>
To: Vinod Koul <vkoul@infradead.org>
Cc: "vinod.koul@intel.com" <vinod.koul@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linus WALLEIJ <linus.walleij@stericsson.com>,
Rabin VINCENT <rabin.vincent@stericsson.com>
Subject: Re: [PATCH] dmaengine/ste_dma40: support pm in dma40
Date: Thu, 17 Nov 2011 10:34:43 +0530 [thread overview]
Message-ID: <20111117050443.GA6256@bnru01> (raw)
In-Reply-To: <1321441623.1516.168.camel@vkoul-udesk3>
On Wed, Nov 16, 2011 at 12:07:03 +0100, Vinod Koul wrote:
> On Wed, 2011-11-16 at 12:00 +0530, Narayanan G wrote:
>
> when you fix something in patch usually convention is to reply in same
> thread and not new one!
>
> > desc = d;
> > - memset(desc, 0, sizeof(*desc));
> > + memset(desc, 0, sizeof(struct d40_desc));
> Bogus changes, previous one is better
Will revert this change.
> > +static void d40_power_off(struct d40_base *base, int phy_num)
> > +{
> > + u32 gcc;
> > + int i;
> > + int j;
> > + int p;
> this is just waste of line; int 1, j p; would make sense as well
> do consider them naming to something more meaningful as well
OK. Will correct this.
> > +
> > + /*
> > + * Disable the rest of the code for v1, because of GCC register HW bugs
> > + * which are not worth working around.
> last time I had questioned this one too?
Yes! I have changed the unconditional return to make it return only
for v1 H/W.
> > + */
> > + if (base->rev == 1)
> > + return;
> > +
> > +
> > + spin_lock_irqsave(&d40c->base->usage_lock, flags);
> > +
> > + d40_power_off(d40c->base, d40c->phy_chan->num);
> if this does what it says then it is wrong.
> power_off should be done in your suspend callbacks.
> same for on as well!!
Actually, we need to switch off the clocks for the event groups,
that are not in use. Say, if only evengroup 2 is active, the other
clocks can be switched off. The clocks for the unused event lines
need not be on till the runtime suspend is called. May be, I should
rename this function as d40_power_off_evt_grp().
> > - d40c->busy = true;
> > + if (!d40c->busy) {
> > + d40_usage_inc(d40c);
> > + d40c->busy = true;
> > + }
> well here is problem!
> You don't need to check busy here, juts call pm_runtime_get(). Power on
> will be take care if it requires resume in your resume callback. No need
> to have checks of busy. You are not properly utilizing functionality
> provided by runtime_pm
I have this usage_inc() function mainly for switching on and off the
clocks for the desired event groups. The busy check here is to ensure
that we don't need to do the usage_inc() (clock management) in case it is
already on.
Is there a way to do this clock management at eventline granularity
using the pm_runtime() framework?
> > + pm_runtime_irq_safe(base->dev);
> > + pm_runtime_set_autosuspend_delay(base->dev, DMA40_AUTOSUSPEND_DELAY);
> > + pm_runtime_use_autosuspend(base->dev);
> > + pm_runtime_enable(base->dev);
> > + pm_runtime_resume(base->dev);
> seriously we need so many calls to initialize?
The autosuspend_delay and irq_safe are causing the extra calls.
I think we need this.
Thanks,
Narayanan
next prev parent reply other threads:[~2011-11-17 5:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 6:30 [PATCH] dmaengine/ste_dma40: support pm in dma40 Narayanan G
2011-11-16 7:06 ` Narayanan G
2011-11-16 11:07 ` Vinod Koul
2011-11-17 5:04 ` Narayanan G [this message]
2011-11-17 5:23 ` Vinod Koul
2011-11-17 6:40 ` Narayanan G
2011-11-17 8:31 ` Vinod Koul
-- strict thread matches above, loose matches on Subject: below --
2011-11-09 4:36 Narayanan G
2011-11-10 9:56 ` Vinod Koul
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=20111117050443.GA6256@bnru01 \
--to=narayanan.gopalakrishnan@stericsson.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rabin.vincent@stericsson.com \
--cc=vinod.koul@intel.com \
--cc=vkoul@infradead.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.