All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix hso soft-lockup
@ 2009-10-22  8:36 Antti Kaijanmäki
  2009-10-26  7:53 ` Antti Kaijanmäki
  2009-10-26 17:15 ` Greg KH
  0 siblings, 2 replies; 9+ messages in thread
From: Antti Kaijanmäki @ 2009-10-22  8:36 UTC (permalink / raw)
  To: linux-kernel

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

Fix soft-lockup in hso.c which is triggered on SMP machine when
modem is removed while file descriptor(s) under /dev are still open:

  old version called kref_put() too early which resulted in destroying
  hso_serial and hso_device objects which were still used later on.

Also fix driver debug routines (not compiled in by default).
---
 drivers/net/usb/hso.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index fa4e581..539642a 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2,6 +2,7 @@
  *
  * Driver for Option High Speed Mobile Devices.
  *
+ *  Copyright (C) 2009 Antti Kaijanmäki <antti.kaijanmaki@nomovok.com>
  *  Copyright (C) 2008 Option International
  *                     Filip Aben <f.aben@option.com>
  *                     Denis Joseph Barrow <d.barow@option.com>
@@ -378,7 +379,7 @@ static void dbg_dump(int line_count, const char *func_name, unsigned char *buf,
 }
 
 #define DUMP(buf_, len_)	\
-	dbg_dump(__LINE__, __func__, buf_, len_)
+	dbg_dump(__LINE__, __func__, (unsigned char*)buf_, len_)
 
 #define DUMP1(buf_, len_)			\
 	do {					\
@@ -1363,7 +1364,7 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
 	/* reset the rts and dtr */
 	/* do the actual close */
 	serial->open_count--;
-	kref_put(&serial->parent->ref, hso_serial_ref_free);
+
 	if (serial->open_count <= 0) {
 		serial->open_count = 0;
 		spin_lock_irq(&serial->serial_lock);
@@ -1383,6 +1384,8 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
 		usb_autopm_put_interface(serial->parent->interface);
 
 	mutex_unlock(&serial->parent->mutex);
+
+	kref_put(&serial->parent->ref, hso_serial_ref_free);
 }
 
 /* close the requested serial port */
@@ -1527,7 +1530,7 @@ static void tiocmget_intr_callback(struct urb *urb)
 		dev_warn(&usb->dev,
 			 "hso received invalid serial state notification\n");
 		DUMP(serial_state_notification,
-		     sizeof(hso_serial_state_notifation))
+		     sizeof(struct hso_serial_state_notification));
 	} else {
 
 		UART_state_bitmap = le16_to_cpu(serial_state_notification->
-- 
1.6.3.3


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-10-29  6:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-22  8:36 [PATCH] fix hso soft-lockup Antti Kaijanmäki
2009-10-26  7:53 ` Antti Kaijanmäki
2009-10-26 17:15 ` Greg KH
2009-10-26 19:37   ` Antti Kaijanmäki
2009-10-26 19:40     ` Greg KH
2009-10-27 14:26       ` [PATCH] hso: fix debug routines Antti Kaijanmäki
2009-10-28 23:16         ` Andrew Morton
2009-10-29  6:57           ` Antti Kaijanmäki
2009-10-27 14:26       ` [PATCH] hso: fix soft-lockup Antti Kaijanmäki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.