From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A7FB3224 for ; Mon, 23 Jan 2023 17:42:08 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="313997890" X-IronPort-AV: E=Sophos;i="5.97,240,1669104000"; d="scan'208";a="313997890" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2023 09:42:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="692308167" X-IronPort-AV: E=Sophos;i="5.97,240,1669104000"; d="scan'208";a="692308167" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP; 23 Jan 2023 09:42:05 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pK0pX-00Dr8K-0m; Mon, 23 Jan 2023 19:42:03 +0200 Date: Mon, 23 Jan 2023 19:42:02 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mauro Carvalho Chehab , Sakari Ailus , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 17/57] media: atomisp: Only set default_run_mode on first open of a stream/asd Message-ID: References: <20230123125205.622152-1-hdegoede@redhat.com> <20230123125205.622152-18-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230123125205.622152-18-hdegoede@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Jan 23, 2023 at 01:51:25PM +0100, Hans de Goede wrote: > Calling v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode) when > the stream is already active (through another /dev/video# node) causes > the stream to stop. > > Move the call to set the default run-mode so that it is only done > on the first open of one of the 4 /dev/video# nodes of one of > the 2 streams (atomisp-sub-devices / asd-s). As mentioned before, perhaps move it closer to the beginning of the series? Reviewed-by: Andy Shevchenko > Fixes: 2c45e343c581 ("media: atomisp: set per-device's default mode") > Signed-off-by: Hans de Goede > --- > drivers/staging/media/atomisp/pci/atomisp_fops.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c > index 7f4934ff9cab..78af97a64362 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c > @@ -764,13 +764,13 @@ static int atomisp_open(struct file *file) > goto done; > > atomisp_subdev_init_struct(asd); + Blank line? > + /* Ensure that a mode is set */ > + v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode); > > done: > pipe->users++; > mutex_unlock(&isp->mutex); > > - /* Ensure that a mode is set */ > - v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode); > > return 0; > > -- > 2.39.0 > -- With Best Regards, Andy Shevchenko