Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp49788imu; Thu, 8 Nov 2018 14:34:34 -0800 (PST) X-Google-Smtp-Source: AJdET5e4Mno+OqdUybhwDxUfCkBodyp38yn/f+cBJRxFMPjzN8EHLSx3icaDJcLyXf2847Ij4gQs X-Received: by 2002:a63:8e43:: with SMTP id k64mr5270921pge.346.1541716474292; Thu, 08 Nov 2018 14:34:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716474; cv=none; d=google.com; s=arc-20160816; b=vhuL/XxG8aHXavBU2V0bvQnP+cgkyWH9RRkNU3yC87f+bQteXoFlU/aOf13MpaRCq4 8eCJQpjU4lq6VibmkaCskINfjcWCaE/18YyxVRdAXQI4fh5HD5fmB8PA6j4jm27psNBF ptOxbHc2s+rPbHLR/PuJX4Tl9CLuDot6ndIxqHyCToqm5c7p9sW3r/pU/h7RiV0TbhWD NeRqTAzBedEmSmIL38JliuFhTmKfroJFP7KBk90Jt7Nv5z56DKkhB3UuHFFSjSYigiJG Gnhz7A/DzVaXGPZtfxI/JPRKcBXZPmFIZodxpLWYjRVB0DGCYft8BhfNTW3QFFZTosCb 8t7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/rDQgbKeLQj0Qxi+GEkEABPFl0bI0zwuyZWLXObhAIY=; b=cavh54KgujTSW2bWd8AANMDOcqjFc2hAO9JzYIMzLHM3s9+z5IxSp1ziYtBJ4GLMUw 1X1xSNyHPzeJs1nDfBh1r/vWFTsPyoYAW6odKT/tnNNCW8kVHoMhfgzPmHl+SjBsqfZN AewTKVauc5AabCAm3JeIQL8YGPNU6GRvt82bGDUUttzYHLjsVIgdzzMO4W8WsCPVg4XE fvJCKXUSc1c9/rdA1OYNNeYLZ7y7atGUk/bEPdLHncRQ+cttHp3804k3DghK+QUKHfRE +4C0mpbavWId1fwj/t0DfnIkbNze+i1h0s7jxCwI4GdCfBFlVw/NaS+6LmpGXsfGcc6R y4jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MsIjedfl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21-v6si4468001pgg.123.2018.11.08.14.34.18; Thu, 08 Nov 2018 14:34:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MsIjedfl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730195AbeKIHhT (ORCPT + 99 others); Fri, 9 Nov 2018 02:37:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:55158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729502AbeKIHhR (ORCPT ); Fri, 9 Nov 2018 02:37:17 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4FFF120818; Thu, 8 Nov 2018 21:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714389; bh=BKQ4Tof9t/8FcwW8nHMYzG1ZPxHUQeMFXstyFne9q8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MsIjedflV7AcjEGuRM1HYDpOUHl6wc51c7ZoApnpnkNWpk9YIKA78T/WmhClDoU6U ZyWRCDrE2c3+p2SgKdo59Op7dBmaqESEFzfhVwCia9YUQfZ6UUGdXpJrwl/3p2tpTG zCsNrAaLQbo54JwgFKLlwIjVHExAwQZU0PyvxFWw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Roskin , Daniel Vetter , Ben Skeggs , Sasha Levin Subject: [PATCH 4.4 052/114] drm/nouveau/fbcon: fix oops without fbdev emulation Date: Thu, 8 Nov 2018 13:51:07 -0800 Message-Id: <20181108215105.860896186@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 4813766325374af6ed0b66879ba6a0bbb05c83b6 ] This is similar to an earlier commit 52dfcc5ccfbb ("drm/nouveau: fix for disabled fbdev emulation"), but protects all occurrences of helper.fbdev in the source. I see oops in nouveau_fbcon_accel_save_disable() called from nouveau_fbcon_set_suspend_work() on Linux 3.13 when CONFIG_DRM_FBDEV_EMULATION option is disabled. Signed-off-by: Pavel Roskin Reviewed-by: Daniel Vetter Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index e40a1b07a014..343476d15726 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -235,7 +235,7 @@ void nouveau_fbcon_accel_save_disable(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); - if (drm->fbcon) { + if (drm->fbcon && drm->fbcon->helper.fbdev) { drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags; drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; } @@ -245,7 +245,7 @@ void nouveau_fbcon_accel_restore(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); - if (drm->fbcon) { + if (drm->fbcon && drm->fbcon->helper.fbdev) { drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags; } } @@ -257,7 +257,8 @@ nouveau_fbcon_accel_fini(struct drm_device *dev) struct nouveau_fbdev *fbcon = drm->fbcon; if (fbcon && drm->channel) { console_lock(); - fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; + if (fbcon->helper.fbdev) + fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; console_unlock(); nouveau_channel_idle(drm->channel); nvif_object_fini(&fbcon->twod); -- 2.17.1