[lm-sensors] [PATCH] adt7470: Update sensors periodically via timer to avoid blocking

Juerg Haefliger juergh at gmail.com
Thu Jul 26 17:08:09 CEST 2007

Hi Darrick,

I guess I'm not seeing the big picture :-) The problem you're trying
to solve is that the reading of the registers takes a long time and
needs to be able to sleep?

> > Hi Darrick,
> >
> > Why using a workqueue at all? Can't you just run a timer and do the
> > update when it expires and restart the timer?
> Currently, I use mutexes (and msleep) which require the ability to
> sleep.  Timers can't sleep because they are implemented as a softirq.


> That said, I think the solution is to have two workqueue items--one to
> start the read and another to run after the temperature sensors have
> been read.  The delays for both can be handled via schedule_delayed_work().
> It could be done with two timers and spinlocks, but ... yuck.

Hmm... Sounds rather complicated. Is there a problem with blocking
apps for that long?
How about forking off a kernel thread instead of using workqueues?


> New patch forthcoming.
> --D
> Version: GnuPG v1.4.6 (GNU/Linux)
> yvfRi5A+xgLK8bJ7ea7oVZA=
> =8vm8

More information about the lm-sensors mailing list