From nobody Mon Sep 28 15:34:41 2026 Received: from mx.prosyst.ru (m2.prosoftsystems.ru [46.48.77.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C867241BA83 for ; Thu, 20 Aug 2026 12:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.48.77.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787227386; cv=none; b=f7DHKHUudaGACytGTXvtZY+NNs10aXTG5RSB8MVWD4iwDJ5dgKZWv/2G9SIZ4WrE0vDqzYH1ejwcQOoEZmqYhfbFhlhGKeDo1tD1xbgmmOm0MNILYvSc83KhBFEakxd6lEAbEvbtiHm5oVnKf43JteEdT51NduarA+9p6gNPoV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787227386; c=relaxed/simple; bh=K+OFDeNONFk68+UsZa4ZqYjKg9Y/e9AzlLz11Xc1dik=; h=Content-Type:From:To:CC:Subject:Date:Message-ID:MIME-Version; b=NB6TlpG1xFz0+0kiJsN7AMErHrOeyeqqWxMwFZLPeAu7OQv1z0sAua6uM8UFZyIeYVUEC4/sgBEIq0uiFYVhDRCcBT/iPwFrksKGcUlngbVLc4XvvKV76X4tTliYCUEsesvtrrJnIu7+inCZhUXVcD9of/speqalP45AiQrpLVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=prosoftsystems.ru; spf=pass smtp.mailfrom=prosoftsystems.ru; dkim=pass (2048-bit key) header.d=prosoftsystems.ru header.i=@prosoftsystems.ru header.b=ktKMGYOH; arc=none smtp.client-ip=46.48.77.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=prosoftsystems.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=prosoftsystems.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=prosoftsystems.ru header.i=@prosoftsystems.ru header.b="ktKMGYOH" Content-Language: ru-RU Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; d=prosoftsystems.ru; s=ps; c=relaxed/relaxed; t=1787227377; h=from:to:date:message-id:subject; bh=K+OFDeNONFk68+UsZa4ZqYjKg9Y/e9AzlLz11Xc1dik=; b=ktKMGYOHNoyR8FkZRU4r4PiLXDrF3VQpwHMKYUYq2ely9OnbhK3bxwVk2CPIqowMg8ZWKf3NWbx om8uvo1qJ8GTJp6X/1cLc1rU+h2vysT4/BnzF5FAuSui13sHmHGuWTtOy6diOjhjS6gKaZ064O909 NLxMGV5XeGE9UUusax98wVfQQAa6R0QRbQ/P1Mvu+YDDeXUJNdcredQn9TMLqqzvArhzCR8pvarRe CVnijqwW36POLere//G+h+LE92w0nHB8YfLJwAYtg/sciD+q+pgXFoKPE24T1efI1Km3IqA9PFbZu s7M4BGiBV1Y7qWVp4ZxARhuv0hwRm5kosC5A== Received: from echo-2.prosoft.ural.ru (172.21.245.22) by mx.prosoftsystems.ru (172.21.240.33) with Microsoft SMTP Server (TLS) id 15.1.396.30; Thu, 20 Aug 2026 17:02:57 +0500 Received: from echo-2.prosoft.ural.ru (172.21.245.22) by echo-2.prosoft.ural.ru (172.21.245.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Thu, 20 Aug 2026 17:02:57 +0500 Received: from echo-2.prosoft.ural.ru ([fe80::8f12:4f85:56d8:13ed]) by echo-2.prosoft.ural.ru ([fe80::8f12:4f85:56d8:13ed%17]) with mapi id 15.02.1748.039; Thu, 20 Aug 2026 17:02:57 +0500 From: =?utf-8?B?0JbQsNC80LHQsNC60LjQtdCyINCg0LDQtNC40Lkg0KDQuNC60LDRgNC00Lg=?= =?utf-8?B?0L3QvtCy0LjRhw==?= To: "andrzej.hajda@intel.com" CC: "rfoss@kernel.org" , "Laurent.pinchart@ideasonboard.com" , "mripard@kernel.org" , "tzimmermann@suse.de" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" , "tomi.valkeinen@ti.com" , "maarten.lankhorst@linux.intel.com" , "simona@ffwll.ch" , "dri-devel@lists.freedesktop.org" , "luca.ceresoli@bootlin.com" , "jonas@kwiboo.se" , "andrew.smirnov@gmail.com" , "airlied@gmail.com" , "neil.armstrong@linaro.org" , "jernej.skrabec@gmail.com" Subject: [PATCH] drm/bridge: tc358767: check regmap_write() return values Thread-Topic: [PATCH] drm/bridge: tc358767: check regmap_write() return values Thread-Index: AQHdMJvWCHWQCzrAakOY6ZnTySZXuQ== Date: Thu, 20 Aug 2026 12:02:57 +0000 Message-ID: Accept-Language: ru-RU, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 commit 6d0c38315915 ("drm/bridge: tc358767: Drop custom tc_write()/tc_read() accessors") replaced the tc_write() macro, which bailed out on failure, with direct regmap_write() calls. At three sites the error check was not carried over, so the return value is overwritten before it is ever examined: The DP0_VIDSYNCDELAY write in tc_set_edp_video_mode(), and both DP_PHY_CTRL writes in the main link PHY reset sequence in tc_main_link_enable(), whose error is clobbered by the following PHY_RDY poll. As a result, failed I2C transactions to the bridge are silently ignored. A failed DP0_VIDSYNCDELAY write can leave the stream running with stale THRESH_DLY and VID_SYNC_DLY values, causing display corruption without any error being reported. A failed PHY reset sequence can leave the main link PHY in reset; the PHY_RDY poll may still succeed because the bit was set during the initial AUX link setup, so link training proceeds on a bad PHY, or the real I2C error is masked by a misleading "timeout waiting for phy become ready". Propagate the errors instead. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 6d0c38315915 ("drm/bridge: tc358767: Drop custom tc_write()/tc_read() accessors") Cc: stable@vger.kernel.org Signed-off-by: Radiy Zhambakiev --- drivers/gpu/drm/bridge/tc358767.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7188935fdb82..d6b62546fed0 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1014,6 +1014,8 @@ static int tc_set_edp_video_mode(struct tc_data *tc, ret =3D regmap_write(tc->regmap, DP0_VIDSYNCDELAY, FIELD_PREP(THRESH_DLY, max_tu_symbol) | FIELD_PREP(VID_SYNC_DLY, vid_sync_dly)); + if (ret) + return ret; =20 ret =3D regmap_write(tc->regmap, DP0_TOTALVAL, FIELD_PREP(H_TOTAL, mode->htotal) | @@ -1144,9 +1146,14 @@ static int tc_main_link_enable(struct tc_data *tc) /* Reset/Enable Main Links */ dp_phy_ctrl |=3D DP_PHY_RST | PHY_M1_RST | PHY_M0_RST; ret =3D regmap_write(tc->regmap, DP_PHY_CTRL, dp_phy_ctrl); + if (ret) + return ret; + usleep_range(100, 200); dp_phy_ctrl &=3D ~(DP_PHY_RST | PHY_M1_RST | PHY_M0_RST); ret =3D regmap_write(tc->regmap, DP_PHY_CTRL, dp_phy_ctrl); + if (ret) + return ret; =20 ret =3D tc_poll_timeout(tc, DP_PHY_CTRL, PHY_RDY, PHY_RDY, 500, 100000); if (ret) { --=20 2.53.0