From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179]) (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 8BA8E330656 for ; Thu, 30 Apr 2026 16:54:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777568100; cv=none; b=W4B310prcmTNq7pkjwO4+iK3rBokMh2b+2R5HKITc7RGdNQxRCohBv2GXB313EAgUcd9wlSsMS6wKVGaQakZnwNvNPGbYBERLiiiJm8P9Vxe1QU0YxQecvQ/fHd7yS7UQslqqaiiH7r3DZAIzyd+mXV/ceruWzaX1OMLm3okgXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777568100; c=relaxed/simple; bh=eUBp07JKTe82zy1ykUrgvp3E6cfoSBuBKsp0BQUA5sM=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=m96x01vP46S0CjqOakXQRGC13unWCxGzNAkiewS6Nd4qH+h/H1eHFW7DXynf0VgU6wQmkZc5d/tm3U/rcw3y7YdxyHQAMtRGeDj3Y9zSjOso3NmZLwLcHFOD3LZ03HsVZXbXjZG4w71awgAFnkOX9g09GOUMaghFPw4xF9WJLvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=embeddedts.com; spf=pass smtp.mailfrom=embeddedts.com; dkim=pass (1024-bit key) header.d=embeddedts.com header.i=@embeddedts.com header.b=la+T50yT; arc=none smtp.client-ip=74.125.82.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=embeddedts.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=embeddedts.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=embeddedts.com header.i=@embeddedts.com header.b="la+T50yT" Received: by mail-dy1-f179.google.com with SMTP id 5a478bee46e88-2d96243c91fso842033eec.1 for ; Thu, 30 Apr 2026 09:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embeddedts.com; s=google; t=1777568098; x=1778172898; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=nSw+yolZYnlsfqzqQJDRiH90jYV8jI3JvmhNU4UgfQ8=; b=la+T50yT46UYls8wd9vBo9pXd4/tj2bcTxIu4bambdQoDJPCPZ2egjDPqeAj8oYlX2 gHz7qwDpPautLnVmijMOK/HbbhxbPTpc7NbGGlJSAdyt0ZjyPlIt60+/E+yQ/6giPD9i VNk3JBUvvf7fWlVmW5DXSdf5FqqtO34OhCHyI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777568098; x=1778172898; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nSw+yolZYnlsfqzqQJDRiH90jYV8jI3JvmhNU4UgfQ8=; b=HSh8eAaQLCO/PVL7ZNQZsrdA1AGz0ac1KlI3FLfWWXoDjb0kSNcRWD8uwWTVSmly9D uOT7ZH5Qpm7NeQAqOf/G+N3VxctVEKnbQUMDZRqXJ37QVL83TczYiQf0QCJO77Jtux7y o5WW3fx+S3v0Mlg2U0WxZyLm9GkK7oz6u6b5Q9ZkkOm8B6b9gpwdRwq7wYpAZZqUIt1Z bIsScqnovEdLffMbJYG/7HM1rMupESn97wZgFr0s+6suCrGsAlAnvDtNIzAlVcavgugH P44l5I2z7O6siOTDbjDE3vK9GjVcR/VVoYwXfLQpsA2zWGso5kUvqebbDtvHoXtE1tE+ Vs6Q== X-Forwarded-Encrypted: i=1; AFNElJ8hwDtZ9b/8w6UWBcxDiSa5WLH3Y5V24Hsk4IERbTDQCw57Kgat84dKFvwQ6zmxfVDNKsKbt3W1ZaGxnPw=@vger.kernel.org X-Gm-Message-State: AOJu0YyppzlPer/pLCUK0VxnRFC0TxTqTuJ8eupPyulVQKo401EMYwqT OuQp8rhGJVBBnwtGisk0m44wCsConamM/KqpsdfLS9EPaGkK7FP4BjunftsXWHQT4bQ= X-Gm-Gg: AeBDiesocKb/SoXimrQflBagpCkNILkoHOgv5kQeKAK/hDN1v7UjsmeoeBiTgBRYfc5 qA2LcrL0mIBB0Ondt8rYhOy2se6tws7/D8xHvYm9UFOLRhDFatflMKKF5Ow337Ooi2MbR2c0fN2 mMDRfNYH/0WMbVG73OEossPfXNvz5MjObWpKryioeXmhBZZqDekpcBhCbxSeMOippdNDVhgufBg OMlZQWi4nTZ1VNrtyAC5d/mq/pXQar6bbrXFGfDu/G1OLAvwXt8ozD1wRVDyU7GrFICzFnvRWQE iSqwrgsYX9A5ueE0KByv3kzi/metCiO2jKw95o3wKYZf8XCYxsD4DX1EoQVQIo7QxciR6wqHffs 0fh7sCd8J/HMBIBY3aU8i17pxk++c/4tPzs/WV7N4bOngat5Qqrm2XlAQkLAI4RMlNWvu8Zsm67 GWekpOvBfgeOtpWqNab5UbXGL/2k//R3swAqgpHP0o1rXdo0XTntJ0X2SNLxdoCme8uhxsdsLJB qHA0YWuSVcqJv0rXPZMOSqYgqyX6wWbH6l1LGw3VuMy5zngbwCNwtSaDf7EeDefUvQiU1iUsmUV 16T3zyM8/W3g+7T40BUx5Jkp9UtJa0acyBDS X-Received: by 2002:a05:7301:6508:b0:2df:7b88:a1b0 with SMTP id 5a478bee46e88-2ed3e67ba53mr2079292eec.27.1777568097436; Thu, 30 Apr 2026 09:54:57 -0700 (PDT) Received: from [10.10.10.191] (97-120-253-104.ptld.qwest.net. [97.120.253.104]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2ee3b29b11fsm553662eec.19.2026.04.30.09.54.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Apr 2026 09:54:56 -0700 (PDT) From: Kris Bahnsen X-Google-Original-From: Kris Bahnsen Message-ID: <271d8aeb-1159-46f3-b290-31b6e094d8a0@embeddedTS.com> Date: Thu, 30 Apr 2026 09:54:53 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] Input: ads7846 - don't use scratch for tx_buf when clearing register To: Dmitry Torokhov Cc: Marek Vasut , stable@vger.kernel.org, Mark Featherston , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260427174657.691272-1-kris@embeddedTS.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Dmitry, On 4/29/26 12:19 PM, Dmitry Torokhov wrote: > On Mon, Apr 27, 2026 at 05:46:57PM +0000, Kris Bahnsen wrote: >> The workaround for XPT2046 clears the command register, giving the >> touchscreen controller a NOP. The change incorrectly re-uses the >> req->scratch variable which is used as rx_buf for xfer[5], so by >> the time xfer[6] occurs, the contents of req->scratch may not be >> 0. It was found that the touchscreen controller can end up in >> a completely unresponsive state due to it being given a command >> the driver does not expect. >> >> Instead, rely on the spi_transfer behavior of tx_buf being NULL to >> transmit all 0 bits. Also set rx_buf to NULL because the value >> returned does not matter. Thus moving the 3 byte pattern to clear >> the command register to a single message. > > Unfortunately my suggestion was flawed: I think this will flood the logs > with "Bufferless transfer has length %3". We need to have either tx or > rx buffer :( Ah. I do see that dev_err() line in spi_transfer_one_message(). All of my testing up to this point has been with an SPI host driver that implements its own transfer_one() operation so that error was never actually reached. I'll send a v3 today that reverts back to the two separate xfers, using scratch for the rx_buf, and then NULL for tx_buf. That sounds like that should be the path of least resistance. > > Thanks. > -- Kris Bahnsen Software Engineer embeddedTS