From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170]) (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 C67F9369D65 for ; Wed, 10 Jun 2026 22:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781131779; cv=none; b=jQyS793PxxrynggTLclKECna01qjdStHTr1RF/bKkuSqpJTdNv+yI8MSyjQxqn+7SQDHAM/N/T8IT3/kSjiagBZ33jG5PAhKH1u4gFFlQDJzXwv6OH5IZtXEpy82+2xPTu8UwRXPPiJKse+6uiskWjjpNas1sxIvWUA6dgCe1Kw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781131779; c=relaxed/simple; bh=8f/3NqncAopUkhQQ7pVzzHLYV7a2fGjbRa0tql4HClA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XkxDR3xFD6h9C2YYhkIffWTMqtiZeMSghX+4Og9qMuiAabDK6qsshjuQ10FMOeIeJCpDdJ+bUCAXdOcWdnES48/kxhdoWF08XePtfVbqJ+SiXv2nOFWKocKSwLxXVAYu9Sy6U1TtW8jbeFXX56OwWiNiZAwRGFpMzqzSOC81TSs= 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=KhN7oK/b; arc=none smtp.client-ip=74.125.82.170 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="KhN7oK/b" Received: by mail-dy1-f170.google.com with SMTP id 5a478bee46e88-3074adb8fcaso1812935eec.0 for ; Wed, 10 Jun 2026 15:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781131777; x=1781736577; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iI334LxgKLmlRyNgL8Ur4M9ac5DP95VOVSvPZmKZ8RU=; b=KhN7oK/b7a9RnLa9mMF37ZK+61y4EPpJqL/eyVcaOOi8WXls07hj/HNRoHXMc0TLv2 q1yN3KhGDnEuTziYHIHOhESubSuGRtGdqrfLmJwuQGt+ySMBlnV7KEG/rf3tijK4eZRa PueZi7+rCSNUtJqMUC+u7+qczgWuqThNgX5QehFr1eGeGs8ravUBC5gPlIR7Pt0yn9B+ ytYzLvNC6/1WlXASHQUIXM/LIisIZrdlL2dYk5GNBUs7oBJhjpYLOPSs304IAI5jq17a Vv/X59nrCo0YGwd1Gnv5aYro4rimJ5bOTHTxpTPbtMqT/HTcISaeqtUpkkYr5c46aMP9 viHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781131777; x=1781736577; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iI334LxgKLmlRyNgL8Ur4M9ac5DP95VOVSvPZmKZ8RU=; b=lHd29jwmZbyqPsEFbaB5C1KGQP1tPOQmz03oGGo6e6P4uApS0S+NpsloCxGcrBOQsW lAJc1A2rT7EYhab8uwaEcYGtOvOz8mtfa6y6Ga9tGw/S/2625/VleGqmoD8kIFWCg8N3 MyM2b8rtuYKgdNaKNhVCkQ6UPgI+Kze/lXOZumYVAWHsm9gwSD6mwi2xiGpSw7tN8Wbs KtPeKNT5MTkzS9zCFDI1625RxzMcztqbXjTJTq7Nvrgn9ZvyICgd0GsVYWlTBWx9+R9h lIvk5VFQ1AiyePLhUGlrLPOkXtZsMz6KbHzbRNlEhBk+WMZVnBGNHfXTkvUeur8uo29s 1ADQ== X-Forwarded-Encrypted: i=1; AFNElJ9smAU8IhaM2a0PBU14QVOs01mAIe4sbtwUs0FL22jC0O0YifUyUjDVh9d3UOI0Zoc7rwMLzyyIehDEIIQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyiCWenp8i7p1No0LpwfUKJX5qqp85WMvvVCWaCnewXBC5yvlJT L4Wpu0EvseDf3kcXeHnRfEggguCRGN2v5pln7ro+PxMIJ2qeezesnVKi X-Gm-Gg: Acq92OGJIwZKZhc3nKkKVxhjbKf205BfvDfsYBY5fDxmiKq94RX9+dCX5QwtQFoCmMA WLWUKe8U7YfJ2uTPkwoJ7CqOxx+0WnIOko6FWH2vO0IGEFZV4p92HrMYa74oLiMCltYaAjGuSBa MZ93K5c6CE7zzSBWYwhL7Ma2Uhtnn3npt627PnmEc2qmnH2X+GScMo0ruGQGMDLs+M95J9adTxt AkJsDL4woAJLxkfdBmjPl1QDVVWcPWzUB+f7mN17H9aCkZ07hGxEehPYe1zo8Kc6zbzAzN+dEWH yQtKT+jUqdsj34DrMBsNLTnVNvh75plFuBQQRlDADvIr1Yg96lIPG6Q9RkJdFmWVvqm4XjgwjSC G8t1wzdvHVNJrwg0Ei8iuhu2k7o74xSaZy9bLulx4q3okqd+U57Dd6RLwzTcJebtjeokzfwXSMu IEva+he77rEtFn1AFPQ8At4jOeSaiy2+xCpxIoX95GsjqNz2cPT9aCGvyPIVpByuNhhcGhRN4Y9 sA= X-Received: by 2002:a05:7301:9bc5:b0:307:3a6c:ecf4 with SMTP id 5a478bee46e88-3080465303emr215050eec.9.1781131776830; Wed, 10 Jun 2026 15:49:36 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:ae0e:e075:91c8:6570]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074df191d0sm39841199eec.21.2026.06.10.15.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 15:49:36 -0700 (PDT) Date: Wed, 10 Jun 2026 15:49:33 -0700 From: Dmitry Torokhov To: Kris Bahnsen Cc: Marek Vasut , stable@vger.kernel.org, Mark Featherston , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] Input: ads7846 - don't use scratch for tx_buf when clearing register Message-ID: References: <20260507164943.760009-1-kris@embeddedTS.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260507164943.760009-1-kris@embeddedTS.com> On Thu, May 07, 2026 at 04:49:43PM +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 and use the scratch variable for the rx_buf for > both the 1 byte command to and 2 byte response from the controller. > > Also relocates the scratch member of struct ser_req to force it > into a different cache line to prevent any potential issues of > DMA stepping on unrelated data in other struct members due to > sharing the same cache line. > > 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 > Signed-off-by: Mark Featherston > Signed-off-by: Kris Bahnsen Applied, thank you. -- Dmitry