media: atomisp: Drop streamoff_mutex
authorHans de Goede <hdegoede@redhat.com>
Sat, 3 Sep 2022 21:42:53 +0000 (23:42 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 24 Sep 2022 08:09:30 +0000 (10:09 +0200)
Now that __atomisp_streamoff() no longer drops isp->mutex to cancel
the watchdog timer, the streamoff_mutex is no longer necessary to
avoid multiple streamoffs racing with each other.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp_internal.h
drivers/staging/media/atomisp/pci/atomisp_ioctl.c
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index e1b213ba46865cc2568192f3400f589c08737d8c..531bbd6d7ee0376b41fa2e09c776438694b68551 100644 (file)
@@ -822,7 +822,6 @@ static int atomisp_release(struct file *file)
        if (!isp)
                return -EBADF;
 
-       mutex_lock(&isp->streamoff_mutex);
        mutex_lock(&isp->mutex);
 
        dev_dbg(isp->dev, "release device %s\n", vdev->name);
@@ -909,7 +908,6 @@ done:
                                     V4L2_SEL_TGT_COMPOSE, 0,
                                     &clear_compose);
        mutex_unlock(&isp->mutex);
-       mutex_unlock(&isp->streamoff_mutex);
 
        return v4l2_fh_release(file);
 }
index 2279d45e7d7aef2c0b5d606ad1df297b29fec514..f3ef840c640a3ac403dd573176ec84eb7ca7957a 100644 (file)
@@ -239,12 +239,6 @@ struct atomisp_device {
        /* Purpose of mutex is to protect and serialize use of isp data
         * structures and css API calls. */
        struct mutex mutex;
-       /*
-        * Serialise streamoff: mutex is dropped during streamoff to
-        * cancel the watchdog queue. MUST be acquired BEFORE
-        * "mutex".
-        */
-       struct mutex streamoff_mutex;
 
        unsigned int input_cnt;
        struct atomisp_input_subdev inputs[ATOM_ISP_MAX_INPUTS];
index 8991575849512a3ed729294b54b63a96fdc8dd63..6d84a7e9cb5702e6e47f90191fde3ab1f33a4aea 100644 (file)
@@ -1872,7 +1872,6 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
                atomisp_subdev_source_pad(vdev), asd->index);
 
        lockdep_assert_held(&isp->mutex);
-       lockdep_assert_held(&isp->streamoff_mutex);
 
        if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
                dev_dbg(isp->dev, "unsupported v4l2 buf type\n");
@@ -2081,11 +2080,9 @@ static int atomisp_streamoff(struct file *file, void *fh,
        struct atomisp_device *isp = video_get_drvdata(vdev);
        int rval;
 
-       mutex_lock(&isp->streamoff_mutex);
        mutex_lock(&isp->mutex);
        rval = __atomisp_streamoff(file, fh, type);
        mutex_unlock(&isp->mutex);
-       mutex_unlock(&isp->streamoff_mutex);
 
        return rval;
 }
index d55e8d32a286e0035c88ae9ffe726d876a879c4b..4ab91858d30883198b61eaace5bb0ed46f069e6b 100644 (file)
@@ -1482,7 +1482,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);
 
        mutex_init(&isp->mutex);
-       mutex_init(&isp->streamoff_mutex);
        spin_lock_init(&isp->lock);
 
        /* This is not a true PCI device on SoC, so the delay is not needed. */