Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/cx0_phy: Fix ARL-S host bridge detection
@ 2026-09-16 15:29 Dnyaneshwar Bhadane
  2026-09-16 16:30 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dnyaneshwar Bhadane @ 2026-09-16 15:29 UTC (permalink / raw)
  To: intel-xe, intel-gfx; +Cc: jani.nikula, Dnyaneshwar Bhadane

is_arrowlake_s_by_host_bridge() re-assigned pdev in the while()
exited (that's the loop's exit condition). This made
condition itself, so pdev was always NULL by the time the loop
"return pdev && ..." always false, so an Arrow Lake S host bridge
was never detected and intel_c20_hdmi_tmds_tx_cgf_1() always used
the wrong tx_misc value for that platform.

Check the ID as each host bridge is enumerated instead of after the
loop, and drop the reference pci_get_class() took on the matching
device before returning.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Fixes: 3630a47b700e ("drm/i915/cx0_phy: Update HDMI TMDS C20 algorithm value")
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
---
 drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
index dbebd7210848..de450ebf541f 100644
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
@@ -2342,12 +2342,14 @@ static void intel_c10pll_dump_hw_state(struct drm_printer *p,
 static bool is_arrowlake_s_by_host_bridge(void)
 {
 	struct pci_dev *pdev = NULL;
-	u16 host_bridge_pci_dev_id;
-
-	while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev)))
-		host_bridge_pci_dev_id = pdev->device;
+	while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev))) {
+		if (IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(pdev->device)) {
+			pci_dev_put(pdev);
+			return true;
+		}
+	}
 
-	return pdev && IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(host_bridge_pci_dev_id);
+	return false;
 }
 
 static u16 intel_c20_hdmi_tmds_tx_cgf_1(struct intel_display *display)
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-17  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 15:29 [PATCH] drm/i915/cx0_phy: Fix ARL-S host bridge detection Dnyaneshwar Bhadane
2026-09-16 16:30 ` ✓ i915.CI.BAT: success for " Patchwork
2026-09-16 23:36 ` ✗ i915.CI.Full: failure " Patchwork
2026-09-17  8:10 ` [PATCH] " Borah, Chaitanya Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox