linux/drivers/gpu/drm/radeon
Adis Hamzić e49f3959a9 radeon: Fix system hang issue when using KMS with older cards
The current radeon driver initialization routines, when using KMS, are written
so that the IRQ installation routine is called before initializing the WB buffer
and the CP rings. With some ASICs, though, the IRQ routine tries to access the
GFX_INDEX ring causing a call to RREG32 with the value of -1 in
radeon_fence_read. This, in turn causes the system to completely hang with some
cards, requiring a hard reset.

A call stack that can cause such a hang looks like this (using rv515 ASIC for the
example here):
 * rv515_init (rv515.c)
 * radeon_irq_kms_init (radeon_irq_kms.c)
 * drm_irq_install (drm_irq.c)
 * radeon_driver_irq_preinstall_kms (radeon_irq_kms.c)
 * rs600_irq_process (rs600.c)
 * radeon_fence_process - due to SW interrupt (radeon_fence.c)
 * radeon_fence_read (radeon_fence.c)
 * hang due to RREG32(-1)

The patch moves the IRQ installation to the card startup routine, after the ring
has been initialized, but before the IRQ has been set. This fixes the issue, but
requires a check to see if the IRQ is already installed, as is the case in the
system resume codepath.
I have tested the patch on three machines using the rv515, the rv770 and the
evergreen ASIC. They worked without issues.

This seems to be a known issue and has been reported on several bug tracking
sites by various distributions (see links below). Most of reports recommend
booting the system with KMS disabled and then enabling KMS by reloading the
radeon module. For some reason, this was indeed a usable workaround, however,
UMS is now deprecated and disabled by default.

Bug reports:
https://bugzilla.redhat.com/show_bug.cgi?id=845745
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/561789
https://bbs.archlinux.org/viewtopic.php?id=156964

Signed-off-by: Adis Hamzić <adis@hamzadis.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-06-03 10:17:54 -04:00
..
reg_srcs drm/radeon: add WAIT_UNTIL to the non-VM safe regs list for cayman/TN 2013-01-27 22:38:44 -05:00
.gitignore
atom-bits.h
atom-names.h
atom-types.h
atom.c drm/radeon: fix endian bugs in atom_allocate_fb_scratch() 2013-05-02 10:01:45 -04:00
atom.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
atombios_crtc.c drm/radeon: Remove superfluous variable 2013-05-20 10:44:57 -04:00
atombios_dp.c drm: extract drm_dp_max_lane_count helper 2012-10-22 22:56:43 +02:00
atombios_encoders.c drm/radeon: switch audio handling to use callbacks 2013-04-23 18:03:53 -04:00
atombios_i2c.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
atombios.h drm/radeon: fix endian bugs in radeon_atom_get_clock_dividers() (v3) 2013-04-23 18:04:00 -04:00
avivod.h
cayman_blit_shaders.c bug.h: add include of it to various implicit C users 2012-02-29 17:15:08 -05:00
cayman_blit_shaders.h
evergreen_blit_kms.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
evergreen_blit_shaders.c bug.h: add include of it to various implicit C users 2012-02-29 17:15:08 -05:00
evergreen_blit_shaders.h
evergreen_cs.c drm/radeon: don't check mipmap alignment if MIP_ADDRESS is FMASK 2013-03-07 12:58:59 -05:00
evergreen_hdmi.c drm/radeon/dce2: use 10khz units for audio dto calculation 2013-05-20 10:44:58 -04:00
evergreen_reg.h drm/radeon: properly lock disp in mc_stop/resume for evergreen+ 2013-04-22 10:39:08 -04:00
evergreen.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
evergreend.h drm/radeon: fix UPLL_REF_DIV_MASK definition 2013-05-02 10:09:48 -04:00
Kconfig drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
Makefile drm/radeon: UVD bringup v8 2013-04-09 10:31:33 -04:00
mkregtable.c
ni_reg.h
ni.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
nid.h drm/radeon: re-enable PTE/PDE packet for set_page on cayman/TN 2013-04-16 16:15:27 -04:00
ObjectID.h drm/radeon/kms: Upstream ObjectID.h updates 2012-03-21 06:55:49 +00:00
r100_track.h drm/radeon: use common next_reloc function 2013-01-31 16:24:45 -05:00
r100.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
r100d.h drm/radeon: consolidate redundant macros and constants 2013-01-31 16:24:46 -05:00
r200.c drm/radeon: use common next_reloc function 2013-01-31 16:24:45 -05:00
r300_cmdbuf.c drm/radeon: check incoming cliprects pointer 2013-05-13 15:23:34 +10:00
r300_reg.h
r300.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
r300d.h drm/radeon: consolidate redundant macros and constants 2013-01-31 16:24:46 -05:00
r420.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
r420d.h
r500_reg.h drm/radeon: disable the crtcs in mc_stop (r5xx-r7xx) (v2) 2013-04-22 10:39:09 -04:00
r520.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
r520d.h
r600_audio.c drm/radeon: clean up audio dto programming 2013-04-23 18:03:53 -04:00
r600_blit_kms.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
r600_blit_shaders.c The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
r600_blit_shaders.h Annotate int2float() as being a pure function. 2012-09-20 13:10:34 -04:00
r600_blit.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
r600_cp.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
r600_cs.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-02-25 16:46:44 -08:00
r600_hdmi.c drm/radeon/dce2: use 10khz units for audio dto calculation 2013-05-20 10:44:58 -04:00
r600_reg.h drm/radeon: improve mc_stop/mc_resume on r5xx-r7xx 2012-12-12 14:34:08 -05:00
r600.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
r600d.h drm/radeon: consolidate UVD clock programming 2013-05-02 10:09:48 -04:00
radeon_acpi.c drm/radeon: fix compilation with backlight disabled 2012-10-15 13:21:00 -04:00
radeon_acpi.h drm/radeon: implement handler for ACPI event 2012-09-20 13:10:36 -04:00
radeon_agp.c radeon: add AGPMode 1 quirk for RV250 2012-11-20 11:47:32 -05:00
radeon_asic.c drm/radeon: track which asics have UVD 2013-05-20 12:09:37 -04:00
radeon_asic.h drm/radeon: switch audio handling to use callbacks 2013-04-23 18:03:53 -04:00
radeon_atombios.c drm/radeon: fix handling of v6 power tables 2013-05-02 11:53:07 -04:00
radeon_atpx_handler.c drm/radeon: properly validate the atpx interface 2013-02-20 08:51:21 -05:00
radeon_benchmark.c drm/radeon/benchmark: allow same domains for dma copy 2013-03-15 18:47:18 -04:00
radeon_bios.c Merge branch 'drm-radeon-sun-hainan' of git://people.freedesktop.org/~airlied/linux 2013-05-21 08:50:57 -07:00
radeon_blit_common.h
radeon_clocks.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_combios.c drm/radeon: add primary dac adj quirk for R200 board 2013-03-07 12:58:57 -05:00
radeon_connectors.c drm/radeon: Properly handle DDC probe for DP bridges 2013-01-03 15:04:38 -05:00
radeon_cp.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
radeon_cs.c drm/radeon: raise UVD clocks only on demand 2013-04-23 17:45:44 -04:00
radeon_cursor.c Merge branch 'fbcon-locking-fixes' of ssh://people.freedesktop.org/~airlied/linux into drm-next 2013-02-08 12:10:18 +10:00
radeon_device.c drm/radeon: narrow scope of Apple re-POST hack 2013-05-29 12:35:45 -04:00
radeon_display.c drm/radeon: use drm_send_vblank_event() helper 2013-05-22 09:13:41 +10:00
radeon_drv.c drm/radeon: restore nomodeset operation (v2) 2013-05-17 11:47:07 +10:00
radeon_drv.h drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
radeon_encoders.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_family.h drm/radeon: add chip family for Hainan 2013-05-20 11:13:06 -04:00
radeon_fb.c drm/<drivers>: simplify ->fb_probe callback 2013-02-14 00:07:58 +01:00
radeon_fence.c drm/radeon: fix scratch reg handling for UVD fence 2013-05-02 10:01:48 -04:00
radeon_gart.c drm/radeon: use IBs for VM page table updates v2 2013-02-01 13:57:10 -05:00
radeon_gem.c radeon: add bo tracking debugfs 2013-05-02 10:09:47 -04:00
radeon_i2c.c drm/radeon: Properly handle DDC probe for DP bridges 2013-01-03 15:04:38 -05:00
radeon_ioc32.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2012-10-03 23:29:23 -07:00
radeon_irq_kms.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-04-30 09:36:50 -07:00
radeon_irq.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
radeon_kms.c drm/radeon: cleanup properly if mmio mapping fails 2013-04-15 10:34:12 -04:00
radeon_legacy_crtc.c drm/radeon: Remove superfluous variable 2013-05-20 10:44:57 -04:00
radeon_legacy_encoders.c radeon/kms: force rn50 chip to always report connected on analog output 2013-01-10 17:05:37 -05:00
radeon_legacy_tv.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_mem.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
radeon_mode.h drm/radeon: Remove superfluous variable 2013-05-20 10:44:57 -04:00
radeon_object.c drm/radeon: UVD bringup v8 2013-04-09 10:31:33 -04:00
radeon_object.h drm/radeon: UVD bringup v8 2013-04-09 10:31:33 -04:00
radeon_pm.c drm/radeon: don't use get_engine_clock() on APUs 2013-04-01 15:23:58 -04:00
radeon_prime.c drm/radeon: use prime helpers 2013-02-08 13:48:43 +10:00
radeon_reg.h drm/radeon: refactor vline packet parsing function 2013-01-31 16:24:43 -05:00
radeon_ring.c drm/radeon: Always flush the VM 2013-04-16 16:15:28 -04:00
radeon_sa.c drm/radeon: allocate SA bo in the requested domain 2013-05-02 10:01:47 -04:00
radeon_semaphore.c drm/radeon: improve semaphore debugging on lockup 2013-01-15 09:07:13 -05:00
radeon_state.c drm/radeon: Deprecate UMS support v2 2013-01-31 16:24:47 -05:00
radeon_test.c drm/radeon: UVD bringup v8 2013-04-09 10:31:33 -04:00
radeon_trace_points.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
radeon_trace.h
radeon_ttm.c drm/radeon: Fix VRAM size calculation for VRAM >= 4GB 2013-05-20 10:44:57 -04:00
radeon_uvd.c drm/radeon: consolidate UVD clock programming 2013-05-02 10:09:48 -04:00
radeon.h drm/radeon: track which asics have UVD 2013-05-20 12:09:37 -04:00
rs100d.h
rs400.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
rs400d.h
rs600.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
rs600d.h drm/radeon/kms: add register definitions for audio 2012-04-24 09:50:13 +01:00
rs690.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
rs690d.h drm/radeon: Use direct mapping for fast fb access on RS690 2013-04-09 10:31:31 -04:00
rv200d.h
rv250d.h
rv350d.h
rv515.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
rv515d.h drm/radeon: consolidate redundant macros and constants 2013-01-31 16:24:46 -05:00
rv770.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
rv770d.h drm/radeon: fix UPLL_REF_DIV_MASK definition 2013-05-02 10:09:48 -04:00
si_blit_shaders.c The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
si_blit_shaders.h drm/radeon/kms: add support for CP setup on SI 2012-03-21 06:55:54 +00:00
si_reg.h drm/radeon: SI tiling fixes for display 2012-06-20 19:55:56 +01:00
si.c radeon: Fix system hang issue when using KMS with older cards 2013-06-03 10:17:54 -04:00
sid.h drm/radeon: fill in GPU init for Hainan (v2) 2013-05-20 11:13:07 -04:00