<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/drm_debugfs_crc.c, branch v4.19.141</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.141</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.141'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-02-24T07:34:45+00:00</updated>
<entry>
<title>drm: remove the newline for CRC source name.</title>
<updated>2020-02-24T07:34:45+00:00</updated>
<author>
<name>Dingchen Zhang</name>
<email>dingchen.zhang@amd.com</email>
</author>
<published>2019-06-10T13:47:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c0127ee523692cc041099d6f36b4bbefc1faa643'/>
<id>urn:sha1:c0127ee523692cc041099d6f36b4bbefc1faa643</id>
<content type='text'>
[ Upstream commit 72a848f5c46bab4c921edc9cbffd1ab273b2be17 ]

userspace may transfer a newline, and this terminating newline
is replaced by a '\0' to avoid followup issues.

'len-1' is the index to replace the newline of CRC source name.

v3: typo fix (Sam)

v2: update patch subject, body and format. (Sam)

Cc: Leo Li &lt;sunpeng.li@amd.com&gt;
Cc: Harry Wentland &lt;Harry.Wentland@amd.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Signed-off-by: Dingchen Zhang &lt;dingchen.zhang@amd.com&gt;
Reviewed-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190610134751.14356-1-dingchen.zhang@amd.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/crc-debugfs: Also sprinkle irqrestore over early exits</title>
<updated>2019-07-31T05:26:59+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2019-06-06T21:15:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a50a272389f58ad45e40c5ab018a8ba76a3ddc3'/>
<id>urn:sha1:0a50a272389f58ad45e40c5ab018a8ba76a3ddc3</id>
<content type='text'>
[ Upstream commit d99004d7201aa653658ff2390d6e516567c96ebc ]

I. was. blind.

Caught with vkms, which has some really slow crc computation function.

Fixes: 1882018a70e0 ("drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry")
Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Cc: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: Benjamin Gaignard &lt;benjamin.gaignard@linaro.org&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Reviewed-by: Benjamin Gaignard &lt;benjamin.gaignard@linaro.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190606211544.5389-1-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry</title>
<updated>2019-07-31T05:26:59+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2019-06-05T19:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=26a66454541c8e57e4e96fb0e1fdb4342dba1616'/>
<id>urn:sha1:26a66454541c8e57e4e96fb0e1fdb4342dba1616</id>
<content type='text'>
[ Upstream commit 1882018a70e06376234133e69ede9dd743b4dbd9 ]

We can be called from any context, we need to be prepared.

Noticed this while hacking on vkms, which calls this function from a
normal worker. Which really upsets lockdep.

Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Cc: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: Benjamin Gaignard &lt;benjamin.gaignard@linaro.org&gt;
Reviewed-by: Benjamin Gaignard &lt;benjamin.gaignard@linaro.org&gt;
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190605194556.16744-1-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/crc: Only report a single overflow when a CRC fd is opened</title>
<updated>2018-07-06T12:57:03+00:00</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2018-04-18T12:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a012024571d98e2e4bf29a9168fb7ddc44b7ab86'/>
<id>urn:sha1:a012024571d98e2e4bf29a9168fb7ddc44b7ab86</id>
<content type='text'>
This reduces the amount of spam when you debug a CRC reading
program.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
[mlankhorst: Change bool overflow to was_overflow (Ville)]
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180418125121.72081-1-maarten.lankhorst@linux.intel.com
</content>
</entry>
<entry>
<title>drm/crc: Add support for polling on the data fd.</title>
<updated>2018-02-05T12:22:44+00:00</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2018-02-02T14:27:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4beb3b40ae7f994af01200323441df13f8f5b241'/>
<id>urn:sha1:4beb3b40ae7f994af01200323441df13f8f5b241</id>
<content type='text'>
This will make it possible for userspace to know whether reading
will block, without blocking on the fd. This makes it possible to
drain all queued CRC's in blocking mode, without having to reopen
the fd.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180202142743.68527-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
[mlankhorst: Use POLLIN|POLLRDNORM, based on Ville's suggestion]
</content>
</entry>
<entry>
<title>drm/atomic: Prepare drm_modeset_lock infrastructure for interruptible waiting, v2.</title>
<updated>2017-09-13T07:50:52+00:00</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-09-12T13:37:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6f8bcc744aad50d719845e4ce06a7831e96e1109'/>
<id>urn:sha1:6f8bcc744aad50d719845e4ce06a7831e96e1109</id>
<content type='text'>
When we want to make drm_atomic_commit interruptible, there are a lot of
places that call the lock function, which we don't have control over.

Rather than trying to convert every single one, it's easier to toggle
interruptible waiting per acquire_ctx. If drm_modeset_acquire_init is
called with DRM_MODESET_ACQUIRE_INTERRUPTIBLE, then we will perform
interruptible waits in drm_modeset_lock and drm_modeset_backoff.

Changes since v1:
- Fix locking example in drm_modeset_lock.c to be compatible
  with interruptible waiting (xexaxo) and make it default.
  Uninterruptible waiting shouldn't happen except in corner cases,
  but the example will still apply if the flag is removed.
- Add drm_modeset_lock_single_interruptible() to documentation.
- Fix dead link to removed drm_modeset_lock_interruptible() in
  drm_modeset_lock().

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt; #v1
Cc: Emil Velikov &lt;emil.l.velikov@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-2-maarten.lankhorst@linux.intel.com
Reviewed-by: Emil Velikov &lt;emil.l.velikov@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/crc: Only open CRC on atomic drivers when the CRTC is active.</title>
<updated>2017-07-17T14:34:51+00:00</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-07-06T13:03:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8038e09be5a3ac061118bd80c7a505829920b50f'/>
<id>urn:sha1:8038e09be5a3ac061118bd80c7a505829920b50f</id>
<content type='text'>
Commit e8fa5671183c ("drm: crc: Wait for a frame before returning
from open()") adds a wait for CRC frame, but with the CRTC off
this will never be generated. For atomic drivers we know if a CRTC
is active through crtc_state-&gt;active, so when inactive reject the
open with -EIO.

Just like with the previous patch changing debugfs opening semantics,
this patch has been tested against igt.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Fixes: e8fa5671183c ("drm: crc: Wait for a frame before returning from open()")
Testcase: debugfs_test.read_all_entries
Link: http://patchwork.freedesktop.org/patch/msgid/15f9d300-65d3-63aa-00e3-e83f5e4d5a7a@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/crc: Handle opening and closing crc better</title>
<updated>2017-07-17T14:32:43+00:00</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-06-21T11:00:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb42ea6d0b8ed9ca8e73cc24fa801f0d8ab28905'/>
<id>urn:sha1:eb42ea6d0b8ed9ca8e73cc24fa801f0d8ab28905</id>
<content type='text'>
When I was doing a grep . -r /sys/kernel/debug/dri/0 I noticed a WARN
appearing when I aborted the grep with ^C.

After investigating I've also noticed that the error handling was
lacking and there are race conditions involving multiple calls to
open/close simultaneously.

Fix this by setting the opened flag first and using crc-&gt;entries to
decide when crc can be collected.

Also call unset crc source before cleaning up, this way there is
no race with a future open().

This patch has been tested with all the tests in igt with CRC in their
name.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170621110007.11674-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
[mlankhorst: Add description that this patch has been tested with IGT,
based on tomeu's feedback]
</content>
</entry>
<entry>
<title>Revert "drm: Don't allow interruptions when opening debugfs/crc"</title>
<updated>2017-04-07T20:18:28+00:00</updated>
<author>
<name>Sean Paul</name>
<email>seanpaul@chromium.org</email>
</author>
<published>2017-04-07T20:15:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c98cdff94a6a7877923dec1329c2b76d6247d076'/>
<id>urn:sha1:c98cdff94a6a7877923dec1329c2b76d6247d076</id>
<content type='text'>
This reverts

commit b8dfa821c27046ede9bf8eb14cc8109d379428e9
Author: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Date:   Fri Apr 7 12:17:12 2017 +0100
    drm: Don't allow interruptions when opening debugfs/crc

It reportedly breaks things, so let's revert now and try again later.

Fixes: b8dfa821c270 ("drm: Don't allow interruptions when opening debugfs/crc")
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Jani Nikula &lt;jani.nikula@linux.intel.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: dri-devel@lists.freedesktop.org
Reported-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Acked-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sean Paul &lt;seanpaul@chromium.org&gt;
</content>
</entry>
<entry>
<title>drm: Don't allow interruptions when opening debugfs/crc</title>
<updated>2017-04-07T16:42:23+00:00</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2017-04-07T11:17:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b8dfa821c27046ede9bf8eb14cc8109d379428e9'/>
<id>urn:sha1:b8dfa821c27046ede9bf8eb14cc8109d379428e9</id>
<content type='text'>
The code does not like to be interrupted when waiting for the first
vblank after opening a debugfs/crc channel, so don't.

[66285.716870] WARNING: CPU: 1 PID: 16615 at drivers/gpu/drm/drm_debugfs_crc.c:185 crtc_crc_open+0x1d0/0x1f0 [drm]
[66285.716877] Modules linked in: i915 intel_powerclamp crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel cryptd intel_gtt i2c_algo_bit lpc_ich mfd_core drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops prime_numbers drm video button autofs4 sd_mod ahci libahci libata i2c_i801 scsi_mod i2c_designware_platform i2c_designware_core i2c_core
[66285.716929] CPU: 1 PID: 16615 Comm: kms_frontbuffer Not tainted 4.11.0-rc5+ #7
[66285.716935] Hardware name: GIGABYTE GB-BXBT-1900/MZBAYAB-00, BIOS F8 03/02/2016
[66285.716941] Call Trace:
[66285.716955]  dump_stack+0x4d/0x6f
[66285.716966]  __warn+0xc1/0xe0
[66285.716975]  warn_slowpath_null+0x18/0x20
[66285.717004]  crtc_crc_open+0x1d0/0x1f0 [drm]
[66285.717014]  ? wake_atomic_t_function+0x50/0x50
[66285.717024]  full_proxy_open+0xf0/0x1b0
[66285.717032]  ? full_proxy_release+0x80/0x80
[66285.717042]  do_dentry_open.isra.17+0x14b/0x2d0
[66285.717051]  vfs_open+0x42/0x60
[66285.717064]  path_openat+0x5e7/0x13d0
[66285.717074]  ? refcount_dec_and_test+0x11/0x20
[66285.717081]  ? down_read+0xd/0x30
[66285.717087]  do_filp_open+0x85/0xf0
[66285.717093]  ? __vfs_write+0x23/0x120
[66285.717100]  ? __alloc_fd+0x3a/0x170
[66285.717107]  do_sys_open+0x11e/0x1f0
[66285.717113]  ? do_sys_open+0x11e/0x1f0
[66285.717119]  SyS_openat+0xf/0x20
[66285.717125]  entry_SYSCALL_64_fastpath+0x17/0x98
[66285.717131] RIP: 0033:0x7f5f2235146a
[66285.717135] RSP: 002b:00007ffd892e6bc0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
[66285.717142] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5f2235146a
[66285.717147] RDX: 0000000000000000 RSI: 00007ffd892e6c40 RDI: 0000000000000006
[66285.717151] RBP: 00007ffd892e6b20 R08: 0000000000000000 R09: 000000000000000f
[66285.717156] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[66285.717161] R13: 00007ffd892e6b10 R14: 0000000000000004 R15: 00000000007e61f4

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100610
Fixes: e8fa5671183c ("drm: crc: Wait for a frame before returning from open()")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170407111712.13962-1-chris@chris-wilson.co.uk
</content>
</entry>
</feed>
