All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wentong Wu <wentong.wu@intel.com>
To: sakari.ailus@linux.intel.com, linux-media@vger.kernel.org
Cc: hao.yao@intel.com, Wentong Wu <wentong.wu@intel.com>,
	Jason Chen <jason.z.chen@intel.com>
Subject: [PATCH 1/3] media: ivsc: csi: don't count privacy on as error
Date: Mon,  3 Jun 2024 16:26:12 +0800	[thread overview]
Message-ID: <20240603082614.1567712-2-wentong.wu@intel.com> (raw)
In-Reply-To: <20240603082614.1567712-1-wentong.wu@intel.com>

Prior to the ongoing command privacy is on, it would return -1 to
indicate the current privacy status, and the ongoing command would
be well executed by firmware as well, so this is not error. This
patch changes its behavior to notify privacy on directly by V4L2
privacy control instead of reporting error.

Fixes: 29006e196a56 ("media: pci: intel: ivsc: Add CSI submodule")
Reported-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
---
 drivers/media/pci/intel/ivsc/mei_csi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c
index 89b582a221ab..004ebab0b814 100644
--- a/drivers/media/pci/intel/ivsc/mei_csi.c
+++ b/drivers/media/pci/intel/ivsc/mei_csi.c
@@ -190,7 +190,11 @@ static int mei_csi_send(struct mei_csi *csi, u8 *buf, size_t len)
 
 	/* command response status */
 	ret = csi->cmd_response.status;
-	if (ret) {
+	if (ret == -1) {
+		/* notify privacy on instead of reporting error */
+		ret = 0;
+		v4l2_ctrl_s_ctrl(csi->privacy_ctrl, CSI_PRIVACY_ON);
+	} else if (ret) {
 		ret = -EINVAL;
 		goto out;
 	}
-- 
2.34.1


  reply	other threads:[~2024-06-03  8:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03  8:26 [PATCH 0/3] Fix privacy issue for MEI CSI Wentong Wu
2024-06-03  8:26 ` Wentong Wu [this message]
2024-06-07 12:45   ` [PATCH 1/3] media: ivsc: csi: don't count privacy on as error Sakari Ailus
2024-06-07 12:55     ` Wu, Wentong
2024-06-03  8:26 ` [PATCH 2/3] media: ivsc: csi: add separate lock for v4l2 control handler Wentong Wu
2024-06-07 12:41   ` Sakari Ailus
2024-06-07 12:53     ` Wu, Wentong
2024-06-03  8:26 ` [PATCH 3/3] media: ivsc: csi: remove privacy status in struct mei_csi Wentong Wu
2024-06-07 12:45   ` Sakari Ailus
2024-06-07 12:54     ` Wu, Wentong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240603082614.1567712-2-wentong.wu@intel.com \
    --to=wentong.wu@intel.com \
    --cc=hao.yao@intel.com \
    --cc=jason.z.chen@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.