Re: [PATCH] esp: Make driver SMP-correct

From: Jan Dittmer (jdittmer_at_ppp0.net)
Date: 12/31/04

  • Next message: Thomas Hellström: "Re: VIA drm bk tree back up..."
    Date:	Fri, 31 Dec 2004 10:45:30 +0100
    To: James Nelson <james4765@verizon.net>
    
    

    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/


  • Next message: Thomas Hellström: "Re: VIA drm bk tree back up..."

    Relevant Pages

    • Re: 2.6.9-rc2-mm3
      ... On Fri, 2004-09-24 at 13:52, Paul Fulghum wrote: ... > I am seeing this deadlock also. ... I assume the lock is held to protect this ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: EXT3: problem with copy_from_user inside a transaction
      ... issue with the page lock, maybe Chris you want to elaborate (the above ... We also hidden the above deadlock with prefaulting (but it's far from ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] Add a writer prior lock methord for rwlock
      ... Oliver Neukum wrote: ... >a read lock already held may deadlock. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] fix send_sigqueue() vs thread exit race
      ... > or does exec. ... No lock - no deadlock. ... > it would deadlock immediately, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [NFS] RE: [autofs] multiple servers per automount
      ... > idea if this is currently a likely scenario, however not sleeping within ... > a lock is 'The Right Thing' and should be avoided at all costs. ... It's a VERY likely deadlock scenario ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)