<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Series is:</p>
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Tuesday, March 20, 2018 4:37:11 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH 2/2] drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">caused by<br>
'commit 83e3c4615872 ("drm/amdgpu: Remove wrapper layer of smu ip functions")'<br>
<br>
BUG: unable to handle kernel NULL pointer dereference at 00000000000005d8<br>
[ 313.241459] IP: ci_dpm_read_sensor+0x37/0xf0 [amdgpu]<br>
<br>
Change-Id: Iac0cf26264ccbc60181ccd9bba79fe3c4e420456<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 1 +<br>
drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 1 +<br>
drivers/gpu/drm/amd/amdgpu/si_dpm.c | 1 +<br>
3 files changed, 3 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
index 98d1dd2..47ef3e6 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
@@ -6244,6 +6244,7 @@ static int ci_dpm_early_init(void *handle)<br>
struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
<br>
adev->powerplay.pp_funcs = &ci_dpm_funcs;<br>
+ adev->powerplay.pp_handle = adev;<br>
ci_dpm_set_irq_funcs(adev);<br>
<br>
return 0;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c<br>
index 81babe0..26ba984 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c<br>
@@ -2963,6 +2963,7 @@ static int kv_dpm_early_init(void *handle)<br>
struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
<br>
adev->powerplay.pp_funcs = &kv_dpm_funcs;<br>
+ adev->powerplay.pp_handle = adev;<br>
kv_dpm_set_irq_funcs(adev);<br>
<br>
return 0;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c<br>
index 3bfcf0d..672eaff 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c<br>
@@ -7917,6 +7917,7 @@ static int si_dpm_early_init(void *handle)<br>
struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
<br>
adev->powerplay.pp_funcs = &si_dpm_funcs;<br>
+ adev->powerplay.pp_handle = adev;<br>
si_dpm_set_irq_funcs(adev);<br>
return 0;<br>
}<br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>