From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1 of 5] rombios/keyboard: Don't needlessly poll the status register Date: Mon, 26 Nov 2012 16:53:08 +0000 Message-ID: <50B39E74.7080605@citrix.com> References: <1728fb78994054ad3695.1353948092@andrewcoop.uk.xensource.com> <1353948513.5830.117.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1353948513.5830.117.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "Keir (Xen.org)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 26/11/12 16:48, Ian Campbell wrote: > On Mon, 2012-11-26 at 16:41 +0000, Andrew Cooper wrote: >> Repeated polling of the status register is not going to change its value, > but the passage of time while doing multiple polls might? If this is not > the case then something needs to be said about why not. In reality, we failed to ever get a keypress on the console to appear here, even when trying. If I remember correctly (it was a long time ago now), this code runs before the PCI bus is scanned, so is really early on during boot. > >> so >> don't needlessly take 8192 traps to Qemu when 1 will do. >> >> Signed-off-by: Andrew Cooper >> >> diff -r 0049de3827bc -r 1728fb789940 tools/firmware/rombios/rombios.c >> --- a/tools/firmware/rombios/rombios.c >> +++ b/tools/firmware/rombios/rombios.c >> @@ -1805,12 +1805,12 @@ keyboard_init() >> while ( (inb(0x64) & 0x02) && (--max>0)) outb(0x80, 0x00); >> >> /* flush incoming keys */ >> - max=0x2000; >> + max=2; >> while (--max > 0) { >> outb(0x80, 0x00); >> if (inb(0x64) & 0x01) { >> inb(0x60); >> - max = 0x2000; >> + max = 2; >> } >> } >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel > -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com