From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 375ED27FB21; Sun, 7 Sep 2025 20:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757276095; cv=none; b=BuV7uO0erglMOW2jHk8df58lCpuy2H2fg8vWZaa96fC2v0togNIeCwgjsGLDO7KR5YsaA014m3x2PsaL6phQKwvEQuRrwz5S9OCo4JHiCj8bNrmMFLFX/YFNmFB5eayutB6VgAHbOoUPQoT22AcRI+6IJA2FrnauiI34ujsVVBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757276095; c=relaxed/simple; bh=QtSGXVZ0q1IzWyNZbslM7+g15VUBrgFb6yt1SlxLz/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UgqpBnbTUWr2P+oeDTKG/qBq9DnPe+hALRtMAQO/+0cL5WZ2yb+ZHQqJeU6tTN030dwk8rEy5GpoklluSUkoVlm2XsNPOjFg8KopRy40ruK2WVdGPI0UtO+0ookXpBAr9x3iCo0a2VV8PVT2i4i74q3AvN094wu1qVEdc7+GnHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Vzb8fGKB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Vzb8fGKB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8C8FC4CEF0; Sun, 7 Sep 2025 20:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757276095; bh=QtSGXVZ0q1IzWyNZbslM7+g15VUBrgFb6yt1SlxLz/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vzb8fGKBW2XyGEFAO2STwMRWlWN5JWIw2ilOPjcPbdUFOI1/v/tsByA1OWZlhJmJ8 aVBOa8EsnWW6OjHL6DY3RJhI1nZkhNKDcbVEoShbmS5Y+lPj2smA73+DqzUi5vP/5B rpU+2OyRBbOIKzPt+mKCpRt5lNO/bJkW0UKoO1n4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael Walle , Douglas Anderson , Sasha Levin Subject: [PATCH 5.15 60/64] drm/bridge: ti-sn65dsi86: fix REFCLK setting Date: Sun, 7 Sep 2025 21:58:42 +0200 Message-ID: <20250907195605.075066564@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195603.394640159@linuxfoundation.org> References: <20250907195603.394640159@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Walle [ Upstream commit bdd5a14e660062114bdebaef9ad52adf04970a89 ] The bridge has three bootstrap pins which are sampled to determine the frequency of the external reference clock. The driver will also (over)write that setting. But it seems this is racy after the bridge is enabled. It was observed that although the driver write the correct value (by sniffing on the I2C bus), the register has the wrong value. The datasheet states that the GPIO lines have to be stable for at least 5us after asserting the EN signal. Thus, there seems to be some logic which samples the GPIO lines and this logic appears to overwrite the register value which was set by the driver. Waiting 20us after asserting the EN line resolves this issue. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Signed-off-by: Michael Walle Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20250821122341.1257286-1-mwalle@kernel.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 1c9dd62d3c47b..1187bfb449f29 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -313,6 +313,17 @@ static int __maybe_unused ti_sn65dsi86_resume(struct device *dev) gpiod_set_value(pdata->enable_gpio, 1); + /* + * After EN is deasserted and an external clock is detected, the bridge + * will sample GPIO3:1 to determine its frequency. The driver will + * overwrite this setting in ti_sn_bridge_set_refclk_freq(). But this is + * racy. Thus we have to wait a couple of us. According to the datasheet + * the GPIO lines has to be stable at least 5 us (td5) but it seems that + * is not enough and the refclk frequency value is still lost or + * overwritten by the bridge itself. Waiting for 20us seems to work. + */ + usleep_range(20, 30); + /* * If we have a reference clock we can enable communication w/ the * panel (including the aux channel) w/out any need for an input clock -- 2.51.0