summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-03-23 21:55:43 -0500
committerDave Airlie <airlied@redhat.com>2010-03-24 13:16:10 +1000
commit533aae6a8cfed34a1554c244151d1a781eec0c3e (patch)
treed7107dfe1d23281b2a146a01b5bafe5bcceba24c
parent0ca903d67e92af0eb0323ca850e55ecf564591e8 (diff)
radeontool regmatch: sync() before reading a bunch of registers
A hard lock-up is always an unpleasant event, but it can be less unpleasant if any unrelated pending I/O is finished first. Make ‘radeontool regmatch '*'’ a little safer by calling sync(). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--radeontool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/radeontool.c b/radeontool.c
index 4aefb72..d4968e5 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -732,6 +732,9 @@ void radeon_reg_match(const char *pattern)
printf("%s\t0x%08x (%d)\n", pattern, value, value);
}
else {
+ /* Prepare for a crash (just in case). */
+ sync();
+
for (i = 0; i < sizeof(reg_list) / sizeof(reg_list[0]); i++) {
if (fnmatch(pattern, reg_list[i].name, 0) == 0) {
printf("%s (%s%04x)\t", reg_list[i].name,