Skip to contentSkip to conversation

drm/ras: Do not fail an error-counter dump on a skipped last ID

PATCH In review Rodrigo Vivi 2 participants 2 messages Nov 24

Subsystems (3)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

PATCH 1/1 drm/ras: Do not fail an error-counter dump on a skipped last ID

drm_ras_nl_get_error_counter_dumpit() skips the IDs the driver reports as -ENOENT, but keeps that value in ret. If the last ID of the range is skipped, a complete dump then fails with -ENOENT.

Fixes c36218dc49f5 ("drm/ras: Introduce the DRM RAS infrastructure over generic netlink")
Cc Zack McKevitt <[email protected]>
Cc Jeff Hugo <[email protected]>
---
 drivers/gpu/drm/drm_ras.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_ras.c +3 -1
index bc30bf0745e5..82fcc766b84b 100644
@@ -616,8 +616,10 @@ int drm_ras_nl_get_error_counter_dumpit(struct sk_buff *skb,
 		 * For non-contiguous range, driver return -ENOENT as indication
 		 * to skip this ID when listing all errors.
 		 */
-		if (ret == -ENOENT)
+		if (ret == -ENOENT) {
+			ret = 0;
 			continue;
+		}
 		if (ret)
 			break;
 
Signature · 1 line
2.56.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Rodrigo Vivi

drm_ras_nl_get_error_counter_dumpit() skips the IDs the driver reports as -ENOENT, but keeps that value in ret. If the last ID of the range is skipped, a complete dump then fails with -ENOENT.

Fixes c36218dc49f5 ("drm/ras: Introduce the DRM RAS infrastructure over generic netlink")
Cc Zack McKevitt <[email protected]>
Cc Jeff Hugo <[email protected]>
---
  drivers/gpu/drm/drm_ras.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_ras.c +0 -0
index bc30bf0745e5..82fcc766b84b 100644
@@ -616,8 +616,10 @@ int drm_ras_nl_get_error_counter_dumpit(struct sk_buff *skb,
  		 * For non-contiguous range, driver return -ENOENT as indication

drivers/gpu/drm/drm_ras.c int drm_ras_nl_get_error_counter_dumpit(struct sk_buff *skb, · line 625

Quoted 10 lines
drivers/gpu/drm/drm_ras.c +3 -1
  		 * to skip this ID when listing all errors.
  		 */
-		if (ret == -ENOENT)
+		if (ret == -ENOENT) {
+			ret = 0;
  			continue;
+		}
  		if (ret)
  			break;