Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235478
b: refs/heads/master
c: 6d71ba2
h: refs/heads/master
v: v3
  • Loading branch information
Pavan Savoy authored and Greg Kroah-Hartman committed Feb 4, 2011
1 parent 482aca5 commit b284376
Show file tree
Hide file tree
Showing 2 changed files with 16 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: ef04d121f030329aae0c2d3ec22beea0c5cbcfd3
refs/heads/master: 6d71ba2105a1d8c1712cdfcf46fc6040e4707cb9
15 changes: 15 additions & 0 deletions trunk/drivers/misc/ti-st/st_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ void st_int_recv(void *disc_data,
int len = 0, type = 0;
unsigned char *plen;
struct st_data_s *st_gdata = (struct st_data_s *)disc_data;
unsigned long flags;

ptr = (char *)data;
/* tty_receive sent null ? */
Expand All @@ -248,6 +249,7 @@ void st_int_recv(void *disc_data,
"rx_count %ld", count, st_gdata->rx_state,
st_gdata->rx_count);

spin_lock_irqsave(&st_gdata->lock, flags);
/* Decode received bytes here */
while (count) {
if (st_gdata->rx_count) {
Expand Down Expand Up @@ -308,13 +310,25 @@ void st_int_recv(void *disc_data,
* sleep state received --
*/
st_ll_sleep_state(st_gdata, *ptr);
/* if WAKEUP_IND collides copy from waitq to txq
* and assume chip awake
*/
spin_unlock_irqrestore(&st_gdata->lock, flags);
if (st_ll_getstate(st_gdata) == ST_LL_AWAKE)
st_wakeup_ack(st_gdata, LL_WAKE_UP_ACK);
spin_lock_irqsave(&st_gdata->lock, flags);

ptr++;
count--;
continue;
case LL_WAKE_UP_ACK:
pr_debug("PM packet");

spin_unlock_irqrestore(&st_gdata->lock, flags);
/* wake up ack received */
st_wakeup_ack(st_gdata, *ptr);
spin_lock_irqsave(&st_gdata->lock, flags);

ptr++;
count--;
continue;
Expand All @@ -337,6 +351,7 @@ void st_int_recv(void *disc_data,
ptr++;
count--;
}
spin_unlock_irqrestore(&st_gdata->lock, flags);
pr_debug("done %s", __func__);
return;
}
Expand Down

0 comments on commit b284376

Please sign in to comment.