diff options
-rw-r--r-- | harddoomdev.c | 1 | ||||
-rw-r--r-- | surface.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/harddoomdev.c b/harddoomdev.c index 067293e..30c37fe 100644 --- a/harddoomdev.c +++ b/harddoomdev.c @@ -46,6 +46,7 @@ void send_command(struct doom_data *doom_data, uint32_t command) free = doomdev_read(doom_data->iomem, HARDDOOM_FIFO_FREE); if (free == 0) { deactivate_intr(doom_data->iomem, HARDDOOM_INTR_PONG_ASYNC); + free = doomdev_read(doom_data->iomem, HARDDOOM_FIFO_FREE); } if (free == 0) { @@ -267,7 +267,7 @@ ssize_t surface_read(struct file *filp, char __user *buf, size_t count, count = surface_data->surface_size - *offset; } - mutex_lock(&surface_data->doom_data->cmd_mutex); + mutex_lock(&surface_data->doom_data->ping_mutex); ping_sync(surface_data->doom_data); down(&surface_data->doom_data->pong_sem); @@ -276,7 +276,7 @@ ssize_t surface_read(struct file *filp, char __user *buf, size_t count, *offset += count - not_written; - mutex_unlock(&surface_data->doom_data->cmd_mutex); + mutex_unlock(&surface_data->doom_data->ping_mutex); return count - not_written; } |