Received: by 2002:ab2:26cd:0:b0:1ed:3240:60d6 with SMTP id c13csp501292lqf; Mon, 4 Mar 2024 12:49:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9qj2Mc61/pKc/1RNiw5/PUolhzSbyoE7tIUUJYP/ETkvuC0Z+vkWAKv4mZCDPdGtApHmudOy5Mbt70qzRzPyG08A8efVGC0ettfjjFA== X-Google-Smtp-Source: AGHT+IHnxWLj3BfObKAtlukAvmKwWpfKMf2wfqQLqMCIvoqE7QhcRvBT7Vj2fkyEWByrs5NKG1+e X-Received: by 2002:a05:6a00:2386:b0:6e5:803e:ee3d with SMTP id f6-20020a056a00238600b006e5803eee3dmr11982628pfc.33.1709585397769; Mon, 04 Mar 2024 12:49:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709585397; cv=pass; d=google.com; s=arc-20160816; b=kI3rBIfBFAtmX7bnS0gXyEkxQbw7e2MWQEHFGwPWSeWX2697BnUiwXoK3N3vsaZJqq /hHh3fx92TZocoxi6zf1qpTMtZAbFqmI3D8sgvGYGKBbiVp1TN200ZCgc2Ywadr/J8p5 KwUbXLDmJzZac+28YEz6aWSMAM9u6yAQh5RCGcmpBO1u5pufXDCkY8RTtshu6uhv7za6 slN3/ukevLHQf2xxiO5qj/EXIvrjJHPg0xjqgt1qfxcOGDkXK0DVcRS6gShpOECicP84 xSqaKLlSDiogDATgqMpliLYpnryA7/cxXEdEyi9OYs8LhtwPE7t0Z3A1+Jmyp4K0V2cQ K6zg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=es2oOUwOcths9Y6eB6L/2cU+bqDrsZEqv6JQVMSjBKI=; fh=QT+iGvNcZeaNbQRUR4DJ7wLtNyZTa5ZJCEL+R9E9tc8=; b=Shu7qZauKBaStzbLu0PA8E41yqJLQ6hDbvamrGi3u2+5XqOWh4LOuqfzqooFzbIV51 F1lujZ0+56Tkg5OdyCroGyNJrNAce/dXicHY0nIcN0W+08091eQsgyMPdh1YOkBvXxwi ig/HER7YOKOB+mfH8pfTj5qVnyYWThH8KGeGznnr5qT4XdJA+60j0aHB8Rj4SvYSb81x V+vFyNb0t04bPEIEK35GUIENQDF5iwxYXV6yvP3GHKW1gGDgO302md0Bj3pUOuCXKQIa 6MOiYYCr3FogC54WSViIv1LBSke8yYmUlowdv5f0DoApBdepSvt0Iqd2z4AIAh7GE8Ca GUTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=djyVpORX; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-91251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91251-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k14-20020a635a4e000000b005dc8554d500si8953668pgm.62.2024.03.04.12.49.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 12:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=djyVpORX; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-91251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91251-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A809FB235F2 for ; Mon, 4 Mar 2024 20:45:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B31EAF9EB; Mon, 4 Mar 2024 20:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="djyVpORX" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 69532DDCB; Mon, 4 Mar 2024 20:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709585113; cv=none; b=BvRncvVGnpNtP4jbZ9cuCRhIhqD2zt0B2eTVfJgZ01864ETWh/fW0snQG8D5KoE2v22UrYNiPm04jBzM2ZQQTYezNB2o629zNb9R/f9wkMPKbltGhjfWk407ELTqNkPnPNqzftnO6fSFj9w+4tApyw2O5Yabuu8e9sqsSvwizyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709585113; c=relaxed/simple; bh=LCizBMempHm6m4HVjhOraAYrjK6MVmfuf33LBSbaVvU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qe9d8d5QuJ1pFMcyBjiTRtAnA4spFzwxNGfdWh1diYJMgE1DSkHsk4lQl1F2kHqvPG9S9PUQOB0sUv6hwlZWGCIe6BPamsvrFqdGjNtkMWflehjXF048oV7BsM8pzSgPTjkFY0SYDQWT0/eZC5/pD4E9BauEGTVpAPZjiwIfjGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=djyVpORX; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8B1D263F; Mon, 4 Mar 2024 21:44:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1709585092; bh=LCizBMempHm6m4HVjhOraAYrjK6MVmfuf33LBSbaVvU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=djyVpORXEtaGgsprqvnTvw+YD67RM3BJdG24vhcJ144EmzHEEeaDmAUTSSEOO8Ln4 RWqgH9tsGSj1tkdcaC0+YXA0fCnl3rSBoJBLDW6ajUf90V6GKW08gzyDaNBV/ZI+rp ZsSWi9YqMe4w7B1Yjg7rVDw0Q6+LrxY/8JH7vh3c= Date: Mon, 4 Mar 2024 22:45:10 +0200 From: Laurent Pinchart To: Mikhail Rudenko Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Sakari Ailus , Jacopo Mondi , Tommaso Merciai , Christophe JAILLET , Dave Stevenson , Mauro Carvalho Chehab Subject: Re: [PATCH v3 09/20] media: i2c: ov4689: Use runtime PM autosuspend Message-ID: <20240304204510.GD9233@pendragon.ideasonboard.com> References: <20240229165333.227484-1-mike.rudenko@gmail.com> <20240229165333.227484-10-mike.rudenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240229165333.227484-10-mike.rudenko@gmail.com> Hi Mikhail, Thank you for the patch. On Thu, Feb 29, 2024 at 07:53:22PM +0300, Mikhail Rudenko wrote: > Use runtime PM autosuspend to avoid powering off the sensor during > fast stop-reconfigure-restart cycles. > > Signed-off-by: Mikhail Rudenko Reviewed-by: Laurent Pinchart > --- > drivers/media/i2c/ov4689.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c > index 0e0e694510aa..2354397ab34c 100644 > --- a/drivers/media/i2c/ov4689.c > +++ b/drivers/media/i2c/ov4689.c > @@ -426,7 +426,8 @@ static int ov4689_s_stream(struct v4l2_subdev *sd, int on) > } else { > cci_write(ov4689->regmap, OV4689_REG_CTRL_MODE, > OV4689_MODE_SW_STANDBY, NULL); > - pm_runtime_put(dev); > + pm_runtime_mark_last_busy(dev); > + pm_runtime_put_autosuspend(dev); > } > > unlock_and_return: > @@ -606,7 +607,8 @@ static int ov4689_set_ctrl(struct v4l2_ctrl *ctrl) > break; > } > > - pm_runtime_put(dev); > + pm_runtime_mark_last_busy(dev); > + pm_runtime_put_autosuspend(dev); > > return ret; > } > @@ -876,8 +878,10 @@ static int ov4689_probe(struct i2c_client *client) > } > > pm_runtime_set_active(dev); > + pm_runtime_get_noresume(dev); > pm_runtime_enable(dev); > - pm_runtime_idle(dev); > + pm_runtime_set_autosuspend_delay(dev, 1000); > + pm_runtime_use_autosuspend(dev); > > ret = v4l2_async_register_subdev_sensor(sd); > if (ret) { > @@ -885,11 +889,14 @@ static int ov4689_probe(struct i2c_client *client) > goto err_clean_subdev_pm; > } > > + pm_runtime_mark_last_busy(dev); > + pm_runtime_put_autosuspend(dev); > + > return 0; > > err_clean_subdev_pm: > pm_runtime_disable(dev); > - pm_runtime_set_suspended(dev); > + pm_runtime_put_noidle(dev); > v4l2_subdev_cleanup(sd); > err_clean_entity: > media_entity_cleanup(&sd->entity); -- Regards, Laurent Pinchart