Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317287
b: refs/heads/master
c: dd13c86
h: refs/heads/master
i:
  317285: 7541dd3
  317283: 13ee071
  317279: 11cae59
v: v3
  • Loading branch information
Ben Chan authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent 43c1ebe commit 498a6de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 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: 7dd80eb925a5aac4ebe8b1abec20802e91f60c2e
refs/heads/master: dd13c86b0dae86efdde98119ffd7348e80719ade
24 changes: 18 additions & 6 deletions trunk/drivers/staging/gdm72xx/gdm_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static void release_usb(struct usbwm_dev *udev)
}
}

static void gdm_usb_send_complete(struct urb *urb)
static void gdm_usb_send_complete_impl(struct urb *urb, bool need_lock)
{
struct usb_tx *t = urb->context;
struct tx_cxt *tx = t->tx_cxt;
Expand All @@ -282,7 +282,8 @@ static void gdm_usb_send_complete(struct urb *urb)
if (urb->status == -ECONNRESET)
return;

spin_lock_irqsave(&tx->lock, flags);
if (need_lock)
spin_lock_irqsave(&tx->lock, flags);

if (t->callback)
t->callback(t->cb_data);
Expand All @@ -296,7 +297,18 @@ static void gdm_usb_send_complete(struct urb *urb)
else
free_tx_struct(t);

spin_unlock_irqrestore(&tx->lock, flags);
if (need_lock)
spin_unlock_irqrestore(&tx->lock, flags);
}

static void gdm_usb_send_complete(struct urb *urb)
{
gdm_usb_send_complete_impl(urb, true);
}

static void gdm_usb_send_complete_no_lock(struct urb *urb)
{
gdm_usb_send_complete_impl(urb, false);
}

static int gdm_usb_send(void *priv_dev, void *data, int len,
Expand Down Expand Up @@ -411,7 +423,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,

send_fail:
t->callback = NULL;
gdm_usb_send_complete(t->urb);
gdm_usb_send_complete_no_lock(t->urb);
spin_unlock_irqrestore(&tx->lock, flags);
return ret;
}
Expand Down Expand Up @@ -540,7 +552,7 @@ static void do_pm_control(struct work_struct *work)

if (ret) {
t->callback = NULL;
gdm_usb_send_complete(t->urb);
gdm_usb_send_complete_no_lock(t->urb);
}
}
}
Expand Down Expand Up @@ -742,7 +754,7 @@ static int k_mode_thread(void *arg)

if (ret) {
t->callback = NULL;
gdm_usb_send_complete(t->urb);
gdm_usb_send_complete_no_lock(t->urb);
}
}

Expand Down

0 comments on commit 498a6de

Please sign in to comment.