From 90d0284008b59144dfeb7dc3f13e89798345cfa7 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Wed, 8 Apr 2015 13:12:09 +0000 Subject: [PATCH] fix #44491 --- 0001-fixup-drm.patch | 70 ++++++++++++++++++++++++++++++++++++++++++++ PKGBUILD | 18 ++++++++++-- 2 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 0001-fixup-drm.patch diff --git a/0001-fixup-drm.patch b/0001-fixup-drm.patch new file mode 100644 index 0000000..2acfb1e --- /dev/null +++ b/0001-fixup-drm.patch @@ -0,0 +1,70 @@ +From 8218c3f4df3bb1c637c17552405039a6dd3c1ee1 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Fri, 27 Feb 2015 12:58:13 +0100 +Subject: drm: Fixup racy refcounting in plane_force_disable + +Originally it was impossible to be dropping the last refcount in this +function since there was always one around still from the idr. But in + +commit 83f45fc360c8e16a330474860ebda872d1384c8c +Author: Daniel Vetter +Date: Wed Aug 6 09:10:18 2014 +0200 + + drm: Don't grab an fb reference for the idr + +we've switched to weak references, broke that assumption but forgot to +fix it up. + +Since we still force-disable planes it's only possible to hit this +when racing multiple rmfb with fbdev restoring or similar evil things. +As long as userspace is nice it's impossible to hit the BUG_ON. + +But the BUG_ON would most likely be hit from fbdev code, which usually +invovles the console_lock besides all modeset locks. So very likely +we'd never get the bug reports if this was hit in the wild, hence +better be safe than sorry and backport. + +Spotted by Matt Roper while reviewing other patches. + +[airlied: pull this back into 4.0 - the oops happens there] + +Cc: stable@vger.kernel.org +Cc: Matt Roper +Reviewed-by: Matt Roper +Signed-off-by: Daniel Vetter +Signed-off-by: Dave Airlie + +diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c +index f6d04c7..679b10e 100644 +--- a/drivers/gpu/drm/drm_crtc.c ++++ b/drivers/gpu/drm/drm_crtc.c +@@ -525,17 +525,6 @@ void drm_framebuffer_reference(struct drm_framebuffer *fb) + } + EXPORT_SYMBOL(drm_framebuffer_reference); + +-static void drm_framebuffer_free_bug(struct kref *kref) +-{ +- BUG(); +-} +- +-static void __drm_framebuffer_unreference(struct drm_framebuffer *fb) +-{ +- DRM_DEBUG("%p: FB ID: %d (%d)\n", fb, fb->base.id, atomic_read(&fb->refcount.refcount)); +- kref_put(&fb->refcount, drm_framebuffer_free_bug); +-} +- + /** + * drm_framebuffer_unregister_private - unregister a private fb from the lookup idr + * @fb: fb to unregister +@@ -1320,7 +1309,7 @@ void drm_plane_force_disable(struct drm_plane *plane) + return; + } + /* disconnect the plane from the fb and crtc: */ +- __drm_framebuffer_unreference(plane->old_fb); ++ drm_framebuffer_unreference(plane->old_fb); + plane->old_fb = NULL; + plane->fb = NULL; + plane->crtc = NULL; +-- +cgit v0.10.2 + diff --git a/PKGBUILD b/PKGBUILD index 04b3ad5..2f23422 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ pkgbase=linux # Build stock -ARCH kernel #pkgbase=linux-custom # Build kernel with a different name _srcname=linux-3.19 pkgver=3.19.3 -pkgrel=2 +pkgrel=3 arch=('i686' 'x86_64') url="http://www.kernel.org/" license=('GPL2') @@ -20,7 +20,8 @@ source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz" # standard config files for mkinitcpio ramdisk 'linux.preset' 'change-default-console-loglevel.patch' - '0001-fix-btrfs-mount-deadlock.patch') + '0001-fix-btrfs-mount-deadlock.patch' + '0001-fixup-drm.patch') sha256sums=('be42511fe5321012bb4a2009167ce56a9e5fe362b4af43e8c371b3666859806c' 'SKIP' 'cd9474b61b859d68f83ff0b769bafef8489d2090e0a933d2a7e5f76a23cc071a' @@ -55,6 +56,9 @@ prepare() { # https://btrfs.wiki.kernel.org/index.php/Gotchas patch -Np1 -i "${srcdir}/0001-fix-btrfs-mount-deadlock.patch" + # fix #44491 + patch -Np1 -i "${srcdir}/0001-fixup-drm.patch" + if [ "${CARCH}" = "x86_64" ]; then cat "${srcdir}/config.x86_64" > ./.config else @@ -301,3 +305,13 @@ for _p in ${pkgname[@]}; do done # vim:set ts=8 sts=2 sw=2 et: +sha256sums=('be42511fe5321012bb4a2009167ce56a9e5fe362b4af43e8c371b3666859806c' + 'SKIP' + 'cd9474b61b859d68f83ff0b769bafef8489d2090e0a933d2a7e5f76a23cc071a' + 'SKIP' + '704a479de77c9022e5c7a797d2cd7fd0e4ba1f52f9039ec8a80efd57f7e9f0d8' + '59830f47c1be39f874640d762dca55f972aca549a7a65ba2f1dac184251dabb2' + 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' + '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99' + '5967cf53cb9db9f070e8f346c3d7045748e4823a7fe2ee330acd18c9d02bbb77' + '911872ef7000af471e649aaeb3490094a0b4c1514ca1024757ca2e90ac1d2a3d')