lkml.org 
[lkml]   [2004]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] esp: Make driver SMP-correct
James Nelson wrote:
> static inline int serial_paranoia_check(struct esp_struct *info,
> char *name, const char *routine)
> {
> @@ -209,34 +197,38 @@
> struct esp_struct *info = (struct esp_struct *)tty->driver_data;
> unsigned long flags;
>
> - if (serial_paranoia_check(info, tty->name, "rs_stop"))
> - return;
> + spin_lock_irqsave(&info->irq_lock, flags);
> +
> + if (unlikely(serial_paranoia_check(info, tty->name, __FUNCTION__)))
> + goto out;

> static void rs_start(struct tty_struct *tty)
> {
> struct esp_struct *info = (struct esp_struct *)tty->driver_data;
> unsigned long flags;
> -
> - if (serial_paranoia_check(info, tty->name, "rs_start"))
> - return;
> -
> - save_flags(flags); cli();
> +
> + spin_lock_irqsave(&info->irq_lock, flags);
> +
> + if (unlikely(serial_paranoia_check(info, tty->name, __FUNCTION__)))
> + goto out;
> +

This will deadlock. serial_paranoia_check also unconditionally tries to
take the lock.

Jan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.055 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site