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

drm: fix ordering of driver unload vs agp unload.

For KMS drivers, we really need to cleanup the driver before disabling
the AGP subsystem.

Signed-off-by: Dave Airlie <airlied@redhat.com>

+3 -3
+3 -3
drivers/gpu/drm/drm_drv.c
··· 314 314 DRM_DEBUG("mtrr_del=%d\n", retval); 315 315 } 316 316 317 + if (dev->driver->unload) 318 + dev->driver->unload(dev); 319 + 317 320 if (drm_core_has_AGP(dev) && dev->agp) { 318 321 drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS); 319 322 dev->agp = NULL; 320 323 } 321 - 322 - if (dev->driver->unload) 323 - dev->driver->unload(dev); 324 324 325 325 drm_ht_remove(&dev->map_hash); 326 326 drm_ctxbitmap_cleanup(dev);