m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}