From owner-freebsd-hackers@FreeBSD.ORG Tue May 27 23:05:14 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 16644106566C for ; Tue, 27 May 2008 23:05:14 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 97F098FC18 for ; Tue, 27 May 2008 23:05:13 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1890054fgb.35 for ; Tue, 27 May 2008 16:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=tR9FtILbEdFLjZpWqS9coCRIdPaHgB53wy80nPal7b8=; b=mvRC71Vz8vkxjv4xqvIICeeYmNIdyhmMa3a7hGaeY1GhYadVm6qLrJm77okUMtUecn3XSfoTGQ8D1gy76HP241GazHlpOlerptodnbObqI0eVOryTy8l/icrpsjjtXNWUF+OLWYDTZhDemN9bid6BbGopPedpuJ5khQNdeKBIo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sBFRq1ptdWQW55rOen1O4reEZ7F0HSrs2tfCQy3pBezlj+sP8G2DMcczk4SaAfUWwWgen1978ST0iwix5D5m9mWqi21KTAvEhclJnZ9spWNAMA1DT+dAGCeZIGb348Mqs6jyjeXRTfPtWid/KFpAonO/uklFUUloOhZk99LF/bQ= Received: by 10.86.59.2 with SMTP id h2mr3158996fga.57.1211929512251; Tue, 27 May 2008 16:05:12 -0700 (PDT) Received: by 10.86.66.5 with HTTP; Tue, 27 May 2008 16:05:12 -0700 (PDT) Message-ID: Date: Tue, 27 May 2008 16:05:12 -0700 From: "Maksim Yevmenkin" To: rick-freebsd@kiwi-computer.com In-Reply-To: <20080527224256.GA83303@keira.kiwi-computer.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48378DA0.8040506@frase.id.au> <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> <20080527224256.GA83303@keira.kiwi-computer.com> 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 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 23:05:14 -0000 On 5/27/08, Rick C. Petty wrote: > 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. all great ideas. please send in the patches and i will be happy to review and commit them for you. > 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? like i said, i suspect delay happens only when driver needs to send command to the keyboard. that is what happens when you press num/scroll/capslock. thanks, max > > > -- Rick C. Petty >