From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="sSNxKmzx" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E32D395; Mon, 11 Dec 2023 10:19:29 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 274C0922; Mon, 11 Dec 2023 19:18:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1702318724; bh=EIg4EO4Pq5viQln2mk2Z+mPdeO40bI0I0QIxtK3AB8Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sSNxKmzxVGwUHs/fJsZ2OsIyU/O1sYytP/uWYGE1ItV1/l+JIi+baiBxLbNDo6WAV aU2iyIrJNjNVcGIVL/X3g3UFqKHFkh56HLbdvHBbfT3mnneTF3btn6DGc/JYA4vLXy yqrrSsovOvwK6aLwDR/Zz+yxu0F1va4ZTyW+7LRc= Date: Mon, 11 Dec 2023 20:19:35 +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 08/19] media: i2c: ov4689: Enable runtime PM before registering sub-device Message-ID: <20231211181935.GG27535@pendragon.ideasonboard.com> References: <20231211175023.1680247-1-mike.rudenko@gmail.com> <20231211175023.1680247-9-mike.rudenko@gmail.com> Precedence: bulk X-Mailing-List: linux-media@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: <20231211175023.1680247-9-mike.rudenko@gmail.com> Hi Mikhail, Thank you for the patch. On Mon, Dec 11, 2023 at 08:50:11PM +0300, Mikhail Rudenko wrote: > As the sensor may be accessible right after its async sub-device is > registered, enable runtime PM before doing so. While at it, could you also switch to runtime PM autosuspend, possibly in a separate patch ? See for instance the imx290 driver. > Signed-off-by: Mikhail Rudenko > --- > drivers/media/i2c/ov4689.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c > index 2eef64cd0070..ba33b0ced532 100644 > --- a/drivers/media/i2c/ov4689.c > +++ b/drivers/media/i2c/ov4689.c > @@ -874,16 +874,16 @@ static int ov4689_probe(struct i2c_client *client) > goto err_clean_entity; > } > > + pm_runtime_set_active(dev); > + pm_runtime_enable(dev); > + pm_runtime_idle(dev); > + > ret = v4l2_async_register_subdev_sensor(sd); > if (ret) { > dev_err(dev, "v4l2 async register subdev failed\n"); > goto err_clean_subdev; Don't you need to disable runtime PM in the error path ? > } > > - pm_runtime_set_active(dev); > - pm_runtime_enable(dev); > - pm_runtime_idle(dev); > - > return 0; > > err_clean_subdev: -- Regards, Laurent Pinchart