Re: [PATCH] USB and Driver Core patches for 2.6.10

From: Greg KH (greg_at_kroah.com)
Date: 01/08/05

  • Next message: Greg KH: "Re: [PATCH] USB and Driver Core patches for 2.6.10"
    Date:	Fri, 7 Jan 2005 21:47:44 -0800
    To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
    
    

    ChangeSet 1.1938.446.11, 2004/12/15 16:01:23-08:00, eolson@MIT.EDU

    [PATCH] usb-serial: add tty_hangup on disconnect

    When a USB serial device is disconnected, user applications performing a
    read() now receive an error code, rather than waiting indefinitely. The
    included patch is originally from Al Borchers, massaged to apply to
    2.6.9 and 2.6.10-rc2. I've tested it on 2.6.9, but not on 2.6.10-rc2.

    Al Borcher's original post:
    http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg27475.html

    Signed-off-by: Edwin Olson (eolson@mit.edu)
    Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

     drivers/usb/serial/usb-serial.c | 7 +++++++
     1 files changed, 7 insertions(+)

    diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
    --- a/drivers/usb/serial/usb-serial.c 2005-01-07 15:50:08 -08:00
    +++ b/drivers/usb/serial/usb-serial.c 2005-01-07 15:50:08 -08:00
    @@ -1238,13 +1238,20 @@
     
     void usb_serial_disconnect(struct usb_interface *interface)
     {
    + int i;
             struct usb_serial *serial = usb_get_intfdata (interface);
             struct device *dev = &interface->dev;
    + struct usb_serial_port *port;
     
             dbg ("%s", __FUNCTION__);
     
             usb_set_intfdata (interface, NULL);
             if (serial) {
    + for (i = 0; i < serial->num_ports; ++i) {
    + port = serial->port[i];
    + if (port && port->tty)
    + tty_hangup(port->tty);
    + }
                     /* let the last holder of this object
                      * cause it to be cleaned up */
                     kref_put(&serial->kref, destroy_serial);

    -
    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: Greg KH: "Re: [PATCH] USB and Driver Core patches for 2.6.10"

    Relevant Pages

    • [PATCH] copy_{to|from}_user checks in ide-tape
      ... (unchecked values found by smatch). ... This patch follows the former approach. ... to return the error code, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [patch 2.6.13-rc6] i386: fix incorrect FP signal delivery
      ... This patch fixes a problem with incorrect floating-point exception ... signal delivery on i386 kernels. ... an error code of zero ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • PROBLEM: incorrect return value checks from kernel_read()
      ... of failure, e.g. an error code is returned. ... return an error code, panic, etc. ... For a detailed explanation of related issues, refer to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)

    Loading