public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Bingbu Cao <bingbu.cao@linux.intel.com>
Cc: linux-media@vger.kernel.org, tian.shu.qiu@intel.com,
	antti.laakso@linux.intel.com, mehdi.djait@linux.intel.com
Subject: Re: [PATCH v3 07/13] media: ipu6: Close firmware streams on streaming enable failure
Date: Wed, 7 Jan 2026 23:55:08 +0200	[thread overview]
Message-ID: <aV7WPPo7p09UTegL@kekkonen.localdomain> (raw)
In-Reply-To: <f8efb83d-2b3d-d69d-0613-1b5e64503265@linux.intel.com>

Hi Bingbu,

On Mon, Jan 05, 2026 at 11:07:02AM +0800, Bingbu Cao wrote:
> Sakari,
> 
> On 1/2/26 3:58 AM, Sakari Ailus wrote:
> > Hi Bingbu,
> > 
> > On Wed, Dec 31, 2025 at 02:11:40PM +0800, Bingbu Cao wrote:
> >> Sakari,
> >>
> >> Thanks for the patch.
> >>
> >> On 12/30/25 9:10 PM, Sakari Ailus wrote:
> >>> When enabling streaming fails, the stream is stopped in firmware but not
> >>> closed. Do this to release resources on firmware side.
> >>>
> >>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> >>> ---
> >>>  drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> >>> index dec8f5ffcfa5..919b77107cef 100644
> >>> --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> >>> +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> >>> @@ -1066,6 +1066,7 @@ int ipu6_isys_video_set_streaming(struct ipu6_isys_video *av, int state,
> >>>  
> >>>  out_media_entity_stop_streaming_firmware:
> >>>  	stop_streaming_firmware(av);
> >>> +	close_streaming_firmware(av);
> >>
> >> It looks the close_streaming_firmware() has no chance to run if
> >> v4l2_subdev_disable_streams() above failed. Beside, the
> >> stop_streaming_firmware() is better called after subdev
> >> disable_streams().
> > 
> > Do you mean we wouldn't need to call stop_streaming_firmware() at all here?
> > That would be actually aligned with start_streaming_firmware() error
> > handling.
> >
> 
> I mean the code above:
>   	if (!state) {
> 		...
> 		ret = v4l2_subdev_disable_streams(sd, r_pad->index,
> 						  stream_mask);
> 		if (ret) {
> 			...
> 			return ret;
> 		}
> 		close_streaming_firmware(av);
> 	} else {
> 
> close_streaming_firmware() should be called anyway.

Ah, good point. I guess in this case it'd be probably best to just ignore
the return value -- but maybe complain -- from disable_streams() above. I
can post a patch for that.

Presumably, the same stream wasn't disabled on the source (as we've been
called) so it'd take a bug somewhere for disable_streams() to return an
error.

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2026-01-07 21:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30 13:10 [PATCH v3 00/13] IPU6 driver cleanups and fixes Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 01/13] media: ipu6: Ensure stream_mutex is acquired when dealing with node list Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 02/13] media: ipu6: Drop MMU hardware initialisation in probe() Sakari Ailus
2025-12-31  5:38   ` Bingbu Cao
2026-01-01 19:39     ` Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 03/13] media: ipu6: Remove redundant driver data checks Sakari Ailus
2025-12-31  5:43   ` Bingbu Cao
2025-12-30 13:10 ` [PATCH v3 04/13] media: ipu6: Make symbols static Sakari Ailus
2025-12-31  5:46   ` Bingbu Cao
2025-12-30 13:10 ` [PATCH v3 05/13] media: ipu6: Remove redundant streaming start via buffer queueing Sakari Ailus
2025-12-31  6:01   ` Bingbu Cao
2026-01-01 19:51     ` Sakari Ailus
2026-01-05  3:07       ` Bingbu Cao
2025-12-30 13:10 ` [PATCH v3 06/13] media: ipu6: Don't check pipeline in stream_start Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 07/13] media: ipu6: Close firmware streams on streaming enable failure Sakari Ailus
2025-12-31  6:11   ` Bingbu Cao
2026-01-01 19:58     ` Sakari Ailus
2026-01-05  3:07       ` Bingbu Cao
2026-01-07 21:55         ` Sakari Ailus [this message]
2025-12-30 13:10 ` [PATCH v3 08/13] media: ipu6: Drop error argument from ipu6_isys_stream_start() Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 09/13] media: ipu6: Obtain remote pad using media_pad_remote_pad_unique() Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 10/13] media: ipu6: Obtain unique source pad from remote sub-device Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 11/13] media: ipu6: Remove source_entity from struct ipu6_isys_stream Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 12/13] media: ipu6: Drop custom functions to obtain sd state information Sakari Ailus
2025-12-30 13:10 ` [PATCH v3 13/13] media: ipu6: Always call video_device_pipeline_alloc_start() Sakari Ailus

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=aV7WPPo7p09UTegL@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=antti.laakso@linux.intel.com \
    --cc=bingbu.cao@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=tian.shu.qiu@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