linux-stable/drivers/platform
Maxim Mikityanskiy cb160f4f90 platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100
[ Upstream commit ad084a6d99 ]

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: 0816392b97 ("msi-laptop: merge quirk tables to one")
Fixes: 0de6575ad0 ("msi-laptop: Add MSI Wind U90/U100 support")
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Link: https://lore.kernel.org/r/20230721145423.161057-1-maxtram95@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-03 10:24:01 +02:00
..
chrome platform/chrome: cros_typec_switch: Add missing fwnode_handle_put() 2023-05-11 23:03:16 +09:00
goldfish platform: goldfish: pipe: Use platform_get_irq() to get the interrupt 2022-03-18 13:55:21 +01:00
loongarch platform/loongarch: laptop: Fix possible UAF and simplify generic_acpi_laptop_init() 2022-10-29 16:29:31 +08:00
mellanox platform/mellanox: fix potential race in mlxbf-tmfifo driver 2023-06-09 10:34:08 +02:00
mips MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error. 2022-06-09 22:24:19 +02:00
olpc platform/olpc: Fix uninitialized data in debugfs write 2022-07-28 20:40:15 +02:00
surface platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem 2023-06-14 11:15:15 +02:00
x86 platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100 2023-08-03 10:24:01 +02:00
Kconfig LoongArch: Add ACPI-based generic laptop driver 2022-10-12 16:36:20 +08:00
Makefile LoongArch: Add ACPI-based generic laptop driver 2022-10-12 16:36:20 +08:00