summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-05-11 15:51:21 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-06-09 14:35:03 +0100
commit820a1338d6a14bde0de7ed57cf486c31798a9619 (patch)
treeed90677e21a7ee2d95c38e4692cf1d10efbf9a36 /drivers/staging
parentfb86cf8bd8a94981be5c0f4263f31e43e1aaf445 (diff)
downloadlinux-stable-820a1338d6a14bde0de7ed57cf486c31798a9619.tar.gz
linux-stable-820a1338d6a14bde0de7ed57cf486c31798a9619.tar.bz2
linux-stable-820a1338d6a14bde0de7ed57cf486c31798a9619.zip
media: atomisp: Remove isp_timeout flag
isp_timeout only ever gets set in __atomisp_css_recover() and then immediately gets cleared again after calling atomisp_reset(). All this happens with isp->mutex held. The only consumer of isp->isp_timeout is atomisp_stop_streaming(), which also holds isp->mutex and which is *not* called by atomisp_reset(). Since both hold isp->mutex and since __atomisp_css_recover() clears isp_timeout before releasing the mutex, atomisp_stop_streaming() can never see isp_timeout being true, so just remove the flag. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_cmd.c8
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_internal.h2
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_ioctl.c7
3 files changed, 4 insertions, 13 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index 42a2a8f0da06..ea07ddcdd7f1 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -935,7 +935,7 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error,
atomisp_qbuffers_to_css(asd);
}
-static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
+static void __atomisp_css_recover(struct atomisp_device *isp)
{
struct pci_dev *pdev = to_pci_dev(isp->dev);
enum ia_css_pipe_id css_pipe_id;
@@ -992,9 +992,7 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
isp->saved_regs.i_control | MRFLD_PCI_I_CONTROL_SRSE_RESET_MASK);
/* reset ISP and restore its state */
- isp->isp_timeout = true;
atomisp_reset(isp);
- isp->isp_timeout = false;
if (stream_restart) {
atomisp_css_input_set_mode(&isp->asd, IA_CSS_INPUT_MODE_BUFFERED_SENSOR);
@@ -1043,14 +1041,14 @@ void atomisp_assert_recovery_work(struct work_struct *work)
assert_recovery_work);
mutex_lock(&isp->mutex);
- __atomisp_css_recover(isp, true);
+ __atomisp_css_recover(isp);
mutex_unlock(&isp->mutex);
}
void atomisp_css_flush(struct atomisp_device *isp)
{
/* Start recover */
- __atomisp_css_recover(isp, false);
+ __atomisp_css_recover(isp);
dev_dbg(isp->dev, "atomisp css flush done\n");
}
diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h
index cec0ac92726e..3d4f0f632f44 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_internal.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h
@@ -204,8 +204,6 @@ struct atomisp_device {
struct atomisp_regs saved_regs;
struct atomisp_css_env css_env;
- /* isp timeout status flag */
- bool isp_timeout;
bool isp_fatal_error;
struct work_struct assert_recovery_work;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 8e2b5b647670..e0a8616ecf05 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -1369,11 +1369,7 @@ stopsensor:
/*
* ISP work around, need to reset isp
* Is it correct time to reset ISP when first node does streamoff?
- */
- if (isp->isp_timeout)
- dev_err(isp->dev, "%s: Resetting with WA activated",
- __func__);
- /*
+ *
* It is possible that the other asd stream is in the stage
* that v4l2_setfmt is just get called on it, which will
* create css stream on that stream. But at this point, there
@@ -1403,7 +1399,6 @@ stopsensor:
}
}
- isp->isp_timeout = false;
out_unlock:
mutex_unlock(&isp->mutex);
}