On Thu, May 08, 2025 at 10:15:31AM +0800, Baolu Lu wrote:
On 5/8/25 01:07, Aditya Garg wrote:
Keyboard and touchpad stopped working on several Apple Macbooks from the year 2017 using kernel 6.12.xx . Until now I could only find this discussion affirming the bug on Debian and Fedora:https://github.com/Dunedan/mbp-2016-linux/issues/202
On siduction I also tried the more recent kernels 6.14.5 and mainline 6.15-rc4 (from Ubuntu) and the issue persisted with my testdevice MacBookPro14,1 -- see the relevant output:
kernel: platform pxa2xx-spi.3: Adding to iommu group 20 kernel: input: Apple SPI Keyboard as /devices/pci0000:00/0000:00:1e.3/pxa2xx-spi.3/spi_master/spi2/spi-APP000D:00/ input/input0 kernel: DMAR: DRHD: handling fault status reg 3 kernel: DMAR: [DMA Read NO_PASID] Request device [00:1e.3] fault addr 0xffffa000 [fault reason 0x06] PTE Read access is not set kernel: DMAR: DRHD: handling fault status reg 3 kernel: DMAR: [DMA Read NO_PASID] Request device [00:1e.3] fault addr 0xffffa000 [fault reason 0x06] PTE Read access is not set kernel: applespispi-APP000D:00: Error writing to device: 01 0e 00 00 kernel: DMAR: DRHD: handling fault status reg 3 kernel: DMAR: [DMA Read NO_PASID] Request device [00:1e.3] fault addr 0xffffa000 [fault reason 0x06] PTE Read access is not set kernel: DMAR: DRHD: handling fault status reg 3 kernel: applespispi-APP000D:00: Error writing to device: 01 0e 00 00
It appears that all DMA faults are related to a fixed address, 0xffffa000. Is this address something special?
Also what does below message mean from a SPI driver's perspective?
"applespispi-APP000D:00: Error writing to device: 01 0e 00 00"
I am asking this because the IOMMU fault messages are about DMA Reads (device raised memory read), while above message complains failing to write to device.
When sending a command to the peripheral device applespi expects it to acknowledge successful transfer with
static u8 status_ok[] = { 0xac, 0x27, 0x68, 0xd5 };
but we are getting "01 0e 00 00" instead.
See applespi_check_write_status() in drivers/input/Keyboard/applespi.c
Thanks.