From nobody Mon Feb 9 17:56:37 2026 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 4FCE6155333 for ; Sun, 26 Jan 2025 19:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918979; cv=none; b=oHyh7kACnC/LfBkXyQvqnVnh1FMFiy+6piIMNeE7LPT91mqnsstGtaqE4nOmjjdkT/mSrdtgu0g97bmgRWoBbwS82OdvaEDiqIGPPanfrmsRFl8Q7Y22BaWFFIPBL/pFLKij2L09h24CwqfTn80HTtpfoQ/kNrTMmcgGNycaE+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918979; c=relaxed/simple; bh=nd4N27lZQNQwDvRtUxv3HZPuGRESGf9+SxxKOC4pgOg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WUxAt9QJQQqLFWfSv3ht7FAiYAAA9sCUcolDJHKRI8wph1HIk18BXN3coKNwUauGmOt2H6EI7XPUs/heP895SEMmyblknopNb9J0ceRioz218EdCtbKdIB3zIa+hcqwzNFV9MIAE8K5rOUL3BDrjZSs9VQ/0pGuZam6RCJwuIlk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Y1WOWEDF; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Y1WOWEDF" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737918969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PItqxAwYwkayk7bfYlkSjBJzxHJLNqrKMo5mzEUqZVs=; b=Y1WOWEDFXO3F2VDC1ZlFdl2KuGIjt4NxFBS5EjIKaXdQp0WEIKRW2Ydx9MlyEuxl0VxgXl iB9ak5630cx35GUsiQ4pZLcuahH996PLsoAPiiWbbe6isMrloViWTHTKSd/VV5k7u4BU6J x1YWM1RAWHb/JRsL2hLpXjWO5aSO5UA= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia , Stable List Subject: [PATCH v8 01/13] drm/bridge: cdns-dsi: Fix connecting to next bridge Date: Mon, 27 Jan 2025 00:45:39 +0530 Message-Id: <20250126191551.741957-2-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Fix the OF node pointer passed to the of_drm_find_bridge() call to find the next bridge in the display chain. The code to find the next panel (and create its panel-bridge) works fine, but to find the next (non-panel) bridge does not. To find the next bridge in the pipeline, we need to pass "np" - the OF node pointer of the next entity in the devicetree chain. Passing "of_node" to of_drm_find_bridge (which is what the code does currently) will fetch the bridge for the cdns-dsi which is not what's required. Fix that. Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver") Cc: Stable List Reviewed-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index c7a0247e06ad..2f897ea5e80a 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -952,7 +952,7 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, bridge =3D drm_panel_bridge_add_typed(panel, DRM_MODE_CONNECTOR_DSI); } else { - bridge =3D of_drm_find_bridge(dev->dev.of_node); + bridge =3D of_drm_find_bridge(np); if (!bridge) bridge =3D ERR_PTR(-EINVAL); } --=20 2.34.1 From nobody Mon Feb 9 17:56:37 2026 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 A27D2175D4F for ; Sun, 26 Jan 2025 19:16:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918987; cv=none; b=GPXTkXx2PO+nfiblw9VFyjeb3zb0H+abBG15XD7Y060mIYaiRGcx+p04SRkK6seoRLrr/zs/l5xT/6/4wiHifSKyY4T0+DUIrvV3GMrZTd3sJRr0kBqrSgztGV4ghdNeUImyT9QPVTOKXkuFpJdbUzTDL2F/4APb6IES9JkZ2Yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918987; c=relaxed/simple; bh=hPHcB4dKWUzFtW6o7dJU7ENTugLBqBWL9XKh6PQpa2s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UhWv+GnNep8pniSv4kmsauLle4+4mrFGIyQ07MWbNlmdGG1vdNWlUxDNfCK+GYNUw0uIGrNwpKPLJ6s7hoKqonksrOa+urB9F0XllZOpn+EksBnC6s2oMFgw9v24ISp32JmuEWH27Ktf2882MMmMfEgHaxt3UzT8yQwD1JYGvcM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ItEduPE4; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ItEduPE4" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737918978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SVQl+/Q/FRo9O752Ko3yMLZpaSxtIIZ7yHyHN2KPnws=; b=ItEduPE4jLQ7A1R5Ofr7aJr1zOTJe1BmDVZ/bLOWfLufHVniPaDR4tnC2JaOWtFt/Gd0sW khcCZiaGuu6l6IU+HM1b4fFqCvLsIea/eH88qFNMx+hwRu4QmVGFQYw7uH1ZIk9TEzC8C9 KumZNmyLcIi0kFigma/gmN50LcW+k6Y= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia , Stable List Subject: [PATCH v8 02/13] drm/bridge: cdns-dsi: Fix phy de-init and flag it so Date: Mon, 27 Jan 2025 00:45:40 +0530 Message-Id: <20250126191551.741957-3-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia The driver code doesn't have a Phy de-initialization path as yet, and so it does not clear the phy_initialized flag while suspending. This is a problem because after resume the driver looks at this flag to determine if a Phy re-initialization is required or not. It is in fact required because the hardware is resuming from a suspend, but the driver does not carry out any re-initialization causing the D-Phy to not work at all. Call the counterparts of phy_init() and phy_power_on(), that are phy_exit() and phy_power_off(), from _bridge_post_disable(), and clear the flags so that the Phy can be initialized again when required. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Cc: Stable List Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia Reviewed-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 2f897ea5e80a..b0a1a6774ea6 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -680,6 +680,11 @@ static void cdns_dsi_bridge_post_disable(struct drm_br= idge *bridge) struct cdns_dsi_input *input =3D bridge_to_cdns_dsi_input(bridge); struct cdns_dsi *dsi =3D input_to_dsi(input); =20 + dsi->phy_initialized =3D false; + dsi->link_initialized =3D false; + phy_power_off(dsi->dphy); + phy_exit(dsi->dphy); + pm_runtime_put(dsi->base.dev); } =20 @@ -1152,7 +1157,6 @@ static int __maybe_unused cdns_dsi_suspend(struct dev= ice *dev) clk_disable_unprepare(dsi->dsi_sys_clk); clk_disable_unprepare(dsi->dsi_p_clk); reset_control_assert(dsi->dsi_p_rst); - dsi->link_initialized =3D false; return 0; } =20 --=20 2.34.1 From nobody Mon Feb 9 17:56:37 2026 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 A367418C03D; Sun, 26 Jan 2025 19:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918996; cv=none; b=bHguZVEmHb/WH34TOp9mbti436+rIcTkzQgYOqG6Xg0U9hCjRoqScjtvwb6swr2INCU+e+zAlwln/eR4Z4jy7fhVlQYzfLXrPKwYm7OKgEpl9fiaIJ0t67pqz07rQJqJkcJ2PBJJq1UYG4e3heWS/Br4JiEWTkpL573hCkOw4Z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737918996; c=relaxed/simple; bh=N9DM0KjNx4iDB4r0QNh7DJ+PDydJZOYkCWFk10H5HFw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Z28TLxg7luVYd2lbbp9jbSUZ1lK7vgYbKqmzGXGhDHmdliKbNXTdn1b4huQuaYAGakPA7Lam2I6s2J6GqafFZz9BD3Bar1FnYBkWJtwBSvd0B9C0GeTg7mBIZSrrSbljwkgeU6usQcyNNij+34oZmWHInPYzufvXVNGHV3WnBPE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Gwr0vj3i; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Gwr0vj3i" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737918987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n+Q6zfVhzhKUmuVVVzbJtveMGdbJJ8wyFdxvA6lkWj8=; b=Gwr0vj3i+NxX5DKkLHHJsPaJGXKxGR2pMOSbKGnqF+xxHOtqkV2ZvUaKdYmfPYLNw4Z0z8 Kdp27Iw0P6Vw8l/Q6Pu2jbufirN7V73r7xN4Ew1BBtjXJCSh9ncBCJ6C6sMSCIQQ1U7a7e 2GPkfkZkIjCRp1qeY1Cv41U4HLBWYeo= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia , Stable List Subject: [PATCH v8 03/13] drm/bridge: cdns-dsi: Fix the clock variable for mode_valid() Date: Mon, 27 Jan 2025 00:45:41 +0530 Message-Id: <20250126191551.741957-4-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia The crtc_* mode parameters do not get generated (duplicated in this case) from the regular parameters before the mode validation phase begins. The rest of the code conditionally uses the crtc_* parameters only during the bridge enable phase, but sticks to the regular parameters for mode validation. In this singular instance, however, the driver tries to use the crtc_clock parameter even during the mode validation, causing the validation to fail. Allow the D-Phy config checks to use mode->clock instead of mode->crtc_clock during mode_valid checks, like everywhere else in the driver. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Cc: Stable List Reviewed-by: Tomi Valkeinen Reviewed-by: Dmitry Baryshkov Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index b0a1a6774ea6..19cc8734a4c8 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -568,13 +568,14 @@ static int cdns_dsi_check_conf(struct cdns_dsi *dsi, struct phy_configure_opts_mipi_dphy *phy_cfg =3D &output->phy_opts.mipi_d= phy; unsigned long dsi_hss_hsa_hse_hbp; unsigned int nlanes =3D output->dev->lanes; + int mode_clock =3D (mode_valid_check ? mode->clock : mode->crtc_clock); int ret; =20 ret =3D cdns_dsi_mode2cfg(dsi, mode, dsi_cfg, mode_valid_check); if (ret) return ret; =20 - phy_mipi_dphy_get_default_config(mode->crtc_clock * 1000, + phy_mipi_dphy_get_default_config(mode_clock * 1000, mipi_dsi_pixel_format_to_bpp(output->dev->format), nlanes, phy_cfg); =20 --=20 2.34.1 From nobody Mon Feb 9 17:56:37 2026 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 E04D9188733 for ; Sun, 26 Jan 2025 19:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919006; cv=none; b=VqjGEDqovHwaFjksq9NnHQnek6kcsSLSZRaMaxNECbOwBMsvtsZTONbLg4T5X5E0jdqav/bnQJAC1R95QnJQnd+DD1uSRJe5A1E5eOjTUABGyg0JCgTfMU65alTCRQz8H2G8rNyve9Fi2IgmJxGCPnjFedFB43Q2jmWCmYeYK8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919006; c=relaxed/simple; bh=kWFwJhAkccU7aKB3JtXVRSHN7Q0Eq0LEAQpIBvDCGFI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XOTGxSsRV13AgMltSv2WKST4JoPWkRZ/qX0HBCR8YDQSKq+9P2OPJGsq8DUMkmkwmkno8Xl3LqKx6Vwdl6qAfpEeq/F/2b3Los7igeWKAkZcHAOAJlQbJ+/FtfocNtdBSzhIUFvzh5NfrYsuP2pW/FG1W6R6V3focsufjOxTrTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Dt/fXxCR; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Dt/fXxCR" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737918996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MJQ5JyPH1JLa8mRMcAzP7MxWc1bNNTJLd+qPMpGZOdI=; b=Dt/fXxCRawwS23a0uNZGkjhL2jGAEu2e+epzNTBoxc7pCWMIbMp161aAUEytwMA0/VnRCJ 88RHWCfo3NKgRBCCDJY8rkQ+GVREE1HWz33MlzsBF8gs6KVBwxPvJdFTusj5vLp0aaIl6+ pSf1q839ku9WEU9UFY0BLotRMJNPI3M= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia , Stable List Subject: [PATCH v8 04/13] drm/bridge: cdns-dsi: Check return value when getting default PHY config Date: Mon, 27 Jan 2025 00:45:42 +0530 Message-Id: <20250126191551.741957-5-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Check for the return value of the phy_mipi_dphy_get_default_config() call, and incase of an error, return back the same. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Cc: Stable List Reviewed-by: Tomi Valkeinen Reviewed-by: Dmitry Baryshkov Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 19cc8734a4c8..87921a748cdb 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -575,9 +575,11 @@ static int cdns_dsi_check_conf(struct cdns_dsi *dsi, if (ret) return ret; =20 - phy_mipi_dphy_get_default_config(mode_clock * 1000, - mipi_dsi_pixel_format_to_bpp(output->dev->format), - nlanes, phy_cfg); + ret =3D phy_mipi_dphy_get_default_config(mode_clock * 1000, + mipi_dsi_pixel_format_to_bpp(output->dev->format), + nlanes, phy_cfg); + if (ret) + return ret; =20 ret =3D cdns_dsi_adjust_phy_config(dsi, dsi_cfg, phy_cfg, mode, mode_vali= d_check); if (ret) --=20 2.34.1 From nobody Mon Feb 9 17:56:37 2026 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 0F814188733 for ; Sun, 26 Jan 2025 19:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919013; cv=none; b=Zqu/ZGzktkjZO+IaTuiMo4NrK+8c1jEOOm47xu9jjESturAGUj0osoKeOpfbzUqEQ1yZAsdYl5r13/dgsrk6tCzUY6FiuBNr4VL1JlRdkrzLTt8aEXZT3VAzUmnoKe6aD8LbP/VKENRPVpISZd/Y42jJedGPxs/ZZK12ihnExVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919013; c=relaxed/simple; bh=QK2mNIgVfgFqU32KvW7t+F3B7NGbIMX4zcWrWdXkBq4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=immVVivFkNcwIthbRa9Yc3cLCL0xc9got+rswcJCLMU0ifC8iBSpAEIn9y3h6Op5uzkJo3DY+BPRGlGTyGEVn//ZkfB8/JbhUbrtNf1fCvC+a6VCwVte92uYQwZxpUnMQGKMpBS3vW0IqRFUfVqkmz6qzo2WZwV6U51jQ1IuIac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=XhIxK4nq; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="XhIxK4nq" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737919006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PU/avQ9TlPjvpr9AxfIB/9oT6G3IkCBy26F4yeJbMvs=; b=XhIxK4nq91yBE8yjZQH7dhUzoVFR82f0YBprwkHjW/QYFmcia4g0P4mqO7cB+xC0PEe1fj EA9BWIZsyr7VRZFZfnx5O/yc+4x5t3eCpCkgSnlX/yjJqDgx43vkFqDiRnsoIQkagjg+Ha 3DC7Bkvbgr8f/DJqx+xMdz4THbApSnY= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia , Stable List , Dominik Haller Subject: [PATCH v8 05/13] drm/bridge: cdns-dsi: Wait for Clk and Data Lanes to be ready Date: Mon, 27 Jan 2025 00:45:43 +0530 Message-Id: <20250126191551.741957-6-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Once the DSI Link and DSI Phy are initialized, the code needs to wait for Clk and Data Lanes to be ready, before continuing configuration. This is in accordance with the DSI Start-up procedure, found in the Technical Reference Manual of Texas Instrument's J721E SoC[0] which houses this DSI TX controller. If the previous bridge (or crtc/encoder) are configured pre-maturely, the input signal FIFO gets corrupt. This introduces a color-shift on the display. Allow the driver to wait for the clk and data lanes to get ready during DSI enable. [0]: See section 12.6.5.7.3 "Start-up Procedure" in J721E SoC TRM TRM Link: http://www.ti.com/lit/pdf/spruil1 Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver") Cc: Stable List Tested-by: Dominik Haller Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 87921a748cdb..6a77ca36cb9d 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -769,7 +769,7 @@ static void cdns_dsi_bridge_enable(struct drm_bridge *b= ridge) struct phy_configure_opts_mipi_dphy *phy_cfg =3D &output->phy_opts.mipi_d= phy; unsigned long tx_byte_period; struct cdns_dsi_cfg dsi_cfg; - u32 tmp, reg_wakeup, div; + u32 tmp, reg_wakeup, div, status; int nlanes; =20 if (WARN_ON(pm_runtime_get_sync(dsi->base.dev) < 0)) @@ -786,6 +786,19 @@ static void cdns_dsi_bridge_enable(struct drm_bridge *= bridge) cdns_dsi_hs_init(dsi); cdns_dsi_init_link(dsi); =20 + /* + * Now that the DSI Link and DSI Phy are initialized, + * wait for the CLK and Data Lanes to be ready. + */ + tmp =3D CLK_LANE_RDY; + for (int i =3D 0; i < nlanes; i++) + tmp |=3D DATA_LANE_RDY(i); + + if (readl_poll_timeout(dsi->regs + MCTL_MAIN_STS, status, + (tmp =3D=3D (status & tmp)), 100, 500000)) + dev_err(dsi->base.dev, + "Timed Out: DSI-DPhy Clock and Data Lanes not ready.\n"); + writel(HBP_LEN(dsi_cfg.hbp) | HSA_LEN(dsi_cfg.hsa), dsi->regs + VID_HSIZE1); writel(HFP_LEN(dsi_cfg.hfp) | HACT_LEN(dsi_cfg.hact), --=20 2.34.1 From nobody Mon Feb 9 17:56:37 2026 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (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 CF0A916DC3C for ; Sun, 26 Jan 2025 19:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919022; cv=none; b=AfuvftQTqaWhusRppvaf6LZeBq2eMAxN63Bb35UQc0qcBGP8Ziyd00UCo8gnGABJW1W60hMU9DqHVRIHhq7Vw4GJL6i3ximH4JF4nlEZ6yra3rDA1w9J5FdBGTtggAr7PnGlTWMUmpuEgFJ39++bmCavwNmKbYkCsDDkuo6/hEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919022; c=relaxed/simple; bh=qeCaEKcGUDVikb0PWYTDwb0iaobuPGbHW8XjOCgX1Lk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jubhwi1dmbk2gaOG/GwE10uxu3LPQKyGpWR5WsFOjKUPSjMo33KVj1rOvV8/Rp0cWNiXdEhpkUR3L4eRIUs5lSueiSQlBx+mgN8ede3AGR2R5djLR113rStphMsgvL7cf+70diFFl8JkCyqaoDAtkPo/Md5nv3r8FBwV5eccOdM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=aqn3p0QY; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="aqn3p0QY" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737919015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AN7JB7Cg+gBv3L+erE+eeh7+gQ4NZV9djINY+4ELNbw=; b=aqn3p0QY8UcfiS81Z3oiMl+1wPN20yxKKSGVR/7YOwTdQQ22bn2YNPsU87iy5XXwbqVy6K paHosxao+gBw05Y/WvxlznoTKz6va0f2HYW+dAd73KfMiQw8/8fDz7EphbEYfT6XLuKYEH 1RqnngNd1YhCxSIVhGVuRSOlkYEGsfI= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v8 06/13] drm/bridge: cdns-dsi: Move to devm_drm_of_get_bridge() Date: Mon, 27 Jan 2025 00:45:44 +0530 Message-Id: <20250126191551.741957-7-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Instead of manually finding the next bridge/panel, and maintaining the panel-bridge (in-case the next entity is a panel), switch to using the automatically managing devm_drm_of_get_bridge() API. Drop the drm_panel support completely from the driver while at it. Reviewed-by: Tomi Valkeinen Reviewed-by: Dmitry Baryshkov Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 28 ++----------------- .../gpu/drm/bridge/cadence/cdns-dsi-core.h | 2 -- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 6a77ca36cb9d..c2512342139c 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -941,8 +941,6 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, struct cdns_dsi_output *output =3D &dsi->output; struct cdns_dsi_input *input =3D &dsi->input; struct drm_bridge *bridge; - struct drm_panel *panel; - struct device_node *np; int ret; =20 /* @@ -960,26 +958,10 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, /* * The host <-> device link might be described using an OF-graph * representation, in this case we extract the device of_node from - * this representation, otherwise we use dsidev->dev.of_node which - * should have been filled by the core. + * this representation. */ - np =3D of_graph_get_remote_node(dsi->base.dev->of_node, DSI_OUTPUT_PORT, - dev->channel); - if (!np) - np =3D of_node_get(dev->dev.of_node); - - panel =3D of_drm_find_panel(np); - if (!IS_ERR(panel)) { - bridge =3D drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - } else { - bridge =3D of_drm_find_bridge(np); - if (!bridge) - bridge =3D ERR_PTR(-EINVAL); - } - - of_node_put(np); - + bridge =3D devm_drm_of_get_bridge(dsi->base.dev, dsi->base.dev->of_node, + DSI_OUTPUT_PORT, dev->channel); if (IS_ERR(bridge)) { ret =3D PTR_ERR(bridge); dev_err(host->dev, "failed to add DSI device %s (err =3D %d)", @@ -989,7 +971,6 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host, =20 output->dev =3D dev; output->bridge =3D bridge; - output->panel =3D panel; =20 /* * The DSI output has been properly configured, we can now safely @@ -1005,12 +986,9 @@ static int cdns_dsi_detach(struct mipi_dsi_host *host, struct mipi_dsi_device *dev) { struct cdns_dsi *dsi =3D to_cdns_dsi(host); - struct cdns_dsi_output *output =3D &dsi->output; struct cdns_dsi_input *input =3D &dsi->input; =20 drm_bridge_remove(&input->bridge); - if (output->panel) - drm_panel_bridge_remove(output->bridge); =20 return 0; } diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.h index ca7ea2da635c..5db5dbbbcaad 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h @@ -10,7 +10,6 @@ =20 #include #include -#include =20 #include #include @@ -21,7 +20,6 @@ struct reset_control; =20 struct cdns_dsi_output { struct mipi_dsi_device *dev; - struct drm_panel *panel; struct drm_bridge *bridge; union phy_configure_opts phy_opts; }; --=20 2.34.1 From nobody Mon Feb 9 17:56:37 2026 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (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 4BF4F18A6C0 for ; Sun, 26 Jan 2025 19:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919032; cv=none; b=r8qIRp0vVZci9sQ89OSZGJZ0QRQZcwwOgy6Bxlv2s84V8jWjlXvJMpZ70IzJot2uEGSCA+3R8V7AYc496PWTeLTMJ+gS3M3ncW1XmB1wwkvRxN8JTKiqKCxQKLTIJDFBIjnx4x3eeh6WKyu1XFQPhjz64BgyADycMi+YSzq/mg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737919032; c=relaxed/simple; bh=TzzvmyZr6inHri4Kx8qN0rk8PqsshAgOnei6iJkGU0s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Bi/YV6OEltyh2OGwW67MUg2iSgT6GscKzBNwK4/rKPqrjIdrKkd/g1Z9AqOejJ9ogRYYvEQvW2Riuen7oCz9OX9GtIBr8vs7dLnGaEs/f0dAEU3PkpFK3XtTKzF3QQMcO21mHOmZPqFYL3bSloYQjY0NrX7eTnzvFeEGfV+SGK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=TrrXKh7U; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="TrrXKh7U" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737919023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4WYLOQhw/RKMm5QY26fFHeUV0OebPBM++WNDwYTSgLM=; b=TrrXKh7UdWgHavDUQZsxGnS6RTJBR7bjHuOXCKoKJA9yBRvbgKLmLWX3J3nLDFbGqhb43B 7kAFDvsUvOI+vGckCCqn2uaUN+1UdZ2x3UTwn+ZrFJs8tLLTf1dl2hbQ4dZTpLg8AlKVeF 5UtlS+d+c4em0R1UBTiPTzj1PgMy190= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v8 07/13] drm/mipi-dsi: Add helper to find input format Date: Mon, 27 Jan 2025 00:45:45 +0530 Message-Id: <20250126191551.741957-8-aradhya.bhatia@linux.dev> In-Reply-To: <20250126191551.741957-1-aradhya.bhatia@linux.dev> References: <20250126191551.741957-1-aradhya.bhatia@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Add a helper API that can be used by the DSI hosts to find the required input bus format for the given output dsi pixel format. Reviewed-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/drm_mipi_dsi.c | 37 ++++++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 38 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 5e5c5f84daac..076826f2445a 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -36,6 +36,8 @@ #include #include =20 +#include + #include