[PATCH] radeon: (re)initialize the CP lockup tracking info at resume

Paul Bolle pebolle at tiscali.nl
Sat Feb 19 08:01:32 PST 2011


A laptop with an "ATI Radeon Mobility 9000 (M9) Lf (AGP)" chipset tends
to show the following WARNING if:
- run with agpmode=-1 (which apparently means "PCI mode");
- suspended and resumed a few times:

[33181.505650] radeon 0000:01:00.0: GPU lockup CP stall for more than 5496706msec
[33181.505655] ------------[ cut here ]------------
[33181.505718] WARNING: at drivers/gpu/drm/radeon/radeon_fence.c:248 radeon_fence_wait+0x248/0x2bb [radeon]()
[33181.505722] Hardware name:
[33181.505724] GPU lockup (waiting for 0x00014AB4 last fence id 0x00014AB2)
[33181.505727] Modules linked in: snd_intel8x0m tcp_lp sco bnep l2cap bluetooth fuse cpufreq_ondemand acpi_cpufreq mperf ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_netbios_ns ip6table_filter ip6_tables arc4 ath5k snd_intel8x0 ath snd_ac97_codec mac80211 ac97_bus snd_seq snd_seq_device snd_pcm snd_timer iTCO_wdt ppdev thinkpad_acpi cfg80211 rfkill snd microcode parport_pc e1000 iTCO_vendor_support snd_page_alloc joydev parport i2c_i801 soundcore uinput ipv6 yenta_socket radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: snd_intel8x0m]
[33181.505779] Pid: 1061, comm: Xorg Not tainted 2.6.38-0.rc4.git0.2.local3.fc15.i686 #1
[33181.505783] Call Trace:
[33181.505794]  [<c043aab5>] ? warn_slowpath_common+0x7c/0x91
[33181.505828]  [<f79cf14b>] ? radeon_fence_wait+0x248/0x2bb [radeon]
[33181.505867]  [<f79cf14b>] ? radeon_fence_wait+0x248/0x2bb [radeon]
[33181.505872]  [<c043ab55>] ? warn_slowpath_fmt+0x33/0x35
[33181.505911]  [<f79cf14b>] ? radeon_fence_wait+0x248/0x2bb [radeon]
[33181.505924]  [<c0451493>] ? autoremove_wake_function+0x0/0x37
[33181.505958]  [<f79cf734>] ? radeon_sync_obj_wait+0x11/0x13 [radeon]
[33181.505976]  [<f78df3ec>] ? ttm_bo_wait+0xae/0x151 [ttm]
[33181.506013]  [<f79de6de>] ? radeon_bo_wait+0x6e/0x8d [radeon]
[33181.506080]  [<f79dec16>] ? radeon_gem_wait_idle_ioctl+0x2f/0x59 [radeon]
[33181.506111]  [<f788340b>] ? drm_ioctl+0x2a4/0x38a [drm]
[33181.506150]  [<f79debe7>] ? radeon_gem_wait_idle_ioctl+0x0/0x59 [radeon]
[33181.506164]  [<c0593524>] ? file_has_perm+0x9a/0xb3
[33181.506180]  [<f7883167>] ? drm_ioctl+0x0/0x38a [drm]
[33181.506186]  [<c04f0737>] ? do_vfs_ioctl+0x451/0x482
[33181.506192]  [<c0593795>] ? selinux_file_ioctl+0x39/0x3c
[33181.506196]  [<c04f07af>] ? sys_ioctl+0x47/0x60
[33181.506203]  [<c07d78dc>] ? syscall_call+0x7/0xb
[33181.506207] ---[ end trace eecc6a32d93293db ]---
[33181.611857] radeon 0000:01:00.0: GPU reset succeed
[33181.637228] radeon 0000:01:00.0: WB enabled

After that the screen is black and the keyboard non-functioning. I then
need to log in over eg. ssh and reboot or kill X to get the laptop in a
usable state again.

After adding a number of printks and running numerous sessions it seems
something like the following is going on:
- at each resume the GPU lockup detection code is run;
- if a previous session was quiet for the GPU the "RPTR" register
  will not have changed from its starting value (apparently 0x80) so at
  the next resume the current RPTR will equal the RPTR value saved in
  the CP lockup tracking information;
- if the GPU lockup detection code runs at resume and more than 10
  seconds have passed since the previous GPU lockup detection
  r100_gpu_cp_is_lockup() will decide a lockup has occurred;
- the GPU lockup detection code will then reset the GPU.

The easiest solution I could think of was to update the CP lockup
tracking information at the end of r100_startup(). This will mean that
this information is up to date after (each boot and after) each resume
and (apparently) before the GPU lockup detection code is run.

I have not been able to generate this WARNING with that (one line)
change added.

Note that this patch (further) invalidates the comment above
r100_gpu_cp_is_lockup(). But I'm not sure how that comment should read
anyhow as it already is at odds with the current code.

Signed-off-by: Paul Bolle <pebolle at tiscali.nl>
---
 drivers/gpu/drm/radeon/r100.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 56deae5..0107cb1 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3831,6 +3831,10 @@ static int r100_startup(struct radeon_device *rdev)
 		dev_err(rdev->dev, "failled initializing IB (%d).\n", r);
 		return r;
 	}
+
+	/* (re)initialize the CP lockup tracking information */
+	r100_gpu_lockup_update(&rdev->config.r100.lockup, &rdev->cp);
+
 	return 0;
 }
 
-- 
1.7.4.1



More information about the dri-devel mailing list