[ARM] Fix timer damage from d3d74453c34f8fd87674a8cf5b8a327c68f22e99
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 28 Jan 2008 10:16:37 +0000 (10:16 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 28 Jan 2008 10:17:12 +0000 (10:17 +0000)
Move the xtime write mode seqlock into timer_tick(), so it only
surrounds the call to do_timer().

This avoids a deadlock in update_process_times() ...
hrtimer_get_softirq_time() which tries to get a read mode seqlock
on xtime, thereby preventing booting.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
21 files changed:
arch/arm/kernel/time.c
arch/arm/mach-aaec2000/core.c
arch/arm/mach-clps711x/time.c
arch/arm/mach-clps7500/core.c
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-footbridge/dc21285-timer.c
arch/arm/mach-footbridge/isa-timer.c
arch/arm/mach-h720x/cpu-h7201.c
arch/arm/mach-h720x/cpu-h7202.c
arch/arm/mach-integrator/core.c
arch/arm/mach-ixp2000/core.c
arch/arm/mach-ks8695/time.c
arch/arm/mach-lh7a40x/time.c
arch/arm/mach-mx3/time.c
arch/arm/mach-netx/time.c
arch/arm/mach-omap2/timer-gp.c
arch/arm/mach-pnx4008/time.c
arch/arm/mach-realview/core.c
arch/arm/mach-sa1100/time.c
arch/arm/mach-shark/core.c

index e59b5b84168dadc02493200f26ee86e426059f70..b5867eca1d0bed94548a1582445a12979c1fc86d 100644 (file)
@@ -325,7 +325,9 @@ void timer_tick(void)
        profile_tick(CPU_PROFILING);
        do_leds();
        do_set_rtc();
+       write_seqlock(&xtime_lock);
        do_timer(1);
+       write_sequnlock(&xtime_lock);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(get_irq_regs()));
 #endif
index 0446ef2f5bd665e3702e3b0448d2c8e73e282000..b016be2b0e35360ac135b6db8521e3b6d10cfb01 100644 (file)
@@ -130,13 +130,9 @@ static irqreturn_t
 aaec2000_timer_interrupt(int irq, void *dev_id)
 {
        /* TODO: Check timer accuracy */
-       write_seqlock(&xtime_lock);
-
        timer_tick();
        TIMER1_CLEAR = 1;
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index f428af7545b4472da7e4440e017366f037fc03b1..e5dc33f1f95c1accc5cbdda25b189f9fcb748b9b 100644 (file)
@@ -50,9 +50,7 @@ static unsigned long clps711x_gettimeoffset(void)
 static irqreturn_t
 p720t_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
        timer_tick();
-       write_sequnlock(&xtime_lock);
        return IRQ_HANDLED;
 }
 
index 986205ec9269985dc47ec3500a3ab9f2d9ca71ae..2ac63671ea5f842aa6605dc5c411fb19728e108c 100644 (file)
@@ -298,8 +298,6 @@ extern unsigned long ioc_timer_gettimeoffset(void);
 static irqreturn_t
 clps7500_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        timer_tick();
 
        /* Why not using do_leds interface?? */
@@ -313,8 +311,6 @@ clps7500_timer_interrupt(int irq, void *dev_id)
                }
        }
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index 8c1b5690dfe8c52b93662c8fe5fd98ca9c48ed8f..7710e14b52684b095b5aa456fd80cd1f35b6ce90 100644 (file)
@@ -178,8 +178,6 @@ ebsa110_timer_interrupt(int irq, void *dev_id)
 {
        u32 count;
 
-       write_seqlock(&xtime_lock);
-
        /* latch and read timer 1 */
        __raw_writeb(0x40, PIT_CTRL);
        count = __raw_readb(PIT_T1);
@@ -192,8 +190,6 @@ ebsa110_timer_interrupt(int irq, void *dev_id)
 
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index 70b2c78011102a7dea24b05f99bd97473942f1d0..f1074ff02fdbb5fdaebe505157e1a36651a70185 100644 (file)
@@ -99,8 +99,6 @@ static unsigned int last_jiffy_time;
 
 static int ep93xx_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        __raw_writel(1, EP93XX_TIMER1_CLEAR);
        while ((signed long)
                (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
@@ -109,8 +107,6 @@ static int ep93xx_timer_interrupt(int irq, void *dev_id)
                timer_tick();
        }
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index 3a63941d43beceea7a022c5c928ad3caa459afde..b2a21189dd81b620fe4e758d9a9cecc23d29a9eb 100644 (file)
@@ -30,14 +30,10 @@ static unsigned long timer1_gettimeoffset (void)
 static irqreturn_t
 timer1_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        *CSR_TIMER1_CLR = 0;
 
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index d08d64139d0051971a4bd57e88424518fa95d83d..a764e01d3573991010db8e629e03b7952d0d67ad 100644 (file)
@@ -64,9 +64,7 @@ static unsigned long isa_gettimeoffset(void)
 static irqreturn_t
 isa_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
        timer_tick();
-       write_sequnlock(&xtime_lock);
        return IRQ_HANDLED;
 }
 
index 9107b8e2ad6e77889955130462bdc3b237d206ea..c2a431f482f01bcbecf06a61897f35716b678e84 100644 (file)
 static irqreturn_t
 h7201_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index 0a1a25fb8ba83beca8f5afcebafdf99dc28b77b1..c627fa124eb361b0a162f1578d497df9804929f6 100644 (file)
@@ -113,9 +113,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
        mask = CPU_REG (TIMER_VIRT, TIMER_TOPSTAT);
 
        if ( mask & TSTAT_T0INT ) {
-               write_seqlock(&xtime_lock);
                timer_tick();
-               write_sequnlock(&xtime_lock);
                if( mask == TSTAT_T0INT )
                        return;
        }
index e9c82deb791d30beb1a99aa043072329361c793c..7fbbc17f8e8b188abf213337af11cccdd4218532 100644 (file)
@@ -250,8 +250,6 @@ unsigned long integrator_gettimeoffset(void)
 static irqreturn_t
 integrator_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        /*
         * clear the interrupt
         */
@@ -259,8 +257,6 @@ integrator_timer_interrupt(int irq, void *dev_id)
 
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index cb6ad211887a942dea628f469230adf352539a82..81cdc826720663722f574605d58cc9b99833cbd5 100644 (file)
@@ -206,8 +206,6 @@ unsigned long ixp2000_gettimeoffset (void)
 
 static int ixp2000_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        /* clear timer 1 */
        ixp2000_reg_wrb(IXP2000_T1_CLR, 1);
 
@@ -217,8 +215,6 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id)
                next_jiffy_time -= ticks_per_jiffy;
        }
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index d2c86e4a72eb79af23c80e38ad4114a4b0f8c63e..02f766b3121dcf35c02b07efa0cfabfc3dadc1c0 100644 (file)
@@ -70,10 +70,7 @@ static unsigned long ks8695_gettimeoffset (void)
  */
 static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
        timer_tick();
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index c25316d02537ef0dc34563b6c4d1bfae1a1de134..e50e60b33851592147f35b838665ec42be89a790 100644 (file)
 static irqreturn_t
 lh7a40x_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        TIMER_EOI = 0;
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index e81fb5c5d7c39e22061a9f0b0be664b2afb55a9e..fb565c98dbfb67c8e0b3c4f047d8426922b41f62 100644 (file)
@@ -45,8 +45,6 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
 {
        unsigned int next_match;
 
-       write_seqlock(&xtime_lock);
-
        if (__raw_readl(MXC_GPT_GPTSR) & GPTSR_OF1) {
                do {
                        timer_tick();
@@ -57,8 +55,6 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
                                       __raw_readl(MXC_GPT_GPTCNT)) <= 0);
        }
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index 4762e207b0bff82c4819e1314b480449a3188cf3..ea07b54afa598be9b115748fe6a30e023f192603 100644 (file)
 static irqreturn_t
 netx_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        /* acknowledge interrupt */
        writel(COUNTER_BIT(0), NETX_GPIO_IRQ);
 
index 8d322c20ccaedd0e65f8537d376e2bceae3f42c4..3234deedb9465ae628f0832e2a4afba16376ecce 100644 (file)
@@ -40,13 +40,9 @@ static inline void omap2_gp_timer_start(unsigned long load_val)
 
 static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        omap_dm_timer_write_status(gptimer, OMAP_TIMER_INT_OVERFLOW);
        timer_tick();
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index 67e05f005a6bcaa99a340c1969307052d15223db..6d4ca8fc0cb4521c18904b761bd1a73d0459d664 100644 (file)
@@ -51,8 +51,6 @@ static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id)
 {
        if (__raw_readl(HSTIM_INT) & MATCH0_INT) {
 
-               write_seqlock(&xtime_lock);
-
                do {
                        timer_tick();
 
@@ -73,8 +71,6 @@ static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id)
                } while ((signed)
                         (__raw_readl(HSTIM_MATCH0) -
                          __raw_readl(HSTIM_COUNTER)) < 0);
-
-               write_sequnlock(&xtime_lock);
        }
 
        return IRQ_HANDLED;
index c7f1b44da40d0849295d55d82f19e718778f5b0d..61d70218f1e8adc60aee99d0e044700cb2fe6fd2 100644 (file)
@@ -530,8 +530,6 @@ static unsigned long realview_gettimeoffset(void)
  */
 static irqreturn_t realview_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
-
        // ...clear the interrupt
        writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
 
@@ -542,8 +540,6 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id)
        update_process_times(user_mode(get_irq_regs()));
 #endif
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index fdf7b016e7adeadfa5652ae9779803209eba3d91..47f8640438e6a9d6ede96c45e7933b864a2037e4 100644 (file)
@@ -62,8 +62,6 @@ sa1100_timer_interrupt(int irq, void *dev_id)
 {
        unsigned int next_match;
 
-       write_seqlock(&xtime_lock);
-
 #ifdef CONFIG_NO_IDLE_HZ
        if (match_posponed) {
                match_posponed = 0;
@@ -85,8 +83,6 @@ sa1100_timer_interrupt(int irq, void *dev_id)
                next_match = (OSMR0 += LATCH);
        } while ((signed long)(next_match - OSCR) <= 0);
 
-       write_sequnlock(&xtime_lock);
-
        return IRQ_HANDLED;
 }
 
index a0545db2a34f5e0fedb1f98551751e303f34e7b8..09d9f33d4072fb591c8f4b1c2f2b90894ef86c70 100644 (file)
@@ -82,9 +82,7 @@ static void __init shark_map_io(void)
 static irqreturn_t
 shark_timer_interrupt(int irq, void *dev_id)
 {
-       write_seqlock(&xtime_lock);
        timer_tick();
-       write_sequnlock(&xtime_lock);
        return IRQ_HANDLED;
 }