<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/scheduler, branch linux-5.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-04-17T14:11:50Z</updated>
<entry>
<title>drm/scheduler: fix rare NULL ptr race</title>
<updated>2020-04-17T14:11:50Z</updated>
<author>
<name>Yintian Tao</name>
</author>
<published>2020-03-23T11:19:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f900b6264f58d5df868eace03865c2325c8736e'/>
<id>urn:sha1:3f900b6264f58d5df868eace03865c2325c8736e</id>
<content type='text'>
[ Upstream commit 3c0fdf3302cb4f186c871684eac5c407a107e480 ]

There is one one corner case at dma_fence_signal_locked
which will raise the NULL pointer problem just like below.
-&gt;dma_fence_signal
    -&gt;dma_fence_signal_locked
	-&gt;test_and_set_bit
here trigger dma_fence_release happen due to the zero of fence refcount.

-&gt;dma_fence_put
    -&gt;dma_fence_release
	-&gt;drm_sched_fence_release_scheduled
	    -&gt;call_rcu
here make the union fled “cb_list” at finished fence
to NULL because struct rcu_head contains two pointer
which is same as struct list_head cb_list

Therefore, to hold the reference of finished fence at drm_sched_process_job
to prevent the null pointer during finished fence dma_fence_signal

[  732.912867] BUG: kernel NULL pointer dereference, address: 0000000000000008
[  732.914815] #PF: supervisor write access in kernel mode
[  732.915731] #PF: error_code(0x0002) - not-present page
[  732.916621] PGD 0 P4D 0
[  732.917072] Oops: 0002 [#1] SMP PTI
[  732.917682] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G           OE     5.4.0-rc7 #1
[  732.918980] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
[  732.920906] RIP: 0010:dma_fence_signal_locked+0x3e/0x100
[  732.938569] Call Trace:
[  732.939003]  &lt;IRQ&gt;
[  732.939364]  dma_fence_signal+0x29/0x50
[  732.940036]  drm_sched_fence_finished+0x12/0x20 [gpu_sched]
[  732.940996]  drm_sched_process_job+0x34/0xa0 [gpu_sched]
[  732.941910]  dma_fence_signal_locked+0x85/0x100
[  732.942692]  dma_fence_signal+0x29/0x50
[  732.943457]  amdgpu_fence_process+0x99/0x120 [amdgpu]
[  732.944393]  sdma_v4_0_process_trap_irq+0x81/0xa0 [amdgpu]

v2: hold the finished fence at drm_sched_process_job instead of
    amdgpu_fence_process
v3: resume the blank line

Signed-off-by: Yintian Tao &lt;yttao@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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/sched: Avoid job cleanup if sched thread is parked.</title>
<updated>2019-11-07T23:08:07Z</updated>
<author>
<name>Andrey Grodzovsky</name>
</author>
<published>2019-11-07T22:55:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b6f717c33ef40257383478479a97d9ba2da8dab'/>
<id>urn:sha1:2b6f717c33ef40257383478479a97d9ba2da8dab</id>
<content type='text'>
When the sched thread is parked we assume ring_mirror_list is
not accessed from here.

Signed-off-by: Andrey Grodzovsky &lt;andrey.grodzovsky@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;
</content>
</entry>
<entry>
<title>drm/sched: Use completion to wait for sched-&gt;thread idle v2.</title>
<updated>2019-11-07T23:08:07Z</updated>
<author>
<name>Andrey Grodzovsky</name>
</author>
<published>2019-11-04T21:30:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83a7772ba223333755d8afd90ab8b2ea3f57d4e6'/>
<id>urn:sha1:83a7772ba223333755d8afd90ab8b2ea3f57d4e6</id>
<content type='text'>
Removes thread park/unpark hack from drm_sched_entity_fini and
by this fixes reactivation of scheduler thread while the thread
is supposed to be stopped.

v2: Per sched entity completion.

Signed-off-by: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Suggested-by: Christian König &lt;christian.koenig@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;
</content>
</entry>
<entry>
<title>drm/sched:  Fix passing zero to 'PTR_ERR' warning v2</title>
<updated>2019-11-06T21:27:47Z</updated>
<author>
<name>Andrey Grodzovsky</name>
</author>
<published>2019-10-29T15:03:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7c5782acd354bdb5ed0fa10e1e397eaed558390'/>
<id>urn:sha1:d7c5782acd354bdb5ed0fa10e1e397eaed558390</id>
<content type='text'>
Fix a static code checker warning.

v2: Drop PTR_ERR_OR_ZERO.

Signed-off-by: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Reviewed-by: Emily Deng &lt;Emily.Deng@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;
</content>
</entry>
<entry>
<title>Merge tag 'drm-next-5.5-2019-11-01' of git://people.freedesktop.org/~agd5f/linux into drm-next</title>
<updated>2019-11-04T00:22:53Z</updated>
<author>
<name>Dave Airlie</name>
</author>
<published>2019-11-04T00:22:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a86b00a437ec06b298477463c7a9b8774570507'/>
<id>urn:sha1:8a86b00a437ec06b298477463c7a9b8774570507</id>
<content type='text'>
drm-next-5.5-2019-11-01:

amdgpu:
- Add EEPROM support for Arcturus
- Enable VCN encode support for Arcturus
- Misc PSP fixes
- Misc DC fixes
- swSMU cleanup

amdkfd:
- Misc cleanups
- Fix typo in cu bitmap parsing

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
From: Alex Deucher &lt;alexdeucher@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191101190607.3763-1-alexander.deucher@amd.com
</content>
</entry>
<entry>
<title>drm/sched: Set error to s_fence if HW job submission failed.</title>
<updated>2019-10-25T20:50:11Z</updated>
<author>
<name>Andrey Grodzovsky</name>
</author>
<published>2019-10-24T19:39:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e91e5f080e03e0c28742f0aa4051c7cefafd7cdd'/>
<id>urn:sha1:e91e5f080e03e0c28742f0aa4051c7cefafd7cdd</id>
<content type='text'>
Problem:
When run_job fails and HW fence returned is NULL we still signal
the s_fence to avoid hangs but the user has no way of knowing if
the actual HW job was ran and finished.

Fix:
Allow .run_job implementations to return ERR_PTR in the fence pointer
returned and then set this error for s_fence-&gt;finished fence so whoever
wait on this fence can inspect the signaled fence for an error.

Signed-off-by: Andrey Grodzovsky &lt;andrey.grodzovsky@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;
</content>
</entry>
<entry>
<title>drm: Don't free jobs in wait_event_interruptible()</title>
<updated>2019-10-25T11:47:58Z</updated>
<author>
<name>Steven Price</name>
</author>
<published>2019-10-25T10:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=588b9828f0744ca13555c4a35cd0251ac8ad8ad2'/>
<id>urn:sha1:588b9828f0744ca13555c4a35cd0251ac8ad8ad2</id>
<content type='text'>
drm_sched_cleanup_jobs() attempts to free finished jobs, however because
it is called as the condition of wait_event_interruptible() it must not
sleep. Unfortunately some free callbacks (notably for Panfrost) do sleep.

Instead let's rename drm_sched_cleanup_jobs() to
drm_sched_get_cleanup_job() and simply return a job for processing if
there is one. The caller can then call the free_job() callback outside
the wait_event_interruptible() where sleeping is possible before
re-checking and returning to sleep if necessary.

Tested-by: Christian Gmeiner &lt;christian.gmeiner@gmail.com&gt;
Fixes: 5918045c4ed4 ("drm/scheduler: rework job destruction")
Signed-off-by: Steven Price &lt;steven.price@arm.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/337652/
</content>
</entry>
<entry>
<title>drm/scheduler: make unexported items static</title>
<updated>2019-10-10T14:11:46Z</updated>
<author>
<name>Ben Dooks</name>
</author>
<published>2019-10-09T12:14:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2636a5172da2eadee8190fad8d82d25d9a276525'/>
<id>urn:sha1:2636a5172da2eadee8190fad8d82d25d9a276525</id>
<content type='text'>
The drm_sched_fence_ops_{scheduled,finished} are not exported
from the file so make them static to avoid the following
warnings from sparse:

drivers/gpu/drm/scheduler/sched_fence.c:131:28: warning: symbol 'drm_sched_fence_ops_scheduled' was not declared. Should it be static?
drivers/gpu/drm/scheduler/sched_fence.c:137:28: warning: symbol 'drm_sched_fence_ops_finished' was not declared. Should it be static?

Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Ben Dooks &lt;ben.dooks@codethink.co.uk&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191009121447.31017-1-ben.dooks@codethink.co.uk
</content>
</entry>
<entry>
<title>drm/scheduler: use job count instead of peek</title>
<updated>2019-08-15T15:52:10Z</updated>
<author>
<name>Christian König</name>
</author>
<published>2019-08-09T15:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=85cb9d506744742ac06114a794fe58a964a24a62'/>
<id>urn:sha1:85cb9d506744742ac06114a794fe58a964a24a62</id>
<content type='text'>
The spsc_queue_peek function is accessing queue-&gt;head which belongs to
the consumer thread and shouldn't be accessed by the producer

This is fixing a rare race condition when destroying entities.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Reviewed-by: Monk.liu@amd.com
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/scheduler: drop use of drmP.h</title>
<updated>2019-07-15T16:11:31Z</updated>
<author>
<name>Sam Ravnborg</name>
</author>
<published>2019-06-30T06:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7c1be93c8e983077b8ec964497f09f2bfb6e7b29'/>
<id>urn:sha1:7c1be93c8e983077b8ec964497f09f2bfb6e7b29</id>
<content type='text'>
Drop use of the deprecated drmP.h header file.
Fix fallout.

Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: Andrey Grodzovsky &lt;andrey.grodzovsky@amd.com&gt;
Cc: Huang Rui &lt;ray.huang@amd.com&gt;
Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: Bas Nieuwenhuizen &lt;bas@basnieuwenhuizen.nl&gt;
Cc: Sharat Masetty &lt;smasetty@codeaurora.org&gt;
Cc: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Cc: Nayan Deshmukh &lt;nayan26deshmukh@gmail.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190630061922.7254-26-sam@ravnborg.org
</content>
</entry>
</feed>
