Reviewed-by: Lijo Lazar <lijo.la...@amd.com>

On 5/20/2021 9:26 PM, Alex Deucher wrote:
Try the handle from ATPX first since this is the most
common case.

Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 14 ++++++--------
  1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 29708b5685ad..49563ff87f1a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -231,16 +231,15 @@ static acpi_handle amdgpu_atif_probe_handle(acpi_handle 
dhandle)
        /* For PX/HG systems, ATIF and ATPX are in the iGPU's namespace, on 
dGPU only
         * systems, ATIF is in the dGPU's namespace.
         */
-       status = acpi_get_handle(dhandle, "ATIF", &handle);
-       if (ACPI_SUCCESS(status))
-               goto out;
-
        if (amdgpu_has_atpx()) {
                status = acpi_get_handle(amdgpu_atpx_get_dhandle(), "ATIF",
                                         &handle);
                if (ACPI_SUCCESS(status))
                        goto out;
        }
+       status = acpi_get_handle(dhandle, "ATIF", &handle);
+       if (ACPI_SUCCESS(status))
+               goto out;
DRM_DEBUG_DRIVER("No ATIF handle found\n");
        return NULL;
@@ -260,16 +259,15 @@ static acpi_handle amdgpu_atcs_probe_handle(acpi_handle 
dhandle)
        /* For PX/HG systems, ATCS and ATPX are in the iGPU's namespace, on 
dGPU only
         * systems, ATIF is in the dGPU's namespace.
         */
-       status = acpi_get_handle(dhandle, "ATCS", &handle);
-       if (ACPI_SUCCESS(status))
-               goto out;
-
        if (amdgpu_has_atpx()) {
                status = acpi_get_handle(amdgpu_atpx_get_dhandle(), "ATCS",
                                         &handle);
                if (ACPI_SUCCESS(status))
                        goto out;
        }
+       status = acpi_get_handle(dhandle, "ATCS", &handle);
+       if (ACPI_SUCCESS(status))
+               goto out;
DRM_DEBUG_DRIVER("No ATCS handle found\n");
        return NULL;


--
Thanks,
Lijo
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to