All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-clk <linux-clk@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH 2/3] clk: renesas: rcar-usb2-clock-sel: Add multiple clocks management
Date: Fri, 25 Oct 2019 01:36:00 +0000	[thread overview]
Message-ID: <TYAPR01MB4544D5F2A77FBBA7B0AF7EBDD8650@TYAPR01MB4544.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdU=58w=4A0WcqytFfyV_Q11BgYaDNsMsA8Z15mnm--ang@mail.gmail.com>

Hi Geert-san,

Thank you for your comments!

> From: Geert Uytterhoeven, Sent: Thursday, October 24, 2019 8:35 PM
<snip>
> > --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c
> > +++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> > @@ -53,14 +60,32 @@ static void usb2_clock_sel_disable_extal_only(struct usb2_clock_sel_priv *priv)
> >
> >  static int usb2_clock_sel_enable(struct clk_hw *hw)
> >  {
> > -       usb2_clock_sel_enable_extal_only(to_priv(hw));
> > +       struct usb2_clock_sel_priv *priv = to_priv(hw);
> > +       int i, ret;
> > +
> > +       for (i = 0; i < CLK_NUM; i++) {
> > +               ret = clk_prepare_enable(priv->clks[i]);
> > +               if (ret) {
> > +                       while (--i >= 0)
> > +                               clk_disable_unprepare(priv->clks[i]);
> > +                       return ret;
> > +               }
> > +       }
> 
> You can use the clk_bulk_* APIs, instead of open-coding the same
> operation.

I didn't know such APIs. I'll fix it.

> > @@ -131,6 +156,14 @@ static int rcar_usb2_clock_sel_probe(struct platform_device *pdev)
> >         pm_runtime_enable(dev);
> >         pm_runtime_get_sync(dev);
> 
> pm_runtime_get_sync() will have already enabled the first module clock listed in
> the DT "clocks" property.
> 
> If you want the driver to manage all clocks itself, perhaps the PM Runtime
> calls should be dropped?

I'm thinking PM Runtime calls are related to power domain control so that we cannot
drop it. Or, since the hardware is the Always-on domain, can we drop it anyway?

Best regards,
Yoshihiro Shimoda


  reply	other threads:[~2019-10-25  1:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 11:16 [PATCH 0/3] clk: renesas: rcar-usb2-clock-sel: Fix clks/resets handling Yoshihiro Shimoda
2019-10-24 11:16 ` [PATCH 1/3] dt-bindings: clock: renesas: rcar-usb2-clock-sel: Fix clock[-name]s properties Yoshihiro Shimoda
2019-10-24 11:45   ` Geert Uytterhoeven
2019-10-25  1:29     ` Yoshihiro Shimoda
2019-10-25  7:45       ` Geert Uytterhoeven
2019-10-24 11:17 ` [PATCH 2/3] clk: renesas: rcar-usb2-clock-sel: Add multiple clocks management Yoshihiro Shimoda
2019-10-24 11:34   ` Geert Uytterhoeven
2019-10-25  1:36     ` Yoshihiro Shimoda [this message]
2019-10-25  7:47       ` Geert Uytterhoeven
2019-10-25  8:44         ` Yoshihiro Shimoda
2019-10-25  8:57           ` Geert Uytterhoeven
2019-10-24 11:17 ` [PATCH 3/3] clk: renesas: rcar-usb2-clock-sel: Add reset_control Yoshihiro Shimoda
2019-10-24 11:26   ` Geert Uytterhoeven
2019-10-25  1:42     ` Yoshihiro Shimoda
2019-10-25  7:54       ` Geert Uytterhoeven
2019-10-25  8:44         ` Yoshihiro Shimoda

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=TYAPR01MB4544D5F2A77FBBA7B0AF7EBDD8650@TYAPR01MB4544.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.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.