From owner-svn-src-all@FreeBSD.ORG Fri Apr 17 00:30:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA7D1065675; Fri, 17 Apr 2009 00:30:56 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587688FC0A; Fri, 17 Apr 2009 00:30:56 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0UuBM098003; Fri, 17 Apr 2009 00:30:56 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0UuPj098002; Fri, 17 Apr 2009 00:30:56 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200904170030.n3H0UuPj098002@svn.freebsd.org> From: Maksim Yevmenkin Date: Fri, 17 Apr 2009 00:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191164 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2009 00:30:56 -0000 Author: emax Date: Fri Apr 17 00:30:56 2009 New Revision: 191164 URL: http://svn.freebsd.org/changeset/base/191164 Log: Prevent atkbd(4) interrupt handler from calling keyboard callback function when polled mode is enabled. This should help with duplicated/missing characters problem at mountroot, geli, etc. prompts on multi CPU systems while kbdmux(4) is enabled. Tested by: Tobias Grosser Tested by: Fabian Keil MFC after: 3 days Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Thu Apr 16 23:42:00 2009 (r191163) +++ head/sys/dev/atkbdc/atkbd.c Fri Apr 17 00:30:56 2009 (r191164) @@ -476,7 +476,7 @@ atkbd_term(keyboard_t *kbd) static int atkbd_intr(keyboard_t *kbd, void *arg) { - atkbd_state_t *state; + atkbd_state_t *state = (atkbd_state_t *)kbd->kb_data; int delay[2]; int c; @@ -485,7 +485,6 @@ atkbd_intr(keyboard_t *kbd, void *arg) * The keyboard was not detected before; * it must have been reconnected! */ - state = (atkbd_state_t *)kbd->kb_data; init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); @@ -496,6 +495,9 @@ atkbd_intr(keyboard_t *kbd, void *arg) atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); } + if (state->ks_polling) + return 0; + if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) { /* let the callback function to process the input */ (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,