diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2018-05-28 16:01:47 +0200 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2018-05-28 16:01:47 +0200 |
commit | ff8d6997c13bc256c15e8db4912f34e910c02b2a (patch) | |
tree | 69e33f26857a15dc7e155ac33b3bc53f7ae17fa5 | |
parent | 9eb310afc4a96304b47d4897c58ca3bb733362a9 (diff) |
Update synchronization
-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; } |