[1/2] drm/amdgpu: fix prt_warning not balance

Submitted by Chunming Zhou on Jan. 3, 2019, 8:54 a.m.

Details

Message ID 20190103085412.30220-1-david1.zhou@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Chunming Zhou Jan. 3, 2019, 8:54 a.m.
use DRM_WARN instead of dev_warn

Change-Id: I8ede212b5f99b1f77d0bd7499da3d85873403c7a
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 6 +++++-
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 6 +++++-
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 6 +++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index 9fc3296592fe..dae73f6768c2 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -450,9 +450,13 @@  static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable)
 	u32 tmp;
 
 	if (enable && !adev->gmc.prt_warning) {
-		dev_warn(adev->dev, "Disabling VM faults because of PRT request!\n");
+		DRM_WARN("Disabling VM faults because of PRT request!\n");
 		adev->gmc.prt_warning = true;
 	}
+	if (!enable && adev->gmc.prt_warning) {
+		DRM_WARN("Re-enabling VM faults!\n");
+		adev->gmc.prt_warning = false;
+	}
 
 	tmp = RREG32(mmVM_PRT_CNTL);
 	tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
index 761dcfb2fec0..5bdeb358bfb5 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
@@ -544,9 +544,13 @@  static void gmc_v7_0_set_prt(struct amdgpu_device *adev, bool enable)
 	uint32_t tmp;
 
 	if (enable && !adev->gmc.prt_warning) {
-		dev_warn(adev->dev, "Disabling VM faults because of PRT request!\n");
+		DRM_WARN("Disabling VM faults because of PRT request!\n");
 		adev->gmc.prt_warning = true;
 	}
+	if (!enable && adev->gmc.prt_warning) {
+		DRM_WARN("Re-enabling VM faults!\n");
+		adev->gmc.prt_warning = false;
+	}
 
 	tmp = RREG32(mmVM_PRT_CNTL);
 	tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index 1ad7e6b8ed1d..5150ab614eaa 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -770,9 +770,13 @@  static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable)
 	u32 tmp;
 
 	if (enable && !adev->gmc.prt_warning) {
-		dev_warn(adev->dev, "Disabling VM faults because of PRT request!\n");
+		DRM_WARN("Disabling VM faults because of PRT request!\n");
 		adev->gmc.prt_warning = true;
 	}
+	if (!enable && adev->gmc.prt_warning) {
+		DRM_WARN("Re-enabling VM faults!\n");
+		adev->gmc.prt_warning = false;
+	}
 
 	tmp = RREG32(mmVM_PRT_CNTL);
 	tmp = REG_SET_FIELD(tmp, VM_PRT_CNTL,