Module: xenomai-forge Branch: next Commit: 5be3e8439fe7ecbe0035d8caed4c3828d89d2bdd URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5be3e8439fe7ecbe0035d8caed4c3828d89d2bdd
Author: Philippe Gerum <r...@xenomai.org> Date: Sat Jul 19 09:51:13 2014 +0200 drivers/autotune: fix wedge detection --- kernel/drivers/autotune/autotune.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/drivers/autotune/autotune.c b/kernel/drivers/autotune/autotune.c index b1f2ddf..d73d0ac 100644 --- a/kernel/drivers/autotune/autotune.c +++ b/kernel/drivers/autotune/autotune.c @@ -427,8 +427,13 @@ static int tune_gravity(struct gravity_tuner *tuner, int period) if (ret) goto fail; - minlat = state->min_lat; - if (minlat <= 0) { + if (state->min_lat <= 0) { + printk(XENO_WARN + "auto-tuning[%s]: early shot by %Ld ns" + ": disabling gravity\n", + tuner->name, + xnclock_ticks_to_ns(&nkclock, state->min_lat)); + gravity = 0; minlat = 0; goto done; } @@ -445,7 +450,7 @@ static int tune_gravity(struct gravity_tuner *tuner, int period) "at wedge (min_ns %Ld => %Ld), gravity reset to %Ld ns\n", tuner->name, xnclock_ticks_to_ns(&nkclock, minlat), - xnclock_ticks_to_ns(&nkclock, minlat), + xnclock_ticks_to_ns(&nkclock, state->min_lat), xnclock_ticks_to_ns(&nkclock, gravity)); #endif if (++wedge >= 5) @@ -459,6 +464,7 @@ static int tune_gravity(struct gravity_tuner *tuner, int period) * more, increase the gravity value by a 3rd for next * round. */ + minlat = state->min_lat; adjust = (long)xnarch_llimd(minlat, 2, 3); if (adjust == 0) goto done; _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git