From nobody Thu Nov 6 08:24:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=reactos.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540149173851711.8146602208144; Sun, 21 Oct 2018 12:12:53 -0700 (PDT) Received: from localhost ([::1]:59946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEJ9g-0005Go-RL for importer@patchew.org; Sun, 21 Oct 2018 15:12:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEJ6N-0003Bn-3x for qemu-devel@nongnu.org; Sun, 21 Oct 2018 15:09:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEJ4a-0000Ow-PK for qemu-devel@nongnu.org; Sun, 21 Oct 2018 15:07:41 -0400 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:51346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gEJ4Z-00008U-P5; Sun, 21 Oct 2018 15:07:36 -0400 Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gEJ4P-0007F6-2F; Sun, 21 Oct 2018 19:07:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org ; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WuChtpd7GGw2pUCxXeVcVlPMnqjzj/1yq2PPeKkWhIk=; b=YP/2kmWKF31gb1xTX8SfjlQtLh JU4p5KEewnSpMnjBCM1NKJJLzWu7PQU4dEYA9GQuVAqOl7JB5pouYA8vn89m/4LwUJGLIDxFSc+zH mOTQ2ye1a3NQ+5lkcN425fCAv5v1c1W886+BLFUreFvq73Lx3TG+Op+rxc3N0cMFwTkg=; From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Sun, 21 Oct 2018 21:07:21 +0200 Message-Id: <20181021190721.2148-1-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH] ps2kbd: default to scan enabled after reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geoffrey McRae , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 A check for scan_enabled has been added to ps2_keyboard_event in commit 143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption. This works well as long as operating system is resetting keyboard, or enabl= ing it. This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET, KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard. Signed-off-by: Herv=C3=A9 Poussineau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index fdfcadf9a1..eded4f0f8d 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -938,7 +938,7 @@ static void ps2_kbd_reset(void *opaque) =20 trace_ps2_kbd_reset(opaque); ps2_common_reset(&s->common); - s->scan_enabled =3D 0; + s->scan_enabled =3D 1; s->translate =3D 0; s->scancode_set =3D 2; s->modifiers =3D 0; --=20 2.11.0