Patch "platform/x86: thinkpad_acpi: Take hotkey_mutex during hotkey_exit()" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/x86: thinkpad_acpi: Take hotkey_mutex during hotkey_exit()

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-x86-thinkpad_acpi-take-hotkey_mutex-during-.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ce3f61af123a77847360a41f2a18bd36140e6458
Author: Hans de Goede <hdegoede@xxxxxxxxxx>
Date:   Wed Apr 24 14:28:11 2024 +0200

    platform/x86: thinkpad_acpi: Take hotkey_mutex during hotkey_exit()
    
    [ Upstream commit e397c564298c2e91aea3887990da8e8eddb65277 ]
    
    hotkey_exit() already takes the mutex around the hotkey_poll_stop_sync()
    call, but not around the other calls.
    
    commit 38831eaf7d4c ("platform/x86: thinkpad_acpi: use lockdep
    annotations") has added lockdep_assert_held() checks to various hotkey
    functions.
    
    These lockdep_assert_held() checks fail causing WARN() backtraces in
    dmesg due to missing locking in hotkey_exit(), fix this.
    
    Fixes: 38831eaf7d4c ("platform/x86: thinkpad_acpi: use lockdep annotations")
    Tested-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Reviewed-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240424122834.19801-2-hdegoede@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 82429e59999da..87a4a381bd988 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3044,10 +3044,9 @@ static void tpacpi_send_radiosw_update(void)
 
 static void hotkey_exit(void)
 {
-#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
 	mutex_lock(&hotkey_mutex);
+#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
 	hotkey_poll_stop_sync();
-	mutex_unlock(&hotkey_mutex);
 #endif
 	dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY,
 		   "restoring original HKEY status and mask\n");
@@ -3057,6 +3056,8 @@ static void hotkey_exit(void)
 	      hotkey_mask_set(hotkey_orig_mask)) |
 	     hotkey_status_set(false)) != 0)
 		pr_err("failed to restore hot key mask to BIOS defaults\n");
+
+	mutex_unlock(&hotkey_mutex);
 }
 
 static void __init hotkey_unmap(const unsigned int scancode)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux