WSL2-Linux-Kernel/drivers/platform/x86
Stephen Boyd 21efa88e77 platform/x86: intel_scu_ipc: Fail IPC send if still busy
[ Upstream commit 85e654c9f7 ]

It's possible for interrupts to get significantly delayed to the point
that callers of intel_scu_ipc_dev_command() and friends can call the
function once, hit a timeout, and call it again while the interrupt
still hasn't been processed. This driver will get seriously confused if
the interrupt is finally processed after the second IPC has been sent
with ipc_command(). It won't know which IPC has been completed. This
could be quite disastrous if calling code assumes something has happened
upon return from intel_scu_ipc_dev_simple_command() when it actually
hasn't.

Let's avoid this scenario by simply returning -EBUSY in this case.
Hopefully higher layers will know to back off or fail gracefully when
this happens. It's all highly unlikely anyway, but it's better to be
correct here as we have no way to know which IPC the status register is
telling us about if we send a second IPC while the previous IPC is still
processing.

Cc: Prashant Malani <pmalani@chromium.org>
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Fixes: ed12f295bf ("ipc: Added support for IPC interrupt mode")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20230913212723.3055315-5-swboyd@chromium.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.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-10-06 13:18:06 +02:00
..
dell platform/x86: dell-sysman: Fix reference leak 2023-09-19 12:22:46 +02:00
hp platform/x86: hp-wmi: add micmute to hp_wmi_keymap struct 2023-05-24 17:36:48 +01:00
intel platform/x86/intel/hid: Add HP Dragonfly G2 to VGBS DMI quirks 2023-09-19 12:22:28 +02:00
Kconfig platform/x86: Move existing HP drivers to a new hp subdir 2023-05-24 17:36:48 +01:00
Makefile platform/x86: Move existing HP drivers to a new hp subdir 2023-05-24 17:36:48 +01:00
acer-wireless.c
acer-wmi.c platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017) 2022-12-02 17:41:10 +01:00
acerhdf.c
adv_swbutton.c
amd-pmc.c platform/x86/amd: pmc: Disable IRQ1 wakeup for RN/CZN 2023-02-22 12:57:05 +01:00
amilo-rfkill.c
apple-gmux.c
asus-laptop.c
asus-nb-wmi.c platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0 2023-06-21 15:59:12 +02:00
asus-wireless.c
asus-wmi.c platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() 2022-12-02 17:41:10 +01:00
asus-wmi.h
classmate-laptop.c
compal-laptop.c
dual_accel_detect.h
eeepc-laptop.c
eeepc-wmi.c
firmware_attributes_class.c
firmware_attributes_class.h
fujitsu-laptop.c
fujitsu-tablet.c
gigabyte-wmi.c platform/x86: gigabyte-wmi: add support for X570S AORUS ELITE 2023-04-26 13:51:51 +02:00
gpd-pocket-fan.c
hdaps.c
huawei-wmi.c platform/x86: huawei-wmi: Silence ambient light sensor 2023-09-19 12:22:28 +02:00
i2c-multi-instantiate.c
ibm_rtl.c
ideapad-laptop.c platform/x86: ideapad-laptop: Add Legion 5 15ARH05 DMI id to set_fn_lock_led_list[] 2023-01-18 11:48:51 +01:00
intel_ips.c
intel_ips.h
intel_scu_ipc.c platform/x86: intel_scu_ipc: Fail IPC send if still busy 2023-10-06 13:18:06 +02:00
intel_scu_ipcutil.c
intel_scu_pcidrv.c platform/x86: intel_scu_pcidrv: Add back PCI ID for Medfield 2023-06-09 10:32:20 +02:00
intel_scu_pltdrv.c
intel_scu_wdt.c
lg-laptop.c
meraki-mx100.c
mlx-platform.c
msi-laptop.c platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100 2023-08-03 10:22:35 +02:00
msi-wmi.c
mxm-wmi.c platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]() 2022-12-31 13:14:05 +01:00
panasonic-laptop.c platform/x86: panasonic-laptop: filter out duplicate volume up/down/mute keypresses 2022-07-07 17:53:34 +02:00
pcengines-apuv2.c
peaq-wmi.c
pmc_atom.c platform/x86: pmc_atom: Fix SLP_TYPx bitfield mask 2022-09-08 12:28:01 +02:00
samsung-laptop.c
samsung-q10.c
sony-laptop.c platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe 2023-01-18 11:48:51 +01:00
system76_acpi.c
think-lmi.c platform/x86: think-lmi: Clean up display of current_value on Thinkstation 2023-04-13 16:48:19 +02:00
think-lmi.h
thinkpad_acpi.c
topstar-laptop.c
toshiba-wmi.c
toshiba_acpi.c
toshiba_bluetooth.c
toshiba_haps.c
touchscreen_dmi.c platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i 2023-05-17 11:50:22 +02:00
uv_sysfs.c
wireless-hotkey.c
wmi-bmof.c
wmi.c platform/x86: wmi: Break possible infinite loop when parsing GUID 2023-07-23 13:47:43 +02:00
xiaomi-wmi.c
xo1-rfkill.c
xo15-ebook.c