Re: [patch - regression]unkill cxacru atm driver

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Thu, 16 Aug 2007, Oliver Neukum wrote:

> Hi Greg,
> 
> it seems like you overdid it a bit in your quest to clean up the
> use of urb->status. In this driver you read it the first thing, which
> means that you are in a race against URB completion you'll
> usually lose, returning -EINPROGRESS. This kills the driver.
> 
> 	Regards
> 		Oliver
> 
> Signed-off-by: Oliver Neukum <[email protected]>
> ---
> 
> --- a/drivers/usb/atm/cxacru.c	2007-08-14 14:58:14.000000000 +0200
> +++ b/drivers/usb/atm/cxacru.c	2007-08-16 15:53:55.000000000 +0200
> @@ -456,7 +456,6 @@ static int cxacru_start_wait_urb(struct 
>  				 int* actual_length)
>  {
>  	struct timer_list timer;
> -	int status = urb->status;
>  
>  	init_timer(&timer);
>  	timer.expires = jiffies + msecs_to_jiffies(CMD_TIMEOUT);
> @@ -468,7 +467,7 @@ static int cxacru_start_wait_urb(struct 
>  
>  	if (actual_length)
>  		*actual_length = urb->actual_length;
> -	return status;
> +	return urb->status; /* must read status after completion */
>  }

This should be changed to resemble the usb_start_wait_urb routine in 
messages.c.  The idea is that urb->status is available _only_ in the 
completion handler, nowhere else.  Greg's mistake was to think that the 
start_wait_urb routines were completion handlers... but they aren't.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.