Skip to contentSkip to conversation

drm/amdgpu: Avoid RAS recovery init when no RAS support.

PATCH In review Andrey Grodzovsky 2 participants 2 messages Sep 9, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Avoid RAS recovery init when no RAS support.

Fixes driver load regression on APUs.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +6 -1
index d2437e1..119bedc 100644
@@ -1494,9 +1494,14 @@ static int amdgpu_ras_release_bad_pages(struct amdgpu_device *adev)
 int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
 {
 	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
-	struct ras_err_handler_data **data = &con->eh_data;
+	struct ras_err_handler_data **data;
 	int ret;
 
+	if (con)
+		data = &con->eh_data;
+	else
+		return 0;
+
 	*data = kmalloc(sizeof(**data), GFP_KERNEL | __GFP_ZERO);
 	if (!*data) {
 		ret = -ENOMEM;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1568040549-3664-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org

Reviewed-by Hawking Zhang
#2 lore raw

Regards,
Hawking

Sent from my iPhone

Quoted 36 lines · Andrey Grodzovsky

Fixes driver load regression on APUs.

---
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 ++++++-

1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +6 -1
index d2437e1..119bedc 100644
@@ -1494,9 +1494,14 @@ static int amdgpu_ras_release_bad_pages(struct amdgpu_device *adev)
 int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
 {
   struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
-    struct ras_err_handler_data **data = &con->eh_data;
+    struct ras_err_handler_data **data;
   int ret;
 
+    if (con)
+        data = &con->eh_data;
+    else
+        return 0;
+
   *data = kmalloc(sizeof(**data), GFP_KERNEL | __GFP_ZERO);
   if (!*data) {
       ret = -ENOMEM;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx