<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/amd, branch v5.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-07-30T15:03:28Z</updated>
<entry>
<title>Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"</title>
<updated>2020-07-30T15:03:28Z</updated>
<author>
<name>Alex Deucher</name>
<email>alexander.deucher@amd.com</email>
</author>
<published>2020-07-30T15:02:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=87004abfbc27261edd15716515d89ab42198b405'/>
<id>urn:sha1:87004abfbc27261edd15716515d89ab42198b405</id>
<content type='text'>
This regressed some working configurations so revert it.  Will
fix this properly for 5.9 and backport then.

This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.

Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amd/display: Clear dm_state for fast updates</title>
<updated>2020-07-30T15:02:10Z</updated>
<author>
<name>Mazin Rezk</name>
<email>mnrzk@protonmail.com</email>
</author>
<published>2020-07-27T05:40:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fde9f39ac7f1ffd799a96ffa1e06b2051f0898f1'/>
<id>urn:sha1:fde9f39ac7f1ffd799a96ffa1e06b2051f0898f1</id>
<content type='text'>
This patch fixes a race condition that causes a use-after-free during
amdgpu_dm_atomic_commit_tail. This can occur when 2 non-blocking commits
are requested and the second one finishes before the first. Essentially,
this bug occurs when the following sequence of events happens:

1. Non-blocking commit #1 is requested w/ a new dm_state #1 and is
deferred to the workqueue.

2. Non-blocking commit #2 is requested w/ a new dm_state #2 and is
deferred to the workqueue.

3. Commit #2 starts before commit #1, dm_state #1 is used in the
commit_tail and commit #2 completes, freeing dm_state #1.

4. Commit #1 starts after commit #2 completes, uses the freed dm_state
1 and dereferences a freelist pointer while setting the context.

Since this bug has only been spotted with fast commits, this patch fixes
the bug by clearing the dm_state instead of using the old dc_state for
fast updates. In addition, since dm_state is only used for its dc_state
and amdgpu_dm_atomic_commit_tail will retain the dc_state if none is found,
removing the dm_state should not have any consequences in fast updates.

This use-after-free bug has existed for a while now, but only caused a
noticeable issue starting from 5.7-rc1 due to 3202fa62f ("slub: relocate
freelist pointer to middle of object") moving the freelist pointer from
dm_state-&gt;base (which was unused) to dm_state-&gt;context (which is
dereferenced).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207383
Fixes: bd200d190f45 ("drm/amd/display: Don't replace the dc_state for fast updates")
Reported-by: Duncan &lt;1i5t5.duncan@cox.net&gt;
Signed-off-by: Mazin Rezk &lt;mnrzk@protonmail.com&gt;
Reviewed-by: Nicholas Kazlauskas &lt;nicholas.kazlauskas@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()</title>
<updated>2020-07-30T15:02:10Z</updated>
<author>
<name>Peilin Ye</name>
<email>yepeilin.cs@gmail.com</email>
</author>
<published>2020-07-28T19:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=543e8669ed9bfb30545fd52bc0e047ca4df7fb31'/>
<id>urn:sha1:543e8669ed9bfb30545fd52bc0e047ca4df7fb31</id>
<content type='text'>
Compiler leaves a 4-byte hole near the end of `dev_info`, causing
amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace
when `size` is greater than 356.

In 2015 we tried to fix this issue by doing `= {};` on `dev_info`, which
unfortunately does not initialize that 4-byte hole. Fix it by using
memset() instead.

Cc: stable@vger.kernel.org
Fixes: c193fa91b918 ("drm/amdgpu: information leak in amdgpu_info_ioctl()")
Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
Suggested-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Peilin Ye &lt;yepeilin.cs@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: Fix NULL dereference in dpm sysfs handlers</title>
<updated>2020-07-21T20:00:01Z</updated>
<author>
<name>Paweł Gronowski</name>
<email>me@woland.xyz</email>
</author>
<published>2020-07-19T15:54:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38e0c89a19fd13f28d2b4721035160a3e66e270b'/>
<id>urn:sha1:38e0c89a19fd13f28d2b4721035160a3e66e270b</id>
<content type='text'>
NULL dereference occurs when string that is not ended with space or
newline is written to some dpm sysfs interface (for example pp_dpm_sclk).
This happens because strsep replaces the tmp with NULL if the delimiter
is not present in string, which is then dereferenced by tmp[0].

Reproduction example:
sudo sh -c 'echo -n 1 &gt; /sys/class/drm/card0/device/pp_dpm_sclk'

Signed-off-by: Paweł Gronowski &lt;me@woland.xyz&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amd/powerplay: fix a crash when overclocking Vega M</title>
<updated>2020-07-21T19:59:32Z</updated>
<author>
<name>Qiu Wenbo</name>
<email>qiuwenbo@phytium.com.cn</email>
</author>
<published>2020-07-17T07:09:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88bb16ad998a0395fe4b346b7d3f621aaa0a2324'/>
<id>urn:sha1:88bb16ad998a0395fe4b346b7d3f621aaa0a2324</id>
<content type='text'>
Avoid kernel crash when vddci_control is SMU7_VOLTAGE_CONTROL_NONE and
vddci_voltage_table is empty. It has been tested on Intel Hades Canyon
(i7-8809G).

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=208489
Fixes: ac7822b0026f ("drm/amd/powerplay: add smumgr support for VEGAM (v2)")
Reviewed-by: Evan Quan &lt;evan.quan@amd.com&gt;
Signed-off-by: Qiu Wenbo &lt;qiuwenbo@phytium.com.cn&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amdgpu/sdma5: fix wptr overwritten in -&gt;get_wptr()</title>
<updated>2020-07-14T19:42:17Z</updated>
<author>
<name>Xiaojie Yuan</name>
<email>xiaojie.yuan@amd.com</email>
</author>
<published>2020-07-14T07:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05051496b2622e4d12e2036b35165969aa502f89'/>
<id>urn:sha1:05051496b2622e4d12e2036b35165969aa502f89</id>
<content type='text'>
"u64 *wptr" points to the the wptr value in write back buffer and
"*wptr = (*wptr) &gt;&gt; 2;" results in the value being overwritten each time
when -&gt;get_wptr() is called.

umr uses /sys/kernel/debug/dri/0/amdgpu_ring_sdma0 to get rptr/wptr and
decode ring content and it is affected by this issue.

fix and simplify the logic similar as sdma_v4_0_ring_get_wptr().

v2: fix for sdma5.2 as well
v3: drop sdma 5.2 changes for 5.8 and stable

Suggested-by: Le Ma &lt;le.ma@amd.com&gt;
Signed-off-by: Xiaojie Yuan &lt;xiaojie.yuan@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amdgpu/powerplay: Modify SMC message name for setting power profile mode</title>
<updated>2020-07-14T19:41:51Z</updated>
<author>
<name>chen gong</name>
<email>curry.gong@amd.com</email>
</author>
<published>2020-07-13T08:11:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=98a34cf931e848f8489d3fb15a8f5fc03802ad65'/>
<id>urn:sha1:98a34cf931e848f8489d3fb15a8f5fc03802ad65</id>
<content type='text'>
I consulted Cai Land(Chuntian.Cai@amd.com), he told me corresponding smc
message name to fSMC_MSG_SetWorkloadMask() is
"PPSMC_MSG_ActiveProcessNotify" in firmware code of Renoir.

Strange though it may seem, but it's a fact.

Signed-off-by: chen gong &lt;curry.gong@amd.com&gt;
Reviewed-by: Evan Quan &lt;evan.quan@amd.com&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amd/display: handle failed allocation during stream construction</title>
<updated>2020-07-14T19:14:15Z</updated>
<author>
<name>Josip Pavic</name>
<email>Josip.Pavic@amd.com</email>
</author>
<published>2020-07-06T19:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be73e608ae2711dc8a1ab8b9549d9e348061b2ee'/>
<id>urn:sha1:be73e608ae2711dc8a1ab8b9549d9e348061b2ee</id>
<content type='text'>
[Why]
Failing to allocate a transfer function during stream construction leads
to a null pointer dereference

[How]
Handle the failed allocation by failing the stream construction

Cc: stable@vger.kernel.org
Signed-off-by: Josip Pavic &lt;Josip.Pavic@amd.com&gt;
Reviewed-by: Aric Cyr &lt;Aric.Cyr@amd.com&gt;
Acked-by: Rodrigo Siqueira &lt;Rodrigo.Siqueira@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amd/display: OLED panel backlight adjust not work with external display connected</title>
<updated>2020-07-14T19:13:15Z</updated>
<author>
<name>hersen wu</name>
<email>hersenxs.wu@amd.com</email>
</author>
<published>2020-06-22T17:29:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b448d30b0c303d5454ea572b772d1ffae96bc6e7'/>
<id>urn:sha1:b448d30b0c303d5454ea572b772d1ffae96bc6e7</id>
<content type='text'>
[Why]
amdgpu_dm-&gt;backlight_caps is for single eDP only. the caps are upddated
for very connector. Real eDP caps will be overwritten by other external
display. For OLED panel, caps-&gt;aux_support is set to 1 for OLED pnael.
after external connected, caps+.aux_support is set to 0. This causes
OLED backlight adjustment not work.

[How]
within update_conector_ext_caps, backlight caps will be updated only for
eDP connector.

Cc: stable@vger.kernel.org
Signed-off-by: hersen wu &lt;hersenxs.wu@amd.com&gt;
Reviewed-by: Nicholas Kazlauskas &lt;Nicholas.Kazlauskas@amd.com&gt;
Acked-by: Rodrigo Siqueira &lt;Rodrigo.Siqueira@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu/display: create fake mst encoders ahead of time (v4)</title>
<updated>2020-07-14T19:11:07Z</updated>
<author>
<name>Alex Deucher</name>
<email>alexander.deucher@amd.com</email>
</author>
<published>2020-07-10T21:50:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3168470142e0a82b5732c04ed4c031a9322ae170'/>
<id>urn:sha1:3168470142e0a82b5732c04ed4c031a9322ae170</id>
<content type='text'>
Prevents a warning in the MST create connector case.

v2: create global fake encoders rather per connector fake encoders
to avoid running out of encoder indices.

v3: use the actual number of crtcs on the asic rather than the max
to conserve encoders.

v4: v3 plus missing hunk I forgot to git add.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1108
Fixes: c6385e503aeaf9 ("drm/amdgpu: drop legacy drm load and unload callbacks")
Reviewed-by: Nicholas Kazlauskas &lt;nicholas.kazlauskas@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org # 5.7.x
</content>
</entry>
</feed>
