From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.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 69DC0248F72 for ; Sun, 12 Jul 2026 16:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783872935; cv=none; b=KqDVSgiy/z276KiTBVOoN9T4GR/ZwN/Y2upVU4yh7uRdYajty7qDdHG4rVx7EiBIAYn0nOglf5Hvpi1mYp+267HfsIj14CayiWMC76rtK+97NKPN3tA8oJdj0KjMCb067N+gyHt6X6tcHsRZiq1CITXEpulGEBH1JF+YGEL1AFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783872935; c=relaxed/simple; bh=zTYHVWB/ww2MpQMv9VB9DxLFqqRHqJuSrc1EoMv0eQM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=fG/VN1Usalyzx45JFvmdpsyZ6S4yS1XwQbh5QNq66AJ+qPKSwyKMhQuHSZxi39qfuH++ul8u+VrNxibSIZvnYeEGI8MA0IoUPrAEd2fwaSywxt583yly2BflTNRMlF6sBiVuTAofYyxrOyn7uFgylUBwni1ml1Ky1zROhyYiDAU= 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.214.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-pl1-f172.google.com with SMTP id d9443c01a7336-2c7cfa17fedso34025495ad.3 for ; Sun, 12 Jul 2026 09:15:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783872934; x=1784477734; h=content-transfer-encoding:content-type:mime-version: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=BB78WwYxxwZ7HeA3JuVfN9r7sDH8CdPWPJM6l6nV4eg=; b=VhWzFoYrmXccAFe+cp8L5YBmrTfldHjSYcJQeCZX4U5/8C5y7/AYwpGqhFic4p3Uq1 krSuMrmAYjTzyGC54L0uOaoUgOAeCURuppP0UJGcG15nVRBUAzZdJ9tSb/3VPNJtutjX pMh9Xh1frQoA84X1tDMWuMHiUxSYfqFi/ajgV96bQbJEQzyH8M9HE6ox9n32CnL1pQU8 w6rSw5NhI6Lz5rYRBolq1ZuzHBD+MIjXfuRN9lPQhv3aoZyoroXE7zrejhdP/l81t39J NamFozs/LnOvZ2IWgNWMtauIkjAQltfzBF9DKcls5FJV7l+DTwGElHA5qEqtoU7DzgNn paFg== X-Forwarded-Encrypted: i=1; AHgh+RqICpha2D/vj85pbG4LIVf4FoLnDlHLqJXfZKiuoC5k2QncTa4Y4+qHtsVZpeFy+m1EcAw/5AvB0cZX3VE=@vger.kernel.org X-Gm-Message-State: AOJu0YzSftUb5M3bvO/H5Gw+4NZEajoi1EGkK/p53jd0z3Phn1vlHwkR xaDhRsQSp52k2+heh9HxeHKOFsOOI3Z64+SOCzRN8REHiOTcv/oQzXQ= X-Gm-Gg: AfdE7cl9ji9sJDHjnjnEhXNP9qLheUXZRdppUdySv3DPmZFbv7bHgT+2Kh2LAyp9EBu bKnAg6L2jD6fLcvsnAoN191pyEYhpkKjRsE4sxNp8r6LflrYa7vvkWgQQS3wb+o7bhgON8Gwu0I MJ5pxRB4+DDBRg0gGGO8irWIY/5L8blDtVejSFIsjI2ppp9KcUxcgzRxpy2MVPdIzxdod5I9J4r rCeBzR0t5dQTQlYDA4PZZCOhWU9f/P7QkUhF5PmrretE3vA6LHjVnCBbWZjiQYj/SYJJGf/qcW1 LBmlLfJjjrvfJAp/EgViVqDaoADiSh5wom2dqRmAkRud2FaintxZoSgH32PQPiKFbHr4bSadApK r/ZdsBtPaqpvvguQWoXGTqSkSJYlNZz582mCa1dyhfrPflLVqhAbFHUe/pDh/ZrVsxK/SnV6Osh RSJvw7NPqfueZgdB3aBs1f5H1a8DnAq7OJ60XSLFi1eSfH/DtUa/ZS2sxDG33enSoM556fXRVD7 Hp+S0EkyjIAXsZK//33IP9oM4Zg X-Received: by 2002:a05:6a21:4598:b0:3bf:b755:ce6f with SMTP id adf61e73a8af0-3c1102a1692mr5830737637.29.1783872933743; Sun, 12 Jul 2026 09:15:33 -0700 (PDT) Received: from penguin.tail0a1999.ts.net (61-228-44-142.dynamic-ip.hinet.net. [61.228.44.142]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3118389d9bcsm51034331eec.20.2026.07.12.09.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 09:15:33 -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 0/2] Input: applespi - probe and remove fixes Date: Mon, 13 Jul 2026 00:15:25 +0800 Message-Id: <20260712161527.7350-1-fourdollars@debian.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) -- 2.39.5