From nobody Thu Mar 28 13:30:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1590268866; cv=none; d=zohomail.com; s=zohoarc; b=le5pkY3UsivDWGQLFvHsSvKysN5DFJdKfvOU05+16MJnlEOrJB/thS2EgGJIUGhQXvjEaC3dVc0HorRWuYK9U6obloJUdVmEaDlixY8ODXOlU/tnyjZQQu+BlWKEP4wSiuMjgshUFtyuIfYKtd6KW2ZrtWGN25sP0qyrpgyTNLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590268866; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:To; bh=OIfVD4S8YhlzTThgPZ73xnnng9uuqG3aXqfNUZH86m4=; b=ORq/SrBd9MdfkK/LA+bmRlk/3sDxlWkwEytcohJgkfHBsOtTHpcaLcEcPGE9do0OAsxmIFBmn0Xq0TJNSdTXs7zI+Z/2Sovclhr3CTqi2Wcu/d7BoCKEEfYsrd/4ftV1DlANqNx2FwnLtgcA6GJUaiOxe7uv+90rlCOE8yobZp4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1590268865818158.32715266575838; Sat, 23 May 2020 14:21:05 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id B834910C1AE2; Sat, 23 May 2020 21:21:01 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 0D2BE10C1997 for ; Sat, 23 May 2020 21:20:43 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 6EDC82002EE29; Sat, 23 May 2020 23:11:08 +0200 (CEST) From: Paul Menzel To: seabios@seabios.org Date: Sat, 23 May 2020 23:10:24 +0200 Message-Id: <20200523211023.6532-1-pmenzel@molgen.mpg.de> MIME-Version: 1.0 Message-ID-Hash: 4QBPSEUGAWNH7NTVNL7FCVGT4KIFFSHL X-Message-ID-Hash: 4QBPSEUGAWNH7NTVNL7FCVGT4KIFFSHL X-MailFrom: pmenzel@molgen.mpg.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Stefan Reinauer , Anthony Liguori , Stefan Reinauer , "Ronald G . Minnich" , Paul Menzel X-Mailman-Version: 3.3.1 Precedence: list Subject: [SeaBIOS] [PATCH] ps2: Disable keyboard and mouse before flushing the queue List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org Content-Type: text/plain; charset="utf-8" From: Stefan Reinauer If SeaBIOS is run as a payload via coreboot (and presumably as a CSM), then it's possible the keyboard or mouse will still be enabled. This can lead to data being queued even after the flush function attempts to clear the queue. Disabling the keyboard/mouse prior to flushing is pretty standard in DOS programming so it's not surprising that it's needed here. I believe this problem manifests with the Chromebook Pixel. People have reported that sometimes the 'ESC to Select Boot Devices' doesn't work. I can reproduce this faithfully by holding 'Ctrl-L' in the firmware screen during SeaBIOS initialization. I can't test this fix on an actual Pixel because I don't know how to update SeaBIOS but I have tested the patch under QEMU. BUG=3Dnone TEST=3DBoot into SeaBIOS, press ESC, see it working. Change-Id: I4e74a559e86539730f4fda1d429612c759da16ee Signed-off-by: Anthony Liguori Signed-off-by: Stefan Reinauer Reviewed-on: https://gerrit.chromium.org/gerrit/49212 Reviewed-by: Ronald G. Minnich Cc: Matt DeVillier Signed-off-by: Paul Menzel --- src/hw/ps2port.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hw/ps2port.c b/src/hw/ps2port.c index 9b099e8..c99ea54 100644 --- a/src/hw/ps2port.c +++ b/src/hw/ps2port.c @@ -58,6 +58,12 @@ static int i8042_flush(void) { dprintf(7, "i8042_flush\n"); + + /* Disable the keyboard and mouse to prevent additional data from + * being queued. */ + outb(0xad, PORT_PS2_STATUS); + outb(0xa7, PORT_PS2_STATUS); + int i; for (i=3D0; i