Skip to contentSkip to conversation

efi term: open input console exlusively

PATCH In review Josef Bacik 2 participants 2 messages Apr 28, 2016 – Apr 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi term: open input console exlusively

We've had issues with a bunch of our EFI machines getting random console input from God knows where. This stops our provisioning because the timeout countdown stops as it thinks we pressed a button, which we most certaintly did not. So open the input console in exclusive mode to make sure only the guy behind the wheel gets to type. With this patch we can no provision these weird machines. Thanks,

---
 grub-core/term/efi/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/term/efi/console.c +1 -1
index 7d31095..5be8530 100644
@@ -201,7 +201,7 @@ grub_efi_console_input_init (struct grub_term_input *term)
 
   text_input = grub_efi_open_protocol(grub_efi_system_table->console_in_handler,
 				      &text_input_ex_guid,
-				      GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+				      GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
   term->data = (void *)text_input;
 
   return 0;
Signature · 1 line
2.5.0
#1 lore raw

28.04.2016 21:14, Josef Bacik пишет:

Quoted 5 lines

We've had issues with a bunch of our EFI machines getting random console input from God knows where. This stops our provisioning because the timeout countdown stops as it thinks we pressed a button, which we most certaintly did not. So open the input console in exclusive mode to make sure only the guy behind the wheel gets to type.

I do not understand how it can fix your issue except by unintentional side effect, sorry. Exclusive open will (attempt to) detach other *consumers* of this protocol, but he problem is related to suppliers.

While it is possible that some driver that opens console also somehow feeds input into it, it looks like too heavy hammer, sorry. We really need better understanding what happens here.

Quoted 22 lines

With this patch we can no provision these weird machines.
Thanks,

---
 grub-core/term/efi/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/term/efi/console.c +1 -1
index 7d31095..5be8530 100644
@@ -201,7 +201,7 @@ grub_efi_console_input_init (struct grub_term_input *term)
 
   text_input = grub_efi_open_protocol(grub_efi_system_table->console_in_handler,
 				      &text_input_ex_guid,
-				      GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+				      GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
   term->data = (void *)text_input;
 
   return 0;