Re: Regression since 2.6.35: mct_u232 and U232-P9 usb serial adapter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 21 Oct 2010, Johan Hovold wrote:

> Hi Eric,
> 
> On Wed, Oct 20, 2010 at 12:21:06AM -0600, Eric Shattow Eprecocious wrote:
> > I have a purple "U232-P9(2.4)" USB to Serial adapter. The distributor
> > I bought it from made a big deal about the purple color distinguishing
> > this from other similar adapters.
> >
> > This adapter works with kernel 2.6.34.7 and breaks with kernel 2.6.35,
> 
> I'm pretty sure this patch will fix the problem you're experiencing.
> Care to give it
> a try?
> 
> (I'm sending this patch through gmail -- hope that does not mess anything (e.g.
> formatting) up. Can resend it later today otherwise).
> 
> Thanks,
> Johan
> 
> 
> >From 3f9ff29016edbfcda051bdefd8d13c549bc8ef6e Mon Sep 17 00:00:00 2001
> From: Johan Hovold <jhovold@xxxxxxxxx>
> Date: Thu, 21 Oct 2010 10:40:20 +0200
> Subject: [PATCH] USB: mct_u232: fix broken close
> 
> Fix regression introduced by commit
> f26788da3b342099d2b02d99ba1cb7f154d6ef7b (USB: serial: refactor generic
> close) which broke driver close().
> 
> This driver uses non-standard semantics for the read urb which makes the
> generic close function fail to kill it (the read urb is actually an
> interrupt urb and therefore bulk_in size is zero).
> 
> Reported-by: Eric Shattow "Eprecocious" <lucent@xxxxxxxxx>
> Cc: stable <stable@xxxxxxxxxx>
> Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
> ---
>  drivers/usb/serial/mct_u232.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
> index 7aa01b9..2849f8c 100644
> --- a/drivers/usb/serial/mct_u232.c
> +++ b/drivers/usb/serial/mct_u232.c
> @@ -549,9 +549,12 @@ static void mct_u232_close(struct usb_serial_port *port)
>  {
>  	dbg("%s port %d", __func__, port->number);
> 
> -	usb_serial_generic_close(port);
> -	if (port->serial->dev)
> +	if (port->serial->dev) {
> +		/* shutdown our urbs */
> +		usb_kill_urb(port->write_urb);
> +		usb_kill_urb(port->read_urb);
>  		usb_kill_urb(port->interrupt_in_urb);
> +	}
>  } /* mct_u232_close */

Heh.  I was going to suggest the following patch, but yours is cleaner.

Alan Stern


Index: usb-2.6/drivers/usb/serial/mct_u232.c
===================================================================
--- usb-2.6.orig/drivers/usb/serial/mct_u232.c
+++ usb-2.6/drivers/usb/serial/mct_u232.c
@@ -434,6 +434,7 @@ static int mct_u232_startup(struct usb_s
 	port->read_urb = rport->interrupt_in_urb;
 	rport->interrupt_in_urb = NULL;
 	port->read_urb->context = port;
+	port->bulk_in_size = port->read_urb->transfer_buffer_length;
 
 	return 0;
 } /* mct_u232_startup */

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux