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

media: atomisp: Remove loading mutex

Now that the registering of the /dev/* video / subdev nodes has been
moved to the end of atomisp_pci_probe() the workaround with the loading
mutex to delay opens until init is done is no longer necessary.
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent eb81065b
......@@ -707,29 +707,13 @@ static int atomisp_open(struct file *file)
dev_dbg(isp->dev, "open device %s\n", vdev->name);
/*
* Ensure that if we are still loading we block. Once the loading
* is over we can proceed. We can't blindly hold the lock until
* that occurs as if the load fails we'll deadlock the unload
*/
rt_mutex_lock(&isp->loading);
/*
* FIXME: revisit this with a better check once the code structure
* is cleaned up a bit more
*/
ret = v4l2_fh_open(file);
if (ret) {
dev_err(isp->dev,
"%s: v4l2_fh_open() returned error %d\n",
__func__, ret);
rt_mutex_unlock(&isp->loading);
return ret;
}
if (!isp->ready) {
rt_mutex_unlock(&isp->loading);
return -ENXIO;
}
rt_mutex_unlock(&isp->loading);
rt_mutex_lock(&isp->mutex);
......
......@@ -239,13 +239,6 @@ struct atomisp_device {
/* Purpose of mutex is to protect and serialize use of isp data
* structures and css API calls. */
struct rt_mutex mutex;
/*
* This mutex ensures that we don't allow an open to succeed while
* the initialization process is incomplete
*/
struct rt_mutex loading;
/* Set once the ISP is ready to allow opens */
bool ready;
/*
* Serialise streamoff: mutex is dropped during streamoff to
* cancel the watchdog queue. MUST be acquired BEFORE
......
......@@ -1515,7 +1515,6 @@ 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);
rt_mutex_init(&isp->loading);
mutex_init(&isp->streamoff_mutex);
spin_lock_init(&isp->lock);
......@@ -1688,8 +1687,6 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
pci_write_config_dword(pdev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL, csi_afe_trim);
}
rt_mutex_lock(&isp->loading);
err = atomisp_initialize_modules(isp);
if (err < 0) {
dev_err(&pdev->dev, "atomisp_initialize_modules (%d)\n", err);
......@@ -1737,9 +1734,6 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
release_firmware(isp->firmware);
isp->firmware = NULL;
isp->css_env.isp_css_fw.data = NULL;
isp->ready = true;
rt_mutex_unlock(&isp->loading);
err = atomisp_register_device_nodes(isp);
if (err)
......@@ -1760,7 +1754,6 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
register_entities_fail:
atomisp_uninitialize_modules(isp);
initialize_modules_fail:
rt_mutex_unlock(&isp->loading);
cpu_latency_qos_remove_request(&isp->pm_qos);
atomisp_msi_irq_uninit(isp);
pci_free_irq_vectors(pdev);
......
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