linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helmut Grohne <h.grohne@intenta.de>
To: Shubhrajyoti Datta <shubhrajyoti.datta@gmail.com>
Cc: linux-gpio@vger.kernel.org,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Subject: Re: [PATCH 4.6 69/81] gpio: zynq: initialize clock even without CONFIG_PM
Date: Thu, 21 Jul 2016 12:57:54 +0200	[thread overview]
Message-ID: <20160721105754.GA5086@laureti-dev> (raw)
In-Reply-To: <CAKfKVtEFF=PvZ62N-Re9BX4iq+pCK5qchbp7N3TworkpRkAZZQ@mail.gmail.com>

On Fri, Jul 08, 2016 at 10:23:07AM +0200, Shubhrajyoti Datta wrote:
>  A small issue
> 
> Now it will be off by 1 ie we enable twice in probe.
> 
> solution is that either there should be get_sync or clk_enable but not both.

As far as I understand the inner workings of pm_runtime_get_sync this is
not a problem.

> > +       ret = clk_prepare_enable(gpio->clk);
> > +       if (ret) {
> > +               dev_err(&pdev->dev, "Unable to enable clock.\n");
> > +               return ret;
> > +       }
> 
> This will now enable the first time.
> >
> > +       pm_runtime_set_active(&pdev->dev);
> the the pm core that it is enabled .

This function sets pdev->dev.power.runtime_status to RPM_ACTIVE (via
__update_runtime_status).

> >         pm_runtime_enable(&pdev->dev);
> >         ret = pm_runtime_get_sync(&pdev->dev);
> 
> this will enable the second time.

The bulk of the work is done by rpm_resume. Close to the top of the
function the runtime_status field is compared to RPM_ACTIVE and if so,
the resume operation is skipped.

Is there any mistake in that analysis?

Helmut

       reply	other threads:[~2016-07-21 11:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160622223743.240652686@linuxfoundation.org>
     [not found] ` <20160622223746.777833462@linuxfoundation.org>
     [not found]   ` <CAKfKVtEFF=PvZ62N-Re9BX4iq+pCK5qchbp7N3TworkpRkAZZQ@mail.gmail.com>
2016-07-21 10:57     ` Helmut Grohne [this message]
2016-08-02  8:59       ` [PATCH 4.6 69/81] gpio: zynq: initialize clock even without CONFIG_PM Shubhrajyoti Datta
2016-08-02 10:58         ` Helmut Grohne

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=20160721105754.GA5086@laureti-dev \
    --to=h.grohne@intenta.de \
    --cc=linux-gpio@vger.kernel.org \
    --cc=shubhrajyoti.datta@gmail.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).