<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/i915/intel_fbdev.c, branch v4.14.70</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.70</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.70'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-12-05T10:26:38+00:00</updated>
<entry>
<title>drm/i915/fbdev: Serialise early hotplug events with async fbdev config</title>
<updated>2017-12-05T10:26:38+00:00</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2017-11-25T19:41:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7042c2b9a19e74972f5783ab3b7ef98ebdee293f'/>
<id>urn:sha1:7042c2b9a19e74972f5783ab3b7ef98ebdee293f</id>
<content type='text'>
commit a45b30a6c5db631e2ba680304bd5edd0cd1f9643 upstream.

As both the hotplug event and fbdev configuration run asynchronously, it
is possible for them to run concurrently. If configuration fails, we were
freeing the fbdev causing a use-after-free in the hotplug event.

&lt;7&gt;[ 3069.935211] [drm:intel_fb_initial_config [i915]] Not using firmware configuration
&lt;7&gt;[ 3069.935225] [drm:drm_setup_crtcs] looking for cmdline mode on connector 77
&lt;7&gt;[ 3069.935229] [drm:drm_setup_crtcs] looking for preferred mode on connector 77 0
&lt;7&gt;[ 3069.935233] [drm:drm_setup_crtcs] found mode 3200x1800
&lt;7&gt;[ 3069.935236] [drm:drm_setup_crtcs] picking CRTCs for 8192x8192 config
&lt;7&gt;[ 3069.935253] [drm:drm_setup_crtcs] desired mode 3200x1800 set on crtc 43 (0,0)
&lt;7&gt;[ 3069.935323] [drm:intelfb_create [i915]] no BIOS fb, allocating a new one
&lt;4&gt;[ 3069.967737] general protection fault: 0000 [#1] PREEMPT SMP
&lt;0&gt;[ 3069.977453] ---------------------------------
&lt;4&gt;[ 3069.977457] Modules linked in: i915(+) vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mei_me mii prime_numbers mei i2c_hid pinctrl_geminilake pinctrl_intel [last unloaded: i915]
&lt;4&gt;[ 3069.977492] CPU: 1 PID: 15414 Comm: kworker/1:0 Tainted: G     U          4.14.0-CI-CI_DRM_3388+ #1
&lt;4&gt;[ 3069.977497] Hardware name: Intel Corp. Geminilake/GLK RVP1 DDR4 (05), BIOS GELKRVPA.X64.0062.B30.1708222146 08/22/2017
&lt;4&gt;[ 3069.977508] Workqueue: events output_poll_execute
&lt;4&gt;[ 3069.977512] task: ffff880177734e40 task.stack: ffffc90001fe4000
&lt;4&gt;[ 3069.977519] RIP: 0010:__lock_acquire+0x109/0x1b60
&lt;4&gt;[ 3069.977523] RSP: 0018:ffffc90001fe7bb0 EFLAGS: 00010002
&lt;4&gt;[ 3069.977526] RAX: 6b6b6b6b6b6b6b6b RBX: 0000000000000282 RCX: 0000000000000000
&lt;4&gt;[ 3069.977530] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880170d4efd0
&lt;4&gt;[ 3069.977534] RBP: ffffc90001fe7c70 R08: 0000000000000001 R09: 0000000000000000
&lt;4&gt;[ 3069.977538] R10: 0000000000000000 R11: ffffffff81899609 R12: ffff880170d4efd0
&lt;4&gt;[ 3069.977542] R13: ffff880177734e40 R14: 0000000000000001 R15: 0000000000000000
&lt;4&gt;[ 3069.977547] FS:  0000000000000000(0000) GS:ffff88017fc80000(0000) knlGS:0000000000000000
&lt;4&gt;[ 3069.977551] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&lt;4&gt;[ 3069.977555] CR2: 00007f7e8b7bcf04 CR3: 0000000003e0f000 CR4: 00000000003406e0
&lt;4&gt;[ 3069.977559] Call Trace:
&lt;4&gt;[ 3069.977565]  ? mark_held_locks+0x64/0x90
&lt;4&gt;[ 3069.977571]  ? _raw_spin_unlock_irq+0x24/0x50
&lt;4&gt;[ 3069.977575]  ? _raw_spin_unlock_irq+0x24/0x50
&lt;4&gt;[ 3069.977579]  ? trace_hardirqs_on_caller+0xde/0x1c0
&lt;4&gt;[ 3069.977583]  ? _raw_spin_unlock_irq+0x2f/0x50
&lt;4&gt;[ 3069.977588]  ? finish_task_switch+0xa5/0x210
&lt;4&gt;[ 3069.977592]  ? lock_acquire+0xaf/0x200
&lt;4&gt;[ 3069.977596]  lock_acquire+0xaf/0x200
&lt;4&gt;[ 3069.977600]  ? __mutex_lock+0x5e9/0x9b0
&lt;4&gt;[ 3069.977604]  _raw_spin_lock+0x2a/0x40
&lt;4&gt;[ 3069.977608]  ? __mutex_lock+0x5e9/0x9b0
&lt;4&gt;[ 3069.977612]  __mutex_lock+0x5e9/0x9b0
&lt;4&gt;[ 3069.977616]  ? drm_fb_helper_hotplug_event.part.19+0x16/0xa0
&lt;4&gt;[ 3069.977621]  ? drm_fb_helper_hotplug_event.part.19+0x16/0xa0
&lt;4&gt;[ 3069.977625]  drm_fb_helper_hotplug_event.part.19+0x16/0xa0
&lt;4&gt;[ 3069.977630]  output_poll_execute+0x8d/0x180
&lt;4&gt;[ 3069.977635]  process_one_work+0x22e/0x660
&lt;4&gt;[ 3069.977640]  worker_thread+0x48/0x3a0
&lt;4&gt;[ 3069.977644]  ? _raw_spin_unlock_irqrestore+0x4c/0x60
&lt;4&gt;[ 3069.977649]  kthread+0x102/0x140
&lt;4&gt;[ 3069.977653]  ? process_one_work+0x660/0x660
&lt;4&gt;[ 3069.977657]  ? kthread_create_on_node+0x40/0x40
&lt;4&gt;[ 3069.977662]  ret_from_fork+0x27/0x40
&lt;4&gt;[ 3069.977666] Code: 8d 62 f8 c3 49 81 3c 24 e0 fa 3c 82 41 be 00 00 00 00 45 0f 45 f0 83 fe 01 77 86 89 f0 49 8b 44 c4 08 48 85 c0 0f 84 76 ff ff ff &lt;f0&gt; ff 80 38 01 00 00 8b 1d 62 f9 e8 01 45 8b 85 b8 08 00 00 85
&lt;1&gt;[ 3069.977707] RIP: __lock_acquire+0x109/0x1b60 RSP: ffffc90001fe7bb0
&lt;4&gt;[ 3069.977712] ---[ end trace 4ad012eb3af62df7 ]---

In order to keep the dev_priv-&gt;ifbdev alive after failure, we have to
avoid the free and leave it empty until we unload the module (which is
less than ideal, but a necessary evil for simplicity). Then we can use
intel_fbdev_sync() to serialise the hotplug event with the configuration.
The serialisation between the two was removed in commit 934458c2c95d
("Revert "drm/i915: Fix races on fbdev""), but the use after free is much
older, commit 366e39b4d2c5 ("drm/i915: Tear down fbdev if initialization
fails")

Fixes: 366e39b4d2c5 ("drm/i915: Tear down fbdev if initialization fails")
Fixes: 934458c2c95d ("Revert "drm/i915: Fix races on fbdev"")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Lukas Wunner &lt;lukas@wunner.de&gt;
Cc: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20171125194155.355-1-chris@chris-wilson.co.uk
(cherry picked from commit ad88d7fc6c032ddfb32b8d496a070ab71de3a64f)
Signed-off-by: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge airlied/drm-next into drm-intel-next-queued</title>
<updated>2017-08-10T16:12:01+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-08-10T16:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=148b1e115eae37c9f3705691b4c45aa4cc0fa71d'/>
<id>urn:sha1:148b1e115eae37c9f3705691b4c45aa4cc0fa71d</id>
<content type='text'>
Ben Widawsky/Daniel Stone need the extended modifier support from
drm-misc to be able to merge CCS support for i915.ko

Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: i915: remove dead code and pointless local lut storage</title>
<updated>2017-08-04T09:35:56+00:00</updated>
<author>
<name>Peter Rosin</name>
<email>peda@axentia.se</email>
</author>
<published>2017-07-13T16:25:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=749083173510c59d8e79ecc6eabcf1fe62ce4310'/>
<id>urn:sha1:749083173510c59d8e79ecc6eabcf1fe62ce4310</id>
<content type='text'>
The driver stores lut values from the fbdev interface, and is able
to give them back, but does not appear to do anything with these
lut values. The generic fb helpers have replaced this function,
and may even have made the driver work for the C8 mode from the
fbdev interface. But that is untested.

Since the fb helpers .gamma_set and .gamma_get are obsolete,
remove the dead code.

Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Peter Rosin &lt;peda@axentia.se&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170713162538.22788-10-peda@axentia.se
</content>
</entry>
<entry>
<title>Merge airlied/drm-next into drm-intel-next-queued</title>
<updated>2017-07-27T07:33:49+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-27T07:33:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=64282ea2d2a90437c0739ce016b80a1dec16507e'/>
<id>urn:sha1:64282ea2d2a90437c0739ce016b80a1dec16507e</id>
<content type='text'>
Resync with upstream to avoid git getting too badly confused. Also, we
have a conflict with the drm_vblank_cleanup removal, which cannot be
resolved by simply taking our side. Bake that in properly.

Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>Merge airlied/drm-next into drm-misc-next</title>
<updated>2017-07-26T11:43:33+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-26T11:23:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=af055598542670c8533a58582813b1419949cae0'/>
<id>urn:sha1:af055598542670c8533a58582813b1419949cae0</id>
<content type='text'>
I need this to be able to apply the deferred fbdev setup patches, I
need the relevant prep work that landed through the drm-intel tree.

Also squash in conflict fixup from Laurent Pinchart.

Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/&lt;drivers&gt;: Drop fbdev info flags</title>
<updated>2017-07-26T11:22:40+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-06T12:57:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1923ab3d01ef600dbde84ee29822980e816ee79'/>
<id>urn:sha1:e1923ab3d01ef600dbde84ee29822980e816ee79</id>
<content type='text'>
- FBINFO_CAN_FORCE_OUTPUT has been a lie ever since we nerfed&amp;removed
  the entire panic handling code in our fbdev emulation. We might
  restore kms panic output, but not through the bazillion of legacy
  code layers called fbdev/fbcon, there's just no way to make that
  work safely.

- With the module check change FBINFO_DEFAULT is always 0, so can be
  removed too.

That removes another change to cargo-cult stuff in kms drivers, yay!

Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170706125735.28299-5-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/i915: Fix fbdev unload sequence</title>
<updated>2017-07-19T12:29:25+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-14T22:46:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4f256d8219f230cb11b49343931dc0b2fa8bd149'/>
<id>urn:sha1:4f256d8219f230cb11b49343931dc0b2fa8bd149</id>
<content type='text'>
First thing we need to do is unregister the fbdev instance, but we
can't just go ahead and kfree it. That must wait until the hotplug and
polling work are stopped, since they can race with the with the
teardown. That means we need to split up the fbdev teardown into the
unregister part and the cleanup part.

I originally suspected that this was broken in one of the unload
shuffles, but on closer inspection the oldest sequence I've dug out
also gets this wrong. Just not quite so badly.

I've run drv_module_reload a few hundred times and it's rock solid
compared to insta-death beforehand. This bug seems to have been
uncovered by

commit 88be58be886f1215cc73dc8c273c985eecd7385c
Author: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Date:   Thu Jul 6 15:00:19 2017 +0200

    drm/i915/fbdev: Always forward hotplug events

But the effect of that seems to only be to increase the race window
enough to make it blow up easier. I'm not exactly clear on what's
going on there ...

v2: Fix whitespace and use fetch_and_zero (Chris).

Testcase: igt/drv_module_reload
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101791
Cc: martin.peres@free.fr
Cc: chris@chris-wilson.co.uk
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170714224656.6431-2-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/i915/fbdev: Always forward hotplug events</title>
<updated>2017-07-14T13:15:01+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-06T13:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=88be58be886f1215cc73dc8c273c985eecd7385c'/>
<id>urn:sha1:88be58be886f1215cc73dc8c273c985eecd7385c</id>
<content type='text'>
With deferred fbdev setup we always need to forward hotplug events,
even if fbdev isn't fully set up yet. Otherwise the deferred setup
will neer happen.

Originally this check was added in

commit c45eb4fed12d278d3619f1904885bd0d7bcbf036 (tag: drm-intel-next-fixes-2016-08-05)
Author: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Date:   Wed Jul 13 18:34:45 2016 +0100

    drm/i915/fbdev: Check for the framebuffer before use

But the specific case of the hotplug function blowing up was fixed in

commit 50c3dc970a09b3b60422a58934cc27a413288bab
Author: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Date:   Fri Jun 27 17:19:22 2014 +0200

    drm/fb-helper: Fix hpd vs. initial config races

Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170706130023.28417-1-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/fb-helper: Stop using mode_config.mutex for internals</title>
<updated>2017-07-06T08:02:01+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-05T04:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e13a058310509b22b2b45cbdd82d8797e173c3db'/>
<id>urn:sha1:e13a058310509b22b2b45cbdd82d8797e173c3db</id>
<content type='text'>
Those are now all protected using fb_helper-&gt;lock.

v2: We still need to hold mode_config.mutex right around calling
connector-&gt;fill_modes.

v3: I forgot to hold mode_config.mutex while looking at
connector-&gt;status and the mode list. Also, we need to patch up the
i915 -&gt;initial_config callback to grab the locks it needs to inspect
the modeset state recovered from the fw.

v4: Don't reorder the probe too much (Ville).

Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Thierry Reding &lt;treding@nvidia.com&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170705045629.31265-1-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/i915/fbdev: Check for existence of ifbdev-&gt;vma before operations</title>
<updated>2017-07-04T12:14:55+00:00</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2017-06-22T16:02:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15727ed0d944ce1dec8b9e1082dd3df29a0fdf44'/>
<id>urn:sha1:15727ed0d944ce1dec8b9e1082dd3df29a0fdf44</id>
<content type='text'>
Commit fabef825626d ("drm/i915: Drop struct_mutex around frontbuffer
flushes") adds a dependency to ifbdev-&gt;vma when flushing the framebufer,
but the checks are only against the existence of the ifbdev-&gt;fb and not
against ifbdev-&gt;vma. This leaves a window of opportunity where we may
try to operate on the fbdev prior to it being probed (thanks to
asynchronous booting).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101534
Fixes: fabef825626d ("drm/i915: Drop struct_mutex around frontbuffer flushes")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170622160211.783-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
</feed>
