Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79894c7b47f78decaa3511f1d6646aa06e2c6bed
Commit:     79894c7b47f78decaa3511f1d6646aa06e2c6bed
Parent:     5ecd3100e695228ac5e0ce0e325e252c0f11806f
Author:     Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 17:54:08 2007 +0200
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Wed Jun 6 19:34:30 2007 +0100

    [MIPS] Atlas, Malta, SEAD: Remove scroll from interrupt handler.
    
    Aside of being handy for debugging this has never been a particularly
    good idea but is now getting in the way of dyntick / tickless kernels
    and general cleanups.
    
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/mips-boards/atlas/atlas_setup.c |    2 +
 arch/mips/mips-boards/generic/display.c   |   24 ++++++++++++++++++++++
 arch/mips/mips-boards/generic/time.c      |   31 +---------------------------
 arch/mips/mips-boards/malta/malta_setup.c |    6 +++++
 arch/mips/mips-boards/sead/sead_setup.c   |    2 +
 include/asm-mips/mips-boards/prom.h       |    1 +
 6 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c 
b/arch/mips/mips-boards/atlas/atlas_setup.c
index 0c6b0ce..1cc6ebb 100644
--- a/arch/mips/mips-boards/atlas/atlas_setup.c
+++ b/arch/mips/mips-boards/atlas/atlas_setup.c
@@ -48,6 +48,8 @@ const char *get_system_type(void)
        return "MIPS Atlas";
 }
 
+const char display_string[] = "        LINUX ON ATLAS       ";
+
 void __init plat_mem_setup(void)
 {
        mips_pcibios_init();
diff --git a/arch/mips/mips-boards/generic/display.c 
b/arch/mips/mips-boards/generic/display.c
index 548dbe5..5d60005 100644
--- a/arch/mips/mips-boards/generic/display.c
+++ b/arch/mips/mips-boards/generic/display.c
@@ -19,9 +19,14 @@
  */
 
 #include <linux/compiler.h>
+#include <linux/timer.h>
 #include <asm/io.h>
 #include <asm/mips-boards/generic.h>
 
+extern const char display_string[];
+static unsigned int display_count;
+static unsigned int max_display_count;
+
 void mips_display_message(const char *str)
 {
        static unsigned int __iomem *display = NULL;
@@ -37,3 +42,22 @@ void mips_display_message(const char *str)
                         writel(' ', display + i);
        }
 }
+
+static void scroll_display_message(unsigned long data);
+static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);
+
+static void scroll_display_message(unsigned long data)
+{
+       mips_display_message(&display_string[display_count++]);
+       if (display_count == max_display_count)
+               display_count = 0;
+
+       mod_timer(&mips_scroll_timer, jiffies + HZ);
+}
+
+void mips_scroll_message(void)
+{
+       del_timer_sync(&mips_scroll_timer);
+       max_display_count = strlen(display_string) + 1 - 8;
+       mod_timer(&mips_scroll_timer, jiffies + 1);
+}
diff --git a/arch/mips/mips-boards/generic/time.c 
b/arch/mips/mips-boards/generic/time.c
index df2a2bd..37735bf 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -53,37 +53,11 @@
 
 unsigned long cpu_khz;
 
-#if defined(CONFIG_MIPS_ATLAS)
-static char display_string[] = "        LINUX ON ATLAS       ";
-#endif
-#if defined(CONFIG_MIPS_MALTA)
-#if defined(CONFIG_MIPS_MT_SMTC)
-static char display_string[] = "       SMTC LINUX ON MALTA       ";
-#else
-static char display_string[] = "        LINUX ON MALTA       ";
-#endif /* CONFIG_MIPS_MT_SMTC */
-#endif
-#if defined(CONFIG_MIPS_SEAD)
-static char display_string[] = "        LINUX ON SEAD       ";
-#endif
-static unsigned int display_count;
-#define MAX_DISPLAY_COUNT (sizeof(display_string) - 8)
-
 #define CPUCTR_IMASKBIT (0x100 << MIPSCPU_INT_CPUCTR)
 
-static unsigned int timer_tick_count;
 static int mips_cpu_timer_irq;
 extern void smtc_timer_broadcast(int);
 
-static inline void scroll_display_message(void)
-{
-       if ((timer_tick_count++ % HZ) == 0) {
-               mips_display_message(&display_string[display_count++]);
-               if (display_count == MAX_DISPLAY_COUNT)
-                       display_count = 0;
-       }
-}
-
 static void mips_timer_dispatch(void)
 {
        do_IRQ(mips_cpu_timer_irq);
@@ -143,7 +117,6 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id)
                if (cpu_data[cpu].vpe_id == 0) {
                                timer_interrupt(irq, NULL);
                                smtc_timer_broadcast(cpu_data[cpu].vpe_id);
-                               scroll_display_message();
                } else {
                        write_c0_compare(read_c0_count() +
                                         (mips_hpt_frequency/HZ));
@@ -167,8 +140,6 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id)
                /* we keep interrupt disabled all the time */
                if (!r2 || (read_c0_cause() & (1 << 30)))
                        timer_interrupt(irq, NULL);
-
-               scroll_display_message();
        } else {
                /* Everyone else needs to reset the timer int here as
                   ll_local_timer_interrupt doesn't */
@@ -262,6 +233,8 @@ void __init mips_time_init(void)
               (est_freq%1000000)*100/1000000);
 
         cpu_khz = est_freq / 1000;
+
+       mips_scroll_message();
 }
 
 void __init plat_timer_setup(struct irqaction *irq)
diff --git a/arch/mips/mips-boards/malta/malta_setup.c 
b/arch/mips/mips-boards/malta/malta_setup.c
index 7873932..c14b7bf 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -56,6 +56,12 @@ const char *get_system_type(void)
        return "MIPS Malta";
 }
 
+#if defined(CONFIG_MIPS_MT_SMTC)
+const char display_string[] = "       SMTC LINUX ON MALTA       ";
+#else
+const char display_string[] = "        LINUX ON MALTA       ";
+#endif /* CONFIG_MIPS_MT_SMTC */
+
 #ifdef CONFIG_BLK_DEV_FD
 void __init fd_activate(void)
 {
diff --git a/arch/mips/mips-boards/sead/sead_setup.c 
b/arch/mips/mips-boards/sead/sead_setup.c
index a189dec..811aba1 100644
--- a/arch/mips/mips-boards/sead/sead_setup.c
+++ b/arch/mips/mips-boards/sead/sead_setup.c
@@ -43,6 +43,8 @@ const char *get_system_type(void)
        return "MIPS SEAD";
 }
 
+const char display_string[] = "        LINUX ON SEAD       ";
+
 void __init plat_mem_setup(void)
 {
        ioport_resource.end = 0x7fffffff;
diff --git a/include/asm-mips/mips-boards/prom.h 
b/include/asm-mips/mips-boards/prom.h
index daaf9f9..a9db576 100644
--- a/include/asm-mips/mips-boards/prom.h
+++ b/include/asm-mips/mips-boards/prom.h
@@ -33,6 +33,7 @@ extern void prom_meminit(void);
 extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
 extern void mips_display_message(const char *str);
 extern void mips_display_word(unsigned int num);
+extern void mips_scroll_message(void);
 extern int get_ethernet_addr(char *ethernet_addr);
 
 /* Memory descriptor management. */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to