lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231125182057.1379357-3-alain.volmat@foss.st.com>
Date:   Sat, 25 Nov 2023 19:20:50 +0100
From:   Alain Volmat <alain.volmat@...s.st.com>
To:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Benjamin Mugnier <benjamin.mugnier@...s.st.com>,
        Sylvain Petinot <sylvain.petinot@...s.st.com>
CC:     Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Alain Volmat <alain.volmat@...s.st.com>,
        <linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/7] media: i2c: st-mipid02: don't keep track of streaming status

As explained in the following series, subdev do not have to keep
track of their streaming status:

https://lore.kernel.org/linux-media/20230914181704.4811-1-laurent.pinchart@ideasonboard.com/

Signed-off-by: Alain Volmat <alain.volmat@...s.st.com>
---
 drivers/media/i2c/st-mipid02.c | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
index b699f0b4efe7..1efaa54866a8 100644
--- a/drivers/media/i2c/st-mipid02.c
+++ b/drivers/media/i2c/st-mipid02.c
@@ -112,7 +112,6 @@ struct mipid02_dev {
 	} r;
 	/* lock to protect all members below */
 	struct mutex lock;
-	bool streaming;
 	struct v4l2_mbus_framefmt fmt;
 };
 
@@ -629,22 +628,13 @@ static int mipid02_s_stream(struct v4l2_subdev *sd, int enable)
 	struct i2c_client *client = bridge->i2c_client;
 	int ret = 0;
 
-	dev_dbg(&client->dev, "%s : requested %d / current = %d", __func__,
-		    enable, bridge->streaming);
-	mutex_lock(&bridge->lock);
-
-	if (bridge->streaming == enable)
-		goto out;
+	dev_dbg(&client->dev, "%s : requested %d\n", __func__, enable);
 
 	ret = enable ? mipid02_stream_enable(bridge) :
 		       mipid02_stream_disable(bridge);
-	if (!ret)
-		bridge->streaming = enable;
-
-out:
-	dev_dbg(&client->dev, "%s current now = %d / %d", __func__,
-		    bridge->streaming, ret);
-	mutex_unlock(&bridge->lock);
+	if (ret)
+		dev_err(&client->dev, "failed to stream %s (%d)\n",
+			enable ? "enable" : "disable", ret);
 
 	return ret;
 }
@@ -777,20 +767,14 @@ static int mipid02_set_fmt(struct v4l2_subdev *sd,
 
 	mutex_lock(&bridge->lock);
 
-	if (bridge->streaming) {
-		ret = -EBUSY;
-		goto error;
-	}
-
 	if (format->pad == MIPID02_SOURCE)
 		mipid02_set_fmt_source(sd, sd_state, format);
 	else
 		mipid02_set_fmt_sink(sd, sd_state, format);
 
-error:
 	mutex_unlock(&bridge->lock);
 
-	return ret;
+	return 0;
 }
 
 static const struct v4l2_subdev_video_ops mipid02_video_ops = {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ