Re: kthread with kpause or callout

2010-02-23 Thread Andrew Doran
On Mon, Feb 22, 2010 at 09:06:13PM +0100, Frank Wille wrote: > Andrew Doran wrote: > > >> I'm just unsure about using mutexes during the callout. I have an > >> IPL_NONE-kmutex which locks register access (my chip supports several > >> register banks, so I need to make sure they are not switched).

Re: kthread with kpause or callout

2010-02-22 Thread Frank Wille
Andrew Doran wrote: >> I'm just unsure about using mutexes during the callout. I have an >> IPL_NONE-kmutex which locks register access (my chip supports several >> register banks, so I need to make sure they are not switched). May I >> acquire this mutex during a callout (which is a softint, as I

Re: kthread with kpause or callout

2010-02-22 Thread Andrew Doran
On Mon, Feb 08, 2010 at 03:04:07PM +0100, Frank Wille wrote: > On Mon, 8 Feb 2010 11:29:51 +0100 > Martin Husemann wrote: > > > On Mon, Feb 08, 2010 at 11:11:04AM +0100, Frank Wille wrote: > > > - Running a kthread and calling kpause() between the polls. > > > - Using a callout which reschedules

Re: kthread with kpause or callout

2010-02-08 Thread Joerg Sonnenberger
On Mon, Feb 08, 2010 at 03:36:07PM +0100, Martin Husemann wrote: > On Mon, Feb 08, 2010 at 03:35:35PM +0100, Frank Wille wrote: > > IMHO that would allow my callout to sleep on acquiring the mutex? > > A softint can sleep, a callout can not. s/can/should/ Joerg

Re: kthread with kpause or callout

2010-02-08 Thread Martin Husemann
On Mon, Feb 08, 2010 at 03:35:35PM +0100, Frank Wille wrote: > IMHO that would allow my callout to sleep on acquiring the mutex? A softint can sleep, a callout can not. Martin

Re: kthread with kpause or callout

2010-02-08 Thread Frank Wille
On Mon, 8 Feb 2010 15:12:10 +0100 Martin Husemann wrote: > On Mon, Feb 08, 2010 at 03:09:55PM +0100, Martin Husemann wrote: > > The wording is not explicit, but a softint is not allowed to block > > on > > s/softint/callout/ of course, sorry for the confusion. *Now* you confused me! :) A callou

Re: kthread with kpause or callout

2010-02-08 Thread Frank Wille
On Mon, 8 Feb 2010 15:09:55 +0100 Martin Husemann wrote: > On Mon, Feb 08, 2010 at 03:04:07PM +0100, Frank Wille wrote: > > [...] May I acquire this mutex during a callout (which is a > > softint, as I understand)? Will the softint sleep or busy-wait? > > Depends on the mutex type, from mutex(9)

Re: kthread with kpause or callout

2010-02-08 Thread Martin Husemann
On Mon, Feb 08, 2010 at 03:09:55PM +0100, Martin Husemann wrote: > The wording is not explicit, but a softint is not allowed to block on s/softint/callout/ of course, sorry for the confusion. Martin

Re: kthread with kpause or callout

2010-02-08 Thread Martin Husemann
On Mon, Feb 08, 2010 at 03:04:07PM +0100, Frank Wille wrote: > I'm just unsure about using mutexes during the callout. I have an > IPL_NONE-kmutex which locks register access (my chip supports several > register banks, so I need to make sure they are not switched). May I > acquire this mutex during

Re: kthread with kpause or callout

2010-02-08 Thread Frank Wille
On Mon, 8 Feb 2010 11:29:51 +0100 Martin Husemann wrote: > On Mon, Feb 08, 2010 at 11:11:04AM +0100, Frank Wille wrote: > > - Running a kthread and calling kpause() between the polls. > > - Using a callout which reschedules itself after the poll. > > The thread is quite a bit more heavyweight, b

Re: kthread with kpause or callout

2010-02-08 Thread Martin Husemann
On Mon, Feb 08, 2010 at 11:11:04AM +0100, Frank Wille wrote: > - Running a kthread and calling kpause() between the polls. > - Using a callout which reschedules itself after the poll. The thread is quite a bit more heavyweight, but you have full freedom to do what you want. The callout is pretty l

kthread with kpause or callout

2010-02-08 Thread Frank Wille
Hi, I'm writing a keyboard driver which doesn't support interrupts in some revisions, so I have to poll its status from time to time. What would be better suited for that task: - Running a kthread and calling kpause() between the polls. - Using a callout which reschedules itself after the poll.