Skip to contentSkip to conversation

hso_spinlockfix.patch

PATCH In review Denis Joseph Barrow 3 participants 3 messages Jan 14, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hso_spinlockfix.patch

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.

drivers/net/usb/hso.c +0 -2
Index: linux-2.6/drivers/net/usb/hso.c
===================================================================
@@ -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) {
Signature · 13 lines
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
[email protected]
www.option.com

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

This patch fixes a double grabbing of a spinlock all
functions which call put_rxbuf_data already have serial->serial_lock grabbed.

drivers/net/usb/hso.c +0 -2
Index: linux-2.6/drivers/net/usb/hso.c
===================================================================
@@ -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) {
maintainer
#1 lore raw

From: Denis Joseph Barrow <[email protected]>
Date: Wed, 14 Jan 2009 10:54:51 +0100

Quoted 3 lines

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.

Are you able to travel in time? :-) 2.6.29-rc6 has not been released yet.

#2 lore raw

Thanks David
Happy new year.
I meant 2.6.28-rc6,

Quoted 9 lines · David Miller

From: Denis Joseph Barrow <[email protected]>
Date: Wed, 14 Jan 2009 10:54:51 +0100

Quoted 3 lines

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.

Are you able to travel in time? :-) 2.6.29-rc6 has not been released yet.

Signature · 13 lines
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
[email protected]
www.option.com

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