From 7c0306ca6f3dae4014d6619eaea4e006070af325 Mon Sep 17 00:00:00 2001 From: Michel Machado Date: Wed, 24 Dec 2014 12:10:47 -0300 Subject: [PATCH] f3probe: avoid hanging before the second reset f3probe was writing too many blocks between the first and the second reset due to a poor estimate of the writing and reseting times. --- libprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libprobe.c b/libprobe.c index f79d6a2..7e69c61 100644 --- a/libprobe.c +++ b/libprobe.c @@ -122,7 +122,7 @@ static uint64_t estimate_best_n_block(struct device *dev) perf_device_sample(dev, NULL, NULL, &write_count, &write_time_us, &reset_count, &reset_time_us); - if (!write_count || !reset_count) { + if (write_count < 3 || reset_count < 2) { /* There is not enough measurements. */ return (1 << 2) - 1; }