From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (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 AC1EB3090C2 for ; Wed, 29 Apr 2026 19:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777490354; cv=none; b=d8B9JPsGufMNwPVzObZQhNHKdJi2RSmaY7J1zhi9XK4AkVyvCgd2is6ILqjsf43tKR1BK/2kWuM8ZUlsh3r5S5e1lX76J/boqakwxBkgZJ0ct6YzcS7SDl/sf0tz+KeMB+PcGOz+o7Lo7gPTfzduA4lwQk+GhKCgdK+/A0Pans4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777490354; c=relaxed/simple; bh=kE6z6ho481l3cRMIBg1rjaXuPr/oIN2dimR6vL3X4OM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aXBiY9UtvC6KjGQom/VsTNGfC3DGpLLwY2OYPHA3uApTablCsnh9DL/wEHeHcqiqAI8vbvaz8J8APd4QgRfxEqgNVuSlpHB8wSQBLsYxrH+bFDFCKjc1dBEQtREvHgOpb6LOXQq1P7Mpkz5sOfRhAjH/6Kt5XQF3vinm+gLYOcA= 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=JYSnVTNF; arc=none smtp.client-ip=74.125.82.48 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="JYSnVTNF" Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-12de530cbf1so353944c88.0 for ; Wed, 29 Apr 2026 12:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777490353; x=1778095153; 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=01rquaTt7d61QtrEpYATFjqsbMMGQjEoJs+Y2dcPj8w=; b=JYSnVTNFLCdlQ763sQtm2Wly08DJv6/hbybz83UsID4Jm5UOVq18R8wjWxg/RRMNEZ 4si19zKAJqBM4dKxIX+zGIHF+DHBRFSRwDyfDbqL6UvTvnG/SIGdCiGu0g1zuOmIJ3mW PWFwuoGLxmIzspyAx7vkpKW3PfrL319H/BrD8wcmvJc3NVn1+UmTbyCTiKfwbZLkgoAa CnVN/Nna8CYct1fwo9GIqkqb57n1g7sADA15x41Kguxay3l7Borf+ZtdLN0TFAF4u2Vv rHO/7tSrD/x2RMoaE2nN7vKdtH4syZpfT+qMJkU5iHYn5/0vE1B8Knn9Ahhr7HIL2ZcN bMOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777490353; x=1778095153; 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=01rquaTt7d61QtrEpYATFjqsbMMGQjEoJs+Y2dcPj8w=; b=oiUX5RTM3CvEQIinAkc0GTuxAa0zolg64wL7JuOQWG/7V/cqo9Zi0nKdbAPBKzonld TZnXqgqSk5l4n8WknIOQAlqDiDZqvAFETbjwj82Fwzv5DumY1RjSFwqatWD8GC8M50Xx dLrMryfHum82tjMThqViE94OFEJv+dhuEprE/gXUOcZ0Iqrcy4wLi7x8DcG81t0SHUij /i/3iN7xfbXONYT5E/2NZKG+h+pzIXcPvHvNRDOu4tZCb0hOGW5HZlaX0rsPxtFJSB/7 A2wS2HUkGHK7LWbKfTCuXk4O0LFtRWF9fbTbtLb/9G3FmUKtGznzDrhYaynyD3FaeL/E HPNQ== X-Forwarded-Encrypted: i=1; AFNElJ8KF6FUuR+zMfE98j44flRUVxCvVWKWChuH4jMuAjSpEcp5/xmMJNND6w2TVCq/GxOL+pCZdfvfNqIFWvg=@vger.kernel.org X-Gm-Message-State: AOJu0YwPmeL42PqV74632V1szg/Fsx1tuqg4kdgiih1JVliKjolhT4M5 FYCFziZDLzsnvC/jnBRJMKIRSp/5EpC4Q38ajnmDyOPMJ1ZKIKAp657a X-Gm-Gg: AeBDieuK2zURu5dQChoN2g4LVLH67VTRq5xjwlpAlRIpqlB+qgwcuFue3NKRX3PkXsg fpahYvL6wX0ZH/8pZrsbVvB8jinuwCy3P57pTHBYyJ417cwYQxmYbB9fVi3TiJWG/t/GWZui8Yx 0ijYklmhbMnWt6RF/7/uqgy6zDLUFTkeQMtMheaQtHyB9I39SmqzOrm9o6MjPJuDkZmIdBW7Ygi Q/JCC5XfW7UsWknM5AFK7dyude+WJTZMClf/sECWxQmjE7TloVNp8tr9Du/4+aGW4mwn8HlhnXP nqbATOuTjHnFN16Xfwzz37jc8KwrVIXo/f0pCaqTAuKH7AwHI1IQMuBRUTyurA4RZaf1d4jDz3Z Dw1EixgnOCatv3p/PJA8riqTjX+Om9vrR1pOnDrAjWDyKUwWoMVDieWjDzaPlKLpoLVsy4e1Gv2 hIbaEWb0DLhfUnkS4sEbB48qhrVwx5qB7E4pqD0OWoEcwNMLECxrhrjNKipoddXveMADZy5W8WT Kfkook0qUjy X-Received: by 2002:a05:7022:23a8:b0:12a:b3c4:c3b6 with SMTP id a92af1059eb24-12ddd984e39mr4038307c88.21.1777490352727; Wed, 29 Apr 2026 12:19:12 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:54e3:5ca2:4f82:c61]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm4929916c88.5.2026.04.29.12.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 12:19:12 -0700 (PDT) Date: Wed, 29 Apr 2026 12:19:09 -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 v2] Input: ads7846 - don't use scratch for tx_buf when clearing register Message-ID: References: <20260427174657.691272-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: <20260427174657.691272-1-kris@embeddedTS.com> 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 :( Thanks. -- Dmitry