mbox series

[v2,0/3] Fix privacy issue for MEI CSI

Message ID 20240607132547.2820515-1-wentong.wu@intel.com (mailing list archive)
Headers show
Series Fix privacy issue for MEI CSI | expand

Message

Wu, Wentong June 7, 2024, 1:25 p.m. UTC
Currently if starting stream goes with privacy mode on, the whole
pipeline will fail because MEI CSI counts privacy mode on as error.
In fact, the ongoing MEI command is well executed by firmware as
well even if privacy mode is turned on. The status (-1) of command
response is just to indicate current privacy on status instead of
failed to execute command by firmware. This patch set changes the
behavior to notify privacy mode on via v4l2 privacy controlinstead
of fail the ongoing MEI command.

This patch set adds one dedicated lock for v4l2 control handler to
avoid dead locking issue as well. And the useless privacy status in
struct mei_csi is removed to make code clean.

---
v1 -> v2:
 1. switch `CSI_PRIVACY_ON` to `notif.cont.cont == CSI_PRIVACY_ON`

Wentong Wu (3):
  media: ivsc: csi: don't count privacy on as error
  media: ivsc: csi: add separate lock for v4l2 control handler
  media: ivsc: csi: remove privacy status in struct mei_csi

 drivers/media/pci/intel/ivsc/mei_csi.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

Comments

Sakari Ailus June 7, 2024, 1:45 p.m. UTC | #1
On Fri, Jun 07, 2024 at 09:25:44PM +0800, Wentong Wu wrote:
> Currently if starting stream goes with privacy mode on, the whole
> pipeline will fail because MEI CSI counts privacy mode on as error.
> In fact, the ongoing MEI command is well executed by firmware as
> well even if privacy mode is turned on. The status (-1) of command
> response is just to indicate current privacy on status instead of
> failed to execute command by firmware. This patch set changes the
> behavior to notify privacy mode on via v4l2 privacy controlinstead
> of fail the ongoing MEI command.
> 
> This patch set adds one dedicated lock for v4l2 control handler to
> avoid dead locking issue as well. And the useless privacy status in
> struct mei_csi is removed to make code clean.

Thanks, Wentong!

I'm reordering the first and the second patch, to avoid a deadlock before
applying the other one, and adding to both of the two:

Fixes: 29006e196a56 ("media: pci: intel: ivsc: Add CSI submodule")
Cc: stable@vger.kernel.org # for 6.6 and later
Wu, Wentong June 7, 2024, 1:48 p.m. UTC | #2
> From: Sakari Ailus <sakari.ailus@linux.intel.com>
> On Fri, Jun 07, 2024 at 09:25:44PM +0800, Wentong Wu wrote:
> > Currently if starting stream goes with privacy mode on, the whole
> > pipeline will fail because MEI CSI counts privacy mode on as error.
> > In fact, the ongoing MEI command is well executed by firmware as well
> > even if privacy mode is turned on. The status (-1) of command response
> > is just to indicate current privacy on status instead of failed to
> > execute command by firmware. This patch set changes the behavior to
> > notify privacy mode on via v4l2 privacy controlinstead of fail the
> > ongoing MEI command.
> >
> > This patch set adds one dedicated lock for v4l2 control handler to
> > avoid dead locking issue as well. And the useless privacy status in
> > struct mei_csi is removed to make code clean.
> 
> Thanks, Wentong!
> 
> I'm reordering the first and the second patch, to avoid a deadlock before
> applying the other one, 

Make sense, thanks

> and adding to both of the two:
> 
> Fixes: 29006e196a56 ("media: pci: intel: ivsc: Add CSI submodule")
> Cc: stable@vger.kernel.org # for 6.6 and later
> 

Thanks

BR,
Wentong
> --
> Sakari Ailus