Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104548
b: refs/heads/master
c: 7119e3c
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 990e381 commit eec59a0
Show file tree
Hide file tree
Showing 4 changed files with 7 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: 7e4d6c387994294ac8198b624ee71e75de60dfd2
refs/heads/master: 7119e3c37fbf7c27adb5929f344c826ecb8c7859
2 changes: 1 addition & 1 deletion trunk/drivers/usb/storage/scsiglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static int queuecommand(struct scsi_cmnd *srb,
/* enqueue the command and wake up the control thread */
srb->scsi_done = done;
us->srb = srb;
up(&(us->sema));
complete(&us->cmnd_ready);

return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/usb/storage/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ static int usb_stor_control_thread(void * __us)

for(;;) {
US_DEBUGP("*** thread sleeping.\n");
if(down_interruptible(&us->sema))
if (wait_for_completion_interruptible(&us->cmnd_ready))
break;

US_DEBUGP("*** thread awakened.\n");

/* lock the device pointers */
Expand Down Expand Up @@ -825,7 +825,7 @@ static void usb_stor_release_resources(struct us_data *us)
*/
US_DEBUGP("-- sending exit command to thread\n");
set_bit(US_FLIDX_DISCONNECTING, &us->dflags);
up(&us->sema);
complete(&us->cmnd_ready);
if (us->ctl_thread)
kthread_stop(us->ctl_thread);

Expand Down Expand Up @@ -975,7 +975,7 @@ static int storage_probe(struct usb_interface *intf,
us = host_to_us(host);
memset(us, 0, sizeof(struct us_data));
mutex_init(&(us->dev_mutex));
init_MUTEX_LOCKED(&(us->sema));
init_completion(&us->cmnd_ready);
init_completion(&(us->notify));
init_waitqueue_head(&us->delay_wait);
init_completion(&us->scanning_done);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/storage/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct us_data {
struct task_struct *ctl_thread; /* the control thread */

/* mutual exclusion and synchronization structures */
struct semaphore sema; /* to sleep thread on */
struct completion cmnd_ready; /* to sleep thread on */
struct completion notify; /* thread begin/end */
wait_queue_head_t delay_wait; /* wait during scan, reset */
struct completion scanning_done; /* wait for scan thread */
Expand Down

0 comments on commit eec59a0

Please sign in to comment.