From: Shawn Guo <shawn.guo@freescale.com>
To: Xiubo Li-B47053 <Li.Xiubo@freescale.com>
Cc: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"pawel.moll@arm.com" <pawel.moll@arm.com>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
"galak@codeaurora.org" <galak@codeaurora.org>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] ARM: ls1021a: add gating clocks to IP blocks.
Date: Thu, 25 Sep 2014 16:29:41 +0800 [thread overview]
Message-ID: <20140925082940.GF6405@dragon> (raw)
In-Reply-To: <e7a0fe3cbe4c4ed0bcc489853a392f35@BY2PR0301MB0613.namprd03.prod.outlook.com>
On Mon, Sep 22, 2014 at 03:55:14PM +0800, Xiubo Li-B47053 wrote:
> > > +static void __init ls1021a_clocks_init(struct device_node *np)
> > > +{
> > > + void __iomem *dcfg_base;
> > > +
> > > +#define DCFG_CCSR_DEVDISR1 (dcfg_base + 0x70)
> > > +#define DCFG_CCSR_DEVDISR2 (dcfg_base + 0x74)
> > > +#define DCFG_CCSR_DEVDISR3 (dcfg_base + 0x78)
> > > +#define DCFG_CCSR_DEVDISR4 (dcfg_base + 0x7c)
> > > +#define DCFG_CCSR_DEVDISR5 (dcfg_base + 0x80)
> > > +
> > > + dcfg_base = of_iomap(np, 0);
> > > +
> > > + BUG_ON(!dcfg_base);
> > Is this worth a BUG?
> Yes, I do think so.
>
> There is one story about my platform:
> We are using the imx2_wdt watchdog device, which cannot stop or suspend
> once it has started.
> And our platform will also support the Power Management, if the gating
> Clock initialized failed, so when the system enters sleep mode, we cannot
> Stop the imx2_wdt IP block, so it will reset the board after 180 seconds at
> most.
>
> So using this gating clock, the watchdog IP block's clock could be disabled
> When the system enter sleep mode.
>
> So I think BUG_ON here is make sense.
>
> Doesn't it ?
>
> > Or is it enough to do
> > if (!dcfg_base) {
> > pr_warn("failed to map fsl,ls1021a-gate device\n");
> > return
> > }
> >
> > > +
> > > + clk[LS1021A_CLK_PBL_EN] = ls1021a_clk_gate("pbl_en", "dummy",
> > > + DCFG_CCSR_DEVDISR1, 0, true);
> > If the machine's device tree contains two (or more) nodes that are
> > compatible to "fsl,ls1021a-gate", you overwrite your static clk array. Is
> > it worth to add another check here?:
> >
> On LS1021A SoC, I can make sure that there will only be one gate node. But for
> More compatibly using one dynamic clk array will be better.
I do not think it's really necessary to use dynamic allocation. Making
dcfg_base a static variable and check if it's null at the beginning of
the function is probably enough.
Shawn
prev parent reply other threads:[~2014-09-25 8:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-22 6:09 [PATCH v2] ARM: ls1021a: add gating clocks to IP blocks Xiubo Li
[not found] ` <1411366160-42685-1-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-22 7:00 ` Uwe Kleine-König
2014-09-22 7:55 ` Li.Xiubo
2014-09-25 8:29 ` Shawn Guo [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=20140925082940.GF6405@dragon \
--to=shawn.guo@freescale.com \
--cc=Li.Xiubo@freescale.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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).