[PATCH] uas: Fix uas not working when plugged into an ehci port

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

 



I thought it would be a good idea to also test uas with usb-2, and it turns out
it ws, as it did not work. The problem is that the uas driver was passing the
bEndpointAddress' direction bit to usb_rcvbulkpipe, the xhci code seems to
not care about this, but with the ehci code this causes usb_submit_urb
failure.

With this fixed the uas code works nicely with an uas device plugged into
an ehci port.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 drivers/usb/storage/uas.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index bf80ef1..ba7c48d 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -594,10 +594,10 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
 
 	if (cmdinfo->state & SUBMIT_DATA_IN_URB) {
 		usb_anchor_urb(cmdinfo->data_in_urb, &devinfo->data_urbs);
-		if (usb_submit_urb(cmdinfo->data_in_urb, gfp)) {
+		if ((err = usb_submit_urb(cmdinfo->data_in_urb, gfp))) {
 			usb_unanchor_urb(cmdinfo->data_in_urb);
 			scmd_printk(KERN_INFO, cmnd,
-					"data in urb submission failure\n");
+					"data in urb submission failure %d\n", err);
 			return SCSI_MLQUEUE_DEVICE_BUSY;
 		}
 		cmdinfo->state &= ~SUBMIT_DATA_IN_URB;
@@ -957,13 +957,13 @@ static void uas_configure_endpoints(struct uas_dev_info *devinfo)
 		eps[3] = usb_pipe_endpoint(udev, devinfo->data_out_pipe);
 	} else {
 		devinfo->cmd_pipe = usb_sndbulkpipe(udev,
-						eps[0]->desc.bEndpointAddress);
+					  eps[0]->desc.bEndpointAddress & 0xf);
 		devinfo->status_pipe = usb_rcvbulkpipe(udev,
-						eps[1]->desc.bEndpointAddress);
+					  eps[1]->desc.bEndpointAddress & 0xf);
 		devinfo->data_in_pipe = usb_rcvbulkpipe(udev,
-						eps[2]->desc.bEndpointAddress);
+					  eps[2]->desc.bEndpointAddress & 0xf);
 		devinfo->data_out_pipe = usb_sndbulkpipe(udev,
-						eps[3]->desc.bEndpointAddress);
+					  eps[3]->desc.bEndpointAddress & 0xf);
 	}
 
 	devinfo->qdepth = usb_alloc_streams(devinfo->intf, eps + 1, 3, 256,
-- 
1.8.3.1

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