From owner-freebsd-hackers@FreeBSD.ORG Tue May 27 22:42:58 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A4D11065674 for ; Tue, 27 May 2008 22:42:58 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id 8B7EC8FC15 for ; Tue, 27 May 2008 22:42:57 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 83420 invoked by uid 2001); 27 May 2008 22:42:56 -0000 Date: Tue, 27 May 2008 17:42:56 -0500 From: "Rick C. Petty" To: Maksim Yevmenkin Message-ID: <20080527224256.GA83303@keira.kiwi-computer.com> References: <48378DA0.8040506@frase.id.au> <20080524201633.GA81364@eos.sc1.parodius.com> <20080527041236.GB68298@keira.kiwi-computer.com> <20080527051109.GA26502@eos.sc1.parodius.com> <20080527054842.GA69670@keira.kiwi-computer.com> <20080527194554.GA79741@keira.kiwi-computer.com> <20080527210158.GB81555@keira.kiwi-computer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org, Jeremy Chadwick , Fraser Tweedale Subject: Re: temporary freezes when pressing capslock / numlock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2008 22:42:58 -0000 On Tue, May 27, 2008 at 02:28:26PM -0700, Maksim Yevmenkin wrote: > > well, i just took a brief look at atkbd(4). specifically one function > - wait_while_controller_busy(). this function polls status every > KBDC_DELAYTIME (20) usec with retry count of 5000. so, just this > function alone can give up to 100 msec delay. keep in mind that > wait_while_controller_busy() is apparently called every time driver > need to talk to the hardware. i can see how we could delay kernel for > 400 msec or even more. I'm not sure why we retry 5000 times. 100ms seems like a long time to block the entire kernel. Is there any reason we can't spawn a kernel thread to deal with the waits? I recommend that we also reduce the timeouts to at most twice what the spec states. How come this doesn't happen when other keys are pressed? Just when the console is flipped. Perhaps because it tries to set the LEDs first? -- Rick C. Petty