public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: dandan bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Dandan Bi <dandan.bi@intel.com>, Ruiyu Ni <ruiyu.ni@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [patch 2/3] IntelFrameworkModulePkg: Avoid key notification called more than once
Date: Mon, 10 Sep 2018 15:12:01 +0800	[thread overview]
Message-ID: <20180910071202.11008-2-dandan.bi@intel.com> (raw)
In-Reply-To: <20180910071202.11008-1-dandan.bi@intel.com>

From: Dandan Bi <dandan.bi@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=996

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 later. 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
cause the notification executed more than once.

This patch is to enhance the code logic to fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c   | 1 +
 IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c | 1 +
 2 files changed, 2 insertions(+)

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;
     }
   }
 
   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;
     }
   }
 
   Enqueue (&BiosKeyboardPrivate->Queue, &KeyData);
 
-- 
2.14.3.windows.1



  reply	other threads:[~2018-09-10  7:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10  7:12 [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once dandan bi
2018-09-10  7:12 ` dandan bi [this message]
2018-09-13  2:24   ` [patch 2/3] IntelFrameworkModulePkg: Avoid key " Ni, Ruiyu
2018-09-10  7:12 ` [patch 3/3] MdeModulePkg: " dandan bi
2018-09-12  1:55   ` Zeng, Star
2018-09-13  2:24   ` Ni, Ruiyu
2018-09-13  2:24 ` [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid " Ni, Ruiyu
2018-09-13 15:50 ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180910071202.11008-2-dandan.bi@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox