Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/xe_late_bind_fw: Correct fan count parsing
@ 2026-12-03 16:36 Karthik Poosa
  2026-12-03 16:43 ` ✓ CI.KUnit: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Karthik Poosa @ 2026-12-03 16:36 UTC (permalink / raw)
  To: intel-xe
  Cc: rodrigo.vivi, anshuman.gupta, badal.nilawar, raag.jadav,
	soham.purkait, riana.tauro, mallesh.koujalagi,
	ravi.kishore.koppuravuri, sk.anirban, Karthik Poosa

FSC_READ_NUM_FANS returns a bitmask of enabled fans rather than the fan
count. Count the set bits in the mask to determine the number of fans.

Fixes: 45832bf9c10f ("drm/xe/xe_late_bind_fw: Initialize late binding firmware")
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
---
 drivers/gpu/drm/xe/xe_late_bind_fw.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
index ad39383a7e41..13516b3a1be3 100644
--- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
+++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
@@ -226,9 +226,17 @@ static int xe_late_bind_fw_num_fans(struct xe_late_bind *late_bind, u32 *num_fan
 {
 	struct xe_device *xe = late_bind_to_xe(late_bind);
 	struct xe_tile *root_tile = xe_device_get_root_tile(xe);
+	int ret = 0;
 
-	return xe_pcode_read(root_tile,
-			     PCODE_MBOX(FAN_SPEED_CONTROL, FSC_READ_NUM_FANS, 0), num_fans, NULL);
+	ret = xe_pcode_read(root_tile,
+			    PCODE_MBOX(FAN_SPEED_CONTROL, FSC_READ_NUM_FANS, 0), num_fans, NULL);
+	if (ret) {
+		*num_fans = 0;
+		return ret;
+	}
+	*num_fans = hweight32(*num_fans);
+
+	return 0;
 }
 
 static void wait_for_worker_completion(struct xe_late_bind *late_bind)
-- 
2.34.1


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

end of thread, other threads:[~2026-12-03 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:36 [PATCH] drm/xe/xe_late_bind_fw: Correct fan count parsing Karthik Poosa
2026-12-03 16:43 ` ✓ CI.KUnit: success for " Patchwork
2026-12-03 16:58 ` [PATCH] " sashiko-bot
2026-12-03 17:28 ` ✗ Xe.CI.BAT: failure for " Patchwork

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