linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Weiyi Lu <weiyi.lu@mediatek.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Dehui Sun <dehui.sun@mediatek.com>, Rob Herring <robh@kernel.org>,
	Nicolas Boichat <drinkcat@chromium.org>,
	srv_heupstream@mediatek.com,
	James Liao <jamesjj.liao@mediatek.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Fan Chen <fan.chen@mediatek.com>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1] clk: mediatek: mt8183: Register 13MHz clock earlier for clocksource
Date: Mon, 10 Jun 2019 10:09:09 +0800	[thread overview]
Message-ID: <1560132549.16837.1.camel@mtksdaap41> (raw)
In-Reply-To: <20190607175922.6D5F5208C0@mail.kernel.org>

On Fri, 2019-06-07 at 10:59 -0700, Stephen Boyd wrote:
> Quoting Weiyi Lu (2019-06-06 20:11:52)
> > diff --git a/drivers/clk/mediatek/clk-mt8183.c b/drivers/clk/mediatek/clk-mt8183.c
> > index 9d86510..a8f50bc 100644
> > --- a/drivers/clk/mediatek/clk-mt8183.c
> > +++ b/drivers/clk/mediatek/clk-mt8183.c
> > @@ -1167,37 +1169,62 @@ static int clk_mt8183_apmixed_probe(struct platform_device *pdev)
> >         return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
> >  }
> >  
> > +static struct clk_onecell_data *top_clk_data;
> > +
> > +static void clk_mt8183_top_init_early(struct device_node *node)
> > +{
> > +       int i;
> > +
> > +       if (!top_clk_data) {
> 
> Is this function ever called more than once? I believe the answer is no
> so this check should be removed.
> 

Thanks for reminding. I'll fix in next version.

> > +               top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
> > +
> > +               for (i = 0; i < CLK_TOP_NR_CLK; i++)
> > +                       top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
> > +       }
> > +
> > +       mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs),
> > +                       top_clk_data);
> > +
> > +       of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
> > +}
> > +
> > +CLK_OF_DECLARE_DRIVER(mt8183_topckgen, "mediatek,mt8183-topckgen",
> > +                       clk_mt8183_top_init_early);
> > +
> >  static int clk_mt8183_top_probe(struct platform_device *pdev)
> >  {
> >         struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >         void __iomem *base;
> > -       struct clk_onecell_data *clk_data;
> >         struct device_node *node = pdev->dev.of_node;
> >  
> >         base = devm_ioremap_resource(&pdev->dev, res);
> >         if (IS_ERR(base))
> >                 return PTR_ERR(base);
> >  
> > -       clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
> > +       if (!top_clk_data)
> > +               top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
> 
> And then this can be removed because top_clk_data must be allocated at
> this point.
> 

I'll fix in next version. Many thanks.

> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2019-06-10  2:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07  3:11 [PATCH v1] clk: mediatek: mt8183: Register 13MHz clock earlier for clocksource Weiyi Lu
2019-06-07 17:59 ` Stephen Boyd
2019-06-10  2:09   ` Weiyi Lu [this message]

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=1560132549.16837.1.camel@mtksdaap41 \
    --to=weiyi.lu@mediatek.com \
    --cc=dehui.sun@mediatek.com \
    --cc=drinkcat@chromium.org \
    --cc=fan.chen@mediatek.com \
    --cc=jamesjj.liao@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=stable@vger.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 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).