diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-12-17 06:43:29 -0500 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-01-22 11:04:52 -0500 |
commit | a602f0f2f04f150fa1f7312b9e601e8e1a5afe10 (patch) | |
tree | 108f52cfb0450127b0d9390bab101980ca31d73d /arch | |
parent | 501d70383aa9ffc78b41aa7e74f6b0254c7c731c (diff) |
arm/{pxa,sa1100,nomadik}: Don't disable irqs in set_next_event and set_mode
These functions are called with irqs already off. This commit removes
the calls to raw_local_irq_save and raw_local_irq_restore on platforms
that don't have to use a shared interrupt for their timekeeping.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/time.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/time.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-nomadik/timer.c | 9 |
3 files changed, 3 insertions, 24 deletions
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 750c448db672..293e40aeaf29 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c | |||
@@ -76,14 +76,12 @@ pxa_ost0_interrupt(int irq, void *dev_id) | |||
76 | static int | 76 | static int |
77 | pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) | 77 | pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) |
78 | { | 78 | { |
79 | unsigned long flags, next, oscr; | 79 | unsigned long next, oscr; |
80 | 80 | ||
81 | raw_local_irq_save(flags); | ||
82 | OIER |= OIER_E0; | 81 | OIER |= OIER_E0; |
83 | next = OSCR + delta; | 82 | next = OSCR + delta; |
84 | OSMR0 = next; | 83 | OSMR0 = next; |
85 | oscr = OSCR; | 84 | oscr = OSCR; |
86 | raw_local_irq_restore(flags); | ||
87 | 85 | ||
88 | return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; | 86 | return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; |
89 | } | 87 | } |
@@ -91,23 +89,17 @@ pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) | |||
91 | static void | 89 | static void |
92 | pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) | 90 | pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) |
93 | { | 91 | { |
94 | unsigned long irqflags; | ||
95 | |||
96 | switch (mode) { | 92 | switch (mode) { |
97 | case CLOCK_EVT_MODE_ONESHOT: | 93 | case CLOCK_EVT_MODE_ONESHOT: |
98 | raw_local_irq_save(irqflags); | ||
99 | OIER &= ~OIER_E0; | 94 | OIER &= ~OIER_E0; |
100 | OSSR = OSSR_M0; | 95 | OSSR = OSSR_M0; |
101 | raw_local_irq_restore(irqflags); | ||
102 | break; | 96 | break; |
103 | 97 | ||
104 | case CLOCK_EVT_MODE_UNUSED: | 98 | case CLOCK_EVT_MODE_UNUSED: |
105 | case CLOCK_EVT_MODE_SHUTDOWN: | 99 | case CLOCK_EVT_MODE_SHUTDOWN: |
106 | /* initializing, released, or preparing for suspend */ | 100 | /* initializing, released, or preparing for suspend */ |
107 | raw_local_irq_save(irqflags); | ||
108 | OIER &= ~OIER_E0; | 101 | OIER &= ~OIER_E0; |
109 | OSSR = OSSR_M0; | 102 | OSSR = OSSR_M0; |
110 | raw_local_irq_restore(irqflags); | ||
111 | break; | 103 | break; |
112 | 104 | ||
113 | case CLOCK_EVT_MODE_RESUME: | 105 | case CLOCK_EVT_MODE_RESUME: |
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index b9cbb56d6e9d..74b6e0e570b6 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c | |||
@@ -35,14 +35,12 @@ static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id) | |||
35 | static int | 35 | static int |
36 | sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) | 36 | sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) |
37 | { | 37 | { |
38 | unsigned long flags, next, oscr; | 38 | unsigned long next, oscr; |
39 | 39 | ||
40 | raw_local_irq_save(flags); | ||
41 | OIER |= OIER_E0; | 40 | OIER |= OIER_E0; |
42 | next = OSCR + delta; | 41 | next = OSCR + delta; |
43 | OSMR0 = next; | 42 | OSMR0 = next; |
44 | oscr = OSCR; | 43 | oscr = OSCR; |
45 | raw_local_irq_restore(flags); | ||
46 | 44 | ||
47 | return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; | 45 | return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; |
48 | } | 46 | } |
@@ -50,16 +48,12 @@ sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) | |||
50 | static void | 48 | static void |
51 | sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) | 49 | sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) |
52 | { | 50 | { |
53 | unsigned long flags; | ||
54 | |||
55 | switch (mode) { | 51 | switch (mode) { |
56 | case CLOCK_EVT_MODE_ONESHOT: | 52 | case CLOCK_EVT_MODE_ONESHOT: |
57 | case CLOCK_EVT_MODE_UNUSED: | 53 | case CLOCK_EVT_MODE_UNUSED: |
58 | case CLOCK_EVT_MODE_SHUTDOWN: | 54 | case CLOCK_EVT_MODE_SHUTDOWN: |
59 | raw_local_irq_save(flags); | ||
60 | OIER &= ~OIER_E0; | 55 | OIER &= ~OIER_E0; |
61 | OSSR = OSSR_M0; | 56 | OSSR = OSSR_M0; |
62 | raw_local_irq_restore(flags); | ||
63 | break; | 57 | break; |
64 | 58 | ||
65 | case CLOCK_EVT_MODE_RESUME: | 59 | case CLOCK_EVT_MODE_RESUME: |
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index 62f18ad43a28..fa7cb3a57cbf 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
@@ -49,24 +49,17 @@ static struct clocksource nmdk_clksrc = { | |||
49 | static void nmdk_clkevt_mode(enum clock_event_mode mode, | 49 | static void nmdk_clkevt_mode(enum clock_event_mode mode, |
50 | struct clock_event_device *dev) | 50 | struct clock_event_device *dev) |
51 | { | 51 | { |
52 | unsigned long flags; | ||
53 | |||
54 | switch (mode) { | 52 | switch (mode) { |
55 | case CLOCK_EVT_MODE_PERIODIC: | 53 | case CLOCK_EVT_MODE_PERIODIC: |
56 | /* enable interrupts -- and count current value? */ | 54 | /* count current value? */ |
57 | raw_local_irq_save(flags); | ||
58 | writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC); | 55 | writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC); |
59 | raw_local_irq_restore(flags); | ||
60 | break; | 56 | break; |
61 | case CLOCK_EVT_MODE_ONESHOT: | 57 | case CLOCK_EVT_MODE_ONESHOT: |
62 | BUG(); /* Not supported, yet */ | 58 | BUG(); /* Not supported, yet */ |
63 | /* FALLTHROUGH */ | 59 | /* FALLTHROUGH */ |
64 | case CLOCK_EVT_MODE_SHUTDOWN: | 60 | case CLOCK_EVT_MODE_SHUTDOWN: |
65 | case CLOCK_EVT_MODE_UNUSED: | 61 | case CLOCK_EVT_MODE_UNUSED: |
66 | /* disable irq */ | ||
67 | raw_local_irq_save(flags); | ||
68 | writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC); | 62 | writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC); |
69 | raw_local_irq_restore(flags); | ||
70 | break; | 63 | break; |
71 | case CLOCK_EVT_MODE_RESUME: | 64 | case CLOCK_EVT_MODE_RESUME: |
72 | break; | 65 | break; |