Patch "platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100" has been added to the 6.1-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: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100

to the 6.1-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-msi-laptop-fix-rfkill-out-of-sync-on-ms.patch
and it can be found in the queue-6.1 subdirectory.

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



commit f69af4919c296317a7f50241b6df65e1c9ffb999
Author: Maxim Mikityanskiy <maxtram95@xxxxxxxxx>
Date:   Fri Jul 21 17:54:23 2023 +0300

    platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100
    
    [ Upstream commit ad084a6d99bc182bf109c190c808e2ea073ec57b ]
    
    Only the HW rfkill state is toggled on laptops with quirks->ec_read_only
    (so far only MSI Wind U90/U100). There are, however, a few issues with
    the implementation:
    
    1. The initial HW state is always unblocked, regardless of the actual
       state on boot, because msi_init_rfkill only sets the SW state,
       regardless of ec_read_only.
    
    2. The initial SW state corresponds to the actual state on boot, but it
       can't be changed afterwards, because set_device_state returns
       -EOPNOTSUPP. It confuses the userspace, making Wi-Fi and/or Bluetooth
       unusable if it was blocked on boot, and breaking the airplane mode if
       the rfkill was unblocked on boot.
    
    Address the above issues by properly initializing the HW state on
    ec_read_only laptops and by allowing the userspace to toggle the SW
    state. Don't set the SW state ourselves and let the userspace fully
    control it. Toggling the SW state is a no-op, however, it allows the
    userspace to properly toggle the airplane mode. The actual SW radio
    disablement is handled by the corresponding rtl818x_pci and btusb
    drivers that have their own rfkills.
    
    Tested on MSI Wind U100 Plus, BIOS ver 1.0G, EC ver 130.
    
    Fixes: 0816392b97d4 ("msi-laptop: merge quirk tables to one")
    Fixes: 0de6575ad0a8 ("msi-laptop: Add MSI Wind U90/U100 support")
    Signed-off-by: Maxim Mikityanskiy <maxtram95@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230721145423.161057-1-maxtram95@xxxxxxxxx
    Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 6b18ec543ac3a..f4c6c36e05a52 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -208,7 +208,7 @@ static ssize_t set_device_state(const char *buf, size_t count, u8 mask)
 		return -EINVAL;
 
 	if (quirks->ec_read_only)
-		return -EOPNOTSUPP;
+		return 0;
 
 	/* read current device state */
 	result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata);
@@ -838,15 +838,15 @@ static bool msi_laptop_i8042_filter(unsigned char data, unsigned char str,
 static void msi_init_rfkill(struct work_struct *ignored)
 {
 	if (rfk_wlan) {
-		rfkill_set_sw_state(rfk_wlan, !wlan_s);
+		msi_rfkill_set_state(rfk_wlan, !wlan_s);
 		rfkill_wlan_set(NULL, !wlan_s);
 	}
 	if (rfk_bluetooth) {
-		rfkill_set_sw_state(rfk_bluetooth, !bluetooth_s);
+		msi_rfkill_set_state(rfk_bluetooth, !bluetooth_s);
 		rfkill_bluetooth_set(NULL, !bluetooth_s);
 	}
 	if (rfk_threeg) {
-		rfkill_set_sw_state(rfk_threeg, !threeg_s);
+		msi_rfkill_set_state(rfk_threeg, !threeg_s);
 		rfkill_threeg_set(NULL, !threeg_s);
 	}
 }



[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