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>,
Linux Serial
<linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH 01/02] hso patch to fix a -EIO from opening a hso serial device
Date: Wed, 14 Jan 2009 12:22:31 +0100 [thread overview]
Message-ID: <496DCAF7.9080906@option.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]
Hi All,
This is an important patch the linux-2.6.29-rc1 driver with itworks much
better than it did.
I'm about 80% sure this patch is correct
but it needs Alan Cox'es blessing as it modifies code he added.
This patch fixes -EIO caused when serial port opened more than once.
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-14 11:51:26.000000000 +0100
+++ linux-2.6/drivers/net/usb/hso.c 2009-01-14 11:57:59.000000000 +0100
@@ -1354,13 +1354,14 @@
/* do the actual close */
serial->open_count--;
kref_put(&serial->parent->ref, hso_serial_ref_free);
+ if (serial->tty == tty)
+ tty_kref_put(tty);
if (serial->open_count <= 0) {
serial->open_count = 0;
spin_lock_irq(&serial->serial_lock);
if (serial->tty == tty) {
serial->tty->driver_data = NULL;
serial->tty = NULL;
- tty_kref_put(tty);
}
spin_unlock_irq(&serial->serial_lock);
if (!usb_gone)
@@ -1368,7 +1369,6 @@
tasklet_kill(&serial->unthrottle_tasklet);
cancel_work_sync(&serial->retry_unthrottle_workqueue);
}
-
if (!usb_gone)
usb_autopm_put_interface(serial->parent->interface);
--
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_open_eio_fix.patch --]
[-- Type: text/x-diff, Size: 1000 bytes --]
This patch fixes -EIO caused when serial port opened more than once.
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-14 11:51:26.000000000 +0100
+++ linux-2.6/drivers/net/usb/hso.c 2009-01-14 11:57:59.000000000 +0100
@@ -1354,13 +1354,14 @@
/* do the actual close */
serial->open_count--;
kref_put(&serial->parent->ref, hso_serial_ref_free);
+ if (serial->tty == tty)
+ tty_kref_put(tty);
if (serial->open_count <= 0) {
serial->open_count = 0;
spin_lock_irq(&serial->serial_lock);
if (serial->tty == tty) {
serial->tty->driver_data = NULL;
serial->tty = NULL;
- tty_kref_put(tty);
}
spin_unlock_irq(&serial->serial_lock);
if (!usb_gone)
@@ -1368,7 +1369,6 @@
tasklet_kill(&serial->unthrottle_tasklet);
cancel_work_sync(&serial->retry_unthrottle_workqueue);
}
next reply other threads:[~2009-01-14 11:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-14 11:22 Denis Joseph Barrow [this message]
[not found] ` <496DCAF7.9080906-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
2009-01-14 11:38 ` [PATCH 01/02] hso patch to fix a -EIO from opening a hso serial device Alan Cox
[not found] ` <20090114113828.7b9f59ca-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2009-01-14 12:40 ` Denis Joseph Barrow
2009-01-14 13:04 ` Alan Cox
2009-01-15 5:14 ` David Miller
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=496DCAF7.9080906@option.com \
--to=d.barow-x9gzzrpc1qbqt0dzr+alfa@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).