mtd: Make MTD tests cancelable

I always go nuts when I start an MTD test on a slow device and have to
wait forever until it finishes. From the debug output I already know
what the issue is but I have to wait or reset the board hard. Resetting
is often not an option (remote access, you don't want lose the current
state, etc...).

The solution is easy, check for pending signals at key positions in the
code. Using that one can even stop a test by pressing CTRL-C as
insmod/modprobe have SIGINT pending.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
Richard Weinberger
2015-03-29 21:52:06 +02:00
committed by Brian Norris
parent d2b51c8087
commit 2a6a28e792
10 changed files with 120 additions and 24 deletions

View File

@@ -9,6 +9,8 @@
#include <linux/slab.h>
#include <linux/mtd/nand_ecc.h>
#include "mtd_test.h"
/*
* Test the implementation for software ECC
*
@@ -274,6 +276,10 @@ static int nand_ecc_test_run(const size_t size)
}
pr_info("ok - %s-%zd\n",
nand_ecc_test[i].name, size);
err = mtdtest_relax();
if (err)
break;
}
error:
kfree(error_data);