Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: "Yan, Dongcheng" <dongcheng.yan@intel.com>,
	Mehdi Djait <mehdi.djait@linux.intel.com>,
	"Yu, Ong Hock" <ong.hock.yu@intel.com>,
	"Ng, Khai Wen" <khai.wen.ng@intel.com>,
	Antti Laakso <antti.laakso@linux.intel.com>,
	"Bajpai, Manik" <manik.bajpai@intel.com>,
	Divyamani Tripathi <divyamani.tripathi@intel.com>,
	"Sapre, Sarang" <sarang.sapre@intel.com>,
	"Yao, Hao" <hao.yao@intel.com>
Subject: [PATCH v2 4/5] media: ipu6: Remove need_reset check from video device open
Date: Mon, 12 Oct 2026 14:40:01 +0300	[thread overview]
Message-ID: <20261012114002.3970409-5-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20261012114002.3970409-1-sakari.ailus@linux.intel.com>

The ISYS requires power reset in some cases. Opening a video node is
however independent of that; allow opening it even if reset is needed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 .../media/pci/intel/ipu6/ipu6-isys-queue.c    |  2 +-
 .../media/pci/intel/ipu6/ipu6-isys-video.c    | 19 +------------------
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c
index d637b428b0f5..74e39dc98ddb 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c
@@ -483,7 +483,7 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
 
 	scoped_guard(mutex, &av->isys->mutex) {
 		if (av->isys->need_reset) {
-			ret = -EBUSY;
+			ret = -EIO;
 			goto out_return_buffers;
 		}
 	}
diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
index 129016e57446..44541aff79b3 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
@@ -109,23 +109,6 @@ const struct ipu6_isys_pixelformat ipu6_isys_pfmts[] = {
 	  IPU6_FW_ISYS_FRAME_FORMAT_RAW16, true },
 };
 
-static int video_open(struct file *file)
-{
-	struct ipu6_isys_video *av = video_drvdata(file);
-	struct ipu6_isys *isys = av->isys;
-	struct ipu6_bus_device *adev = isys->adev;
-
-	mutex_lock(&isys->mutex);
-	if (isys->need_reset) {
-		mutex_unlock(&isys->mutex);
-		dev_warn(&adev->auxdev.dev, "isys power cycle required\n");
-		return -EIO;
-	}
-	mutex_unlock(&isys->mutex);
-
-	return v4l2_fh_open(file);
-}
-
 const struct ipu6_isys_pixelformat *
 ipu6_isys_get_isys_format(u32 pixelformat, u32 type)
 {
@@ -809,7 +792,7 @@ static const struct v4l2_file_operations isys_fops = {
 	.poll = vb2_fop_poll,
 	.unlocked_ioctl = video_ioctl2,
 	.mmap = vb2_fop_mmap,
-	.open = video_open,
+	.open = v4l2_fh_open,
 	.release = vb2_fop_release,
 };
 
-- 
2.47.3


  parent reply	other threads:[~2026-10-12 11:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 11:39 [PATCH v2 0/5] IPU reset workaround changes Sakari Ailus
2026-10-12 11:39 ` [PATCH v2 1/5] media: ipu6: Don't mark need_reset based on returned buffers Sakari Ailus
2026-10-12 11:39 ` [PATCH v2 2/5] media: ipu6: Tell about not being able to obtain frame descriptor Sakari Ailus
2026-10-12 11:40 ` [PATCH v2 3/5] media: ipu6: Prevent starting streaming if ISYS needs reset Sakari Ailus
2026-10-12 11:40 ` Sakari Ailus [this message]
2026-10-12 11:40 ` [PATCH v2 5/5] media: ipu6: Return errors from stream stop and close Sakari Ailus
2026-10-12 12:20   ` Antti Laakso

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=20261012114002.3970409-5-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=antti.laakso@linux.intel.com \
    --cc=divyamani.tripathi@intel.com \
    --cc=dongcheng.yan@intel.com \
    --cc=hao.yao@intel.com \
    --cc=khai.wen.ng@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=manik.bajpai@intel.com \
    --cc=mehdi.djait@linux.intel.com \
    --cc=ong.hock.yu@intel.com \
    --cc=sarang.sapre@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox