From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (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 6BF7F37268A for ; Thu, 4 Jun 2026 20:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780604826; cv=none; b=Um07BKBFLflQMIABn9nOAX2iE8ifgmTj57tUPIx805lJihef2ZR95c3kdMuk0fW5brJWSNOWxXIfLm285zSEXZHs3pxDkkPyz5CrQdKULXz64+svDcD27BiQu997vQKKxBp3OGywgPKMUsuDY8gmx02EVdjiQ2H7sjZL/hAsCRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780604826; c=relaxed/simple; bh=Wce5xGa/nLSLqGMURGpy4Ao2T2nkLcD9GtxfRyC3InY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s3MJEIrRl7PqpD1CP6PP5mNjkcRce1kaLzLjYVgQpBtQ7p/xWlO2jskhycr966jk2HM0CK0rRknMdBSxC8+yeF14JfqvALftO7XE4VuFp0k76Zak6HayXwo++3CC7QWL6msvqW4/raCrhoK9t85Cc6H4kjHvXl0sFF0j3NxcX6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WDgWzmgK; arc=none smtp.client-ip=209.85.167.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WDgWzmgK" Received: by mail-lf1-f68.google.com with SMTP id 2adb3069b0e04-5aa69131836so1016015e87.3 for ; Thu, 04 Jun 2026 13:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780604824; x=1781209624; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DoIRyWg6RlmfL4adV/AmFkchSnn0ZkhyqkOhiIb6Q6o=; b=WDgWzmgKpVbIAyi5zs4k0MAWCe5VSIL3hmYSA8bLLrV0f65PKrd1pHPDLruejZSI2v 1X4cgJROHAj6JlcTszOiMww4kJx1w0QCZf6RbszgeyLU5qKtnL9WBnKcG34zr/uJxcHv CNmG8t2oPuvEtF83QPZ7JZ+5SBEuatfgfVZry7nbQGaAF90g4kWnxdg3orw8zNI0vVRk nxH42ctLPRyQpbX0vfUsJuhOviB3w2Z3rWy4gPEHiEW311LzW/gu0EBfespJbjTYSiN6 Dt93m9jWxmuH3gf2NvtJtp6qxawPZZdc/2nnEvhkKcELfQf9C+DTCSOXbZZwMSnC23wX Ajsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780604824; x=1781209624; 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; bh=DoIRyWg6RlmfL4adV/AmFkchSnn0ZkhyqkOhiIb6Q6o=; b=Z+ObDTOYXwqUqKKfxSXlJwK0JFLv2afCGavW5at9Tz+s/VROu48QNxf94a45dzAxYw J+D/mVWNHbNjxPIApJE4pDOH6DHjEKvQ7E/FZV3AYb5EkONR5kxeJsNDVLPX3kHB8T3C KS//p/rmcbQz34afMJbrOHw6GI1pOsIXaXdxnEkr4Q8ZZle0iu0gC0HkEDntb9nERLeP 7IjziykTA/6rIHt5T25PZ4obBg88JzR0E8+HyD9enF/v3oNrmaZB77jWkZivvwpAbM96 wxA0rX7nUPzlBS0ON463SWNUQQDldCnaXtLpf43FOJ+8PO5Qwre3VSIztzVWxesuScIp KAyg== X-Forwarded-Encrypted: i=1; AFNElJ+yNs/Bnfw3MWT9VWb2HA4d9iq975RP4spQS/ppTBbqTN2+3Sb8VVHuLQ9fWVq7eB10BBn8z0zqenDXczs=@vger.kernel.org X-Gm-Message-State: AOJu0YwKiQTkDp5kykiS+LB3d852L73WDMfBfSJIeb0dMr3ZRgSj1vhv IQACN4HOQjKfJ9fG16ej41u1/NboJ9ViWahD/0RQkan8GtJsCmbGG9JX X-Gm-Gg: Acq92OGe9PyAFHtkOWXVLrMUJ+DIg6r9sXvG1IkvsGcQ5+FKAi5MbM76eby8t0N2Eu1 xwIcoXd99xmqg0Mcr64wJkjR8wcvwXO+5ERyBiLMUvT9pJyHsvkski7INK/pGJvUt+brtCS2/p4 /O2H4SOYULm3oJZFibDiXTIcw01Sv0e4qqIMp51MSEfuIwNBnGiBLmvE6YNhpWIcCwKM1MFNyt+ HdY7kMzC+6bWZBomYO0yl/J2Tvtl0VPlvvtXmXO35TYvUUCCZrtu3T4XuHPPlaxJGsWEZ9IHFJl pr0UF7C/QftreNDcuBPmvtFhhmoo5x/6P22tlklpvrUlQAi6KvGrRrxs1LYuyB87TAbdYygUWKU eT1MDgf+lopOB6cjFn3/BM0lFTFt6yjZzoHxmhNq8mU4FFRF+k3wUZhZKFuIJC6DQZzL339eRxV tTqe30clGnDmIo+koVf2E01auO/RGMW2fyt3FpHpYziwpt5sssobj6Um7Cy6ZqLlLk/A== X-Received: by 2002:a05:6512:4158:20b0:5aa:6f89:9378 with SMTP id 2adb3069b0e04-5aa87be9785mr77648e87.33.1780604823357; Thu, 04 Jun 2026 13:27:03 -0700 (PDT) Received: from machine (host-176-37-220-32.b025.la.net.ua. [176.37.220.32]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5aa7b906a83sm1427292e87.33.2026.06.04.13.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2026 13:27:02 -0700 (PDT) From: d3z To: even.xu@intel.com, xinpeng.sun@intel.com, jikos@kernel.org, bentiss@kernel.org Cc: "Danny D ." , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, abhishektamboli9@gmail.com, sakari.ailus@linux.intel.com Subject: Re: [PATCH] HID: intel-thc-hid: intel-quickspi: reset touch IC on system resume Date: Thu, 4 Jun 2026 23:26:46 +0300 Message-ID: <20260604202647.16777-1-d3z.the.dev@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: <20260529222210.1532876-1-d3z.the.dev@gmail.com> <20260601213047.115271-1-d3z.the.dev@gmail.com> <20260602151317.27768-1-d3z.the.dev@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Danny D. Hi Even, Good catch on the missing state restore. I rebuilt with your version and re-ran the test. This is exactly your proposal: reset_tic() after thc_dma_configure(), then qsdev->state = QUICKSPI_ENABLED, with no thc_spi_*_config and no thc_ltr_*. I built it as a module and swapped it into a clean linux-surface 6.19.8 on the Surface Pro 10. It still doesn't survive s2idle - touch is fine at probe, but after one suspend/resume it's dead again. This time resume() fails outright instead of coming back quietly broken: intel_quickspi 0000:00:10.0: Wait DEVICE_DESCRIPTOR timeout, ret:0 intel_quickspi 0000:00:10.0: PM: dpm_run_callback(): pci_pm_resume returns -110 intel_quickspi 0000:00:10.0: PM: failed to resume async: error -110 So reset_tic() can't complete here. It clears the reset handshake, then times out in quickspi_get_device_descriptor() and the whole resume bails with -ETIMEDOUT. The device isn't a wake source on this box - "Can't find wake GPIO resource" - so device_may_wakeup() is false and we're on the reset path, as expected. And the timeout is the THC, not the touch IC: across s2idle its SPI input/output address and read/write config are gone, so reset_tic()'s descriptor exchange has nothing valid to run against. Reprogram those first - the thc_spi_input_output_address_config + read_config + write_config block, same as quickspi_restore(), same as v2 on the no-wake path - and reset_tic() completes and touch comes back. That's exactly why v2 reconfigures the THC instead of only resetting the IC. One more platform note: the SP10 never reaches S3. Firmware only offers s2idle - mem_sleep is just "[s2idle]", with no "deep" entry to select - yet the THC still loses its context across plain s2idle. So a reset gated on S3 would never fire here, which is why it has to run on the ordinary resume path. Thanks, Danny