mirror of https://github.com/torvalds/linux.git
Cards typically have 5-7 scratch registers; one of these is reserved for
rdev->rptr_save_reg. Unfortunately the reservation is done in function
r100_cp_init, which is called by all drivers except r600 - and this
function is also invoked on resume from suspend. After several resumes,
no scratch registers are free and graphics acceleration is disabled.
Dmesg then reports either:
*ERROR* radeon: cp failed to get scratch reg (-22).
*ERROR* radeon: cp isn't working(-22).
radeon 0000:01:00.0: failed initializing CP (-22).
or:
*ERROR* radeon: failed to get scratch reg (-22).
*ERROR* radeon: failed testing IB on GFX ring (-22).
*ERROR* ib ring test failed (-22).
The chain of calls on boot for all except r600 is:
radeon_init -> ... -> (rXXX_init) -> rXXX_startup -> r100_cp_init
The chain of calls on resume for all except r600 is:
rXXX_resume -> rXXX_startup -> r100_cp_init.
R600 correctly allocates rptr_save_reg in r600_init (ie once only, not
in resume). However moving the code into the init functions for all
drivers means touching 4 drivers. So instead, this patch just adds a
test in r100_cp_init to avoid reallocating on resume. As the rdev
structure is allocated via kzalloc in radeon_driver_load_kms, and zero
is not a valid registerid, zero safely implies not-yet-allocated.
This issue appears to have been introduced in
|
||
|---|---|---|
| .. | ||
| reg_srcs | ||
| .gitignore | ||
| Kconfig | ||
| Makefile | ||
| ObjectID.h | ||
| atom-bits.h | ||
| atom-names.h | ||
| atom-types.h | ||
| atom.c | ||
| atom.h | ||
| atombios.h | ||
| atombios_crtc.c | ||
| atombios_dp.c | ||
| atombios_encoders.c | ||
| atombios_i2c.c | ||
| avivod.h | ||
| cayman_blit_shaders.c | ||
| cayman_blit_shaders.h | ||
| evergreen.c | ||
| evergreen_blit_kms.c | ||
| evergreen_blit_shaders.c | ||
| evergreen_blit_shaders.h | ||
| evergreen_cs.c | ||
| evergreen_hdmi.c | ||
| evergreen_reg.h | ||
| evergreend.h | ||
| mkregtable.c | ||
| ni.c | ||
| ni_reg.h | ||
| nid.h | ||
| r100.c | ||
| r100_track.h | ||
| r100d.h | ||
| r200.c | ||
| r300.c | ||
| r300_cmdbuf.c | ||
| r300_reg.h | ||
| r300d.h | ||
| r420.c | ||
| r420d.h | ||
| r500_reg.h | ||
| r520.c | ||
| r520d.h | ||
| r600.c | ||
| r600_audio.c | ||
| r600_blit.c | ||
| r600_blit_kms.c | ||
| r600_blit_shaders.c | ||
| r600_blit_shaders.h | ||
| r600_cp.c | ||
| r600_cs.c | ||
| r600_hdmi.c | ||
| r600_reg.h | ||
| r600d.h | ||
| radeon.h | ||
| radeon_acpi.c | ||
| radeon_agp.c | ||
| radeon_asic.c | ||
| radeon_asic.h | ||
| radeon_atombios.c | ||
| radeon_atpx_handler.c | ||
| radeon_benchmark.c | ||
| radeon_bios.c | ||
| radeon_blit_common.h | ||
| radeon_clocks.c | ||
| radeon_combios.c | ||
| radeon_connectors.c | ||
| radeon_cp.c | ||
| radeon_cs.c | ||
| radeon_cursor.c | ||
| radeon_device.c | ||
| radeon_display.c | ||
| radeon_drv.c | ||
| radeon_drv.h | ||
| radeon_encoders.c | ||
| radeon_family.h | ||
| radeon_fb.c | ||
| radeon_fence.c | ||
| radeon_gart.c | ||
| radeon_gem.c | ||
| radeon_i2c.c | ||
| radeon_ioc32.c | ||
| radeon_irq.c | ||
| radeon_irq_kms.c | ||
| radeon_kms.c | ||
| radeon_legacy_crtc.c | ||
| radeon_legacy_encoders.c | ||
| radeon_legacy_tv.c | ||
| radeon_mem.c | ||
| radeon_mode.h | ||
| radeon_object.c | ||
| radeon_object.h | ||
| radeon_pm.c | ||
| radeon_prime.c | ||
| radeon_reg.h | ||
| radeon_ring.c | ||
| radeon_sa.c | ||
| radeon_semaphore.c | ||
| radeon_state.c | ||
| radeon_test.c | ||
| radeon_trace.h | ||
| radeon_trace_points.c | ||
| radeon_ttm.c | ||
| rs100d.h | ||
| rs400.c | ||
| rs400d.h | ||
| rs600.c | ||
| rs600d.h | ||
| rs690.c | ||
| rs690d.h | ||
| rv200d.h | ||
| rv250d.h | ||
| rv350d.h | ||
| rv515.c | ||
| rv515d.h | ||
| rv770.c | ||
| rv770d.h | ||
| si.c | ||
| si_blit_shaders.c | ||
| si_blit_shaders.h | ||
| si_reg.h | ||
| sid.h | ||