From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35699301474 for ; Sat, 11 Jul 2026 05:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783749182; cv=none; b=Et75M9DNkTDePY03NG3kIivO1a0LwxmZmExzDNmOz85Mo1JbqhnPAhZ0GUcEcfeJLu1freLKbuFk13TGfxoDIgaH1LrAFcYfinDpyQAlmh9OoJm2PhzFgDWb/lK2oIfwFj+TVUo5g8ffeTGKJtn/yEmK3FRny/pKC3vseD/uvUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783749182; c=relaxed/simple; bh=Aa8KFCxdXBWMQUbn68y6G2KRIT+gUSN1LDah6Ckw9LI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M9L8JjKojY342zIFPyDiOyGctz7LOq3r+utvu7ysV6q/QS4BMiYgEqCnltae9rgg9MVHX0x0KHFCWL35DVTN2HEMMr+cH+GQ6EVlJhJhCGentUOjEfDuM5B7kcIFgeZ+mrSt14xp7jl5ZGfSh/XKzvsqfocZOUZoe6CBr8FE7F0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8487b7b3fc8so1158551b3a.3 for ; Fri, 10 Jul 2026 22:53:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783749179; x=1784353979; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=WqMDDgVvs8rEZ8j+IjLB6O1vXNqeXixwW35hhGBVOZk=; b=F8Kqv5E07Sh1qgpDdwVF2Lsb2JRo+88GDtyehqZxpF3CRbLigReFHzufYKt7DwHY9+ rOxR4wMjIuTLj1T8l6tgkvB1BW6tYS+ToNLuxYRyf9lJtPPnC/D54S+kUZ56ro6Hw2zM xeUn8qzFwZEYmxPqwz8Loxi8+K3E2WvFivqWydLOOaqQ0EasYx7GtSsdouKSFnk2aJIe 6/pg/fAkOSN5Q+h7si/40gd/hSW5WIp01eLLqjw/MTV5CbeYG3MPthi6GXpsUD43AaFa 6SJeLlzpXTYyxe66X6VeSxet3DmNLvnuRKkF3RJoyZDKYvhrwvVlJio+g3j6UF0QF8xN LOGg== X-Forwarded-Encrypted: i=1; AHgh+RrdY9r9vgOeRTypE8CJ14tdHEhwHo4kPMsdOwpMBO/s/ls1T0A/gjAR+gszoUAG201FY98uwMbdVyFdSEI=@vger.kernel.org X-Gm-Message-State: AOJu0YxluTuPz5nO4fBSPspKoEh69PUpJ6I3Upmz0lfs7sRz4jk8gD9L lIiSURjvUqwpQQr29OzVT1dfFe/8KGDk0mkbObHeOupgCYbynNcNQs8= X-Gm-Gg: AfdE7cn4P5rXyMcDVE4fwz5fmcI36ZiwpMMEB2yAMabtL5RTnbsbG6xqULafiQ5+4Y8 P7MTXW5IRprjWVWCiyLrSTJUaNa+ZRhGZEdT8dt7dVvlVe9ZU8eQ/ZWknkaZ2dVc9c0pg9Qt/OO oQ/kVP+Hgo7NDEorelhj6q+CUsKHQpL9xco8aanPErY7coZWDP8tkJcarKTVINBm5qgLzrBSUMO UqEMWSTCVPNDQJU8D0qaWjtP2JOT76pWl1EZGSb647j5SovGu3/IZQ0HJDTZ7J6HZRcpHQU903v v/vy6Wuwz16ZQNurYs4XiV15ogyvMNxxYGyeUI54EvkllKSyGCZUvRL/Pk4G695T0dUcvx8NsqD 5R6M2BTy7PNHynQ+8qdOzng8IygDQMD5Rylpl/iyOmbDREQ65Inr+nOYX5YrTVmY1pZdunQ6+iJ e7LrYdRlf5PeMc54BWfQe+bCClF98fWLzANXxH6q6TN1XicLAMaAGfDIgQrYyS/p00Keo1qfIs2 8Z/K+lXTBK14LkHpAW5UWvQUw== X-Received: by 2002:a05:6a00:1406:b0:848:30fe:da3b with SMTP id d2e1a72fcca58-8488972215bmr1768883b3a.40.1783749179489; Fri, 10 Jul 2026 22:52:59 -0700 (PDT) Received: from penguin.tail0a1999.ts.net (61-228-52-13.dynamic-ip.hinet.net. [61.228.52.13]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8484123ce87sm5360084b3a.58.2026.07.10.22.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 22:52:59 -0700 (PDT) From: Shih-Yuan Lee To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Shih-Yuan Lee Subject: [PATCH 1/1] Input: applespi - force PIO mode on MacBook8,1 Date: Sat, 11 Jul 2026 13:52:47 +0800 Message-Id: <20260711055247.5412-2-fourdollars@debian.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260711055247.5412-1-fourdollars@debian.org> References: <20260711055247.5412-1-fourdollars@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On MacBook8,1 (early 2015 12" MacBook), the LPSS SPI controller's DMA handshake and interrupt routing frequently fail or time out after warm reboots, causing the keyboard and trackpad to become unresponsive and spamming "SPI transfer timed out" (-110) errors to dmesg. Address this by introducing a DMI quirk inside the probe function that detects the MacBook8,1 model and overrides the controller's can_dma callback to a custom helper that always returns false. This forces the host controller to fall back to the rock-solid PIO mode. This is a self-contained device quirk that completely solves the DMA race condition on MacBook8,1 systems without impacting other MacBooks or generic Intel platforms. Signed-off-by: Shih-Yuan Lee --- drivers/input/keyboard/applespi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index b5ff71cd5a70..edf81e383612 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1605,6 +1606,13 @@ static void applespi_save_bl_level(struct applespi_data *applespi, "Error saving backlight level to EFI vars: 0x%lx\n", sts); } +static bool applespi_can_not_dma(struct spi_controller *controller, + struct spi_device *spi, + struct spi_transfer *xfer) +{ + return false; +} + static int applespi_probe(struct spi_device *spi) { struct applespi_data *applespi; @@ -1613,6 +1621,15 @@ static int applespi_probe(struct spi_device *spi) int sts, i; unsigned long long gpe, usb_status; + /* + * MacBook8,1's SPI host controller DMA is broken (timeout errors). + * Force PIO mode by overriding the controller's can_dma callback. + */ + if (dmi_match(DMI_PRODUCT_NAME, "MacBook8,1")) { + dev_info(&spi->dev, "Disabling DMA for MacBook8,1 SPI to force PIO mode\n"); + spi->controller->can_dma = applespi_can_not_dma; + } + /* check if the USB interface is present and enabled already */ acpi_sts = acpi_evaluate_integer(spi_handle, "UIST", NULL, &usb_status); if (ACPI_SUCCESS(acpi_sts) && usb_status) { -- 2.39.5