Skip to contentSkip to conversation

Fix Linux task preemption on Versatile board

PATCH In review Daniel Jacobowitz 2 participants 2 messages Sep 13, 2009 – Sep 14, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix Linux task preemption on Versatile board

Recent versions of the Linux kernel will not preempt CPU-intensive tasks unless the clock used by sched_clock() works. On -M versatilepb that's the 24MHz timer in the system controller. It's a very simple timer, so implement it.

---

 hw/arm_sysctl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
hw/arm_sysctl.c +3 -2
index 686c1cc..26300ef 100644
@@ -7,6 +7,8 @@
  * This code is licenced under the GPL.
  */
 
+#include "hw.h"
+#include "qemu-timer.h"
 #include "sysbus.h"
 #include "primecell.h"
 #include "sysemu.h"
@@ -71,8 +73,7 @@ static uint32_t arm_sysctl_read(void *opaque, target_phys_addr_t offset)
     case 0x58: /* BOOTCS */
         return 0;
     case 0x5c: /* 24MHz */
-        /* ??? not implemented.  */
-        return 0;
+        return muldiv64(qemu_get_clock(vm_clock), 24000000, get_ticks_per_sec());
     case 0x60: /* MISC */
         return 0;
     case 0x84: /* PROCID0 */
Signature · 2 lines
Daniel Jacobowitz
CodeSourcery
#1 lore raw
Quoted 4 lines · Daniel Jacobowitz

Recent versions of the Linux kernel will not preempt CPU-intensive tasks unless the clock used by sched_clock() works. On -M versatilepb that's the 24MHz timer in the system controller. It's a very simple timer, so implement it.

Thanks for fixing this long standing issue that has been reported a few times already on the mailing list. I have applied the patch.

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net