Re: ums-karma regression since 2.6.34

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

 



On Sun, 11 Jul 2010, Bob Copeland wrote:

> Good idea.  I didn't save the output, but the 'dma already free'
> error happens in the error path after the initialization already
> failed, so that's probably a red herring.  The transfer sequence
> looked like:
> 
> send cmd 1
> recv ack
> send cmd 2
> recv -> -EPIPE
> 
> The recv side isn't using us->iobuf after all, it's the second
> use of a driver-allocated buffer.
> 
> This patch fixes it for me, what do you think?
> 
> From: Bob Copeland <me@xxxxxxxxxxxxxxx>
> Date: Sun, 11 Jul 2010 09:21:56 -0400
> Subject: [PATCH] usb: initialize transfer flags in usb storage
> 
> Commit 0ede76fcec5415ef82a423a95120286895822e2d, "USB: remove uses of
> URB_NO_SETUP_DMA_MAP" introduced a regression by inadvertantly removing
> initialization of the transfer flags.  This caused initialization
> failures in the ums-karma driver.
> 
> Signed-off-by: Bob Copeland <me@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/storage/transport.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
> index 4471642..c17b7b0 100644
> --- a/drivers/usb/storage/transport.c
> +++ b/drivers/usb/storage/transport.c
> @@ -142,6 +142,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)
>  	us->current_urb->actual_length = 0;
>  	us->current_urb->error_count = 0;
>  	us->current_urb->status = 0;
> +	us->current_urb->transfer_flags = 0;
>  
>  	/* we assume that if transfer_buffer isn't us->iobuf then it
>  	 * hasn't been mapped for DMA.  Yes, this is clunky, but it's

Yep, that looks right.  The URB_NO_TRANSFER_DMA_MAP flag is getting set
but never cleared.

While you're at it, you could remove the lines that reset
actual_length, error_count, and status.  The core takes care of 
actual_length and status when an URB is submitted, and error_count is 
used only for isochronous URBs.

Kind of ironic that the driver was resetting a bunch of flags that 
didn't need it but ignoring the one flag that did!

Alan Stern

--
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