linux/drivers/misc/mei
Hans de Goede fdb1ada57c mei: vsc: Use "wakeuphostint" when getting the host wakeup GPIO
The _CRS ACPI resources table has 2 entries for the host wakeup GPIO,
the first one being a regular GpioIo () resource while the second one
is a GpioInt () resource for the same pin.

The acpi_gpio_mapping table used by vsc-tp.c maps the first Gpio ()
resource to "wakeuphost-gpios" where as the second GpioInt () entry
is mapped to "wakeuphostint-gpios".

Using "wakeuphost" to request the GPIO as was done until now, means
that the gpiolib-acpi code does not know that the GPIO is active-low
as that info is only available in the GpioInt () entry.

Things were still working before due to the following happening:

1. Since the 2 entries point to the same pin they share a struct gpio_desc
2. The SPI core creates the SPI device vsc-tp.c binds to and calls
   acpi_dev_gpio_irq_get(). This does use the second entry and sets
   FLAG_ACTIVE_LOW in gpio_desc.flags .
3. vsc_tp_probe() requests the "wakeuphost" GPIO and inherits the
   active-low flag set by acpi_dev_gpio_irq_get()

But there is a possible scenario where things do not work:

1. - 3. happen as above
4. After requesting the "wakeuphost" GPIO, the "resetfw" GPIO is requested
   next, but its USB GPIO controller is not available yet, so this call
   returns -EPROBE_DEFER.
5. The gpio_desc for "wakeuphost" is put() and during this the active-low
   flag is cleared from gpio_desc.flags .
6. Later on vsc_tp_probe() requests the "wakeuphost" GPIO again, but now it
   is not marked active-low.

The difference can also be seen in /sys/kernel/debug/gpio, which contains
the following line for this GPIO:

 gpio-535 (                    |wakeuphost          ) in  hi IRQ ACTIVE LOW

If the second scenario is hit the "ACTIVE LOW" at the end disappears and
things do not work.

Fix this by requesting the GPIO through the "wakeuphostint" mapping instead
which provides active-low info without relying on acpi_dev_gpio_irq_get()
pre-populating this info in the gpio_desc.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2316918
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Fixes: 566f5ca976 ("mei: Add transport driver for IVSC device")
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20250214212425.84021-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-02-19 14:47:35 +01:00
..
gsc_proxy drm: move i915_component.h under include/drm/intel 2024-05-31 16:11:00 +03:00
hdcp drm: move i915_hdcp_interface.h under include/drm/intel 2024-05-31 16:11:36 +03:00
pxp Merge drm/drm-next into drm-intel-next 2024-06-19 11:38:31 +03:00
bus-fixup.c mei: bus-fixup: set timeout for MKHI send operations 2024-06-24 16:40:29 +02:00
bus.c mei: bus: Reorganize kerneldoc parameter names 2024-10-13 17:10:35 +02:00
client.c mei: use kvmalloc for read buffer 2024-10-29 04:01:40 +01:00
client.h
debugfs.c
dma-ring.c
gsc-me.c
hbm.c
hbm.h
hw-me-regs.h mei: me: add panther lake P DID 2025-02-19 14:47:01 +01:00
hw-me.c
hw-me.h
hw-txe-regs.h
hw-txe.c
hw-txe.h
hw.h mei: Avoid a bunch of -Wflex-array-member-not-at-end warnings 2024-04-11 15:13:30 +02:00
init.c
interrupt.c
Kconfig
main.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
Makefile
mei-trace.c
mei-trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
mei_dev.h
mkhi.h
pci-me.c mei: me: add panther lake P DID 2025-02-19 14:47:01 +01:00
pci-txe.c
platform-vsc.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
vsc-fw-loader.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
vsc-tp.c mei: vsc: Use "wakeuphostint" when getting the host wakeup GPIO 2025-02-19 14:47:35 +01:00
vsc-tp.h mei: vsc: Unregister interrupt handler for system suspend 2024-04-11 15:15:53 +02:00