From 9ca5fbcb63a8dcaee0527f96afb91dc4b4bd8fa9 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 22 Nov 2023 01:08:11 +0000
Subject: [PATCH] add ip1811 driver

---
 kernel/arch/x86/platform/efi/efi_64.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/kernel/arch/x86/platform/efi/efi_64.c b/kernel/arch/x86/platform/efi/efi_64.c
index 77d05b5..cd7e4bf 100644
--- a/kernel/arch/x86/platform/efi/efi_64.c
+++ b/kernel/arch/x86/platform/efi/efi_64.c
@@ -619,18 +619,16 @@
 
 /*
  * Makes the calling thread switch to/from efi_mm context. Can be used
- * for SetVirtualAddressMap() i.e. current->active_mm == init_mm as well
- * as during efi runtime calls i.e current->active_mm == current_mm.
- * We are not mm_dropping()/mm_grabbing() any mm, because we are not
- * losing/creating any references.
+ * in a kernel thread and user context. Preemption needs to remain disabled
+ * while the EFI-mm is borrowed. mmgrab()/mmdrop() is not used because the mm
+ * can not change under us.
+ * It should be ensured that there are no concurent calls to this function.
  */
 void efi_switch_mm(struct mm_struct *mm)
 {
-	task_lock(current);
 	efi_scratch.prev_mm = current->active_mm;
 	current->active_mm = mm;
 	switch_mm(efi_scratch.prev_mm, mm, NULL);
-	task_unlock(current);
 }
 
 #ifdef CONFIG_EFI_MIXED

--
Gitblit v1.6.2