From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 374592112E001 for ; Wed, 12 Sep 2018 19:25:11 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 19:25:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,367,1531810800"; d="scan'208";a="90004936" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 12 Sep 2018 19:25:04 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 19:25:04 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 19:25:04 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Thu, 13 Sep 2018 10:25:02 +0800 From: "Ni, Ruiyu" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [patch 2/3] IntelFrameworkModulePkg: Avoid key notification called more than once Thread-Index: AQHUSNWyoNIDJMaOKUOxsSSGyA5TEqTtgDAA Date: Thu, 13 Sep 2018 02:24:24 +0000 Deferred-Delivery: Thu, 13 Sep 2018 02:25:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BE07035@SHSMSX104.ccr.corp.intel.com> References: <20180910071202.11008-1-dandan.bi@intel.com> <20180910071202.11008-2-dandan.bi@intel.com> In-Reply-To: <20180910071202.11008-2-dandan.bi@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 2/3] IntelFrameworkModulePkg: Avoid key notification called more than once X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2018 02:25:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Bi, Dandan > Sent: Monday, September 10, 2018 3:12 PM > To: edk2-devel@lists.01.org > Cc: Bi, Dandan ; Ni, Ruiyu ; Gao= , > Liming > Subject: [patch 2/3] IntelFrameworkModulePkg: Avoid key notification call= ed > more than once >=20 > From: Dandan Bi >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D996 >=20 > Issue: > In current code logic, when a key is pressed, it will search the whole > NotifyList to find whether a notification has been registered with the > keystroke. if yes, it will en-queue the key for notification execution la= ter. > And now if different notification functions have been registered with the > same key, then the key will be en-queued more than once. Then it will cau= se > the notification executed more than once. >=20 > This patch is to enhance the code logic to fix this issue. >=20 > Cc: Ruiyu Ni > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi > --- > IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 1 + > IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c > | 1 + > 2 files changed, 2 insertions(+) >=20 > diff --git > a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c > b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c > index 202588191e..fddb0b21fb 100644 > --- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c > +++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c > @@ -1485,10 +1485,11 @@ KeyGetchar ( > // while current TPL is TPL_NOTIFY. It will be invoked in > // KeyNotifyProcessHandler() which runs at TPL_CALLBACK. > // > PushEfikeyBufTail (&ConsoleIn->EfiKeyQueueForNotify, &KeyData); > gBS->SignalEvent (ConsoleIn->KeyNotifyProcessEvent); > + break; > } > } >=20 > PushEfikeyBufTail (&ConsoleIn->EfiKeyQueue, &KeyData); } diff --git > a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard. > c > b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard. > c > index 63f6303995..bee5f8f5e5 100644 > --- > a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard. > c > +++ > b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard. > c > @@ -1984,10 +1984,11 @@ BiosKeyboardTimerHandler ( > // while current TPL is TPL_NOTIFY. It will be invoked in > // KeyNotifyProcessHandler() which runs at TPL_CALLBACK. > // > Enqueue (&BiosKeyboardPrivate->QueueForNotify, &KeyData); > gBS->SignalEvent (BiosKeyboardPrivate->KeyNotifyProcessEvent); > + break; > } > } >=20 > Enqueue (&BiosKeyboardPrivate->Queue, &KeyData); >=20 > -- > 2.14.3.windows.1