All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cousson, Benoit" <b-cousson@ti.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>,
	linux-omap@vger.kernel.org, tony@atomide.com, khilman@ti.com,
	santosh.shilimkar@ti.com, rnayak@ti.com
Subject: Re: [PATCH 3/3] ARM: OMAP2+: dmtimer: cleanup fclk usage
Date: Mon, 16 Apr 2012 22:51:23 +0200	[thread overview]
Message-ID: <4F8C864B.4090101@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1204161034290.29048@utopia.booyaka.com>

On 4/16/2012 6:40 PM, Paul Walmsley wrote:
> Hi
>
> a few comments
>
> On Mon, 16 Apr 2012, Tarun Kanti DebBarma wrote:

...

>> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
>> index 5d7a0ee..9459d70 100644
>> --- a/arch/arm/mach-omap2/timer.c
>> +++ b/arch/arm/mach-omap2/timer.c
>> @@ -164,8 +164,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
>>   		return -ENXIO;
>>
>>   	/* After the dmtimer is using hwmod these clocks won't be needed */
>> -	sprintf(name, "gpt%d_fck", gptimer_id);
>> -	timer->fclk = clk_get(NULL, name);
>> +	timer->fclk = clk_get(NULL, oh->main_clk);
>>   	if (IS_ERR(timer->fclk))
>>   		return -ENODEV;
>
> If you find yourself accessing struct omap_hwmod structure fields
> directly, something is almost certainly wrong; and this case is not an
> exception.  Since the omap_device code is defining an "fck" alias to the
> main_clk, all you should need to do is:
>
> -     sprintf(name, "gpt%d_fck", gptimer_id);
> -     timer->fclk = clk_get(NULL, name);
> +     timer->fclk = clk_get(NULL, "fck");

Are you sure that's the same in that case?
"timer1_fck" is an unique entry in the clkdev table whereas there are a 
bunch of clock nodes with the "fck" alias local to a device.
Without the proper dev_id, there is no way to guaranty we will get the 
timer fck clock alias.

Since that code is executed pretty early before there is any device, 
accessing directly the hwmod entry seems to be the only method to get 
the proper clock without having to provide again the full clock name.

AFAIR, the "fck" alias is created during the omap_device creation, so I 
guess it is too early here to have it.

To be honest I'm always a little bit confused with that early code, but 
it looks like there is no device at all in that early part of the code.

Regards,
Benoit

  reply	other threads:[~2012-04-16 20:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 12:25 [PATCH 0/3] ARM: OMAP2+: dmtimer: cleanup related to devm API and clk usage Tarun Kanti DebBarma
2012-04-16 12:25 ` [PATCH 1/3] ARM: OMAP: dmtimer: Use devm_ API and do some cleanup in probe() Tarun Kanti DebBarma
2012-04-16 15:02   ` Shubhrajyoti
2012-04-17  5:01     ` DebBarma, Tarun Kanti
2012-04-16 12:25 ` [PATCH 2/3] ARM: OMAP2+: dmtimer: cleanup iclk usage Tarun Kanti DebBarma
2012-04-16 15:03   ` Hiremath, Vaibhav
2012-04-16 19:12     ` DebBarma, Tarun Kanti
2012-04-16 19:17       ` Hiremath, Vaibhav
2012-04-16 19:27     ` Paul Walmsley
2012-04-16 19:50       ` Hiremath, Vaibhav
2012-04-16 16:45   ` Paul Walmsley
2012-04-16 16:50   ` Paul Walmsley
2012-04-16 19:26     ` DebBarma, Tarun Kanti
2012-04-16 19:29       ` Paul Walmsley
2012-04-16 19:30       ` Paul Walmsley
2012-04-16 19:34         ` DebBarma, Tarun Kanti
2012-04-16 12:25 ` [PATCH 3/3] ARM: OMAP2+: dmtimer: cleanup fclk usage Tarun Kanti DebBarma
2012-04-16 16:40   ` Paul Walmsley
2012-04-16 20:51     ` Cousson, Benoit [this message]
2012-04-18  5:00       ` DebBarma, Tarun Kanti
2012-04-18  8:15         ` Paul Walmsley
2012-04-18  8:19           ` DebBarma, Tarun Kanti
2012-04-16 14:53 ` [PATCH 0/3] ARM: OMAP2+: dmtimer: cleanup related to devm API and clk usage Hiremath, Vaibhav
2012-04-16 19:50   ` DebBarma, Tarun Kanti
2012-04-16 19:53     ` Hiremath, Vaibhav

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=4F8C864B.4090101@ti.com \
    --to=b-cousson@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tarun.kanti@ti.com \
    --cc=tony@atomide.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 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.