alistair23-linux/drivers/gpu/drm
Paulo Zanoni d9255d5714 drm/i915: destroy connector sysfs files earlier
For some reason, every single time I try to run module_reload
something tries to read the connector sysfs files. This happens
after we destroy the encoders and before we destroy the connectors, so
when the sysfs read triggers the connector detect() function,
intel_conector->encoder points to memory that was already freed.

The bad backtrace is just:
    [<ffffffff8163ca9a>] dump_stack+0x54/0x74
    [<ffffffffa00c2c8e>] intel_dp_detect+0x1e/0x4b0 [i915]
    [<ffffffffa001913d>] status_show+0x3d/0x80 [drm]
    [<ffffffff813d5340>] dev_attr_show+0x20/0x60
    [<ffffffff81221f50>] ? sysfs_read_file+0x80/0x1b0
    [<ffffffff81221f79>] sysfs_read_file+0xa9/0x1b0
    [<ffffffff811aaf1e>] vfs_read+0x9e/0x170
    [<ffffffff811aba4c>] SyS_read+0x4c/0xa0
    [<ffffffff8164e392>] system_call_fastpath+0x16/0x1b

But if you add tons of memory checking debug options to your Kernel
you'll also see:
 - general protection fault: 0000
 - BUG kmalloc-4096 (Tainted: G      D W   ): Poison overwritten
 - INFO: Allocated in intel_ddi_init+0x65/0x270 [i915]
 - INFO: Freed in intel_dp_encoder_destroy+0x69/0xb0 [i915]
Among a bunch of other error messages.

So this commit just destroys the sysfs files before both the encoder
and connectors are freed.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-01 07:45:48 +02:00
..
ast drm/ast: fix the ast open key function 2013-09-12 15:32:41 +10:00
cirrus Merge branch 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-next 2013-09-02 09:31:40 +10:00
exynos drm/exynos: fix return value check in lowlevel_buffer_allocate() 2013-09-16 21:57:08 +09:00
gma500 Merge branch 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-next 2013-09-02 09:31:40 +10:00
i2c drm/i2c: tda998x: fix audio muting 2013-09-24 09:41:18 -07:00
i810 drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
i915 drm/i915: destroy connector sysfs files earlier 2013-10-01 07:45:48 +02:00
mga drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
mgag200 Merge branch 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-next 2013-09-02 09:31:40 +10:00
msm drm/msm: use drm_gem_dumb_destroy helper 2013-09-28 10:14:06 -04:00
nouveau drm: Remove clock_index from struct drm_display_mode 2013-10-01 07:45:34 +02:00
omapdrm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-09-05 10:17:26 -07:00
qxl drm: verify vma access in TTM+GEM drivers 2013-08-27 11:54:58 +10:00
r128 drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
radeon Merge branch 'drm-fixes-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-fixes 2013-09-28 14:45:30 +10:00
rcar-du drm: Pass page flip ioctl flags to driver 2013-08-30 09:24:54 +10:00
savage drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
shmobile drm: Pass page flip ioctl flags to driver 2013-08-30 09:24:54 +10:00
sis drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
tdfx drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
tilcdc Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-09-05 10:17:26 -07:00
ttm Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux 2013-09-18 21:17:44 -05:00
udl drm/udl: rip out set_need_resched 2013-09-16 08:35:04 +10:00
via drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
vmwgfx Merge branch 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-next 2013-09-02 09:31:40 +10:00
ati_pcigart.c
drm_agpsupport.c drm/agp: move AGP cleanup paths to drm_agpsupport.c 2013-08-07 10:14:24 +10:00
drm_auth.c
drm_buffer.c
drm_bufs.c drm: remove the dma_ioctl special-case 2013-08-19 14:15:50 +10:00
drm_cache.c
drm_context.c Revert "drm: mark context support as a legacy subsystem" 2013-09-20 08:32:59 +10:00
drm_crtc.c drm: Reject stereo modes with an unknown layout 2013-10-01 07:45:45 +02:00
drm_crtc_helper.c drm: Make exposing stereo modes a per-connector opt-in 2013-10-01 07:45:33 +02:00
drm_debugfs.c
drm_dma.c drm: mark dma setup/teardown as legacy systems 2013-08-19 10:04:21 +10:00
drm_dp_helper.c
drm_drv.c drm: Add a SET_CLIENT_CAP ioctl 2013-10-01 07:45:26 +02:00
drm_edid.c drm: Code stereo layouts as an enum rather than a bit field 2013-10-01 07:45:44 +02:00
drm_edid_load.c drm: avoid warning in drm_load_edid_firmware() 2013-07-10 14:21:46 -07:00
drm_encoder_slave.c drm: refactor call to request_module 2013-05-10 14:46:03 +10:00
drm_fb_cma_helper.c drm: Make drm_fb_cma_describe() static 2013-08-21 12:47:41 +10:00
drm_fb_helper.c drm/fb-helper: don't sleep for screen unblank when an oops is in progress 2013-09-19 11:54:34 +10:00
drm_flip_work.c drm: add flip-work helper 2013-08-19 10:32:26 +10:00
drm_fops.c Revert "drm: mark context support as a legacy subsystem" 2013-09-20 08:32:59 +10:00
drm_gem.c drm/prime: Remove PRIME handles only if supported 2013-08-30 09:11:59 +10:00
drm_gem_cma_helper.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-09-05 10:17:26 -07:00
drm_global.c
drm_hashtab.c
drm_info.c drm/gem: switch dev->object_name_lock to a mutex 2013-08-21 12:58:01 +10:00
drm_ioc32.c
drm_ioctl.c drm: Add a STEREO_3D capability to the SET_CLIENT_CAP ioctl 2013-10-01 07:45:27 +02:00
drm_irq.c drm: Don't pass negative delta to ktime_sub_ns() 2013-08-08 09:50:25 +10:00
drm_lock.c
drm_memory.c drm/memory: don't export agp helpers 2013-08-19 10:05:53 +10:00
drm_mm.c Merge tag 'drm-intel-next-2013-08-23' of git://people.freedesktop.org/~danvet/drm-intel into drm-next 2013-08-30 09:47:41 +10:00
drm_modes.c drm: Implement timings adjustments for frame packing 2013-10-01 07:45:36 +02:00
drm_pci.c drm: implement experimental render nodes 2013-08-30 08:43:57 +10:00
drm_platform.c drm: implement experimental render nodes 2013-08-30 08:43:57 +10:00
drm_prime.c drm/prime: double lock typo 2013-08-30 08:58:32 +10:00
drm_rect.c drm: Add drm_rect_debug_print() 2013-04-30 22:20:00 +02:00
drm_scatter.c drm: disallow legacy sg ioctls for modesetting drivers 2013-08-19 10:04:06 +10:00
drm_stub.c Revert "drm: mark context support as a legacy subsystem" 2013-09-20 08:32:59 +10:00
drm_sysfs.c drm: Convert drm class driver from legacy pm ops to dev_pm_ops 2013-07-04 10:50:26 +10:00
drm_trace.h drm: fix print format of sequence in trace point 2013-07-04 10:55:27 +10:00
drm_trace_points.c
drm_usb.c drm: implement experimental render nodes 2013-08-30 08:43:57 +10:00
drm_vm.c drm: rip out drm_core_has_MTRR checks 2013-08-19 14:11:44 +10:00
drm_vma_manager.c drm/vma: add access management helpers 2013-08-27 11:54:54 +10:00
Kconfig Merge tag 'drm-intel-next-2013-08-23' of git://people.freedesktop.org/~danvet/drm-intel into drm-next 2013-08-30 09:47:41 +10:00
Makefile drm/msm: basic KMS driver for snapdragon 2013-08-24 14:57:07 -04:00
README.drm

************************************************************
* For the very latest on DRI development, please see:      *
*     http://dri.freedesktop.org/                          *
************************************************************

The Direct Rendering Manager (drm) is a device-independent kernel-level
device driver that provides support for the XFree86 Direct Rendering
Infrastructure (DRI).

The DRM supports the Direct Rendering Infrastructure (DRI) in four major
ways:

    1. The DRM provides synchronized access to the graphics hardware via
       the use of an optimized two-tiered lock.

    2. The DRM enforces the DRI security policy for access to the graphics
       hardware by only allowing authenticated X11 clients access to
       restricted regions of memory.

    3. The DRM provides a generic DMA engine, complete with multiple
       queues and the ability to detect the need for an OpenGL context
       switch.

    4. The DRM is extensible via the use of small device-specific modules
       that rely extensively on the API exported by the DRM module.


Documentation on the DRI is available from:
    http://dri.freedesktop.org/wiki/Documentation
    http://sourceforge.net/project/showfiles.php?group_id=387
    http://dri.sourceforge.net/doc/

For specific information about kernel-level support, see:

    The Direct Rendering Manager, Kernel Support for the Direct Rendering
    Infrastructure
    http://dri.sourceforge.net/doc/drm_low_level.html

    Hardware Locking for the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/hardware_locking_low_level.html

    A Security Analysis of the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/security_low_level.html