Re: [PATCH] fix unchecked mutex_lock_interruptible (was Re: use mutex instead of semaphore in RocketPort driver)

2007-05-23 Thread Matthias Kaehlcke
El Wed, May 23, 2007 at 06:25:49PM +0530 Satyam Sharma ha dit: > On 5/23/07, Jiri Slaby <[EMAIL PROTECTED]> wrote: > >Simon Arlott napsal(a): > >> On 22/05/07 21:06, Matthias Kaehlcke wrote: > >>> would the following resolve the problem? > >>> > >>> if(mutex_lock_interruptible(&info->write_mtx))

[PATCH] fix unchecked mutex_lock_interruptible (was Re: use mutex instead of semaphore in RocketPort driver)

2007-05-23 Thread Satyam Sharma
On 5/23/07, Jiri Slaby <[EMAIL PROTECTED]> wrote: Simon Arlott napsal(a): > On 22/05/07 21:06, Matthias Kaehlcke wrote: >> would the following resolve the problem? >> >> if(mutex_lock_interruptible(&info->write_mtx)) return >> -ERESTARTSYS >> >> thanks for your comments Hum. I remember

Re: use mutex instead of semaphore in RocketPort driver

2007-05-22 Thread Jiri Slaby
Simon Arlott napsal(a): > On 22/05/07 21:06, Matthias Kaehlcke wrote: >> would the following resolve the problem? >> >> if(mutex_lock_interruptible(&info->write_mtx)) return >> -ERESTARTSYS >> >> thanks for your comments >> > > No. At least one user of tty_operations/tty_driver's write fun

Re: use mutex instead of semaphore in RocketPort driver

2007-05-22 Thread Simon Arlott
On 22/05/07 21:06, Matthias Kaehlcke wrote: El Tue, May 22, 2007 at 09:59:01AM -0700 Arjan van de Ven ha dit: Please provide context when quoting a patch, git grep takes a while... - down_interruptible(&info->write_sem); + mutex_lock_interruptible(&info->write_mtx); #ifdef R

Re: use mutex instead of semaphore in RocketPort driver

2007-05-22 Thread Matthias Kaehlcke
El Tue, May 22, 2007 at 09:59:01AM -0700 Arjan van de Ven ha dit: > > > > - down_interruptible(&info->write_sem); > > + mutex_lock_interruptible(&info->write_mtx); > > > > #ifdef ROCKET_DEBUG_WRITE > > printk(KERN_INFO "rp_write %d chars...", count); > > @@ -1773,7 +1776,7 @@ end: > >

Re: use mutex instead of semaphore in RocketPort driver

2007-05-22 Thread Arjan van de Ven
> > - down_interruptible(&info->write_sem); > + mutex_lock_interruptible(&info->write_mtx); > > #ifdef ROCKET_DEBUG_WRITE > printk(KERN_INFO "rp_write %d chars...", count); > @@ -1773,7 +1776,7 @@ end: > wake_up_interruptible(&tty->poll_wait); > #endif > } >

[PATCH] use mutex instead of semaphore in RocketPort driver v3

2007-04-25 Thread Matthias Kaehlcke
the RocketPort driver uses a semaphore as mutex. use the mutex API instead of the (binary) semaphore Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> -- diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 76357c8..af9379b 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rock

Re: [PATCH] use mutex instead of semaphore in RocketPort driver v2

2007-04-25 Thread Matthias Kaehlcke
El Wed, Apr 25, 2007 at 03:54:36PM +0200 Jiri Slaby ha dit: > Matthias Kaehlcke napsal(a): > > the RocketPort driver uses a semaphore as mutex. use the mutex API > > instead of the (binary) semaphore > > > > Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> > > > > I think that ERESTARTSYS i

Re: [PATCH] use mutex instead of semaphore in RocketPort driver v2

2007-04-25 Thread Jiri Slaby
Matthias Kaehlcke napsal(a): > the RocketPort driver uses a semaphore as mutex. use the mutex API > instead of the (binary) semaphore > > Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> > > -- > > diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c > index 76357c8..7d23790 100644 > -

Re: [PATCH] use mutex instead of semaphore in RocketPort driver v2

2007-04-25 Thread Jiri Slaby
Matthias Kaehlcke napsal(a): > the RocketPort driver uses a semaphore as mutex. use the mutex API > instead of the (binary) semaphore > > Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> > > -- > > diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c > index 76357c8..7d23790 100644 > -

[PATCH] use mutex instead of semaphore in RocketPort driver v2

2007-04-25 Thread Matthias Kaehlcke
the RocketPort driver uses a semaphore as mutex. use the mutex API instead of the (binary) semaphore Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> -- diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 76357c8..7d23790 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/roc

Re: [PATCH] use mutex instead of semaphore in RocketPort driver

2007-04-25 Thread Matthias Kaehlcke
El Wed, Apr 25, 2007 at 10:36:38AM +0530 Satyam Sharma ha dit: > Hi Matthias, > > On 4/25/07, Robert Hancock <[EMAIL PROTECTED]> wrote: > >Matthias Kaehlcke wrote: > >> El Tue, Apr 24, 2007 at 07:53:04PM +0200 Oliver Neukum ha dit: > >> > >>> Am Dienstag, 24. April 2007 19:49 schrieb Matthias Kae

Re: [PATCH] use mutex instead of semaphore in RocketPort driver

2007-04-24 Thread Satyam Sharma
Hi Matthias, On 4/25/07, Robert Hancock <[EMAIL PROTECTED]> wrote: Matthias Kaehlcke wrote: > El Tue, Apr 24, 2007 at 07:53:04PM +0200 Oliver Neukum ha dit: > >> Am Dienstag, 24. April 2007 19:49 schrieb Matthias Kaehlcke: >>> @@ -1706,7 +1706,7 @@ static int rp_write(struct tty_struct *tty, >>>

Re: [PATCH] use mutex instead of semaphore in RocketPort driver

2007-04-24 Thread Robert Hancock
Matthias Kaehlcke wrote: El Tue, Apr 24, 2007 at 07:53:04PM +0200 Oliver Neukum ha dit: Am Dienstag, 24. April 2007 19:49 schrieb Matthias Kaehlcke: @@ -1706,7 +1706,7 @@ static int rp_write(struct tty_struct *tty, if (count <= 0 || rocket_paranoia_check(info, "rp_write"))

Re: [PATCH] use mutex instead of semaphore in RocketPort driver

2007-04-24 Thread Matthias Kaehlcke
El Tue, Apr 24, 2007 at 07:53:04PM +0200 Oliver Neukum ha dit: > Am Dienstag, 24. April 2007 19:49 schrieb Matthias Kaehlcke: > > @@ -1706,7 +1706,7 @@ static int rp_write(struct tty_struct *tty, > > if (count <= 0 || rocket_paranoia_check(info, "rp_write")) > > return 0; >

Re: [PATCH] use mutex instead of semaphore in RocketPort driver

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 19:49 schrieb Matthias Kaehlcke: > @@ -1706,7 +1706,7 @@ static int rp_write(struct tty_struct *tty, > if (count <= 0 || rocket_paranoia_check(info, "rp_write")) > return 0; >   > -   down_interruptible(&info->write_sem); > +   mutex_lock_

[PATCH] use mutex instead of semaphore in RocketPort driver

2007-04-24 Thread Matthias Kaehlcke
the RocketPort driver uses a semaphore as mutex. use the mutex API instead of the (binary) semaphore Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> -- diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 76357c8..faa5dd5 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/roc