[Intel-gfx] [PATCH] drm/i915: Fix module unloading with DRM_I915_UMS=n
Paulo Zanoni
przanoni at gmail.com
Fri Nov 22 20:25:41 CET 2013
2013/11/15 Daniel Vetter <daniel.vetter at ffwll.ch>:
> Oops, makes testing early boot failures in i915.ko a bit more pain, so
> let's fix it.
>
> v2: We already have a bit of static storage to track this (Chris).
>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
I can reproduce the failure by booting with i915.modeset=0, then get
the oops when "rmmod i915".
Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
I also looked at Chris' patch. I think that since we take the early
"return 0" inside i915_init, we never call drm_pci_init, so it doesn't
make too much sense to fix the problem inside drm_pci_exit.
> ---
> drivers/gpu/drm/i915/i915_drv.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index c2e00ed23195..72fc9e33c78c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1020,6 +1020,11 @@ static int __init i915_init(void)
>
> static void __exit i915_exit(void)
> {
> +#ifndef CONFIG_DRM_I915_UMS
> + if (!(driver.driver_features & DRIVER_MODESET))
> + return; /* Never loaded a driver. */
> +#endif
> +
> drm_pci_exit(&driver, &i915_pci_driver);
> }
>
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Paulo Zanoni
More information about the Intel-gfx
mailing list