Skip to contentSkip to conversation

sparc32: forced setting of mode of sun4m per-cpu timers

PATCH Applied Kirill Tkhai 2 participants 4 messages Jan 6, 2012 – Jan 11, 2012 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc32: forced setting of mode of sun4m per-cpu timers

SUN4M per-cpu timers have two modes of work. These are timer mode and counter mode. Kernel doesn't write anything to the register, which is connected with mode choice.
So, the mode is chosen by bootloader. This patch forces to use timer mode from the kernel and to be independent of bootloader.

I had this problem with OpenBIOS. Timers don't tick and kernel fails on QEMU, when it's compiled with SMP support. The patch fixes problem.

---

(quoted diff) +0 -0

b/arch/sparc/kernel/sun4m_irq.c
index 422c16d..e611651 100644

arch/sparc/kernel/sun4m_irq.c +0 -0
@@ -399,6 +399,9 @@ static void __init sun4m_init_timers(irq_handler_t

counter_fn)
timers_global = (void __iomem *)
(unsigned long) addr[num_cpu_timers];

+ /* Every per-cpu timer works in timer mode */
+ sbus_writel(0x00000000, &timers_global->timer_config);
+
sbus_writel((((1000000/HZ) + 1) << 10), &timers_global->l10_limit);

master_l10_counter = &timers_global->l10_count;

maintainer
#1 lore raw

From: Kirill Tkhai <[email protected]>
Date: Sat, 07 Jan 2012 01:34:51 +0400

Quoted 11 lines

SUN4M per-cpu timers have two modes of work. These are timer mode and counter mode. Kernel doesn't write anything to the register, which is connected with mode choice.
So, the mode is chosen by bootloader. This patch forces to use timer mode from the kernel and to be independent of bootloader.

I had this problem with OpenBIOS. Timers don't tick and kernel fails on QEMU, when it's compiled with SMP support. The patch fixes problem.

Your email client corrupted your patch.

Review static void __init sun4m_init_timers(irq_handler_t · line 399

Quoted 2 lines
(quoted diff) +0 -0
@@ -399,6 +399,9 @@ static void __init sun4m_init_timers(irq_handler_t
 counter_fn)

It split up this line into two.

Please, test email the patch to yourself until you can successfully apply the patch contained in the email. Then, and only then, resubmit your patch here.

Thanks.

#2 lore raw

PATCH 1/1 sparc32: forced setting of mode of sun4m per-cpu timers

In reply to Kirill Tkhai

SUN4M per-cpu timers have two modes of work. These are timer mode and counter mode. Kernel doesn't write anything to the register, which is connected with mode choice.
So, the mode is chosen by bootloader. This patch forces to use timer mode from the kernel and to be independent of bootloader.

I had this problem with OpenBIOS. Timers don't tick and kernel fails on QEMU, when it's compiled with SMP support. The patch fixes problem.

---

arch/sparc/kernel/sun4m_irq.c +3 -0
index 422c16d..e611651 100644
@@ -399,6 +399,9 @@ static void __init sun4m_init_timers(irq_handler_t counter_fn)
 	timers_global = (void __iomem *)
 		(unsigned long) addr[num_cpu_timers];
 
+	/* Every per-cpu timer works in timer mode */
+	sbus_writel(0x00000000, &timers_global->timer_config);
+
 	sbus_writel((((1000000/HZ) + 1) << 10), &timers_global->l10_limit);
 
 	master_l10_counter = &timers_global->l10_count;
maintainer Applied
#3 lore raw
In reply to Kirill Tkhai

From: Kirill Tkhai <[email protected]>
Date: Wed, 11 Jan 2012 03:17:03 +0400

Quoted 11 lines

SUN4M per-cpu timers have two modes of work. These are timer mode and counter mode. Kernel doesn't write anything to the register, which is connected with mode choice.
So, the mode is chosen by bootloader. This patch forces to use timer mode from the kernel and to be independent of bootloader.

I had this problem with OpenBIOS. Timers don't tick and kernel fails on QEMU, when it's compiled with SMP support. The patch fixes problem.

Applied, thanks.