m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2018-05-28 16:01:47 +0200
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2018-05-28 16:01:47 +0200
commitff8d6997c13bc256c15e8db4912f34e910c02b2a (patch)
tree69e33f26857a15dc7e155ac33b3bc53f7ae17fa5
parent9eb310afc4a96304b47d4897c58ca3bb733362a9 (diff)
Update synchronization
-rw-r--r--harddoomdev.c1
-rw-r--r--surface.c4
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) {
diff --git a/surface.c b/surface.c
index cbb9406..13b0e6b 100644
--- a/surface.c
+++ b/surface.c
@@ -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;
}