* [patch 2/3] IntelFrameworkModulePkg: Avoid key notification called more than once
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
2018-09-13 2:24 ` Ni, Ruiyu
2018-09-10 7:12 ` [patch 3/3] MdeModulePkg: " dandan bi
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: dandan bi @ 2018-09-10 7:12 UTC (permalink / raw)
To: edk2-devel; +Cc: Dandan Bi, Ruiyu Ni, Liming Gao
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [patch 2/3] IntelFrameworkModulePkg: Avoid key notification called more than once
2018-09-10 7:12 ` [patch 2/3] IntelFrameworkModulePkg: Avoid key " dandan bi
@ 2018-09-13 2:24 ` Ni, Ruiyu
0 siblings, 0 replies; 8+ messages in thread
From: Ni, Ruiyu @ 2018-09-13 2:24 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Gao, Liming
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: Bi, Dandan
> Sent: Monday, September 10, 2018 3:12 PM
> To: edk2-devel@lists.01.org
> Cc: Bi, Dandan <dandan.bi@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Gao,
> Liming <liming.gao@intel.com>
> Subject: [patch 2/3] IntelFrameworkModulePkg: Avoid key notification called
> more than once
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [patch 3/3] MdeModulePkg: Avoid key notification called more than once
2018-09-10 7:12 [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once dandan bi
2018-09-10 7:12 ` [patch 2/3] IntelFrameworkModulePkg: Avoid key " dandan bi
@ 2018-09-10 7:12 ` 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
3 siblings, 2 replies; 8+ messages in thread
From: dandan bi @ 2018-09-10 7:12 UTC (permalink / raw)
To: edk2-devel; +Cc: Dandan Bi, Ruiyu Ni, Star Zeng
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: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 1 +
MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 1 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 2ee293d64d..53cb6f0b48 100644
--- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1449,10 +1449,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/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
index b3b5fb9ff4..9cb4b5db6b 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
@@ -1693,10 +1693,11 @@ UsbKeyCodeToEfiInputKey (
// while current TPL is TPL_NOTIFY. It will be invoked in
// KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
//
Enqueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, KeyData, sizeof (*KeyData));
gBS->SignalEvent (UsbKeyboardDevice->KeyNotifyProcessEvent);
+ break;
}
}
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 33f9b6e585..d681a3039e 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -985,10 +985,11 @@ EfiKeyFiFoInsertOneKey (
// while current TPL is TPL_NOTIFY. It will be invoked in
// KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
//
EfiKeyFiFoForNotifyInsertOneKey (TerminalDevice->EfiKeyFiFoForNotify, Key);
gBS->SignalEvent (TerminalDevice->KeyNotifyProcessEvent);
+ break;
}
}
if (IsEfiKeyFiFoFull (TerminalDevice)) {
//
// Efi Key FIFO is full
--
2.14.3.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [patch 3/3] MdeModulePkg: Avoid key notification called more than once
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
1 sibling, 0 replies; 8+ messages in thread
From: Zeng, Star @ 2018-09-12 1:55 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Ni, Ruiyu, Zeng, Star
Reviewed-by: Star Zeng <star.zeng@intel.com>
-----Original Message-----
From: Bi, Dandan
Sent: Monday, September 10, 2018 3:12 PM
To: edk2-devel@lists.01.org
Cc: Bi, Dandan <dandan.bi@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [patch 3/3] MdeModulePkg: Avoid key notification called more than once
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: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 1 +
MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 1 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 2ee293d64d..53cb6f0b48 100644
--- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1449,10 +1449,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/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
index b3b5fb9ff4..9cb4b5db6b 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
@@ -1693,10 +1693,11 @@ UsbKeyCodeToEfiInputKey (
// while current TPL is TPL_NOTIFY. It will be invoked in
// KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
//
Enqueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, KeyData, sizeof (*KeyData));
gBS->SignalEvent (UsbKeyboardDevice->KeyNotifyProcessEvent);
+ break;
}
}
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 33f9b6e585..d681a3039e 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -985,10 +985,11 @@ EfiKeyFiFoInsertOneKey (
// while current TPL is TPL_NOTIFY. It will be invoked in
// KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
//
EfiKeyFiFoForNotifyInsertOneKey (TerminalDevice->EfiKeyFiFoForNotify, Key);
gBS->SignalEvent (TerminalDevice->KeyNotifyProcessEvent);
+ break;
}
}
if (IsEfiKeyFiFoFull (TerminalDevice)) {
//
// Efi Key FIFO is full
--
2.14.3.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [patch 3/3] MdeModulePkg: Avoid key notification called more than once
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
1 sibling, 0 replies; 8+ messages in thread
From: Ni, Ruiyu @ 2018-09-13 2:24 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Zeng, Star
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: Bi, Dandan
> Sent: Monday, September 10, 2018 3:12 PM
> To: edk2-devel@lists.01.org
> Cc: Bi, Dandan <dandan.bi@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Zeng,
> Star <star.zeng@intel.com>
> Subject: [patch 3/3] MdeModulePkg: Avoid key notification called more than
> once
>
> 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: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
> MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 1 +
> MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 1 +
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 1 +
> 3 files changed, 3 insertions(+)
>
> diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> index 2ee293d64d..53cb6f0b48 100644
> --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> @@ -1449,10 +1449,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/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
> b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
> index b3b5fb9ff4..9cb4b5db6b 100644
> --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
> +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
> @@ -1693,10 +1693,11 @@ UsbKeyCodeToEfiInputKey (
> // while current TPL is TPL_NOTIFY. It will be invoked in
> // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
> //
> Enqueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, KeyData, sizeof
> (*KeyData));
> gBS->SignalEvent (UsbKeyboardDevice->KeyNotifyProcessEvent);
> + break;
> }
> }
>
> return EFI_SUCCESS;
> }
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> index 33f9b6e585..d681a3039e 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> @@ -985,10 +985,11 @@ EfiKeyFiFoInsertOneKey (
> // while current TPL is TPL_NOTIFY. It will be invoked in
> // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
> //
> EfiKeyFiFoForNotifyInsertOneKey (TerminalDevice->EfiKeyFiFoForNotify,
> Key);
> gBS->SignalEvent (TerminalDevice->KeyNotifyProcessEvent);
> + break;
> }
> }
> if (IsEfiKeyFiFoFull (TerminalDevice)) {
> //
> // Efi Key FIFO is full
> --
> 2.14.3.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once
2018-09-10 7:12 [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once dandan bi
2018-09-10 7:12 ` [patch 2/3] IntelFrameworkModulePkg: Avoid key " dandan bi
2018-09-10 7:12 ` [patch 3/3] MdeModulePkg: " dandan bi
@ 2018-09-13 2:24 ` Ni, Ruiyu
2018-09-13 15:50 ` Ard Biesheuvel
3 siblings, 0 replies; 8+ messages in thread
From: Ni, Ruiyu @ 2018-09-13 2:24 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: Bi, Dandan
> Sent: Monday, September 10, 2018 3:12 PM
> To: edk2-devel@lists.01.org
> Cc: Bi, Dandan <dandan.bi@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Ard
> Biesheuvel <ard.biesheuvel@linaro.org>; Leif Lindholm
> <leif.lindholm@linaro.org>
> Subject: [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called
> more than once
>
> 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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
> EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> b/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> index 6609bc8dbe..daea9c47d2 100644
> --- a/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> +++ b/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> @@ -1,9 +1,9 @@
> /** @file
> VirtualKeyboard driver
>
> -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
>
> This program and the accompanying materials are licensed and made
> available under the terms and conditions of the BSD License which
> accompanies this distribution. The @@ -1043,10 +1043,11 @@
> VirtualKeyboardTimerHandler (
> // while current TPL is TPL_NOTIFY. It will be invoked in
> // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
> //
> Enqueue (&VirtualKeyboardPrivate->QueueForNotify, &KeyData);
> gBS->SignalEvent (VirtualKeyboardPrivate->KeyNotifyProcessEvent);
> + break;
> }
> }
>
> Enqueue (&VirtualKeyboardPrivate->Queue, &KeyData);
>
> --
> 2.14.3.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once
2018-09-10 7:12 [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid notification called more than once dandan bi
` (2 preceding siblings ...)
2018-09-13 2:24 ` [patch 1/3] EmbeddedPkg/VirtualKeyboard: Avoid " Ni, Ruiyu
@ 2018-09-13 15:50 ` Ard Biesheuvel
3 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2018-09-13 15:50 UTC (permalink / raw)
To: dandan bi; +Cc: edk2-devel@lists.01.org, Ruiyu Ni, Leif Lindholm
On 10 September 2018 at 09:12, dandan bi <dandan.bi@intel.com> wrote:
> 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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c b/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> index 6609bc8dbe..daea9c47d2 100644
> --- a/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> +++ b/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c
> @@ -1,9 +1,9 @@
> /** @file
> VirtualKeyboard driver
>
> -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions
> of the BSD License which accompanies this distribution. The
> @@ -1043,10 +1043,11 @@ VirtualKeyboardTimerHandler (
> // while current TPL is TPL_NOTIFY. It will be invoked in
> // KeyNotifyProcessHandler() which runs at TPL_CALLBACK.
> //
> Enqueue (&VirtualKeyboardPrivate->QueueForNotify, &KeyData);
> gBS->SignalEvent (VirtualKeyboardPrivate->KeyNotifyProcessEvent);
> + break;
> }
> }
>
> Enqueue (&VirtualKeyboardPrivate->Queue, &KeyData);
>
> --
> 2.14.3.windows.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread