From nobody Fri Apr 3 01:08:32 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 9B250363C5C for ; Mon, 9 Mar 2026 07:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773042795; cv=none; b=XVWuwTpS9OlEK6D2TcVjDkH7E5eiA9DS7N3N5mdzOPqGpdEFcFx89I+9wcw2W5VNBpuu3QnqARhMwK3gdVXJf3l8BN6tAxlZnBcCEKSGAOgDN6Yr124hgrfgUDS4uzpKysffLEefkkmkMpBJbcBjh8YVYzSPuFLcGTxoYZEHbQA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773042795; c=relaxed/simple; bh=BfCGLduhY9yG7QLq78Hh4dR6ZPzK4zm1QeyS8EzRSxY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EX2l5/XLfuz8e0cCFhQ+2EOjxXFo77nwLqE1MBV3z8n6S9u162jNW7EYHGKq5HwqMGX4wZTgqAHxaUtgCG1C2Jyxe1d2N1BdfSagM/iSGmwuB541b7jlrN+dQ4IIxlOhhDYnpd5zmjF1niRYGG8GJyoBUVP14ZR86zMmOl/jMBs= 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=I8JZtw2L; arc=none smtp.client-ip=209.85.128.51 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="I8JZtw2L" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-482f454be5bso113377315e9.0 for ; Mon, 09 Mar 2026 00:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773042793; x=1773647593; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4/vo+yztL0AmH8P24goXzbtezovr3DoQGmWB3EtlnhE=; b=I8JZtw2LZx739So3eBhwattFpRcM/xJeGX48zSgjcbsJ4loHtVOdhw27bOASyxg/QK iTJElJGMR++V4iLgpAZWCW/zXomiigO0SZ8/gMRcK8oxmgIf0kgU+KWmHwsqwJOhUmNl uYkLaZOJ+Bh6Xdp/V43EUH3/gjJev5BuQpLdOQoJxvIAbaQ3Iwl4rcpMfLenllXtPM6A FPYLJqp57ywk/1NyJWBqqIcyxgN7q46YmJOJZYHa8v5TSQ5Gh6n1zA6og5FF05Ilypsk Y2Cf9+Yfc3sAIpH0jsOktB6KCkSTyfEje314ySJM314l/v5k5CrskOmae8XN/rjuXdZ7 4ZPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773042793; x=1773647593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4/vo+yztL0AmH8P24goXzbtezovr3DoQGmWB3EtlnhE=; b=D5ncguNTVTWwvyKbEYRCU0U4O37Wesd+7hxkkkP81lSQAQFYpu5h+TudBQqh6inl4+ 99Yry+6unor+ryNClmOi2afWSHMIDvsCW9zGtb0x8/SatHh5yYvtqU4mTP5cIB0v9Rns aX+mN6nfjE503ifC+2Lz2XL2tWBrWhv9McWfAd9SfsMnPqyAPAKPLZmHUMpPbFxIDqWj F5L34YBOhe9CWr2XdHEUM8GR8VecmpMie0uG2bmmpLJUk6//igaNUuZaAXlh1oIo+Hde CRQ4ap9MAr7IPfcek5oG2AwXG1YwXSCt5cWC25RK4wO5avBKN/6dX3OWyqJEXGS64DHH 5oug== X-Forwarded-Encrypted: i=1; AJvYcCVyr8I/A597SpsI6VSEeDEesJbHVzQwSLKTXkQDBuyVmF/hkKgHrqoltBDVyCuUP0BwzFhwx1Sli7SYqxs=@vger.kernel.org X-Gm-Message-State: AOJu0YwAj459SEk7Ws/Y97BLX48u3JxrTC/bDEC8gOAZM0zWu2T4ooev D+88hq0PPwyhBOhFCGa6koUio7JUJru8+YayuG58Mp3pCzwrqM7P72hR X-Gm-Gg: ATEYQzyYnCwaljMTYEcGhlClRub+tDmCx44l2zcE7sB+SfNu4n103kJzOcDPc9MTyOX PWz0KsA1UvCOZrA3z5x27kUgcpZ+pAT4C1a9aRTAAI7WiwJ21/Z7oQAwd15i1lxzTSwKqgX+ZmT OevWIwm4XCO5y2juySAA8OsugaQwfC4KcBRDwS/KW+Um1NoyEnqTlx687pmnxTDIhFfrD4Z15nE Cq1YxHcclnOT+TYGZ+hCWjCkFfD6HJjoqQGpOAS4j/MOZmdJv8RoCEB6mEZqUnjqCp3AVSxZIVt p9gU2LkcyE1ag10Wl8UCLbpiOqGto7GDcY+t35XzTNVN9q0P9ftnsVX70/cFSpD4QOhP2sXZzyH QVyDydG8M9xpu+OfG1/TNqsbo2f5LnLsKbNsBYZYnRVBNPOCla06haYj9rg+acNIQy6j0NWIGaq rs2c1djuPKRiGG6DsW6OrvnQE= X-Received: by 2002:a05:600c:3f06:b0:485:3e00:944a with SMTP id 5b1f17b1804b1-4853e0094c8mr13491155e9.9.1773042792676; Mon, 09 Mar 2026 00:53:12 -0700 (PDT) Received: from xeon ([188.163.112.72]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485245dbd87sm97799975e9.16.2026.03.09.00.53.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 00:53:12 -0700 (PDT) From: Svyatoslav Ryhel To: Thierry Reding , Mikko Perttunen , David Airlie , Simona Vetter , Jonathan Hunter , Diogo Ivo , Svyatoslav Ryhel Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] drm/tegra: dsi: re-add clear enable register if DSI was powered by bootloader Date: Mon, 9 Mar 2026 09:52:48 +0200 Message-ID: <20260309075248.47730-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309075248.47730-1-clamor95@gmail.com> References: <20260309075248.47730-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Original commit b22fd0b9639e ("drm/tegra: dsi: Clear enable register if powered by bootloader") was added to address the issue of DSI being in an unknown state after the bootloader, ensuring correct panel configuration. This worked fairly well under the assumption that the bootloader had set up DSI; however, in cases where it did not, the device would hang because a DSI read was called before the DSI hardware was ready. Removing this workaround results in the issue described in the original fix: the panel initialization sequence fails and the panel gets stuck in an undefined state. This is especially noticeable with command mode panels In order to properly address this issue, the original workaround is restored and placed after the DSI hardware is prepared for R/W operations. This fixes behavior for both cases: where DSI is set by the bootloader and where DSI is untouched. I have tested this change on Tegra20 (Motorola Atrix 4G), Tegra114 (NVIDIA Tegra Note 7 and ASUS Transformer Pad TF701T), and Tegra124 (Xiaomi Mi Pad) with U-Boot, using both bootloader-initialized DSI and untouched DSI. Fixes: b22fd0b9639e ("drm/tegra: dsi: Clear enable register if powered by b= ootloader") Fixes: 660b299bed2a ("Revert "drm/tegra: dsi: Clear enable register if powe= red by bootloader"") Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- drivers/gpu/drm/tegra/dsi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index fbab10bc5c41..e7fdd8c7ac12 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -936,6 +936,15 @@ static void tegra_dsi_encoder_enable(struct drm_encode= r *encoder) return; } =20 + /* If the bootloader enabled DSI it needs to be disabled + * in order for the panel initialization commands to be + * properly sent. + */ + value =3D tegra_dsi_readl(dsi, DSI_POWER_CONTROL); + + if (value & DSI_POWER_CONTROL_ENABLE) + tegra_dsi_disable(dsi); + state =3D tegra_dsi_get_state(dsi); =20 tegra_dsi_set_timeout(dsi, state->bclk, state->vrefresh); --=20 2.51.0