* [PATCH] arm/tegra: clk_get should not be fatal
@ 2011-10-25 16:15 pdeschrijver at nvidia.com
2011-10-25 16:26 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: pdeschrijver at nvidia.com @ 2011-10-25 16:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Peter De Schrijver <pdeschrijver@nvidia.com>
The timer and rtc-timer clocks aren't gated by default, so there is no reason
to crash the system if the dummy enable call failed.
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
arch/arm/mach-tegra/timer.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index e2272d2..e12b064 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -186,16 +186,20 @@ static void __init tegra_init_timer(void)
int ret;
clk = clk_get_sys("timer", NULL);
- BUG_ON(IS_ERR(clk));
- clk_enable(clk);
+ if (IS_ERR(clk))
+ pr_warning("Unable to get timer clock");
+ else
+ clk_enable(clk);
/*
* rtc registers are used by read_persistent_clock, keep the rtc clock
* enabled
*/
clk = clk_get_sys("rtc-tegra", NULL);
- BUG_ON(IS_ERR(clk));
- clk_enable(clk);
+ if (IS_ERR(clk))
+ pr_warning("Unable to get rtc-tegra clock");
+ else
+ clk_enable(clk);
#ifdef CONFIG_HAVE_ARM_TWD
twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600);
--
1.7.7.rc0.72.g4b5ea.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] arm/tegra: clk_get should not be fatal
2011-10-25 16:15 [PATCH] arm/tegra: clk_get should not be fatal pdeschrijver at nvidia.com
@ 2011-10-25 16:26 ` Joe Perches
2011-10-25 17:00 ` Peter De Schrijver
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2011-10-25 16:26 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 2011-10-25 at 19:15 +0300, pdeschrijver at nvidia.com wrote:
> The timer and rtc-timer clocks aren't gated by default, so there is no reason
> to crash the system if the dummy enable call failed.
[]
> diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
[]
> @@ -186,16 +186,20 @@ static void __init tegra_init_timer(void)
> int ret;
>
> clk = clk_get_sys("timer", NULL);
> - BUG_ON(IS_ERR(clk));
> - clk_enable(clk);
> + if (IS_ERR(clk))
> + pr_warning("Unable to get timer clock");
> + else
> + clk_enable(clk);
>
> /*
> * rtc registers are used by read_persistent_clock, keep the rtc clock
> * enabled
> */
> clk = clk_get_sys("rtc-tegra", NULL);
> - BUG_ON(IS_ERR(clk));
> - clk_enable(clk);
> + if (IS_ERR(clk))
> + pr_warning("Unable to get rtc-tegra clock");
> + else
> + clk_enable(clk);
Are these messages are really necessary?
Maybe just:
if (!IS_ERR(clk))
clk_enable(clk)
If these are really necessary, please use
pr_warn("Unable to get <foo>\n");
pr_warn and with a terminating newline.
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] arm/tegra: clk_get should not be fatal
2011-10-25 16:26 ` Joe Perches
@ 2011-10-25 17:00 ` Peter De Schrijver
2011-10-26 1:15 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Peter De Schrijver @ 2011-10-25 17:00 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 25, 2011 at 06:26:08PM +0200, Joe Perches wrote:
> On Tue, 2011-10-25 at 19:15 +0300, pdeschrijver at nvidia.com wrote:
> > The timer and rtc-timer clocks aren't gated by default, so there is no reason
> > to crash the system if the dummy enable call failed.
> []
> > diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
> []
> > @@ -186,16 +186,20 @@ static void __init tegra_init_timer(void)
> > int ret;
> >
> > clk = clk_get_sys("timer", NULL);
> > - BUG_ON(IS_ERR(clk));
> > - clk_enable(clk);
> > + if (IS_ERR(clk))
> > + pr_warning("Unable to get timer clock");
> > + else
> > + clk_enable(clk);
> >
> > /*
> > * rtc registers are used by read_persistent_clock, keep the rtc clock
> > * enabled
> > */
> > clk = clk_get_sys("rtc-tegra", NULL);
> > - BUG_ON(IS_ERR(clk));
> > - clk_enable(clk);
> > + if (IS_ERR(clk))
> > + pr_warning("Unable to get rtc-tegra clock");
> > + else
> > + clk_enable(clk);
>
> Are these messages are really necessary?
I think it's still useful to have them as not having a clock fw is a strange
situation. It's not fatal though, but worth a warning I would say.
> Maybe just:
> if (!IS_ERR(clk))
> clk_enable(clk)
>
> If these are really necessary, please use
> pr_warn("Unable to get <foo>\n");
> pr_warn and with a terminating newline.
>
Is pr_warn any different then pr_warning? Point taken about the newline.
Cheers,
Peter.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-26 1:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 16:15 [PATCH] arm/tegra: clk_get should not be fatal pdeschrijver at nvidia.com
2011-10-25 16:26 ` Joe Perches
2011-10-25 17:00 ` Peter De Schrijver
2011-10-26 1:15 ` Joe Perches
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).