From: Greg Kroah-Hartman Date: Tue, 4 Jun 2019 12:43:13 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.1.8~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c5cf0148f58e28580effce6f48c4ddc7341aeef;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: drm-lease-make-sure-implicit-planes-are-leased.patch drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch drm-vmwgfx-don-t-send-drm-sysfs-hotplug-events-on-initial-master-set.patch --- diff --git a/queue-4.14/drm-lease-make-sure-implicit-planes-are-leased.patch b/queue-4.14/drm-lease-make-sure-implicit-planes-are-leased.patch new file mode 100644 index 00000000000..9f7a40d1be2 --- /dev/null +++ b/queue-4.14/drm-lease-make-sure-implicit-planes-are-leased.patch @@ -0,0 +1,68 @@ +From 204f640da6914844b3270b41b29c84f6e3b74083 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Thu, 28 Feb 2019 15:49:08 +0100 +Subject: drm/lease: Make sure implicit planes are leased + +From: Daniel Vetter + +commit 204f640da6914844b3270b41b29c84f6e3b74083 upstream. + +If userspace doesn't enable universal planes, then we automatically +add the primary and cursor planes. But for universal userspace there's +no such check (and maybe we only want to give the lessee one plane, +maybe not even the primary one), hence we need to check for the +implied plane. + +v2: don't forget setcrtc ioctl. + +v3: Still allow disabling of the crtc in SETCRTC. + +Cc: stable@vger.kernel.org +Cc: Keith Packard +Reviewed-by: Boris Brezillon +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20190228144910.26488-6-daniel.vetter@ffwll.ch +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/drm_crtc.c | 4 ++++ + drivers/gpu/drm/drm_plane.c | 8 ++++++++ + 2 files changed, 12 insertions(+) + +--- a/drivers/gpu/drm/drm_crtc.c ++++ b/drivers/gpu/drm/drm_crtc.c +@@ -576,6 +576,10 @@ int drm_mode_setcrtc(struct drm_device * + } + DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); + ++ /* allow disabling with the primary plane leased */ ++ if (crtc_req->mode_valid && !drm_lease_held(file_priv, plane->base.id)) ++ return -EACCES; ++ + mutex_lock(&crtc->dev->mode_config.mutex); + drm_modeset_acquire_init(&ctx, 0); + retry: +--- a/drivers/gpu/drm/drm_plane.c ++++ b/drivers/gpu/drm/drm_plane.c +@@ -851,6 +851,11 @@ retry: + if (ret) + goto out; + ++ if (!drm_lease_held(file_priv, crtc->cursor->base.id)) { ++ ret = -EACCES; ++ goto out; ++ } ++ + ret = drm_mode_cursor_universal(crtc, req, file_priv, &ctx); + goto out; + } +@@ -949,6 +954,9 @@ int drm_mode_page_flip_ioctl(struct drm_ + if (!crtc) + return -ENOENT; + ++ if (!drm_lease_held(file_priv, plane->base.id)) ++ return -EACCES; ++ + if (crtc->funcs->page_flip_target) { + u32 current_vblank; + int r; diff --git a/queue-4.14/drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch b/queue-4.14/drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch new file mode 100644 index 00000000000..a917bcebbc6 --- /dev/null +++ b/queue-4.14/drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch @@ -0,0 +1,69 @@ +From b8f9d7f37b6af829c34c49d1a4f73ce6ed58e403 Mon Sep 17 00:00:00 2001 +From: Vicente Bergas +Date: Tue, 2 Apr 2019 13:37:53 +0200 +Subject: drm/rockchip: shutdown drm subsystem on shutdown + +From: Vicente Bergas + +commit b8f9d7f37b6af829c34c49d1a4f73ce6ed58e403 upstream. + +As explained by Robin Murphy: +> the IOMMU shutdown disables paging, so if the VOP is still +> scanning out then that will result in whatever IOVAs it was using now going +> straight out onto the bus as physical addresses. + +We had a more radical approach before in commit +7f3ef5dedb14 ("drm/rockchip: Allow driver to be shutdown on reboot/kexec") +but that resulted in new warnings and oopses on shutdown on rk3399 +chromeos devices. + +So second try is resurrecting Vicentes shutdown change which should +achieve the same result but in a less drastic way. + +Fixes: 63238173b2fa ("Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"") +Cc: Jeffy Chen +Cc: Robin Murphy +Cc: Marc Zyngier +Cc: Brian Norris +Cc: Doug Anderson +Cc: stable@vger.kernel.org +Suggested-by: JeffyChen +Suggested-by: Robin Murphy +Signed-off-by: Vicente Bergas +[adapted commit message to explain the history] +Signed-off-by: Heiko Stuebner +Tested-by: Brian Norris +Tested-by: Douglas Anderson +Acked-by: Marc Zyngier +Link: https://patchwork.freedesktop.org/patch/msgid/20190402113753.10118-1-heiko@sntech.de +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c ++++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +@@ -425,6 +425,14 @@ static int rockchip_drm_platform_remove( + return 0; + } + ++static void rockchip_drm_platform_shutdown(struct platform_device *pdev) ++{ ++ struct drm_device *drm = platform_get_drvdata(pdev); ++ ++ if (drm) ++ drm_atomic_helper_shutdown(drm); ++} ++ + static const struct of_device_id rockchip_drm_dt_ids[] = { + { .compatible = "rockchip,display-subsystem", }, + { /* sentinel */ }, +@@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ + static struct platform_driver rockchip_drm_platform_driver = { + .probe = rockchip_drm_platform_probe, + .remove = rockchip_drm_platform_remove, ++ .shutdown = rockchip_drm_platform_shutdown, + .driver = { + .name = "rockchip-drm", + .of_match_table = rockchip_drm_dt_ids, diff --git a/queue-4.14/drm-vmwgfx-don-t-send-drm-sysfs-hotplug-events-on-initial-master-set.patch b/queue-4.14/drm-vmwgfx-don-t-send-drm-sysfs-hotplug-events-on-initial-master-set.patch new file mode 100644 index 00000000000..2d9038eea06 --- /dev/null +++ b/queue-4.14/drm-vmwgfx-don-t-send-drm-sysfs-hotplug-events-on-initial-master-set.patch @@ -0,0 +1,40 @@ +From 63cb44441826e842b7285575b96db631cc9f2505 Mon Sep 17 00:00:00 2001 +From: Thomas Hellstrom +Date: Tue, 7 May 2019 11:07:53 +0200 +Subject: drm/vmwgfx: Don't send drm sysfs hotplug events on initial master set + +From: Thomas Hellstrom + +commit 63cb44441826e842b7285575b96db631cc9f2505 upstream. + +This may confuse user-space clients like plymouth that opens a drm +file descriptor as a result of a hotplug event and then generates a +new event... + +Cc: +Fixes: 5ea1734827bb ("drm/vmwgfx: Send a hotplug event at master_set") +Signed-off-by: Thomas Hellstrom +Reviewed-by: Deepak Rawat +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +@@ -1245,7 +1245,13 @@ static int vmw_master_set(struct drm_dev + } + + dev_priv->active_master = vmaster; +- drm_sysfs_hotplug_event(dev); ++ ++ /* ++ * Inform a new master that the layout may have changed while ++ * it was gone. ++ */ ++ if (!from_open) ++ drm_sysfs_hotplug_event(dev); + + return 0; + } diff --git a/queue-4.14/series b/queue-4.14/series index 38217ac4ff8..6ed3868c04f 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -59,3 +59,6 @@ staging-wlan-ng-fix-adapter-initialization-failure.patch cifs-cifs_read_allocate_pages-don-t-iterate-through-whole-page-array-on-enomem.patch revert-lockd-show-pid-of-lockd-for-remote-locks.patch gcc-plugins-fix-build-failures-under-darwin-host.patch +drm-vmwgfx-don-t-send-drm-sysfs-hotplug-events-on-initial-master-set.patch +drm-rockchip-shutdown-drm-subsystem-on-shutdown.patch +drm-lease-make-sure-implicit-planes-are-leased.patch