tests/gem_reset_stats : mask off ring_stop bits
PATCH 1/1 tests/gem_reset_stats : mask off ring_stop bits
From: Tim Gore <[email protected]>
Function check_gpu_ok checks to make sure that any hangs have cleared by testing for (flags == 0). Some tests set the STOP_RINGS_ALLOW_BAN and STOP_RINGS_ALLOW_ERRORS flags but these do not get cleared by an individual ring reset, (a feature added recently to the driver), leading the check_gpu_ok function to think that the gpu is still hung.
So I mask the flags with STOP_RING_ALL, to ignore the mode bits and look only at the bits that stop the rings.
Once gpu_check_ok sees that the gpu is not hung I write 0 to stop_rings in order to clear it completely. This is because igt_set_stop_rings will only write to stop_rings if either a) they are currently 0 or b) we are writing 0. If we leave the mode bits set then subsequent calls to igt_set_stop_rings to create hangs will fail.
--- tests/gem_reset_stats.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tests/gem_reset_stats.c +7 -1
@@ -1033,7 +1033,7 @@ static void check_gpu_ok(void)igt_debug ("checking gpu state\n" );while (retry_count--) { - flags =igt_get_stop_rings (); + flags =igt_get_stop_rings () &STOP_RING_ALL ;if (flags ==0 )break ;
@@ -1043,6 +1043,12 @@ static void check_gpu_ok(void)igt_assert (flags ==0 ); +/* +* Clear the _ALLOW_ERRORS and _ALLOW_BAN flags; +* these are not cleared by individual ring reset. +*/ +igt_set_stop_rings (0 ); + fd =drm_open_any ();gem_quiescent_gpu (fd);close (fd);
Signature · 6 lines
2.3.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 12 lines · On Wed, Jun 03, 2015 at 09:20:21AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
Function
check_gpu_okchecks to make sure that any hangs have cleared by testing for (flags == 0). Some tests set theSTOP_RINGS_ALLOW_BANandSTOP_RINGS_ALLOW_ERRORSflags but these do not get cleared by an individual ring reset, (a feature added recently to the driver), leading thecheck_gpu_okfunction to think that the gpu is still hung.So I mask the flags with
STOP_RING_ALL, to ignore the mode bits and look only at the bits that stop the rings.
Quoted 6 lines
Once
gpu_check_oksees that the gpu is not hung I write 0 tostop_ringsin order to clear it completely. This is becauseigt_set_stop_ringswill only write tostop_ringsif either a) they are currently 0 or b) we are writing 0. If we leave the mode bits set then subsequent calls toigt_set_stop_ringsto create hangs will fail.
Can we please just deprecate the stop_rings interface? We can do explicit hang injection and GPU resets on gen4+, most of gen3 but not gen2. Even if we mask of testing for gen2/3, that still provides (almost, just a couple of gen2/3 reset functions will be missed) complete coverage of GEM reset handling.
The benefit is we lose this attrocious interface and remove some hideous complications from the kernel.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 35 lines
-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Wednesday, June 03, 2015 9:30 AM
To: Gore, Tim
Cc: [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_reset_stats : mask offring_stopbitsQuoted 11 lines · On Wed, Jun 03, 2015 at 09:20:21AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
Function
check_gpu_okchecks to make sure that any hangs have cleared by testing for (flags == 0). Some tests set theSTOP_RINGS_ALLOW_BANandSTOP_RINGS_ALLOW_ERRORSflags but these do not get cleared by an individual ring reset, (a feature added recently to the driver), leading thecheck_gpu_okfunction to think that the gpu is still hung.So I mask the flags with
STOP_RING_ALL, to ignore the mode bits and look only at the bits that stop the rings.Quoted 6 lines
Once
gpu_check_oksees that the gpu is not hung I write 0 tostop_ringsin order to clear it completely. This is becauseigt_set_stop_ringswill only write tostop_ringsif either a) they are currently 0 or b) we are writing 0.
If we leave the mode bits set then subsequent calls toigt_set_stop_ringsto create hangs will fail.Can we please just deprecate the
stop_ringsinterface? We can do explicit hang injection and GPU resets on gen4+, most of gen3 but not gen2. Even if we mask of testing for gen2/3, that still provides (almost, just a couple of gen2/3 reset functions will be missed) complete coverage of GEM reset handling.
Quoted 6 lines
The benefit is we lose this attrocious interface and remove some hideous complications from the kernel.
-Chris--
Chris Wilson, Intel Open Source Technology Centre
Sounds good to me. I think most people here (Egham) see the stop rings interface as Being a rather nasty hack, and it certainly makes pain for the TDR mechanism.
Tim
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 53 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Gore, Tim
Sent: Wednesday, June 03, 2015 9:43 AM
To: Chris Wilson
Cc: [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_reset_stats : mask offring_stopbitsQuoted 8 lines
-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Wednesday, June 03, 2015 9:30 AM
To: Gore, Tim
Cc: [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_reset_stats : mask offring_stopbitsQuoted 6 lines
Quoted 5 lines · On Wed, Jun 03, 2015 at 09:20:21AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
Function
check_gpu_okchecks to make sure that any hangs have cleared by testing for (flags == 0). Some tests set theSTOP_RINGS_ALLOW_BANandSTOP_RINGS_ALLOW_ERRORSflags butthese do
Quoted 2 lines
Quoted 2 lines
not get cleared by an individual ring reset, (a feature added recently to the driver), leading the
check_gpu_okfunction to think thatthe gpu is still hung.
Quoted 22 lines
Quoted 10 lines
So I mask the flags with
STOP_RING_ALL, to ignore the mode bits and look only at the bits that stop the rings.Once
gpu_check_oksees that the gpu is not hung I write 0 tostop_ringsin order to clear it completely. This is becauseigt_set_stop_ringswill only write tostop_ringsif either a) they are currently 0 or b) we are writing 0.
If we leave the mode bits set then subsequent calls toigt_set_stop_ringsto create hangs will fail.Can we please just deprecate the
stop_ringsinterface? We can do explicit hang injection and GPU resets on gen4+, most of gen3 but not gen2. Even if we mask of testing for gen2/3, that still provides (almost, just a couple of
gen2/3 reset functions will be missed) complete coverage of GEM reset handling.The benefit is we lose this attrocious interface and remove some hideous complications from the kernel.
-Chris
Quoted 8 lines
Quoted 2 lines
--
Chris Wilson, Intel Open Source Technology CentreSounds good to me. I think most people here (Egham) see the stop rings interface as Being a rather nasty hack, and it certainly makes pain for the TDR mechanism.
Tim
However it would still be good to get this fix in for now. I'll start looking At removing the use of stop_rings from IGT when I've finished my current Crop of HSD's, so if someone could push this patch it would be appreciated. One less test failure to be reported :-)
Tim
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 4 lines · Tim
However it would still be good to get this fix in for now. I'll start looking At removing the use of
stop_ringsfrom IGT when I've finished my current Crop of HSD's, so if someone could push this patch it would be appreciated. One less test failure to be reported :-)
Sorry, got sidetracked by my loathing of stop_rings. Patch lgtm indeed.
Pushed, thanks.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 20 lines · Chris Wilson
Quoted 12 lines · On Wed, Jun 03, 2015 at 09:20:21AM +0100, [email protected] wrote:
From: Tim Gore <[email protected]>
Function
check_gpu_okchecks to make sure that any hangs have cleared by testing for (flags == 0). Some tests set theSTOP_RINGS_ALLOW_BANandSTOP_RINGS_ALLOW_ERRORSflags but these do not get cleared by an individual ring reset, (a feature added recently to the driver), leading thecheck_gpu_okfunction to think that the gpu is still hung.So I mask the flags with
STOP_RING_ALL, to ignore the mode bits and look only at the bits that stop the rings.Quoted 6 lines
Once
gpu_check_oksees that the gpu is not hung I write 0 tostop_ringsin order to clear it completely. This is becauseigt_set_stop_ringswill only write tostop_ringsif either a) they are currently 0 or b) we are writing 0. If we leave the mode bits set then subsequent calls toigt_set_stop_ringsto create hangs will fail.
Quoted 5 lines
Can we please just deprecate the
stop_ringsinterface? We can do explicit hang injection and GPU resets on gen4+, most of gen3 but not gen2. Even if we mask of testing for gen2/3, that still provides (almost, just a couple of gen2/3 reset functions will be missed) complete coverage of GEM reset handling.
Yeah I guess it's ok to nuke stop_rings. The only issue I see is that stop_rings provided a neat way for the kernel to support gpu resets on platforms where it's not working. I guess we'd need to move that knowledge to igt with an require_gpu_reset macro and skip the tests correctly. Otherwise I don't see an issue here really.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx