<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c, branch v4.9</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=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-10-24T21:01:22Z</updated>
<entry>
<title>drm/amdgpu: fix fence slab teardown</title>
<updated>2016-10-24T21:01:22Z</updated>
<author>
<name>Grazvydas Ignotas</name>
<email>notasas@gmail.com</email>
</author>
<published>2016-10-23T18:31:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f10425e811355986907c54f7d1d06703e406092'/>
<id>urn:sha1:0f10425e811355986907c54f7d1d06703e406092</id>
<content type='text'>
To free fences, call_rcu() is used, which calls amdgpu_fence_free()
after a grace period. During teardown, there is no guarantee all
callbacks have finished, so amdgpu_fence_slab may be destroyed before
all fences have been freed. If we are lucky, this results in some slab
warnings, if not, we get a crash in one of rcu threads because callback
is called after amdgpu has already been unloaded.

Fix it with a rcu_barrier().

Fixes: b44135351a3a ("drm/amdgpu: RCU protected amdgpu_fence_release")
Acked-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: don't leave dangling pointers around</title>
<updated>2016-09-27T17:00:51Z</updated>
<author>
<name>Grazvydas Ignotas</name>
<email>notasas@gmail.com</email>
</author>
<published>2016-09-25T20:34:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54ddf3a6af537cbfe038f9a2754f26de80c5818b'/>
<id>urn:sha1:54ddf3a6af537cbfe038f9a2754f26de80c5818b</id>
<content type='text'>
Right now it's possible to trigger fence_drv.fences[] dereference after
the array has been freed. While the real problem is elsewhere, this still
results in confusing errors that depend on how the freed memory was
reused (I've seen "kernel tried to execute NX-protected page"), it's
better to clear them and get NULL dereference so that it's obvious what's
going wrong.

Signed-off-by: Grazvydas Ignotas &lt;notasas@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: always signal all fences</title>
<updated>2016-07-14T20:46:07Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2016-07-12T11:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ef004d984226fb6845481bc928ae37fb1dacc5e'/>
<id>urn:sha1:2ef004d984226fb6845481bc928ae37fb1dacc5e</id>
<content type='text'>
A little fallout from "drm/amdgpu: sanitize fence numbers", we
sometimes need to signal all fences in the ring.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Reviewed-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: sanitize fence numbers</title>
<updated>2016-07-14T20:46:03Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2016-06-24T19:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f399a082866e137cd3c3bdf329f5c7ce1dca5d7'/>
<id>urn:sha1:4f399a082866e137cd3c3bdf329f5c7ce1dca5d7</id>
<content type='text'>
Looks like the VCE block sometimes still sends nonsense
fence numbers on startup.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: fix bug in fence driver fini</title>
<updated>2016-05-25T13:42:53Z</updated>
<author>
<name>Monk Liu</name>
<email>Monk.Liu@amd.com</email>
</author>
<published>2016-05-18T08:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48c60c03bcac36bb443f771b5e221a47d501b2ad'/>
<id>urn:sha1:48c60c03bcac36bb443f771b5e221a47d501b2ad</id>
<content type='text'>
Using wrong counter for walking fences.  Fixes
a crash when unloading the driver.

Signed-off-by: Monk Liu &lt;Monk.Liu@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/amdgpu: create fence slab once when amdgpu module init.</title>
<updated>2016-05-13T18:30:22Z</updated>
<author>
<name>Rex Zhu</name>
<email>Rex.Zhu@amd.com</email>
</author>
<published>2016-05-12T05:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d573de2d00835e38cef1fb4bff7b49c174c68941'/>
<id>urn:sha1:d573de2d00835e38cef1fb4bff7b49c174c68941</id>
<content type='text'>
This avoids problems with multiple GPUs.  For example,
if the first GPU failed before amdgpu_fence_init() was
called, amdgpu_fence_slab_ref is still 0 and it will
get decremented in amdgpu_fence_driver_fini().  This
will lead to a crash during init of the second GPU since
amdgpu_fence_slab_ref is not 0.

v2: add functions for init/exit instead of
    moving the variables into the driver.

Signed-off-by: Rex Zhu &lt;Rex.Zhu@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/amdgpu: Replace rcu_assign_pointer() with RCU_INIT_POINTER()</title>
<updated>2016-05-05T00:31:06Z</updated>
<author>
<name>Muhammad Falak R Wani</name>
<email>falakreyaz@gmail.com</email>
</author>
<published>2016-04-30T19:00:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=84fae133f0ccc974a425eee21101f5644bd8d14d'/>
<id>urn:sha1:84fae133f0ccc974a425eee21101f5644bd8d14d</id>
<content type='text'>
The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structre. It is always
safe to use RCU_INIT_POINTER() to NULL a pointer, instead of
rcu_assign_pointer().
This results in slightly smaller/faster code.

The following semantic patch was used:
&lt;smpl&gt;

@@
@@

- rcu_assign_pointer
+ RCU_INIT_POINTER
  (..., NULL)

&lt;/smpl&gt;

Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Muhammad Falak R Wani &lt;falakreyaz@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: double fence slot</title>
<updated>2016-05-05T00:22:48Z</updated>
<author>
<name>Chunming Zhou</name>
<email>David1.Zhou@amd.com</email>
</author>
<published>2016-04-14T02:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66067ad73c384a1780421e48a72a69b393359aa7'/>
<id>urn:sha1:66067ad73c384a1780421e48a72a69b393359aa7</id>
<content type='text'>
we introduced vmid fence, so one hw submission could produce two fences.

Signed-off-by: Chunming Zhou &lt;David1.Zhou@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/amdgpu: Mark all instances of struct drm_info_list as const</title>
<updated>2016-05-05T00:20:10Z</updated>
<author>
<name>Nils Wallménius</name>
<email>nils.wallmenius@gmail.com</email>
</author>
<published>2016-05-02T16:46:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=06ab6832ac06c77332e3b0415977acf68ea364cf'/>
<id>urn:sha1:06ab6832ac06c77332e3b0415977acf68ea364cf</id>
<content type='text'>
All these are compile time constand and the
drm_debugfs_create/remove_files functions take a const
pointer argument.

Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Nils Wallménius &lt;nils.wallmenius@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: fence wait old rcu slot</title>
<updated>2016-04-01T14:08:39Z</updated>
<author>
<name>Chunming Zhou</name>
<email>David1.Zhou@amd.com</email>
</author>
<published>2016-03-31T03:07:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fc387a0b183150b5beb953d740441f19b49a1fb3'/>
<id>urn:sha1:fc387a0b183150b5beb953d740441f19b49a1fb3</id>
<content type='text'>
since the rcu slot was initialized to be num_hw_submission,
if command submission doesn't use scheduler, this limitation
will be invalid like uvd test.

Signed-off-by: Chunming Zhou &lt;David1.Zhou@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>
</feed>
