<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/gpu/drm/msm/msm_gpu.c, branch linux-rolling-lts</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>drm/msm: always recover the gpu</title>
<updated>2026-05-17T15:15:32+00:00</updated>
<author>
<name>Anna Maniscalco</name>
<email>anna.maniscalco2000@gmail.com</email>
</author>
<published>2026-02-10T16:29:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=132b8d51f0ffbee6e4e1ebbe1a50330aaf2dbd5d'/>
<id>132b8d51f0ffbee6e4e1ebbe1a50330aaf2dbd5d</id>
<content type='text'>
commit 01a0d6cd7032e9993feea19fadb03ef9d5b488f2 upstream.

Previously, in case there was no more work to do, recover worker
wouldn't trigger recovery and would instead rely on the gpu going to
sleep and then resuming when more work is submitted.

Recover_worker will first increment the fence of the hung ring so, if
there's only one job submitted to a ring and that causes an hang, it
will early out.

There's no guarantee that the gpu will suspend and resume before more
work is submitted and if the gpu is in a hung state it will stay in that
state and probably trigger a timeout again.

Just stop checking and always recover the gpu.

Signed-off-by: Anna Maniscalco &lt;anna.maniscalco2000@gmail.com&gt;
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.freedesktop.org/patch/704066/
Message-ID: &lt;20260210-recovery_suspend_fix-v1-1-00ed9013da04@gmail.com&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 01a0d6cd7032e9993feea19fadb03ef9d5b488f2 upstream.

Previously, in case there was no more work to do, recover worker
wouldn't trigger recovery and would instead rely on the gpu going to
sleep and then resuming when more work is submitted.

Recover_worker will first increment the fence of the hung ring so, if
there's only one job submitted to a ring and that causes an hang, it
will early out.

There's no guarantee that the gpu will suspend and resume before more
work is submitted and if the gpu is in a hung state it will stay in that
state and probably trigger a timeout again.

Just stop checking and always recover the gpu.

Signed-off-by: Anna Maniscalco &lt;anna.maniscalco2000@gmail.com&gt;
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.freedesktop.org/patch/704066/
Message-ID: &lt;20260210-recovery_suspend_fix-v1-1-00ed9013da04@gmail.com&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: fix missing NULL check after kcalloc in crashstate_get_bos()</title>
<updated>2025-12-18T13:03:03+00:00</updated>
<author>
<name>Huiwen He</name>
<email>hehuiwen@kylinos.cn</email>
</author>
<published>2025-11-12T17:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=966fcbb8c80318aa581e97da32056ffbab6138fe'/>
<id>966fcbb8c80318aa581e97da32056ffbab6138fe</id>
<content type='text'>
[ Upstream commit 3065e6a4d3594b42dae6176b3e2c0c3563cf94b8 ]

The crashstate_get_bos() function allocates memory for `state-&gt;bos`
using kcalloc(), but the vmbind path does not check for allocation
failure before dereferencing it in the following drm_gpuvm_for_each_va()
loop. This could lead to a NULL pointer dereference if memory allocation
fails.

Fix this by wrapping the drm_gpuvm_for_each_va() loop with a NULL check
on state-&gt;bos, similar to the safety check in the non-vmbind path.

Fixes: af9aa6f316b3d ("drm/msm: Crashdump support for sparse")
Signed-off-by: Huiwen He &lt;hehuiwen@kylinos.cn&gt;
Patchwork: https://patchwork.freedesktop.org/patch/687556/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 3065e6a4d3594b42dae6176b3e2c0c3563cf94b8 ]

The crashstate_get_bos() function allocates memory for `state-&gt;bos`
using kcalloc(), but the vmbind path does not check for allocation
failure before dereferencing it in the following drm_gpuvm_for_each_va()
loop. This could lead to a NULL pointer dereference if memory allocation
fails.

Fix this by wrapping the drm_gpuvm_for_each_va() loop with a NULL check
on state-&gt;bos, similar to the safety check in the non-vmbind path.

Fixes: af9aa6f316b3d ("drm/msm: Crashdump support for sparse")
Signed-off-by: Huiwen He &lt;hehuiwen@kylinos.cn&gt;
Patchwork: https://patchwork.freedesktop.org/patch/687556/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: Fix NULL pointer dereference in crashstate_get_vm_logs()</title>
<updated>2025-12-18T13:03:03+00:00</updated>
<author>
<name>Huiwen He</name>
<email>hehuiwen@kylinos.cn</email>
</author>
<published>2025-11-12T17:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0bc9149da210df7e9a191dde246b89d9ad23be8a'/>
<id>0bc9149da210df7e9a191dde246b89d9ad23be8a</id>
<content type='text'>
[ Upstream commit 3099e0247e3217e1b39c1c61766e06ec3d13835f ]

crashstate_get_vm_logs() did not check the return value of
kmalloc_array(). In low-memory situations, kmalloc_array() may return
NULL, leading to a NULL pointer dereference when the function later
accesses state-&gt;vm_logs.

Fix this by checking the return value of kmalloc_array() and setting
state-&gt;nr_vm_logs to 0 if allocation fails.

Fixes: 9edc52967cc7 ("drm/msm: Add VM logging for VM_BIND updates")
Signed-off-by: Huiwen He &lt;hehuiwen@kylinos.cn&gt;
Patchwork: https://patchwork.freedesktop.org/patch/687555/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 3099e0247e3217e1b39c1c61766e06ec3d13835f ]

crashstate_get_vm_logs() did not check the return value of
kmalloc_array(). In low-memory situations, kmalloc_array() may return
NULL, leading to a NULL pointer dereference when the function later
accesses state-&gt;vm_logs.

Fix this by checking the return value of kmalloc_array() and setting
state-&gt;nr_vm_logs to 0 if allocation fails.

Fixes: 9edc52967cc7 ("drm/msm: Add VM logging for VM_BIND updates")
Signed-off-by: Huiwen He &lt;hehuiwen@kylinos.cn&gt;
Patchwork: https://patchwork.freedesktop.org/patch/687555/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: remove extraneous semicolon after a statement</title>
<updated>2025-08-28T22:51:46+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.i.king@gmail.com</email>
</author>
<published>2025-07-18T13:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=12c3c6c44d1b0fd17f18522089b12ad269769c00'/>
<id>12c3c6c44d1b0fd17f18522089b12ad269769c00</id>
<content type='text'>
There is a statement that has an extraneous semicolon; remove it.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/664675/
Link: https://lore.kernel.org/r/20250718133404.2047673-1-colin.i.king@gmail.com
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a statement that has an extraneous semicolon; remove it.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/664675/
Link: https://lore.kernel.org/r/20250718133404.2047673-1-colin.i.king@gmail.com
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: skip re-emitting IBs for unusable VMs</title>
<updated>2025-08-18T14:51:10+00:00</updated>
<author>
<name>Antonino Maniscalco</name>
<email>antomani103@gmail.com</email>
</author>
<published>2025-08-13T13:04:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4876b391654142dcf31ac6da619ace357b6b902d'/>
<id>4876b391654142dcf31ac6da619ace357b6b902d</id>
<content type='text'>
When a VM is marked as an usuable we disallow new submissions from it,
however submissions that where already scheduled on the ring would still
be re-sent.

Since this can lead to further hangs, avoid emitting the actual IBs.

Fixes: 6a4d287a1ae6 ("drm/msm: Mark VM as unusable on GPU hangs")
Signed-off-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Akhil P Oommen &lt;akhilpo@oss.qualcomm.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/668314/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a VM is marked as an usuable we disallow new submissions from it,
however submissions that where already scheduled on the ring would still
be re-sent.

Since this can lead to further hangs, avoid emitting the actual IBs.

Fixes: 6a4d287a1ae6 ("drm/msm: Mark VM as unusable on GPU hangs")
Signed-off-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Akhil P Oommen &lt;akhilpo@oss.qualcomm.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/668314/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: Update global fault counter when faulty process has already ended</title>
<updated>2025-08-01T17:51:57+00:00</updated>
<author>
<name>Maíra Canal</name>
<email>mcanal@igalia.com</email>
</author>
<published>2025-07-20T21:42:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=25654a1756a4ace072404e89882d7ba8391900bd'/>
<id>25654a1756a4ace072404e89882d7ba8391900bd</id>
<content type='text'>
The global fault counter is no longer used since commit 12578c075f89
("drm/msm/gpu: Skip retired submits in recover worker"). However, it's
still needed, as we need to handle cases where a GPU fault occurs after
the faulting process has already ended.

Hence, increment the global fault counter when the submitting process
had already ended. This way, the number of faults returned by
MSM_PARAM_FAULTS will stay consistent.

While here, s/unusuable/unusable.

Fixes: 12578c075f89 ("drm/msm/gpu: Skip retired submits in recover worker")
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/664853/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The global fault counter is no longer used since commit 12578c075f89
("drm/msm/gpu: Skip retired submits in recover worker"). However, it's
still needed, as we need to handle cases where a GPU fault occurs after
the faulting process has already ended.

Hence, increment the global fault counter when the submitting process
had already ended. This way, the number of faults returned by
MSM_PARAM_FAULTS will stay consistent.

While here, s/unusuable/unusable.

Fixes: 12578c075f89 ("drm/msm/gpu: Skip retired submits in recover worker")
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/664853/
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: Add VM logging for VM_BIND updates</title>
<updated>2025-07-05T00:48:38+00:00</updated>
<author>
<name>Rob Clark</name>
<email>robdclark@chromium.org</email>
</author>
<published>2025-06-29T20:13:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9edc52967cc7fcd430749cdd8866aa68f25422bf'/>
<id>9edc52967cc7fcd430749cdd8866aa68f25422bf</id>
<content type='text'>
When userspace opts in to VM_BIND, the submit no longer holds references
keeping the VMA alive.  This makes it difficult to distinguish between
UMD/KMD/app bugs.  So add a debug option for logging the most recent VM
updates and capturing these in GPU devcoredumps.

The submitqueue id is also captured, a value of zero means the operation
did not go via a submitqueue (ie. comes from msm_gem_vm_close() tearing
down the remaining mappings when the device file is closed.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661518/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When userspace opts in to VM_BIND, the submit no longer holds references
keeping the VMA alive.  This makes it difficult to distinguish between
UMD/KMD/app bugs.  So add a debug option for logging the most recent VM
updates and capturing these in GPU devcoredumps.

The submitqueue id is also captured, a value of zero means the operation
did not go via a submitqueue (ie. comes from msm_gem_vm_close() tearing
down the remaining mappings when the device file is closed.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661518/
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: Crashdump support for sparse</title>
<updated>2025-07-05T00:48:37+00:00</updated>
<author>
<name>Rob Clark</name>
<email>robdclark@chromium.org</email>
</author>
<published>2025-06-29T20:13:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=af9aa6f316b3dae53318a044e975dae979cc022b'/>
<id>af9aa6f316b3dae53318a044e975dae979cc022b</id>
<content type='text'>
In this case, we need to iterate the VMAs looking for ones with
MSM_VMA_DUMP flag.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661504/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this case, we need to iterate the VMAs looking for ones with
MSM_VMA_DUMP flag.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661504/
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: Crashdump prep for sparse mappings</title>
<updated>2025-07-05T00:48:36+00:00</updated>
<author>
<name>Rob Clark</name>
<email>robdclark@chromium.org</email>
</author>
<published>2025-06-29T20:13:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=757cff73e122666fae96eb0be567f6897c6c853c'/>
<id>757cff73e122666fae96eb0be567f6897c6c853c</id>
<content type='text'>
In this case, userspace could request dumping partial GEM obj mappings.
Also drop use of should_dump() helper, which really only makes sense in
the old submit-&gt;bos[] table world.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661496/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this case, userspace could request dumping partial GEM obj mappings.
Also drop use of should_dump() helper, which really only makes sense in
the old submit-&gt;bos[] table world.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661496/
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/msm: Mark VM as unusable on GPU hangs</title>
<updated>2025-07-05T00:48:36+00:00</updated>
<author>
<name>Rob Clark</name>
<email>robdclark@chromium.org</email>
</author>
<published>2025-06-29T20:13:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6a4d287a1ae6e49f8ef57fcb2a512c2b0bbef966'/>
<id>6a4d287a1ae6e49f8ef57fcb2a512c2b0bbef966</id>
<content type='text'>
If userspace has opted-in to VM_BIND, then GPU hangs and VM_BIND errors
will mark the VM as unusable.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661499/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If userspace has opted-in to VM_BIND, then GPU hangs and VM_BIND errors
will mark the VM as unusable.

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661499/
</pre>
</div>
</content>
</entry>
</feed>
