linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] ARM: delay: add registration mechanism for delay timer sources
Date: Tue, 04 Sep 2012 10:11:51 -0700	[thread overview]
Message-ID: <50463657.1070109@codeaurora.org> (raw)
In-Reply-To: <20120904104403.GE2458@mudshark.cambridge.arm.com>

On 09/04/12 03:44, Will Deacon wrote:
> On Tue, Sep 04, 2012 at 11:07:50AM +0100, Will Deacon wrote:
>> On Fri, Aug 31, 2012 at 12:51:25AM +0100, Stephen Boyd wrote:
>>>> +void __init register_current_timer_delay(struct delay_timer *timer)
>>> const?
>> Sure. I'll send an updated patch.
> Gah, spoke too soon. This isn't going to work, as the frequency may not be
> known until probe time (for example, it could be obtained by the device
> tree) so const data isn't going to cut it.
>

That's fine. We can still do const can't we? I was suggesting you make
the argument const and not the data in arch_timer.c const. This way we
can be sure that delay.c isn't going to muck with the struct, but the
ones who register the struct can fill it in at runtime.

Squash this in and test compile?

----8<------

diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
index 50928e8..ab98fdd 100644
--- a/arch/arm/include/asm/delay.h
+++ b/arch/arm/include/asm/delay.h
@@ -63,7 +63,7 @@ extern void __loop_const_udelay(unsigned long);
 
 /* Delay-loop timer registration. */
 #define ARCH_HAS_READ_CURRENT_TIMER
-extern void register_current_timer_delay(struct delay_timer *timer);
+extern void register_current_timer_delay(const struct delay_timer *timer);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index fe6f4fb..e868ef0 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -34,7 +34,7 @@ struct arm_delay_ops arm_delay_ops = {
        .udelay         = __loop_udelay,
 };
 
-static struct delay_timer *delay_timer;
+static const struct delay_timer *delay_timer;
 static bool delay_calibrated;
 
 int read_current_timer(unsigned long *timer_val)
@@ -62,7 +62,7 @@ static void __timer_udelay(unsigned long usecs)
        __timer_const_udelay(usecs * UDELAY_MULT);
 }
 
-void __init register_current_timer_delay(struct delay_timer *timer)
+void __init register_current_timer_delay(const struct delay_timer *timer)
 {
        if (!delay_calibrated) {
                pr_info("Switching to timer-based delay loop\n");

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2012-09-04 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29 21:25 [PATCH v2 1/2] ARM: delay: set loops_per_jiffy when moving to timer-based loop Will Deacon
2012-08-29 21:25 ` [PATCH v2 2/2] ARM: delay: add registration mechanism for delay timer sources Will Deacon
2012-08-30 23:51   ` Stephen Boyd
2012-09-04 10:07     ` Will Deacon
2012-09-04 10:44       ` Will Deacon
2012-09-04 17:11         ` Stephen Boyd [this message]
2012-09-04 17:38           ` Will Deacon
2012-09-07 17:07   ` Will Deacon
2012-08-30 23:51 ` [PATCH v2 1/2] ARM: delay: set loops_per_jiffy when moving to timer-based loop Stephen Boyd

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=50463657.1070109@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).