OpenCloudOS-Kernel/drivers/gpu/drm
Sergey Senozhatsky e4158f1b10 radeon_pm: fix oops in hwmon_attributes_visible() and radeon_hwmon_show_temp_thresh()
Since commit ec39f64bba ("drm/radeon/dpm: Convert to use
devm_hwmon_register_with_groups") radeon_hwmon_init() is using
hwmon_device_register_with_groups(), which sets `rdev' as a device
private driver_data, while hwmon_attributes_visible() and
radeon_hwmon_show_temp_thresh() are still waiting for `drm_device'.

Fix them by using dev_get_drvdata(), in order to avoid this oops:

  BUG: unable to handle kernel paging request at 0000000000001e28
  IP: [<ffffffffa02ae8b4>] hwmon_attributes_visible+0x18/0x3d [radeon]
  PGD 15057e067 PUD 151a8e067 PMD 0
  Oops: 0000 [#1] PREEMPT SMP
  Call Trace:
    internal_create_group+0x114/0x1d9
    sysfs_create_group+0xe/0x10
    sysfs_create_groups+0x22/0x5f
    device_add+0x34f/0x501
    device_register+0x15/0x18
    hwmon_device_register_with_groups+0xb5/0xed
    radeon_hwmon_init+0x56/0x7c [radeon]
    radeon_pm_init+0x134/0x7e5 [radeon]
    radeon_modeset_init+0x75f/0x8ed [radeon]
    radeon_driver_load_kms+0xc6/0x187 [radeon]
    drm_dev_register+0xf9/0x1b4 [drm]
    drm_get_pci_dev+0x98/0x129 [drm]
    radeon_pci_probe+0xa3/0xac [radeon]
    pci_device_probe+0x6e/0xcf
    driver_probe_device+0x98/0x1c4
    __driver_attach+0x5c/0x7e
    bus_for_each_dev+0x7b/0x85
    driver_attach+0x19/0x1b
    bus_add_driver+0x104/0x1ce
    driver_register+0x89/0xc5
    __pci_register_driver+0x58/0x5b
    drm_pci_init+0x86/0xea [drm]
    radeon_init+0x97/0x1000 [radeon]
    do_one_initcall+0x7f/0x117
    load_module+0x1583/0x1bb4
    SyS_init_module+0xa0/0xaf

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Alexander Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-12-15 12:16:00 -08:00
..
armada DRM: Armada: convert to use simple_open() 2013-11-06 12:02:36 +10:00
ast drm: Add separate Kconfig option for fbdev helpers 2013-10-11 23:36:58 +02:00
cirrus drm/cirrus: use drm_set_preferred_mode 2013-11-06 13:36:19 +10:00
exynos drm/exynos: release unhandled page flip events at postclose. 2013-12-02 22:49:20 +09:00
gma500 Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-11-15 14:19:54 +09:00
i2c drm/i2c: tda998x: set VIF for full range, underscanned display 2013-10-18 15:58:32 +01:00
i810 drm: Kill drm perf counter leftovers 2013-10-09 15:55:33 +10:00
i915 Merge tag 'drm-intel-fixes-2013-12-02' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes 2013-12-05 09:26:20 +10:00
mga drm: Kill drm perf counter leftovers 2013-10-09 15:55:33 +10:00
mgag200 drm/mgag200: drop pointless info print. 2013-11-08 15:49:43 +10:00
msm Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next 2013-11-10 18:27:31 +10:00
nouveau Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes 2013-12-05 09:21:16 +10:00
omapdrm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-11-15 14:19:54 +09:00
qxl drm/qxl: fix memory leak in release list handling 2013-11-29 08:36:15 +10:00
r128
radeon radeon_pm: fix oops in hwmon_attributes_visible() and radeon_hwmon_show_temp_thresh() 2013-12-15 12:16:00 -08:00
rcar-du drm: Add separate Kconfig option for fbdev helpers 2013-10-11 23:36:58 +02:00
savage
shmobile drm: shmob_drm: Convert to clk_prepare/unprepare 2013-11-10 18:48:38 +10:00
sis
tdfx
tegra drm/tegra: return -EFAULT if copy_from_user() fails 2013-12-03 10:14:03 +01:00
tilcdc drm: Add separate Kconfig option for fbdev helpers 2013-10-11 23:36:58 +02:00
ttm Merge branch 'ttm-fixes-3.13' of git://people.freedesktop.org/~thomash/linux into drm-fixes 2013-11-21 18:46:56 +10:00
udl udl: fix issue with imported prime buffers 2013-12-05 09:23:38 +10:00
via drm: Kill ctx_count from struct drm_device 2013-10-09 15:55:32 +10:00
vmwgfx drm/vmwgfx: Add our connectors to sysfs 2013-12-04 12:04:02 -08:00
Kconfig drm/tegra: Changes for v3.13-rc1 2013-11-05 16:21:00 +10:00
Makefile drm/tegra: Changes for v3.13-rc1 2013-11-05 16:21:00 +10:00
README.drm
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c
drm_cache.c
drm_context.c drm: Kill ctx_count from struct drm_device 2013-10-09 15:55:32 +10:00
drm_crtc.c drm: Pretty print pixel format in drm_fb_get_bpp_depth() and format_check() 2013-11-06 13:29:34 +10:00
drm_crtc_helper.c drm: eliminate bit-copy restoration of crtc 2013-11-06 14:27:51 +10:00
drm_debugfs.c drm: Make drm_debugfs_list const 2013-11-06 12:05:21 +10:00
drm_dma.c
drm_dp_helper.c drm/dp: constify DP DPCD helpers 2013-10-01 15:28:57 +10:00
drm_drv.c Merge tag 'drm-intel-fixes-2013-11-07' of git://people.freedesktop.org/~danvet/drm-intel into drm-next 2013-11-08 16:34:39 +10:00
drm_edid.c drm: fix the addition of the side-by-side (half) flag for extra 3D modes 2013-12-05 11:00:59 +10:00
drm_edid_load.c drm: Try loading builtin EDIDs first 2013-10-09 15:55:28 +10:00
drm_encoder_slave.c drm: encoder_slave: Don't use i2c_client->driver 2013-10-03 22:28:28 +02:00
drm_fb_cma_helper.c
drm_fb_helper.c Merge tag 'v3.12' into drm-intel-next 2013-11-04 16:28:52 +01:00
drm_flip_work.c kfifo API type safety 2013-11-15 09:32:23 +09:00
drm_fops.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-11-15 14:19:54 +09:00
drm_gem.c drm: kill ->gem_init_object() and friends 2013-10-09 14:38:02 +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: Remove unused variable in drm_global_item_ref() 2013-10-01 15:28:58 +10:00
drm_hashtab.c
drm_info.c drm: Collect per-crtc vblank stuff to a struct 2013-10-09 15:55:31 +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 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
drm_lock.c drm: Kill drm perf counter leftovers 2013-10-09 15:55:33 +10:00
drm_memory.c
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: copy mode type in drm_mode_connector_list_update() 2013-10-23 14:21:12 +01:00
drm_pci.c drm: Pass pointers to virt_to_page() 2013-11-06 13:23:20 +10:00
drm_platform.c drm: introduce drm_dev_free() to fix error paths 2013-10-09 15:55:09 +10:00
drm_prime.c drm: Remove unused variable in drm_prime_sg_to_page_addr_arrays() 2013-10-01 15:28:58 +10:00
drm_rect.c
drm_scatter.c
drm_stub.c drm: check for !kdev in drm_unplug_minor() 2013-11-15 20:49:02 +10:00
drm_sysfs.c drm/sysfs: fix OOM verification 2013-11-28 14:35:23 +10:00
drm_trace.h
drm_trace_points.c
drm_usb.c drm: introduce drm_dev_free() to fix error paths 2013-10-09 15:55:09 +10:00
drm_vm.c drm: Pass pointers to virt_to_page() 2013-11-06 13:23:20 +10:00
drm_vma_manager.c

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