Commit f10fc179 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: Use a normal mutex for the main lock

There is no reason for atomisp to use a rt_mutex instead of a normal
mutex, so switch over to a normal mutex.

All the changes in this patch are just s/rt_mutex/mutex/.

This is a preparation patch for switching the ioctl locking over
to using the video_dev.lock member so that the v4l2-core takes
care of the locking.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 3ad29019
......@@ -1446,10 +1446,10 @@ void atomisp_wdt_work(struct work_struct *work)
unsigned int pipe_wdt_cnt[MAX_STREAM_NUM][4] = { {0} };
bool css_recover = true;
rt_mutex_lock(&isp->mutex);
mutex_lock(&isp->mutex);
if (!atomisp_streaming_count(isp)) {
atomic_set(&isp->wdt_work_queued, 0);
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return;
}
......@@ -1581,7 +1581,7 @@ void atomisp_wdt_work(struct work_struct *work)
isp->isp_fatal_error = true;
atomic_set(&isp->wdt_work_queued, 0);
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return;
}
}
......@@ -1601,7 +1601,7 @@ void atomisp_wdt_work(struct work_struct *work)
dev_err(isp->dev, "timeout recovery handling done\n");
atomic_set(&isp->wdt_work_queued, 0);
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
}
void atomisp_css_flush(struct atomisp_device *isp)
......@@ -1861,7 +1861,7 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
* For CSS2.0: we change the way to not dequeue all the event at one
* time, instead, dequue one and process one, then another
*/
rt_mutex_lock(&isp->mutex);
mutex_lock(&isp->mutex);
if (atomisp_css_isr_thread(isp, frame_done_found, css_pipe_done))
goto out;
......@@ -1872,7 +1872,7 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
atomisp_setup_flash(asd);
}
out:
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
dev_dbg(isp->dev, "<%s\n", __func__);
return IRQ_HANDLED;
......
......@@ -711,7 +711,7 @@ static int atomisp_open(struct file *file)
if (ret)
return ret;
rt_mutex_lock(&isp->mutex);
mutex_lock(&isp->mutex);
asd->subdev.devnode = vdev;
/* Deferred firmware loading case. */
......@@ -745,7 +745,7 @@ static int atomisp_open(struct file *file)
*/
if (pipe->users) {
dev_dbg(isp->dev, "video node already opened\n");
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return -EBUSY;
}
......@@ -788,7 +788,7 @@ static int atomisp_open(struct file *file)
done:
pipe->users++;
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
/* Ensure that a mode is set */
v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode);
......@@ -799,7 +799,7 @@ static int atomisp_open(struct file *file)
atomisp_css_uninit(isp);
pm_runtime_put(vdev->v4l2_dev->dev);
error:
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
v4l2_fh_release(file);
return ret;
}
......@@ -822,7 +822,7 @@ static int atomisp_release(struct file *file)
return -EBADF;
mutex_lock(&isp->streamoff_mutex);
rt_mutex_lock(&isp->mutex);
mutex_lock(&isp->mutex);
dev_dbg(isp->dev, "release device %s\n", vdev->name);
......@@ -905,7 +905,7 @@ static int atomisp_release(struct file *file)
atomisp_subdev_source_pad(vdev),
V4L2_SEL_TGT_COMPOSE, 0,
&clear_compose);
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
mutex_unlock(&isp->streamoff_mutex);
return v4l2_fh_release(file);
......@@ -1063,7 +1063,7 @@ static int atomisp_mmap(struct file *file, struct vm_area_struct *vma)
if (!(vma->vm_flags & (VM_WRITE | VM_READ)))
return -EACCES;
rt_mutex_lock(&isp->mutex);
mutex_lock(&isp->mutex);
if (!(vma->vm_flags & VM_SHARED)) {
/* Map private buffer.
......@@ -1074,7 +1074,7 @@ static int atomisp_mmap(struct file *file, struct vm_area_struct *vma)
*/
vma->vm_flags |= VM_SHARED;
ret = hmm_mmap(vma, vma->vm_pgoff << PAGE_SHIFT);
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return ret;
}
......@@ -1117,7 +1117,7 @@ static int atomisp_mmap(struct file *file, struct vm_area_struct *vma)
}
raw_virt_addr->data_bytes = origin_size;
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return 0;
}
......@@ -1129,12 +1129,12 @@ static int atomisp_mmap(struct file *file, struct vm_area_struct *vma)
ret = -EINVAL;
goto error;
}
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return atomisp_videobuf_mmap_mapper(&pipe->capq, vma);
error:
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return ret;
}
......@@ -1146,12 +1146,12 @@ static __poll_t atomisp_poll(struct file *file,
struct atomisp_device *isp = video_get_drvdata(vdev);
struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
rt_mutex_lock(&isp->mutex);
mutex_lock(&isp->mutex);
if (pipe->capq.streaming != 1) {
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return EPOLLERR;
}
rt_mutex_unlock(&isp->mutex);
mutex_unlock(&isp->mutex);
return videobuf_poll_stream(file, &pipe->capq, pt);
}
......
......@@ -238,7 +238,7 @@ struct atomisp_device {
/* Purpose of mutex is to protect and serialize use of isp data
* structures and css API calls. */
struct rt_mutex mutex;
struct mutex mutex;
/*
* Serialise streamoff: mutex is dropped during streamoff to
* cancel the watchdog queue. MUST be acquired BEFORE
......
......@@ -1514,7 +1514,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
dev_dbg(&pdev->dev, "atomisp mmio base: %p\n", isp->base);
rt_mutex_init(&isp->mutex);
mutex_init(&isp->mutex);
mutex_init(&isp->streamoff_mutex);
spin_lock_init(&isp->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment