|
@@ -1183,8 +1183,10 @@ static ssize_t smu_read_command(struct file *file, struct smu_private *pp,
|
|
|
return -EOVERFLOW;
|
|
|
spin_lock_irqsave(&pp->lock, flags);
|
|
|
if (pp->cmd.status == 1) {
|
|
|
- if (file->f_flags & O_NONBLOCK)
|
|
|
+ if (file->f_flags & O_NONBLOCK) {
|
|
|
+ spin_unlock_irqrestore(&pp->lock, flags);
|
|
|
return -EAGAIN;
|
|
|
+ }
|
|
|
add_wait_queue(&pp->wait, &wait);
|
|
|
for (;;) {
|
|
|
set_current_state(TASK_INTERRUPTIBLE);
|