drm/amd/powerplay: use REG32_PCIE wrapper instead for powerplay
authorHuang Rui <ray.huang@amd.com>
Mon, 25 Feb 2019 06:54:20 +0000 (14:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Feb 2019 03:18:42 +0000 (22:18 -0500)
This patch uses REG32_PCIE wrapper instead of writting pci_index2 and reading
pci_data2 for powerplay. This sequence should be protected by pcie_idx_lock.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/smumgr/smu9_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/vega20_smumgr.c

index 079fc8e8f709f39d1ca764e6893fefaa640f58bc..742b3dc1f6cba748012c054da7cc77849d6d270b 100644 (file)
@@ -40,10 +40,8 @@ bool smu9_is_smc_ram_running(struct pp_hwmgr *hwmgr)
        struct amdgpu_device *adev = hwmgr->adev;
        uint32_t mp1_fw_flags;
 
-       WREG32_SOC15(NBIF, 0, mmPCIE_INDEX2,
-                       (MP1_Public | (smnMP1_FIRMWARE_FLAGS & 0xffffffff)));
-
-       mp1_fw_flags = RREG32_SOC15(NBIF, 0, mmPCIE_DATA2);
+       mp1_fw_flags = RREG32_PCIE(MP1_Public |
+                                  (smnMP1_FIRMWARE_FLAGS & 0xffffffff));
 
        if (mp1_fw_flags & MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED_MASK)
                return true;
index b7ff7d4d6f448d1145ed97cc4805f2dc9e7a9d73..ba00744c3413f53e03db1aa9c91226ed9ddc5c6a 100644 (file)
@@ -49,10 +49,8 @@ static bool vega20_is_smc_ram_running(struct pp_hwmgr *hwmgr)
        struct amdgpu_device *adev = hwmgr->adev;
        uint32_t mp1_fw_flags;
 
-       WREG32_SOC15(NBIF, 0, mmPCIE_INDEX2,
-                    (MP1_Public | (smnMP1_FIRMWARE_FLAGS & 0xffffffff)));
-
-       mp1_fw_flags = RREG32_SOC15(NBIF, 0, mmPCIE_DATA2);
+       mp1_fw_flags = RREG32_PCIE(MP1_Public |
+                                  (smnMP1_FIRMWARE_FLAGS & 0xffffffff));
 
        if ((mp1_fw_flags & MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED_MASK) >>
            MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED__SHIFT)