From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 5479D22D7A9 for ; Sat, 25 Jul 2026 04:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784953813; cv=none; b=F+VQDd8SVLH4p/G/rdap9Ub2EVgnMyexkT/7muGN92VDsUsQY5cQAUaRbuBwesmGge4GrEEJN4ONAsP5a67ljzECB5w21uNELzOJJVsHdbrIM3XwBCA4CCQ6GDAV9BGACbPb5JnSf4JLAeJ01GHz9wzOZUYEp8Z1ZA5WusJZ3LA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784953813; c=relaxed/simple; bh=musYvu4kG+XXqxnTHrbOaZuAwdan+yHB+92wfOCg1PM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sIB/eU7QK+LyfYmoMA4zI5/XwJuHmt2M5Vz6OrJya2rREVW9GqmTBWiEdASEJ3xptmWJ9cyS5APiXsblUyFevNMwQ2U681U2ljYIBdt1q67ec3eRxeUHwGyMfpDnAvFPVKk5DWj4QyJcXOvp1L5OV2DYhRu2hJY3DsTaTa5JmRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=maticrobots.com; spf=pass smtp.mailfrom=matician.com; dkim=pass (2048-bit key) header.d=maticrobots.com header.i=@maticrobots.com header.b=T01Dbcwk; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=maticrobots.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=matician.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=maticrobots.com header.i=@maticrobots.com header.b="T01Dbcwk" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-cb5b8572b70so899785a12.2 for ; Fri, 24 Jul 2026 21:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maticrobots.com; s=google; t=1784953812; x=1785558612; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=EjohzwxsJRfPbC2U2sWKg8g16sF/knZCZszVfz0+Kq4=; b=T01DbcwkuNOiALqPv+mOpI21gYOVK1xpEz1S+bRM6rv0uEvmgoYx4yKyuQxJNL8zCB Az+Fhd85wyBHkrgzCTw7eR+hKKtycilsh9nJAr+yTodGY9O/+MDnKSczCaqLPa61bCTk /n59kYtHnBcfUidvDj3qFQ2iAcZ+w0hWl2iVLd+NxJM5al9kgqyf5+5HO/Do2ZzDUzbf NVqi86z+jUKacxv+PWs+uWWSOBS3xsxdd9J0MLu0yaHGixOfminPKQ1oIbIdImcVgobo BtzEIhUfb2yFT698Dd4wobsOtsAKvMofkMj8UJZF4pf87R8nHffrOzWYV9Yfm97cF+wq CrTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784953812; x=1785558612; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EjohzwxsJRfPbC2U2sWKg8g16sF/knZCZszVfz0+Kq4=; b=lj1hn+O2FqRprNu3YlDvhnW1wF6lHe2J2rXvvaTH0Il1DetXhDgcu1MqT1qIhkK8o5 VT/HrLNyR09eFmNV2No0cX1b22fwydtQjRtNvJKCwUbYzFG0zonscLRSmCUq1YBlNkfO MISFDEzr8TWRBb0WDLhUB+g6VFPxBupXQlKVyrP2z0IE/StnCbEJw8s5s7Ka8nq5w544 xUWNiTyendV/KSk2S2UZf3pUWCeejgKQSrzXVUgmrd5LINw5NkJdCOrx2c3S7JTT6byl r/5hxJxsTBZcUtmDm/1GsDFXoCIIdrdZdOLj6KaT1MT2RdTmw8fojguH3GgckpFfzbn2 6ACw== X-Forwarded-Encrypted: i=1; AHgh+Rp34izFti0yMeSER6CmlGlVw5jgvA3tIXfBObl8pkRZXAAGPNQxuHxJl8s8Brzsxn+6BReMFx+IUkIalfE=@vger.kernel.org X-Gm-Message-State: AOJu0YyHOSXKMPJMHoQik6alw2kdxoCD7mQtRtRxrFXieejMs7PQEM1Z eXMDCN1l33wAAt+mvhz0mFWUSfLDMJrnIUT/N2Kqo9hEE7GEvLMjXFmxhjXzlgnNIao= X-Gm-Gg: AR+sD10ojMxj17A0uvmVw+e8LROyOJllWFB9vcpSpXxTEZ6io3XR1taFmmzeO6083CC 0GakKB4a9IwxYwm7tPlb9g3+wvxyoNHwdM5FpgQyMFcMXCVbM45Ap1ZJGMEyide4JihELhNUwC8 9Kil7wJkwuXJcetCwdOdYNGGqq/vTufpiw1T5ejH+CdkwzD+C8nh2dt7r4cjxu9vmMTZN7FrssO EML029MMmvf2V0n2v9IvUiXENW2VP2stcRgREMThOYkblW0rgPIoXTeNmFgfyBq89dayew0F8vp a+DZGATRuZzUgE9DJBRWQoZk5rsvmqcLjcIzTidqb/47bNYtvD14Eyey+Kmt57Vez1YjNY2eVq3 LOiGlF25Vi8y4ZC6vghTdoa+I6WzmdwKmbFaEXjKjCBofNDRBbe6FIdF8r7hQA3z6peDwenwd0q Fjo3VGIGSOWIMi2V0ivrCGZCGd0zcot0FxCwW3JAaNOr9YauMR5H4= X-Received: by 2002:a05:6a20:9f46:b0:3c4:46ca:3350 with SMTP id adf61e73a8af0-3c67dae9748mr1209444637.6.1784953811727; Fri, 24 Jul 2026 21:30:11 -0700 (PDT) Received: from abeMaticDesktop.1020marsh.offices.matician.com ([2600:1700:471:807f:da8a:3174:41e9:b949]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-314bc5a04b2sm5158361eec.28.2026.07.24.21.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 21:30:11 -0700 (PDT) From: Abraham Zukor To: Mark Brown , Laxman Dewangan Cc: Thierry Reding , Jonathan Hunter , linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Abraham Zukor Subject: [PATCH] spi: tegra114: initialize native chip selects inactive Date: Fri, 24 Jul 2026 21:29:44 -0700 Message-ID: <20260725042944.1204409-1-abe@maticrobots.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit tegra_spi_probe() initializes SPI_COMMAND1 with only SPI_M_S, leaving CS_POL_INACTIVE clear for every chip select. This drives every native active-low chip select low until tegra_spi_setup() runs for that device. SPI children are registered and probed one at a time. A synchronous probe of an earlier child can therefore transfer while a later child's chip select is still asserted. On a Tegra234 system with active-low devices on CS0 and CS1, this caused both devices to be selected when the CS1 device probed first. Its initialization then intermittently failed. A logic analyzer showed CS0 remained low throughout the CS1 transfer and went high only after the CS1 probe failed. The Tegra234 TRM also documents all CS_POL_INACTIVE bits as one after reset, so the existing probe code replaces the hardware's safe reset polarity with zeros on that SoC. Set CS_POL_INACTIVE for all native chip selects during controller probe. This matches SPI's default active-low polarity and the documented Tegra234 reset polarity. tegra_spi_setup() continues to configure the inactive polarity of SPI_CS_HIGH devices before their drivers probe. Fixes: f333a331adfa ("spi/tegra114: add spi driver") Assisted-by: Codex:GPT-5 Signed-off-by: Abraham Zukor --- drivers/spi/spi-tegra114.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index aa44ffd09e61..c28aae093d57 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -1394,7 +1394,7 @@ static int tegra_spi_probe(struct platform_device *pdev) reset_control_assert(tspi->rst); udelay(2); reset_control_deassert(tspi->rst); - tspi->def_command1_reg = SPI_M_S; + tspi->def_command1_reg = SPI_M_S | SPI_CS_POL_INACTIVE_MASK; tegra_spi_writel(tspi, tspi->def_command1_reg, SPI_COMMAND1); tspi->spi_cs_timing1 = tegra_spi_readl(tspi, SPI_CS_TIMING1); tspi->spi_cs_timing2 = tegra_spi_readl(tspi, SPI_CS_TIMING2); -- 2.54.0