Skip to contentSkip to conversation

drm/amd/ras: sleep on PMFW EEPROM busy in bad page count query

PATCH In review Candice Li 2 participants 3 messages Jun 3

Subsystems (3)
lore
Share & tools
lore

Candice Li

author
#0 lore raw

PATCH 1/2 drm/amd/ras: sleep on PMFW EEPROM busy in bad page count query

Use usleep_range() instead of mdelay() when ras_fw_get_badpage_count() retries on -EBUSY so the driver yields the CPU while waiting for PMFW EEPROM to become ready.

---
 drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/ras/rascore/ras_eeprom_fw.c +1 -1
index f5fa80db91fb1e..59e195652e427f 100644
@@ -72,7 +72,7 @@ int ras_fw_get_badpage_count(struct ras_core_context *ras_core,
 		if (ret != -EBUSY)
 			return ret;
 
-		mdelay(10);
+		usleep_range(10000, 15000);
 		now = (uint64_t)ktime_to_ms(ktime_get());
 	} while (now < end);
 
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 drm/amd/pm: sleep on PMFW EEPROM busy in bad page count query

Use usleep_range() instead of mdelay() to matche the behavior of ras_fw_get_badpage_count() in rascore path.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +1 -1
index 7193e3e4946ac6..12b57a0f4fc48f 100644
@@ -1042,7 +1042,7 @@ static int smu_v13_0_12_get_badpage_count(struct amdgpu_device *adev, uint32_t *
 		/* eeprom is not ready */
 		if (ret != -EBUSY)
 			return ret;
-		mdelay(10);
+		usleep_range(10000, 15000);
 		now = (uint64_t)ktime_to_ms(ktime_get());
 	} while (now < end);
 
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#2 lore raw

RE: [PATCH 2/2] drm/amd/pm: sleep on PMFW EEPROM busy in bad page count query

AMD General

Series is

Best Regards,
Kevin

Quoted 36 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Candice Li
Sent: Wednesday, June 3, 2026 10:06 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Xie, Patrick <[email protected]>; Li, Candice <[email protected]>
Subject: [PATCH 2/2] drm/amd/pm: sleep on PMFW EEPROM busy in bad page count query

Use usleep_range() instead of mdelay() to matche the behavior of ras_fw_get_badpage_count() in rascore path.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +0 -0
index 7193e3e4946ac6..12b57a0f4fc48f 100644
@@ -1042,7 +1042,7 @@ static int smu_v13_0_12_get_badpage_count(struct

amdgpu_device *adev, uint32_t *

              /* eeprom is not ready */
              if (ret != -EBUSY)
                      return ret;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +1 -2
-             mdelay(10);
+             usleep_range(10000, 15000);
              now = (uint64_t)ktime_to_ms(ktime_get());
      } while (now < end);
 
--

2.25.1