diff --git a/bcwc_drv.c b/bcwc_drv.c index ff52246..f534a9b 100644 --- a/bcwc_drv.c +++ b/bcwc_drv.c @@ -196,6 +196,7 @@ static void bcwc_handle_irq(struct bcwc_private *dev_priv, struct fw_channel *ch } else if (chan == dev_priv->channel_buf_t2h) { buf_t2h_handler(dev_priv, chan, entry); } else if (chan == dev_priv->channel_io) { + dev_priv->cmd_ready = 1; wake_up_interruptible(&dev_priv->cmd_wq); } else if (chan == dev_priv->channel_io_t2h) { io_t2h_handler(dev_priv, chan, entry); diff --git a/bcwc_drv.h b/bcwc_drv.h index 77d87cf..2e4a8eb 100644 --- a/bcwc_drv.h +++ b/bcwc_drv.h @@ -76,7 +76,7 @@ struct bcwc_private { /* waitqueue for signaling command completion */ wait_queue_head_t cmd_wq; - + int cmd_ready; /* Mapped PCI resources */ void *s2_io; u32 s2_io_len; diff --git a/bcwc_isp.c b/bcwc_isp.c index 6eb8dfd..2733f17 100644 --- a/bcwc_isp.c +++ b/bcwc_isp.c @@ -307,7 +307,7 @@ int bcwc_isp_cmd(struct bcwc_private *dev_priv, enum bcwc_isp_cmds command, void goto out; } - if (wait_event_interruptible_timeout(dev_priv->cmd_wq, (entry->address_flags & 1), HZ) <= 0) { + if (wait_event_interruptible_timeout(dev_priv->cmd_wq, dev_priv->cmd_ready, HZ) <= 0) { dev_err(&dev_priv->pdev->dev, "timeout wait for command %d\n", cmd->opcode); bcwc_channel_ringbuf_dump(dev_priv, dev_priv->channel_io); if (response_len) @@ -315,6 +315,7 @@ int bcwc_isp_cmd(struct bcwc_private *dev_priv, enum bcwc_isp_cmds command, void ret = -ETIMEDOUT; goto out; } + dev_priv->cmd_ready = 0; /* XXX: response size in the ringbuf is zero after command completion, how is buffer size verification done? */ if (response_len && *response_len)