Skip to content

Input: applespi - probe and remove fixes

Shih-Yuan Lee linux-input lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Input: applespi - register touchpad device synchronously in probedrivers/input/keyboard/applespi.c+118 -300 replies
2/2Input: applespi - fix use-after-free in applespi_remove()drivers/input/keyboard/applespi.c+9 -30 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchRonald Tschalär
1/2Based-on-patch-by
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Input: applespi - probe and remove fixes

This series fixes two bugs in the applespi driver found during work to restore MacBook8,1 SPI keyboard/touchpad functionality across S3 suspend/resume cycles.

Patch 1 fixes a probe-time regression introduced when the touchpad registration was made asynchronous: a deferred workqueue task could complete after the spi_device was already removed, causing a NULL pointer dereference. The fix registers the touchpad input device synchronously in probe and removes the deferred path.

Patch 2 fixes a use-after-free race in applespi_remove(). The original code called applespi_drain_writes(), then removed the GPE handler, then called applespi_drain_reads() -- but any read completion arriving after GPE removal would reference the already-torn-down applespi struct. The fix uses the existing cancel_spi + wait_event_lock_irq mechanism to drain all in-flight SPI transfers atomically before proceeding with teardown.

These patches are independent of the companion spi-pxa2xx series also submitted today (MacBook8,1 DMA quirk and LPSS S3 resume fix).

Shih-Yuan Lee (2):
Input: applespi - register touchpad device synchronously in probe
Input: applespi - fix use-after-free in applespi_remove()

 drivers/input/keyboard/applespi.c | 160 ++++++++++++++++++++++++------
 1 file changed, 127 insertions(+), 33 deletions(-)
Signature · 1 line
2.39.5