Public bug reported:

On a MacBook8,1 (2016 12" MacBook, Intel Broadwell), the internal SPI
keyboard and trackpad intermittently fail to initialize at boot. A
restart always resolves the issue. The failure is caused by a race
between dw_dmac_pci and pxa2xx_spi_pci module probe order.

Symptoms:

Intermittent: keyboard and trackpad not detected after boot (no input: Apple 
SPI Keyboard / input: Apple SPI Touchpad in dmesg)
Restart always fixes it
No external keyboard required to reproduce (it's a boot-time race)
Root Cause:

The spi_pxa2xx_pci driver checks for DMA channel availability at probe
time. The outcome depends on whether dw_dmac_pci has already registered
its channels:

Good boot: pxa2xx_spi_pci probes first → "no DMA channels available, using PIO" 
→ works
Bad boot: dw_dmac_pci probes first → SPI sees DMA → uses DMA → transfers time 
out (-110) → driver re-queues a message still linked in the SPI core's list → 
list corruption (__list_add_valid_or_report warning) → driver is permanently 
stuck
Failed boot log (kernel 7.0.0-31-generic):

dw_dmac_pci 0000:00:15.0: DesignWare DMA Controller, 8 channels
input: Apple SPI Keyboard as 
/devices/pci0000:00/0000:00:15.4/spi_master/spi1/spi-APP000D:00/input/input4
applespi spi-APP000D:00: SPI transfer timed out
applespi spi-APP000D:00: Error writing to device: -110
spi_master spi1: failed to transfer one message from queue
applespi spi-APP000D:00: SPI transfer timed out
applespi spi-APP000D:00: Error reading from device: -110
WARNING: lib/list_debug.c:35 at __list_add_valid_or_report+0xc6/0xe0, CPU#3: 
spi1/455
  spi_queued_transfer+0xed/0x110
  __spi_async+0xd5/0x160
  spi_async+0xd6/0xe0
  applespi_send_cmd_msg+0x17d/0x400 [applespi]
  applespi_msg_complete+0xc5/0x110 [applespi]
  applespi_async_read_complete+0x5c/0x60 [applespi]
spi_master spi1: failed to transfer one message from queue
applespi spi-APP000D:00: SPI transfer timed out
applespi spi-APP000D:00: Error writing to device: -110

Successful boot log (same kernel, same machine):

pxa2xx_spi_pci 0000:00:15.4: no DMA channels available, using PIO
dw_dmac_pci 0000:00:15.0: DesignWare DMA Controller, 8 channels
input: Apple SPI Keyboard as 
/devices/pci0000:00/0000:00:15.4/spi_master/spi1/spi-APP000D:00/input/input4
applespi spi-APP000D:00: Received corrupted packet (crc mismatch)
applespi spi-APP000D:00: modeswitch done.
input: Apple SPI Touchpad as 
/devices/pci0000:00/0000:00:15.4/spi_master/spi1/spi-APP000D:00/input/input5

Upstream Status:

The list-corruption bug (re-queueing applespi->wr_m via spi_async()
while still linked in SPI core lists) was identified in the sashiko-bot
review of the v4/v5 patch series (Shih-Yuan Lee, July 2026, linux-spi
mailing list). The same series adds a force_pio module parameter to
spi_pxa2xx_pci as a workaround.

Workaround (untested, for reference):

# /etc/modprobe.d/spi-force-pio.conf
options spi_pxa2xx_pci force_pio=1

(Requires the upstream patch to be applied; the parameter does not exist
in 7.0.0-31-generic.)

System:

Ubuntu 24.04.1 LTS
Kernel: 7.0.0-31-generic
Hardware: MacBook8,1 (Intel Core M, Broadwell)
SPI controller: Intel LPSS at 00:15.4
DMA controller: DesignWare at 00:15.0

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2167177

Title:
  Intermittent SPI keyboard/trackpad failure at boot — DMA/PIO module
  load order race in spi_pxa2xx_pci

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2167177/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to