bcwc_pcie: add variable for wait_event_interruptible()

This commit is contained in:
Sven Schnelle
2015-11-23 20:03:02 +01:00
parent 5c8ecaef7f
commit 1f22dd2da2
3 changed files with 4 additions and 2 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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)