WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [linux-ppc-2.6] [POWERPC] get the UDB delay correct

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [linux-ppc-2.6] [POWERPC] get the UDB delay correct
From: Xen patchbot-linux-ppc-2.6 <patchbot-linux-ppc-2.6@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Aug 2006 21:22:37 +0000
Delivery-date: Thu, 10 Aug 2006 14:29:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 584e21f08d0c092170a6879892b43efe860e2a9c
# Parent  8a5663668eed06e69bf09f67a5d37f6e1d4bbc80
[POWERPC] get the UDB delay correct

This patch makes sure that an absolute time is used to set the timer.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 arch/powerpc/platforms/xen/setup.c    |    5 -----
 arch/powerpc/platforms/xen/setup.h    |   10 ++++++++++
 arch/powerpc/platforms/xen/udbg_xen.c |   10 +++++++---
 3 files changed, 17 insertions(+), 8 deletions(-)

diff -r 8a5663668eed -r 584e21f08d0c arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.c        Thu Aug 10 15:43:50 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.c        Thu Aug 10 16:36:39 2006 -0400
@@ -155,11 +155,6 @@ static u64 jiffies_to_ns(unsigned long j
 static u64 jiffies_to_ns(unsigned long j) 
 {
        return j * (1000000000UL / HZ);
-}
-
-static u64 tb_to_ns(u64 tb)
-{
-       return tb * (1000000000UL / tb_ticks_per_sec);
 }
 
 static void xen_idle(void)
diff -r 8a5663668eed -r 584e21f08d0c arch/powerpc/platforms/xen/setup.h
--- a/arch/powerpc/platforms/xen/setup.h        Thu Aug 10 15:43:50 2006 -0400
+++ b/arch/powerpc/platforms/xen/setup.h        Thu Aug 10 16:36:39 2006 -0400
@@ -1,6 +1,16 @@
+
+#include <asm/machdep.h>
 
 extern void evtchn_init_IRQ(void);
 extern void xen_init_IRQ(void);
 extern void xen_reboot_init(struct machdep_calls *);
 extern void xen_maple_init_IRQ(void);
 extern int xen_get_irq(struct pt_regs *regs);
+
+static inline u64 tb_to_ns(u64 tb)
+{
+       if (likely(tb_ticks_per_sec)) {
+               return tb * (1000000000UL / tb_ticks_per_sec);
+       }
+       return 0;
+}
diff -r 8a5663668eed -r 584e21f08d0c arch/powerpc/platforms/xen/udbg_xen.c
--- a/arch/powerpc/platforms/xen/udbg_xen.c     Thu Aug 10 15:43:50 2006 -0400
+++ b/arch/powerpc/platforms/xen/udbg_xen.c     Thu Aug 10 16:36:39 2006 -0400
@@ -4,6 +4,7 @@
 #include <xen/evtchn.h>
 #include <asm/udbg.h>
 #include <asm/hypervisor.h>
+#include "setup.h"
 
 static void udbg_putc_dom0_xen(char c)
 {
@@ -52,9 +53,12 @@ static int udbg_getc_dom0_xen(void)
        for (;;) {
                ch = udbg_getc_poll_dom0_xen();
                if (ch == -1) {
-                       /* nano seconds */
-                       HYPERVISOR_set_timer_op(100000000);
-                       HYPERVISOR_sched_op(SCHEDOP_block, NULL);
+                       u64 now_ns = tb_to_ns(get_tb());
+                       if (now_ns > 0) {
+                               u64 offset_ns = 100000000; /* 100ms */
+                               HYPERVISOR_set_timer_op(now_ns + offset_ns);
+                               HYPERVISOR_sched_op(SCHEDOP_block, NULL);
+                       }
                } else {
                        return ch;
                }

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [linux-ppc-2.6] [POWERPC] get the UDB delay correct, Xen patchbot-linux-ppc-2 . 6 <=