public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public•gmane.org>
To: Linux USB kernel mailing list
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>,
	Linux netdev Mailing list
	<netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>
Subject: [PATCH] hso_spinlockfix.patch
Date: Wed, 14 Jan 2009 10:54:51 +0100	[thread overview]
Message-ID: <496DB66B.4070306@option.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

Hi,
This is a really important fix it fixes a consistent kernel deadlock
when the hso driver starts going. It's against 2.6.29-rc1, 2.6.29-rc6
worked fine.

This patch obviously wasn't tested & I neither I or Filip was subscribed to the tty mailing 
list to catch it.

Even with this patch the driver is still broken.
opening the serial port on the driver a second time causes a -EIO,
I've yet to figure out what but it is not returned from hso_serial_open
but a parent function.


This patch fixes a double grabbing of a spinlock all
functions which call put_rxbuf_data already have serial->serial_lock grabbed.
Signed-off-by: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public•gmane.org>
Index: linux-2.6/drivers/net/usb/hso.c
===================================================================
--- linux-2.6.orig/drivers/net/usb/hso.c	2009-01-13 17:39:15.000000000 +0100
+++ linux-2.6/drivers/net/usb/hso.c	2009-01-13 17:40:42.000000000 +0100
@@ -2043,9 +2043,7 @@
 		return -2;
 	}
 
-	spin_lock(&serial->serial_lock);
 	tty = tty_kref_get(serial->tty);
-	spin_unlock(&serial->serial_lock);
 
 	/* Push data to tty */
 	if (tty) {

-- 
best regards,
D.J. Barrow

Linux Kernel Developer
Option NV, Gaston Geenslaan 14, 3001 Leuven, Belgium
 
T: +32 16 311 621
F: +32 16 207 164
d.barow-x9gZzRpC1QbQT0dZR+AlfA@public•gmane.org
www.option.com

Disclaimer:
http://www.option.com/company/disclaimer.shtml

[-- Attachment #2: hso_spinlockfix.patch --]
[-- Type: text/x-diff, Size: 661 bytes --]

This patch fixes a double grabbing of a spinlock all
functions which call put_rxbuf_data already have serial->serial_lock grabbed.
Signed-off-by: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public•gmane.org>
Index: linux-2.6/drivers/net/usb/hso.c
===================================================================
--- linux-2.6.orig/drivers/net/usb/hso.c	2009-01-13 17:39:15.000000000 +0100
+++ linux-2.6/drivers/net/usb/hso.c	2009-01-13 17:40:42.000000000 +0100
@@ -2043,9 +2043,7 @@
 		return -2;
 	}
 
-	spin_lock(&serial->serial_lock);
 	tty = tty_kref_get(serial->tty);
-	spin_unlock(&serial->serial_lock);
 
 	/* Push data to tty */
 	if (tty) {

             reply	other threads:[~2009-01-14  9:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14  9:54 Denis Joseph Barrow [this message]
2009-01-14 10:08 ` [PATCH] hso_spinlockfix.patch David Miller
2009-01-14 10:14   ` Denis Joseph Barrow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496DB66B.4070306@option.com \
    --to=d.barow-x9gzzrpc1qbqt0dzr+alfa@public$(echo .)gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox