From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6ED0606A31C for ; Mon, 30 Nov 2026 12:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Z/h7DSJi Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33DF510E263; Mon, 30 Nov 2026 12:12:03 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3FF110E263 for ; Mon, 30 Nov 2026 12:11:56 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 52CDA61FA0; Mon, 30 Nov 2026 12:11:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6A171F000C1; Mon, 30 Nov 2026 12:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796040715; bh=3D0Cbgc80LXXLqirmOIUpfUJWHM8CJ5+I+YK3AihZhc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Z/h7DSJiSvST1MKGh0otgJTaHl5sCQTwxqkc7+XSra3qAsqLtSveoDO2AyC3A27rX wABdfLT3CASCP0YOE+fi0MwQhKzVz8QQJvzQyqIQJjm8C+6QfX9d05zOv592k19JB/ xWFlRr8L0mpeghmpmdyYil9l45c6dbVTgMNK1YB/JcaUp9BDFinRvjUZ/B8cOUOXxz tUbpfVyKIisXrIxgrhuHrmPAptdG+k6R/vJQVj4KkXKX1BkzkG1oXYrsDXLtq3XNVY vgKWIOOymyd1ZduBDz2pMjOCJt0dZDgWzpe4+k8WhEaYSb+JReGAs0nF8vKPa38+Fp l1DmzuBz5d9lQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v9 13/13] drm/tegra: Add support for 8-bit CPU interface To: "Svyatoslav Ryhel" Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261130114155.72920-14-clamor95@gmail.com> References: <20261130114155.72920-1-clamor95@gmail.com> <20261130114155.72920-14-clamor95@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 12:11:55 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] drm/tegra: duplicate and out-of-order next_bridge enable/disable calls - [Medium] drm/tegra: unconditional PIN_LDC muxing in tegra_dbi_atomic_enable() -- commit 38f73e44f1c5bf7df4c07a00d683e9382cb4da10 Author: Svyatoslav Ryhel drm/tegra: Add support for 8-bit CPU interface This commit adds a DRM bridge and MIPI DBI host driver for the Tegra20/30 display controller's 8-bit CPU interface to transfer MIPI DCS commands before switching the pins to RGB scanout. > diff --git a/drivers/gpu/drm/tegra/dbi.c b/drivers/gpu/drm/tegra/dbi.c > new file mode 100644 > index 0000000000000..a33e2c1147122 > --- /dev/null > +++ b/drivers/gpu/drm/tegra/dbi.c [ ... ] > +static void tegra_dbi_atomic_enable(struct drm_bridge *bridge, > + struct drm_atomic_commit *state) > +{ > + struct tegra_dbi_priv *priv =3D bridge_to_tegra_dbi(bridge); > + struct drm_bridge *next_bridge =3D priv->next_bridge; > + struct tegra_dc *dc =3D priv->dc; > + u32 value, reg_idx; > + int ret; [ ... ] > + /* > + * Set the LDC pin to V Pulse 1. The secondary interface may require > + * LVP0 to be set to function 6 (V Pulse 1), but this is not confirmed. > + * TODO: parameterize this if needed. > + */ > + reg_idx =3D PIN_SELECT_REGISTER_INDEX(PIN_LDC); > + value =3D tegra_dc_readl(dc, DC_COM_PIN_OUTPUT_SELECT(reg_idx)); > + value &=3D ~PIN_OUTPUT_SELECT_MASK(PIN_SELECT_SHIFT(PIN_LDC)); > + value |=3D PIN_OUTPUT_SELECT_F4(PIN_SELECT_SHIFT(PIN_LDC)); > + tegra_dc_writel(dc, value, DC_COM_PIN_OUTPUT_SELECT(reg_idx)); [Severity: Medium] Does this break per-frame D/C signaling when the secondary interface (nvidia,interface =3D <1>) is selected? tegra_dc_dbi_probe() accepts both interface 0 (where dc_pin is PIN_LDC) and interface 1 (where dc_pin is PIN_LVP0), but tegra_dbi_atomic_enable() unconditionally muxes V_PULSE1 onto PIN_LDC before saving tegra_dbi_pin_regs[] into com_pin_backup. When interface 1 is used, PIN_LDC is clobbered while PIN_LVP0 in DC_COM_PIN_OUTPUT_SELECT(4) keeps the PIN_OUTPUT_SELECT_OUT setting programmed by tegra_rgb_encoder_enable(), leaving PIN_LVP0 in static GPIO output mode once com_pin_backup is restored for active scanout. [ ... ] > + /* Unshadow to set up command and data pins */ > + tegra_dc_writel(dc, WRITE_MUX | READ_MUX, DC_CMD_STATE_ACCESS); > + > + tegra_dbi_init_interface(priv); > + priv->active =3D true; > + > + /* > + * DBI requires that the next bridge be enabled here in order to > + * send DCS commands, since the interface pins will subsequently be > + * reconfigured for video data. > + * > + * Using the prepare_prev_first flag in the panel will not work, > + * because the DBI bridge requires the panel to be enabled beforehand > + * for proper configuration. > + */ > + if (next_bridge && next_bridge->funcs && next_bridge->funcs->atomic_ena= ble) > + next_bridge->funcs->atomic_enable(next_bridge, state); > + > + tegra_dbi_pin_set(dc, priv->interface->cs_pin, 0); > + > + priv->active =3D false; > + > + tegra_dc_writel(dc, 0, DC_CMD_STATE_ACCESS); > + > + for (int i =3D 0; i < ARRAY_SIZE(tegra_dbi_pin_regs); i++) > + tegra_dc_writel(dc, priv->com_pin_backup[i], > + tegra_dbi_pin_regs[i]); > + > + tegra_dc_commit(dc); > + > + value =3D tegra_dc_readl(dc, DC_CMD_DISPLAY_COMMAND); > + value &=3D ~DISP_CTRL_MODE_MASK; > + value |=3D DISP_CTRL_MODE_C_DISPLAY; > + tegra_dc_writel(dc, value, DC_CMD_DISPLAY_COMMAND); > +} > + > +static void tegra_dbi_atomic_disable(struct drm_bridge *bridge, > + struct drm_atomic_commit *state) > +{ > + struct tegra_dbi_priv *priv =3D bridge_to_tegra_dbi(bridge); > + struct drm_bridge *next_bridge =3D priv->next_bridge; > + struct tegra_dc *dc =3D priv->dc; > + int ret; > + > + for (int i =3D 0; i < ARRAY_SIZE(tegra_dbi_pin_regs); i++) > + priv->com_pin_backup[i] =3D tegra_dc_readl(dc, tegra_dbi_pin_regs[i]); > + > + ret =3D tegra_dbi_stop_dc(priv); > + if (ret) > + return; > + > + tegra_dc_writel(dc, WRITE_MUX | READ_MUX, DC_CMD_STATE_ACCESS); > + > + tegra_dbi_init_interface(priv); > + priv->active =3D true; > + > + /* > + * DBI requires that the next bridge be disabled here in order to > + * send DCS commands, since the interface pins will subsequently be > + * reconfigured for video data and tegra_rgb_encoder_disable() will > + * be called before drm_panel_unprepare() runs in post_disable. > + */ > + if (next_bridge && next_bridge->funcs && next_bridge->funcs->atomic_dis= able) > + next_bridge->funcs->atomic_disable(next_bridge, state); [Severity: High] As reported by Mikko Perttunen on v5 [1], does manually calling next_bridge->funcs->atomic_enable() and atomic_disable() cause duplicate and out-of-order execution with drm_atomic_bridge_chain_enable() and drm_atomic_bridge_chain_disable()? Because tegra_dbi_attach() attaches priv->next_bridge to encoder->bridge_chain, the DRM bridge helpers already walk both bridges: 1. On enable, drm_atomic_bridge_chain_enable() calls tegra_dbi_atomic_enable() (which manually runs next_bridge->funcs->atomic_enable() while priv->active is true) and then advances to next_bridge and calls its atomic_enable() a second time while priv->active is false, triggering the "Skipping enable of already enabled panel" warning in drm_panel_enable(). 2. On disable, drm_atomic_bridge_chain_disable() walks encoder->bridge_chain in reverse order and calls next_bridge->funcs->atomic_disable() before tegra_dbi_atomic_disable() has stopped the DC, configured the pins for DBI output, or set priv->active =3D true. During that first call, tegra_dbi_dbi_command() rejects every DCS shutdown command with -ENODEV while the panel driver still runs its msleep() delays; tegra_dbi_atomic_disable() then runs next_bridge->funcs->atomic_disable() a second time. [1] https://lore.kernel.org/r/weWUeY3nRGCfNVcl2RuY5g@nvidia.com --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130114155.7292= 0-1-clamor95@gmail.com?part=3D13