xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/HPET: fix oversight in 23033:84bacd800bf8
@ 2011-03-15  9:55 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2011-03-15  9:55 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

Clearly for the adjusted BUG_ON()s to not yield false positives
num_chs_used must be incremented before setting up an IRQ (and
decremented back when the setup failed).

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -428,10 +428,8 @@ static unsigned int __init hpet_fsb_cap_
         ch->flags = 0;
         ch->idx = i;
 
-        if ( (ch->irq = hpet_assign_irq(num_chs_used)) < 0 )
-            continue;
-
-        num_chs_used++;
+        if ( (ch->irq = hpet_assign_irq(num_chs_used++)) < 0 )
+            num_chs_used--;
     }
 
     printk(XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n",




[-- Attachment #2: x86-hpet-fix-23033.patch --]
[-- Type: text/plain, Size: 693 bytes --]

Clearly for the adjusted BUG_ON()s to not yield false positives
num_chs_used must be incremented before setting up an IRQ (and
decremented back when the setup failed).

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -428,10 +428,8 @@ static unsigned int __init hpet_fsb_cap_
         ch->flags = 0;
         ch->idx = i;
 
-        if ( (ch->irq = hpet_assign_irq(num_chs_used)) < 0 )
-            continue;
-
-        num_chs_used++;
+        if ( (ch->irq = hpet_assign_irq(num_chs_used++)) < 0 )
+            num_chs_used--;
     }
 
     printk(XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n",

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-15  9:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15  9:55 [PATCH] x86/HPET: fix oversight in 23033:84bacd800bf8 Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).