Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280899
b: refs/heads/master
c: b1930da
h: refs/heads/master
i:
  280897: 1f7ab94
  280895: aeabf0f
v: v3
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Dec 13, 2011
1 parent 29fc693 commit f500e69
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31e00fd116cab296da2d12bc0b82a30a9fbdd681
refs/heads/master: b1930da08872f6e17b8cdca60ee9c7321a8b5b8c
32 changes: 32 additions & 0 deletions trunk/drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,21 @@ static void usbhsh_ureq_free(struct usbhsh_hpriv *hpriv,
kfree(ureq);
}

/*
* status
*/
static int usbhsh_is_running(struct usbhsh_hpriv *hpriv)
{
/*
* we can decide some device is attached or not
* by checking mod.irq_attch
* see
* usbhsh_irq_attch()
* usbhsh_irq_dtch()
*/
return (hpriv->mod.irq_attch == NULL);
}

/*
* pipe control
*/
Expand Down Expand Up @@ -900,6 +915,11 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,

dev_dbg(dev, "%s (%s)\n", __func__, is_dir_in ? "in" : "out");

if (!usbhsh_is_running(hpriv)) {
ret = -EIO;
goto usbhsh_urb_enqueue_error_not_linked;
}

ret = usb_hcd_link_urb_to_ep(hcd, urb);
if (ret)
goto usbhsh_urb_enqueue_error_not_linked;
Expand Down Expand Up @@ -1249,6 +1269,12 @@ static int usbhsh_irq_attch(struct usbhs_priv *priv,
* attch interrupt might happen infinitely on some device
* (on self power USB hub ?)
* disable it here.
*
* usbhsh_is_running() becomes effective
* according to this process.
* see
* usbhsh_is_running()
* usbhsh_urb_enqueue()
*/
hpriv->mod.irq_attch = NULL;
usbhs_irq_callback_update(priv, &hpriv->mod);
Expand All @@ -1269,6 +1295,12 @@ static int usbhsh_irq_dtch(struct usbhs_priv *priv,

/*
* enable attch interrupt again
*
* usbhsh_is_running() becomes invalid
* according to this process.
* see
* usbhsh_is_running()
* usbhsh_urb_enqueue()
*/
hpriv->mod.irq_attch = usbhsh_irq_attch;
usbhs_irq_callback_update(priv, &hpriv->mod);
Expand Down

0 comments on commit f500e69

Please sign in to comment.