linux/drivers/gpu/drm/radeon
Rafael J. Wysocki 3f53eb6f84 DRM / radeon / KMS: Fix hibernation regression related to radeon PM (was: Re: [Regression, post-2.6.34] Hibernation broken on machines with radeon/KMS and r300)
There is a regression from 2.6.34 related to the recent radeon power
management changes, caused by attempting to cancel a delayed work
item that's never been scheduled.  However, the code as is has some
other issues potentially leading to visible problems.

First, the mutex around cancel_delayed_work() in radeon_pm_suspend()
doesn't really serve any purpose, because cancel_delayed_work() only
tries to delete the work's timer.  Moreover, it doesn't prevent the
work handler from running, so the handler can do some wrong things if
it wins the race and in that case it will rearm itself to do some
more wrong things going forward.  So, I think it's better to wait for
the handler to return in case it's already been queued up for
execution.  Also, it should be prevented from rearming itself in that
case.

Second, in radeon_set_pm_method() the cancel_delayed_work() is not
sufficient to prevent the work handler from running and queing up
itself for the next run (the failure scenario is that
cancel_delayed_work() returns 0, so the handler is run, it waits on
the mutex and then rearms itself after the mutex has been released),
so again the work handler should be prevented from rearming itself in
that case..

Finally, there's a potential deadlock in radeon_pm_fini(), because
cancel_delayed_work_sync() is called under rdev->pm.mutex, but the
work handler tries to acquire the same mutex (if it wins the race).

Fix the issues described above.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-01 11:59:44 +10:00
..
reg_srcs drm/radeon/kms: fix typos in evergreen command checker 2010-07-01 11:59:38 +10:00
.gitignore
atom-bits.h
atom-names.h
atom-types.h
atom.c Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-04-19 07:27:06 -07:00
atom.h drm/radeon/kms/atom: make sure tables are valid (v2) 2010-03-31 13:11:29 +10:00
atombios.h Merge branch 'drm-for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-05-21 11:14:52 -07:00
atombios_crtc.c drm/radeon/kms: disable frac fb dividers for rs6xx 2010-07-01 11:59:31 +10:00
atombios_dp.c drm/radeon/kms: hpd cleanup 2010-05-19 10:31:41 +10:00
avivod.h [rfc] drm/radeon/kms: pm debugging check for vbl. 2010-02-23 09:46:21 +10:00
evergreen.c drm/radeon/kms: add some missing regs to evergreen gpu init 2010-07-01 11:59:39 +10:00
evergreen_cs.c drm/radeon/kms: fix typos in evergreen command checker 2010-07-01 11:59:38 +10:00
evergreen_reg.h drm/radeon/kms/evergreen: add initial CS parser 2010-06-01 11:46:04 +10:00
evergreend.h drm/radeon/kms: add some missing regs to evergreen gpu init 2010-07-01 11:59:39 +10:00
Kconfig drm/radeon: fix power supply kconfig interaction. 2010-05-21 15:41:20 +10:00
Makefile drm/radeon/kms/evergreen: add initial CS parser 2010-06-01 11:46:04 +10:00
mkregtable.c drm/radeon: mkregtable.c: close a file before exit 2010-01-08 13:11:55 +10:00
ObjectID.h drm/radeon/kms: pull in the latest upstream ObjectID.h changes 2010-01-08 13:03:57 +10:00
r100.c drm/radeon/r100/r200: fix calculation of compressed cube maps 2010-07-01 11:59:24 +10:00
r100_track.h drm/radeon/kms: r300 fix CS checker to allow zbuffer-only fastfill 2010-04-28 17:20:41 +10:00
r100d.h drm/radeon/kms/pm: add additional asic callbacks 2010-05-18 18:21:12 +10:00
r200.c drm/radeon/r200: handle more hw tex coord types 2010-07-01 11:59:22 +10:00
r300.c drm/radeon/kms: CS checker texture fixes for r1xx/r2xx/r3xx 2010-07-01 11:59:21 +10:00
r300_cmdbuf.c drm/radeon: Fix sparc regression in r300_scratch() 2010-04-27 09:40:57 +10:00
r300_reg.h drm/radeon/kms: add support for square microtiles on r3xx-r5xx 2010-02-25 11:36:12 +10:00
r300d.h drm/radeon/kms: simplify & improve GPU reset V2 2010-04-06 11:21:11 +10:00
r420.c drm/radeon/kms/pm: add mid profile 2010-06-08 09:35:19 +10:00
r420d.h
r500_reg.h radeon: Try harder to ensure we reclock in vblank 2010-05-18 18:21:29 +10:00
r520.c drm/radeon/kms/pm: rework power management 2010-05-18 18:21:52 +10:00
r520d.h
r600.c drm/radeon/kms/igp: fix possible divide by 0 in bandwidth code (v2) 2010-07-01 11:59:42 +10:00
r600_audio.c drm/radeon/kms: HDMI irq support 2010-04-23 14:12:17 +10:00
r600_blit.c drm/radeon: use ALIGN instead of open coding it 2010-03-01 15:56:41 +10:00
r600_blit_kms.c drm/radeon/kms: simplify & improve GPU reset V2 2010-04-06 11:21:11 +10:00
r600_blit_shaders.c drm/radeon/r600: add missing license and comments to r600_blit_shaders.c 2010-03-15 10:07:38 +10:00
r600_blit_shaders.h
r600_cp.c drm/radeon/kms: gfx init fixes for r6xx/r7xx 2010-03-31 09:53:53 +10:00
r600_cs.c drm/radeon/r6xx/r7xx: CS parser fixes 2010-03-31 13:12:17 +10:00
r600_hdmi.c drm/radeon: fix hdmi offset bug reported by smatch. 2010-05-19 10:35:02 +10:00
r600_reg.h drm/radeon/kms: HDMI irq support 2010-04-23 14:12:17 +10:00
r600d.h drm/radeon/r6xx/r7xx: CS parser fixes 2010-03-31 13:12:17 +10:00
radeon.h DRM / radeon / KMS: Fix hibernation regression related to radeon PM (was: Re: [Regression, post-2.6.34] Hibernation broken on machines with radeon/KMS and r300) 2010-07-01 11:59:44 +10:00
radeon_agp.c drm/radeon/kms: release AGP bridge at suspend 2010-05-24 10:02:08 +10:00
radeon_asic.c drm/radeon/kms: avoid oops on mac r4xx cards 2010-07-01 11:59:36 +10:00
radeon_asic.h drm/radeon/kms/evergreen: add initial CS parser 2010-06-01 11:46:04 +10:00
radeon_atombios.c drm/radeon/kms/pm: track current voltage (v2) 2010-06-08 09:35:53 +10:00
radeon_atpx_handler.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
radeon_benchmark.c drm/radeon: Skip dma copy test in benchmark if card doesn't have dma engine. 2010-02-11 13:13:25 +10:00
radeon_bios.c drm/radeon/kms: don't read attempt to read bios from VRAM on unposted GPU. 2010-07-01 11:59:30 +10:00
radeon_clocks.c drm/radeon/kms: add initial Evergreen support (Radeon HD 5xxx) 2010-02-09 09:44:02 +10:00
radeon_combios.c drm/radeon: add quirk to make HP nx6125 laptop resume. 2010-07-01 11:59:41 +10:00
radeon_connectors.c Merge remote branch 'anholt/drm-intel-next' into drm-next 2010-05-19 09:35:51 +10:00
radeon_cp.c drm/radeon: 9800 SE has only one quadpipe 2010-04-23 13:54:59 +10:00
radeon_cs.c drm/radeon/kms: simplify & improve GPU reset V2 2010-04-06 11:21:11 +10:00
radeon_cursor.c drm/radeon/kms: return ret in cursor_set failure path 2010-07-01 11:59:27 +10:00
radeon_device.c drm/radeon/kms: fix dpms state on resume 2010-07-01 11:59:11 +10:00
radeon_display.c drm/radeon/kms: fix typo in printing the HPD info 2010-06-08 09:35:27 +10:00
radeon_drv.c drm/radeon/kms/evergreen: set accel_enabled 2010-06-08 09:34:42 +10:00
radeon_drv.h drm/radeon: bump the UMS driver version for r6xx/r7xx const buffer support 2010-03-31 13:12:28 +10:00
radeon_encoders.c drm/radeon/kms: fix DP after DPMS cycle 2010-07-01 11:59:14 +10:00
radeon_family.h drm/radeon/kms: print GPU family and device id when loading 2010-04-19 11:25:24 +10:00
radeon_fb.c drm: Propagate error from drm_fb_helper_init(). 2010-06-08 09:32:02 +10:00
radeon_fence.c drm/radeon/kms: R3XX-R4XX fix GPU reset code 2010-04-27 09:48:16 +10:00
radeon_gart.c drm/radeon/kms: simplify & improve GPU reset V2 2010-04-06 11:21:11 +10:00
radeon_gem.c drm: free core gem object from driver callbacks 2010-04-20 13:19:33 +10:00
radeon_i2c.c drm/radeon/kms: add hw_i2c module option 2010-03-31 14:55:52 +10:00
radeon_ioc32.c
radeon_irq.c gpu/drm/radeon/radeon_irq.c: move a dereference below a NULL test 2010-01-07 13:56:32 +10:00
radeon_irq_kms.c drm/radeon/kms: add support for gui idle interrupts (v4) 2010-05-18 18:20:49 +10:00
radeon_kms.c drm/radeon/kms/evergreen: set accel_enabled 2010-06-08 09:34:42 +10:00
radeon_legacy_crtc.c drm/radeon/kms/pm: add support for no display power states 2010-05-18 18:21:50 +10:00
radeon_legacy_encoders.c drm/radeon: fix dual-head on rv250 2010-06-15 09:55:57 +10:00
radeon_legacy_tv.c drm/radeon/kms: fix pal tv-out support on legacy IGP chips 2010-03-15 09:57:42 +10:00
radeon_mem.c
radeon_mode.h drm/radeon: add fake RN50 table for powerpc 2010-07-01 11:59:19 +10:00
radeon_object.c drm/radeon/kms: record object that have been list reserved 2010-05-21 15:07:24 +10:00
radeon_object.h drm/radeon/kms: add support for new fault callback V7 2010-04-20 14:12:22 +10:00
radeon_pm.c DRM / radeon / KMS: Fix hibernation regression related to radeon PM (was: Re: [Regression, post-2.6.34] Hibernation broken on machines with radeon/KMS and r300) 2010-07-01 11:59:44 +10:00
radeon_reg.h drm/radeon/kms/pm: add asic specific callbacks for setting power state (v2) 2010-05-18 18:20:57 +10:00
radeon_ring.c drm/radeon/kms: fix lock ordering in ring, ib handling 2010-05-18 18:21:48 +10:00
radeon_state.c Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2010-05-28 16:14:40 -07:00
radeon_test.c drm/radeon/kms: simplify memory controller setup V2 2010-02-18 14:49:35 +10:00
radeon_ttm.c drm/radeon: AGP memory is only I/O if the aperture can be mapped by the CPU. 2010-05-21 15:06:45 +10:00
rs100d.h
rs400.c drm/radeon/kms/pm: rework power management 2010-05-18 18:21:52 +10:00
rs400d.h
rs600.c drm/radeon/kms/pm: add support for SetVoltage cmd table (V2) 2010-06-03 13:13:24 +10:00
rs600d.h drm/radeon/kms: enable misc pm power state features on r5xx, rs6xx 2010-05-18 18:21:42 +10:00
rs690.c drm/radeon/kms/igp: fix possible divide by 0 in bandwidth code (v2) 2010-07-01 11:59:42 +10:00
rs690d.h drm/radeon/kms: display watermark updates (v2) 2010-03-31 14:54:47 +10:00
rv200d.h
rv250d.h
rv350d.h
rv515.c drm/radeon/kms/pm: rework power management 2010-05-18 18:21:52 +10:00
rv515d.h drm/radeon/kms: simplify & improve GPU reset V2 2010-04-06 11:21:11 +10:00
rv770.c drm/radeon/kms: Force HDP_NONSURF to maximum size 2010-07-01 11:59:33 +10:00
rv770d.h drm/radeon/kms: add initial Evergreen support (Radeon HD 5xxx) 2010-02-09 09:44:02 +10:00