aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/r8a66597-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/r8a66597-hcd.c')
-rw-r--r--drivers/usb/host/r8a66597-hcd.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 60248b01ce14..98b9e0547544 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -1118,7 +1118,7 @@ __releases(r8a66597->lock) __acquires(r8a66597->lock)
1118 r8a66597->timeout_map &= ~(1 << pipenum); 1118 r8a66597->timeout_map &= ~(1 << pipenum);
1119 1119
1120 if (likely(td)) { 1120 if (likely(td)) {
1121 if (td->set_address && urb->status != 0) 1121 if (td->set_address && (urb->status != 0 || urb->unlinked))
1122 r8a66597->address_map &= ~(1 << urb->setup_packet[2]); 1122 r8a66597->address_map &= ~(1 << urb->setup_packet[2]);
1123 1123
1124 pipe_toggle_save(r8a66597, td->pipe, urb); 1124 pipe_toggle_save(r8a66597, td->pipe, urb);
@@ -1225,8 +1225,7 @@ static void packet_read(struct r8a66597 *r8a66597, u16 pipenum)
1225 } 1225 }
1226 1226
1227 if (finish && pipenum != 0) { 1227 if (finish && pipenum != 0) {
1228 if (td->urb->status == -EINPROGRESS) 1228 td->urb->status = status;
1229 td->urb->status = status;
1230 finish_request(r8a66597, td, pipenum, urb); 1229 finish_request(r8a66597, td, pipenum, urb);
1231 } 1230 }
1232} 1231}
@@ -1308,32 +1307,24 @@ static void check_next_phase(struct r8a66597 *r8a66597)
1308 switch (td->type) { 1307 switch (td->type) {
1309 case USB_PID_IN: 1308 case USB_PID_IN:
1310 case USB_PID_OUT: 1309 case USB_PID_OUT:
1311 if (urb->status != -EINPROGRESS) {
1312 finish = 1;
1313 break;
1314 }
1315 if (check_transfer_finish(td, urb)) 1310 if (check_transfer_finish(td, urb))
1316 td->type = USB_PID_ACK; 1311 td->type = USB_PID_ACK;
1317 break; 1312 break;
1318 case USB_PID_SETUP: 1313 case USB_PID_SETUP:
1319 if (urb->status != -EINPROGRESS) 1314 if (urb->transfer_buffer_length == urb->actual_length)
1320 finish = 1;
1321 else if (urb->transfer_buffer_length == urb->actual_length) {
1322 td->type = USB_PID_ACK; 1315 td->type = USB_PID_ACK;
1323 urb->status = 0; 1316 else if (usb_pipeout(urb->pipe))
1324 } else if (usb_pipeout(urb->pipe))
1325 td->type = USB_PID_OUT; 1317 td->type = USB_PID_OUT;
1326 else 1318 else
1327 td->type = USB_PID_IN; 1319 td->type = USB_PID_IN;
1328 break; 1320 break;
1329 case USB_PID_ACK: 1321 case USB_PID_ACK:
1330 finish = 1; 1322 finish = 1;
1331 if (urb->status == -EINPROGRESS) 1323 urb->status = 0;
1332 urb->status = 0;
1333 break; 1324 break;
1334 } 1325 }
1335 1326
1336 if (finish) 1327 if (finish || urb->unlinked)
1337 finish_request(r8a66597, td, 0, urb); 1328 finish_request(r8a66597, td, 0, urb);
1338 else 1329 else
1339 start_transfer(r8a66597, td); 1330 start_transfer(r8a66597, td);
@@ -1418,8 +1409,7 @@ static void irq_pipe_empty(struct r8a66597 *r8a66597)
1418 if ((tmp & INBUFM) == 0) { 1409 if ((tmp & INBUFM) == 0) {
1419 disable_irq_empty(r8a66597, pipenum); 1410 disable_irq_empty(r8a66597, pipenum);
1420 pipe_irq_disable(r8a66597, pipenum); 1411 pipe_irq_disable(r8a66597, pipenum);
1421 if (td->urb->status == -EINPROGRESS) 1412 td->urb->status = 0;
1422 td->urb->status = 0;
1423 finish_request(r8a66597, td, pipenum, td->urb); 1413 finish_request(r8a66597, td, pipenum, td->urb);
1424 } 1414 }
1425 } 1415 }