Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Don't oops during modeset shutdown after lpe audio deinit

We deinit the lpe audio device before we call
drm_atomic_helper_shutdown(), which means the platform device
may already be gone when it comes time to shut down the crtc.
As we don't know when the last reference to the platform
device gets dropped by the audio driver we can't assume that
the device and its data are still around when turning off the
crtc. Mark the platform device as gone as soon as we do the
audio deinit.

Cc: stable@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181105194604.6994-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit f45a7977d1140c11f334e01a9f77177ed68e3bfa)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

authored by

Ville Syrjälä and committed by
Joonas Lahtinen
6a8915d0 0014868b

+3 -1
+3 -1
drivers/gpu/drm/i915/intel_lpe_audio.c
··· 297 297 lpe_audio_platdev_destroy(dev_priv); 298 298 299 299 irq_free_desc(dev_priv->lpe_audio.irq); 300 - } 301 300 301 + dev_priv->lpe_audio.irq = -1; 302 + dev_priv->lpe_audio.platdev = NULL; 303 + } 302 304 303 305 /** 304 306 * intel_lpe_audio_notify() - notify lpe audio event