Motion Sensor Status

Werner Almesberger werner at
Thu Jan 24 18:43:17 CET 2008

Andy Green wrote:
> Anyway INT is working as an INT pin now.

Congratulations on slaying the dragon !

> Once I had the INT pin working I hooked a scope probe on it so I could
> watch it.  I saw the latency from assertion to deassertion after
> servicing was hugely variable, >=1.5ms but sometimes 50ms or more and in
> granular lumps rather than completely random.

I was afraid that we'd see bad latency :-( You could try to raise
the scheduling priority of the workqueue, though, by scheduling
something like the following work queue item during initialization:

#include <linux/sched.h>

static void make_high_priority(void *data)
        struct sched_param __user param = { .sched_priority = 1 };
		/* up to MAX_RT_PRIO-1 */
	int error;

	error = sys_sched_setscheduler(0, SCHED_FIFO, &param);
	if (error)
		trouble ...;

Maybe this helps a bit.

> I think this will improve when the excessive SPI bug is fixed, but it
> still might not be very good to add 200 actions/sec through the scheduler.

Yeah. That whole design a bit on the questionable side, and it's
definitely begging for an ultra-low-overhead interrupt-driven
SPI interface.

- Werner

More information about the openmoko-kernel mailing list