From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] x86/HPET: fix oversight in 23033:84bacd800bf8 Date: Tue, 15 Mar 2011 09:55:11 +0000 Message-ID: <4D7F458F020000780003687F@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part022E3D6F.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part022E3D6F.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 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 =3D 0; ch->idx =3D i; =20 - if ( (ch->irq =3D hpet_assign_irq(num_chs_used)) < 0 ) - continue; - - num_chs_used++; + if ( (ch->irq =3D hpet_assign_irq(num_chs_used++)) < 0 ) + num_chs_used--; } =20 printk(XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n"= , --=__Part022E3D6F.0__= Content-Type: text/plain; name="x86-hpet-fix-23033.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-hpet-fix-23033.patch" Clearly for the adjusted BUG_ON()s to not yield false positives=0Anum_chs_u= sed must be incremented before setting up an IRQ (and=0Adecremented back = when the setup failed).=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/hpet.c=0A+++ b/xen/arch/x86/hpet.c=0A@@ -428,10 = +428,8 @@ static unsigned int __init hpet_fsb_cap_=0A ch->flags = =3D 0;=0A ch->idx =3D i;=0A =0A- if ( (ch->irq =3D = hpet_assign_irq(num_chs_used)) < 0 )=0A- continue;=0A-=0A- = num_chs_used++;=0A+ if ( (ch->irq =3D hpet_assign_irq(num_chs_used= ++)) < 0 )=0A+ num_chs_used--;=0A }=0A =0A printk(XENLOG= _INFO "HPET: %u timers (%u will be used for broadcast)\n",=0A --=__Part022E3D6F.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part022E3D6F.0__=--