From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34098 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753AbcFDUql (ORCPT ); Sat, 4 Jun 2016 16:46:41 -0400 Date: Sat, 4 Jun 2016 13:46:39 -0700 From: Greg Kroah-Hartman To: Lyude Cc: stable@vger.kernel.org, Daniel Vetter , Jani Nikula , David Airlie , "open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...), dri-devel@lists.freedesktop.org (open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...), linux-kernel@vger.kernel.org (open list))" Subject: Re: [PATCH 3/4] drm/i915: Discard previous atomic state on resume if connectors change Message-ID: <20160604204639.GA21443@kroah.com> References: <1464713347-28982-1-git-send-email-cpaul@redhat.com> <1464713347-28982-4-git-send-email-cpaul@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464713347-28982-4-git-send-email-cpaul@redhat.com> Sender: stable-owner@vger.kernel.org List-ID: On Tue, May 31, 2016 at 12:49:06PM -0400, Lyude wrote: > If an MST device is disconnected while the machine is suspended, the > number of connectors will change as well after we call > intel_dp_mst_resume(). This means that any previous atomic state we had > before suspending is no longer valid, since it'll still be pointing to > missing connectors. We need to check for this before committing the > state, otherwise we'll kernel panic on resume whenever if any MST > display was disconnected before we started resuming: > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 > IP: [] drm_atomic_helper_check_modeset+0x29f/0xb40 [drm_kms_helper] > Call Trace: > [] intel_atomic_check+0x34/0x1180 [i915] > [] ? mark_held_locks+0x6f/0xa0 > [] ? trace_hardirqs_on_caller+0x129/0x1b0 > [] drm_atomic_check_only+0x192/0x620 [drm] > [] ? pci_pm_thaw+0x21/0x90 > [] drm_atomic_commit+0x17/0x60 [drm] > [] intel_display_resume+0xbd/0x160 [i915] > [] ? pci_pm_thaw+0x90/0x90 > [] i915_drm_resume+0xd8/0x160 [i915] > [] i915_pm_resume+0x25/0x30 [i915] > [] pci_pm_resume+0x64/0xa0 > [] dpm_run_callback+0x90/0x190 > [] device_resume+0xd5/0x1f0 > [] async_resume+0x1d/0x50 > [] async_run_entry_fn+0x48/0x150 > [] process_one_work+0x1e9/0x5c0 > [] ? process_one_work+0x166/0x5c0 > [] worker_thread+0x48/0x4e0 > [] ? process_one_work+0x5c0/0x5c0 > [] kthread+0xe4/0x100 > [] ret_from_fork+0x22/0x50 > [] ? kthread_create_on_node+0x200/0x200 > > Changes since v1: > - Move drm_atomic_state_free() call down so we're holding the > appropriate locks when destroying the atomic state > Changes since v2: > - Check that state != NULL before we start accessing it's members > > This fix is only required for 4.6 and below. David Airlie's patchseries > for 4.7 to add connector reference counting provides a more proper fix > for this. This doesn't apply to 4.5-stable or 4.4-stable, if you want it there, can you provide a backported version for me to apply? thanks, greg k-h