1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

Interim patch/kludge for keyboard lock-up when `kbdcontrol' tries to

change typematic rate, or the X server (XFree86 or Accelerated X)
starts up.

So far, there have been two independent reports from Dell Latitude XPi
notebook/laptop owners. The Latitude seems to be the only system which
suffers from this problem.  (I don't know the problem is with the
entire Latitude line or with only some Latitude models) No problem
report has been heard about other systems (I certainly cannot
reproduce the problem in my -current and 2.2 systems).

In 3.0-CURRENT, 2.2-RELEASE and 2.2-GAMMA-970310, when programming the
keyboard LED/repeat-rate, `set_keyboard()' in `syscons' tells the
keyboard controller not to generate keyboard interrupt (IRQ1) and then
enable tty interrupts, expecting the keyboard interrupt doesn't occur.

It appears that somehow Latitude's keyboard controller still generates
the keyboard interrupt thereafter, and `set_keyboard()' doesn't see
the return code from the keyboard because it is consumed by the
keyboard interrupt handler.

The patch entirely disables tty interrupts while setting LED and
typematic rate in `set_keyboard()', making the routine behave more
like the previous versions of `syscons' (versions in 2.1.X and
2.2-ALPHA, -BETA, and some -GAMMAs). The reporter said this patch
eliminated the problem.

(I also found another typo/bug, but the reporter and I found that it
wasn't the cause of the problem...)

This should go into RELENG_2_2.
This commit is contained in:
Kazutaka YOKOTA 1997-03-28 10:11:24 +00:00
parent a6660d6035
commit 31774f6d83
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24338
3 changed files with 30 additions and 9 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.205 1997/03/01 23:53:46 jmg Exp $
* $Id: syscons.c,v 1.206 1997/03/24 11:24:07 bde Exp $
*/
#include "sc.h"
@ -3109,11 +3109,12 @@ set_keyboard(int command, int data)
/* disable the keyboard and mouse interrupt */
s = spltty();
#if 0
c = get_controller_command_byte(sc_kbdc);
if ((c == -1)
|| !set_controller_command_byte(sc_kbdc,
kbdc_get_device_mask(sc_kbdc),
KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT
KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
| KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
/* CONTROLLER ERROR */
kbdc_lock(sc_kbdc, FALSE);
@ -3128,15 +3129,21 @@ set_keyboard(int command, int data)
* by the lock flag set via `kbdc_lock()'
*/
splx(s);
#endif
send_kbd_command_and_data(sc_kbdc, command, data);
if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
#if 0
/* restore the interrupts */
if (!set_controller_command_byte(sc_kbdc,
kbdc_get_device_mask(sc_kbdc),
c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
/* CONTROLLER ERROR */
}
#else
splx(s);
#endif
kbdc_lock(sc_kbdc, FALSE);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.205 1997/03/01 23:53:46 jmg Exp $
* $Id: syscons.c,v 1.206 1997/03/24 11:24:07 bde Exp $
*/
#include "sc.h"
@ -3109,11 +3109,12 @@ set_keyboard(int command, int data)
/* disable the keyboard and mouse interrupt */
s = spltty();
#if 0
c = get_controller_command_byte(sc_kbdc);
if ((c == -1)
|| !set_controller_command_byte(sc_kbdc,
kbdc_get_device_mask(sc_kbdc),
KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT
KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
| KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
/* CONTROLLER ERROR */
kbdc_lock(sc_kbdc, FALSE);
@ -3128,15 +3129,21 @@ set_keyboard(int command, int data)
* by the lock flag set via `kbdc_lock()'
*/
splx(s);
#endif
send_kbd_command_and_data(sc_kbdc, command, data);
if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
#if 0
/* restore the interrupts */
if (!set_controller_command_byte(sc_kbdc,
kbdc_get_device_mask(sc_kbdc),
c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
/* CONTROLLER ERROR */
}
#else
splx(s);
#endif
kbdc_lock(sc_kbdc, FALSE);
}

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.205 1997/03/01 23:53:46 jmg Exp $
* $Id: syscons.c,v 1.206 1997/03/24 11:24:07 bde Exp $
*/
#include "sc.h"
@ -3109,11 +3109,12 @@ set_keyboard(int command, int data)
/* disable the keyboard and mouse interrupt */
s = spltty();
#if 0
c = get_controller_command_byte(sc_kbdc);
if ((c == -1)
|| !set_controller_command_byte(sc_kbdc,
kbdc_get_device_mask(sc_kbdc),
KBD_ENABLE_KBD_PORT | KBD_DISABLE_KBD_INT
KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
| KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
/* CONTROLLER ERROR */
kbdc_lock(sc_kbdc, FALSE);
@ -3128,15 +3129,21 @@ set_keyboard(int command, int data)
* by the lock flag set via `kbdc_lock()'
*/
splx(s);
#endif
send_kbd_command_and_data(sc_kbdc, command, data);
if (send_kbd_command_and_data(sc_kbdc, command, data) != KBD_ACK)
send_kbd_command(sc_kbdc, KBDC_ENABLE_KBD);
#if 0
/* restore the interrupts */
if (!set_controller_command_byte(sc_kbdc,
kbdc_get_device_mask(sc_kbdc),
c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
/* CONTROLLER ERROR */
}
#else
splx(s);
#endif
kbdc_lock(sc_kbdc, FALSE);
}