Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232609
b: refs/heads/master
c: bd65f62
h: refs/heads/master
i:
  232607: c542872
v: v3
  • Loading branch information
Max Vozeler authored and Greg Kroah-Hartman committed Jan 21, 2011
1 parent b338ff9 commit 972aa90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e249c8b0737429bbf534515f81aded93504f449
refs/heads/master: bd65f6233f6bc3233e7910752689fe3a45dc2e0c
21 changes: 20 additions & 1 deletion trunk/drivers/staging/usbip/vhci_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,19 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev,
return;
}

static int vhci_priv_tx_empty(struct vhci_device *vdev)
{
int empty = 0;

spin_lock(&vdev->priv_lock);

empty = list_empty(&vdev->priv_rx);

spin_unlock(&vdev->priv_lock);

return empty;
}

/* recv a pdu */
static void vhci_rx_pdu(struct usbip_device *ud)
{
Expand All @@ -210,8 +223,14 @@ static void vhci_rx_pdu(struct usbip_device *ud)
if (ret < 0) {
if (ret == -ECONNRESET)
usbip_uinfo("connection reset by peer\n");
else if (ret != -ERESTARTSYS)
else if (ret == -EAGAIN) {
/* ignore if connection was idle */
if (vhci_priv_tx_empty(vdev))
return;
usbip_uinfo("connection timed out with pending urbs\n");
} else if (ret != -ERESTARTSYS)
usbip_uinfo("xmit failed %d\n", ret);

usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
return;
}
Expand Down

0 comments on commit 972aa90

Please sign in to comment.