From: Ville Syrjälä Date: Wed, 15 Feb 2012 13:02:52 +0000 (+0200) Subject: gfx: drv: Warn if mode_config.mutex is not locked in GTT code X-Git-Tag: 2.1b_release~280 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7089ecf3227064183404d2941af20d5981d5635;p=kernel%2Fkernel-mfld-blackbay.git gfx: drv: Warn if mode_config.mutex is not locked in GTT code The GTT ref counting relies on mode_config.mutex for protection. Print a warning if the code is called without holding the mutex. Signed-off-by: Ville Syrjälä Reviewed-by: Imre Deak Signed-off-by: Kirill A. Shutemov --- diff --git a/drivers/staging/mrst/drv/psb_gtt.c b/drivers/staging/mrst/drv/psb_gtt.c index 9610f7a..2025c9e 100644 --- a/drivers/staging/mrst/drv/psb_gtt.c +++ b/drivers/staging/mrst/drv/psb_gtt.c @@ -897,6 +897,8 @@ int psb_gtt_map_meminfo(struct drm_device *dev, { struct psb_gtt_mem_mapping *mapping; + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); + /* check if memory is already mapped */ mapping = psb_gtt_find_mapping_for_key(dev, psb_get_tgid(), (u32) psKernelMemInfo); @@ -940,6 +942,8 @@ int psb_gtt_unmap_meminfo(struct drm_device *dev, { struct psb_gtt_mem_mapping *mapping; + WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); + mapping = psb_gtt_find_mapping_for_key(dev, tgid, (u32) psKernelMemInfo); if (IS_ERR(mapping)) {