public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Eduardo Valentin <edubezval@gmail.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-omap@vger.kernel.org, Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH 9/17] ARM: OMAP2: Add common clock framework for 24xx and 34xx
Date: Mon, 31 Mar 2008 10:56:33 +0300	[thread overview]
Message-ID: <20080331075632.GF26502@atomide.com> (raw)
In-Reply-To: <a0580c510803301149l55d753c2m3ba7cec1882e5b1c@mail.gmail.com>

* Eduardo Valentin <edubezval@gmail.com> [080330 21:49]:
> Hi Tony and Paul,
> 
> Just a little question/warn, these kind of code may not be preempt safe:
> <snip>
> +/* Enables clock without considering parent dependencies or use count
> + * REVISIT: Maybe change this to use clk->enable like on omap1?
> + */
> +int _omap2_clk_enable(struct clk *clk)
> +{
> +	u32 regval32;
> +
> +	if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
> +		return 0;
> +
> +	if (clk->enable)
> +		return clk->enable(clk);
> +
> +	if (unlikely(clk->enable_reg == 0)) {
> +		printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
> +		       clk->name);
> +		return 0; /* REVISIT: -EINVAL */
> +	}
> +
> +	regval32 = cm_read_reg(clk->enable_reg);
> +	if (clk->flags & INVERT_ENABLE)
> +		regval32 &= ~(1 << clk->enable_bit);
> +	else
> +		regval32 |= (1 << clk->enable_bit);
> +	cm_write_reg(regval32, clk->enable_reg);
> +	wmb();
> +
> +	omap2_clk_wait_ready(clk);
> +
> +	return 0;
> +}
> <snip>
> 
> Are these registers protected somehow? because this read followed by a write
> may not be a preempt safe operation. Or this code is not designed for
> CONFIG_PREEMPT?

Yeah, it's OK. Both clk24xx.c and clk34xx.c register omap2_clk_enable()
with omap common clock code.

Then omap common clock code calls omap2_clk_enable() with spin_lock_irqsave(),
see clk_enable() in arch/arm/plat-omap/clock.c.

Regards,

Tony




> 
> Cheers,
> 
> Eduardo Valentin
> 
> On Fri, Mar 28, 2008 at 8:38 AM, Tony Lindgren <tony@atomide.com> wrote:
> > * Tony Lindgren <tony@atomide.com> [080318 17:04]:
> >
> > > From: Paul Walmsley <paul@pwsan.com>
> >  >
> >  > This patch adds a common clock framework for 24xx and 34xx.
> >  > Note that this patch does not add it to Makefile until in
> >  > next patch. Some functions are modified from earlier 24xx
> >  > clock framework code.
> >
> >  Here's an updated version of this patch. I've folded in two more patches
> >  from Paul [1][2]. Patches change to use __ffs() instead of
> >  mask_to_shift,
> >  and clean up clock register defines.
> >
> >  Regards,
> >
> >  Tony
> >
> >  [1] http://master.kernel.org/git/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commitdiff;h=f417e171cd2d2bd0302c8f420ee97295a165a39c
> >  [2] http://master.kernel.org/git/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commitdiff;h=70d19cc5c7999445b84e6ffea8e025512b877e8c
> >
> 
> 
> 
> -- 
> Eduardo Bezerra Valentin

  reply	other threads:[~2008-03-31  7:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 14:01 [PATCH 0/17] omap2 patches for post 2.6.25, take #2 Tony Lindgren
2008-03-18 14:01 ` [PATCH 1/17] ARM: OMAP2: Add new pin multiplexing configurations Tony Lindgren
2008-03-18 14:02   ` [PATCH 2/17] ARM: OMAP2: Clean-up mux code Tony Lindgren
2008-03-18 14:02     ` [PATCH 3/17] ARM: OMAP2: Add common register access for 24xx and 34xx Tony Lindgren
2008-03-18 14:02       ` [PATCH 4/17] ARM: OMAP2: Add register access for 34xx Tony Lindgren
2008-03-18 14:02         ` [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access Tony Lindgren
2008-03-18 14:02           ` [PATCH 6/17] ARM: OMAP2: Remove old 24xx PM code Tony Lindgren
2008-03-18 14:02             ` [PATCH 7/17] ARM: OMAP2: Move clock.h to clock24xx.h Tony Lindgren
2008-03-18 14:02               ` [PATCH 8/17] ARM: OMAP2: Move clock.c to clock24xx.c Tony Lindgren
2008-03-18 14:02                 ` [PATCH 9/17] ARM: OMAP2: Add common clock framework for 24xx and 34xx Tony Lindgren
2008-03-18 14:02                   ` [PATCH 10/17] ARM: OMAP2: Change 24xx to use shared clock code and new reg access Tony Lindgren
2008-03-18 14:02                     ` [PATCH 11/17] ARM: OMAP: Add rest of 24xx clocks Tony Lindgren
2008-03-18 14:02                       ` [PATCH 12/17] ARM: OMAP2: Remove old 24xx specific clock functions Tony Lindgren
2008-03-18 14:02                         ` [PATCH 13/17] ARM: OMAP2: Clean up 24xx clock code Tony Lindgren
2008-03-18 14:02                           ` [PATCH 14/17] ARM: OMAP2: Remove old PRCM register access code Tony Lindgren
2008-03-18 14:02                             ` [PATCH 15/17] ARM: OMAP2: Add 34xx clocks Tony Lindgren
2008-03-18 14:02                               ` [PATCH 16/17] ARM: OMAP2: Add 34xx clock code Tony Lindgren
2008-03-18 14:02                                 ` [PATCH 17/17] ARM: OMAP2: New DPLL clock framework Tony Lindgren
2008-03-28 12:39                                   ` Tony Lindgren
2008-03-28 12:39                                 ` [PATCH 16/17] ARM: OMAP2: Add 34xx clock code Tony Lindgren
2008-03-28 12:38                     ` [PATCH 10/17] ARM: OMAP2: Change 24xx to use shared clock code and new reg access Tony Lindgren
2008-03-28 12:38                   ` [PATCH 9/17] ARM: OMAP2: Add common clock framework for 24xx and 34xx Tony Lindgren
2008-03-30 18:49                     ` Eduardo Valentin
2008-03-31  7:56                       ` Tony Lindgren [this message]
2008-04-07 16:48           ` [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access Russell King - ARM Linux
2008-04-09 20:57             ` Tony Lindgren
2008-04-09 21:22               ` Russell King - ARM Linux
2008-04-09 21:54                 ` Tony Lindgren
2008-04-09 23:24                   ` Tony Lindgren
2008-03-28 12:37         ` [PATCH 4/17] ARM: OMAP2: Add register access for 34xx Tony Lindgren
2008-03-28 12:36       ` [PATCH 3/17] ARM: OMAP2: Add common register access for 24xx and 34xx Tony Lindgren
2008-04-07 16:20       ` Russell King - ARM Linux
2008-04-09 20:50         ` Tony Lindgren
2008-04-14 14:05           ` Russell King - ARM Linux
2008-04-14 17:39             ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-04-09 21:03 [PATCH 0/17] omap2 patches for post 2.6.25, take #3 Tony Lindgren
2008-04-09 21:03 ` [PATCH 1/17] ARM: OMAP2: Add new pin multiplexing configurations Tony Lindgren
2008-04-09 21:03   ` [PATCH 2/17] ARM: OMAP2: Clean-up mux code Tony Lindgren
2008-04-09 21:03     ` [PATCH 3/17] ARM: OMAP2: Add common register access for 24xx and 34xx Tony Lindgren
2008-04-09 21:03       ` [PATCH 4/17] ARM: OMAP2: Add register access for 34xx Tony Lindgren
2008-04-09 21:03         ` [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access Tony Lindgren
2008-04-09 21:03           ` [PATCH 6/17] ARM: OMAP2: Remove old 24xx PM code Tony Lindgren
2008-04-09 21:03             ` [PATCH 7/17] ARM: OMAP2: Move clock.h to clock24xx.h Tony Lindgren
2008-04-09 21:03               ` [PATCH 8/17] ARM: OMAP2: Move clock.c to clock24xx.c Tony Lindgren
2008-04-09 21:03                 ` [PATCH 9/17] ARM: OMAP2: Add common clock framework for 24xx and 34xx Tony Lindgren

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=20080331075632.GF26502@atomide.com \
    --to=tony@atomide.com \
    --cc=edubezval@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox