public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@nabladev.com>
To: Kris Bahnsen <kris@embeddedTS.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: stable@vger.kernel.org, Mark Featherston <mark@embeddedTS.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: ads7846 - don't use scratch for tx_buf when clearing register
Date: Sun, 26 Apr 2026 02:51:15 +0200	[thread overview]
Message-ID: <8ff84eba-0e6e-45ea-bdfe-fa934de9cfa6@nabladev.com> (raw)
In-Reply-To: <20260424192534.3504976-1-kris@embeddedTS.com>

On 4/24/26 9:25 PM, 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, moving the 3 bytes to a single message.
> 
> This change was tested on real TSC2046 and ADS7843 controllers,
> but not the XPT2046 the workaround was originally created for.
> Confirming that the original modification to clear the command
> register does not impact either real controller.
> 
> Fixes: 781a07da9bb94 ("Input: ads7846 - add dummy command register clearing cycle")
> Cc: stable@vger.kernel.org
> Co-developed-by: Mark Featherston <mark@embeddedTS.com>
> Signed-off-by: Mark Featherston <mark@embeddedTS.com>
> Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Tested-by: Marek Vasut <marex@nabladev.com> # XPT2046

  reply	other threads:[~2026-04-26  0:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 19:25 [PATCH] Input: ads7846 - don't use scratch for tx_buf when clearing register Kris Bahnsen
2026-04-26  0:51 ` Marek Vasut [this message]
2026-04-26  4:51 ` Dmitry Torokhov
2026-04-27 16:20   ` Kris Bahnsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ff84eba-0e6e-45ea-bdfe-fa934de9cfa6@nabladev.com \
    --to=marex@nabladev.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kris@embeddedTS.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@embeddedTS.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox