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:

committed by
Brian Norris

parent
d2b51c8087
commit
2a6a28e792
@@ -221,7 +221,10 @@ static int __init mtd_stresstest_init(void)
|
||||
err = do_operation();
|
||||
if (err)
|
||||
goto out;
|
||||
cond_resched();
|
||||
|
||||
err = mtdtest_relax();
|
||||
if (err)
|
||||
goto out;
|
||||
}
|
||||
pr_info("finished, %d operations done\n", op);
|
||||
|
||||
|
Reference in New Issue
Block a user