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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Darrick J. Wong wrote:
> On Wed, Jul 25, 2007 at 06:19:22PM -0700, Juerg Haefliger wrote:
>> 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.
>

Or we could decide that we can live with the current 1 second + blocking of 
userspace apps, that is an option we should seriously consider too if this 
becomes ugly.

Regards,

hans




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux