Received: by 2002:ac8:4b50:0:b0:42d:ce8e:db0a with SMTP id e16csp745914qts; Fri, 23 Feb 2024 03:29:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLunI0iyATnaOIi/GxFpgHbYhUo3W60nsMfUErMIgOSSbLYfnbYi5lugEn13ENiojaAUFVCAZ7YIALyVloMMKcimbJemyXfw0VwfKIAQ== X-Google-Smtp-Source: AGHT+IEQx+Rk+W4eWo/Y43t1wZ2ObNYGlSC7N8wzirWJRuRKrmcq0wnyCfXC31QbEVO31u1vNP7H X-Received: by 2002:a05:6a20:e198:b0:1a0:d0d1:8e97 with SMTP id ks24-20020a056a20e19800b001a0d0d18e97mr1419818pzb.18.1708687764376; Fri, 23 Feb 2024 03:29:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708687764; cv=pass; d=google.com; s=arc-20160816; b=D35KQgSIpWmQrVLYi2chjwYbyZiVx/o7M46jg8MI3ANbQhjILl/5vTg1BGKDHUCXV3 9UjWPPn2pCCh28Vp4l41uHVxAlGG1gjvXzOpqR1IjtlaY492eowJZ9zlnw3JgTCAqwvM siqQmXreBYaktkwb8c9n10p5Q9XP73bK8Q/GwXazSfGjVqFi0gemUKhYPrxuurVljor4 0m/Q0OkSgTXmA5AHdw4q8YiA9MadlLIJ+Tn/viuETdzP/XLIkB+2/gUIZOh4UEM+vszF Hn5B9NwiIpi86Eo3c2jAvMkFBobYEehA78wk1BhRZlOWpRUWsppzEL4GZ6PP5ZfTQL5P fAoQ== 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=6jUq+jprecIcwNA6jYtCRCl6IrbUjSDazXifhaxN4nk=; fh=QT+iGvNcZeaNbQRUR4DJ7wLtNyZTa5ZJCEL+R9E9tc8=; b=LsIspuprPCXluYO7nvoFQWqIPNKab8suOkHMp9wOuv2JiqvM9AQ3JBZASBqIAyVs7f IUwJ9akETBrUuB+Q21t4LE6wIh862FPVQaoSk+igmWHsBq2xEKC/M2erLRdXenCZBZbw TA6bwK9FLxK8nRqYWk/BnW2WJj0kkHV6vYs/Z+ynHnFSEFn0mumqBTU3xrCTu4Yh3xNo nVgfgqWcEnHbV0OPzBRNZcS61X6iuUPIEJDvKuEmlQA4Z7zlv8xVGVMrpSfE2o8MVO9H NFJSG4ZBbiMXmCrg/lJcxp1/3o3VT+cfj+QeqXgUgPer3iae+k1vA5mzdwibC7/X2tFd nTSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hrpIosHy; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-78217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78217-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w184-20020a6362c1000000b005dc612990ccsi11859846pgb.319.2024.02.23.03.29.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hrpIosHy; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-78217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78217-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DA0822856D8 for ; Fri, 23 Feb 2024 11:29:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 227CC78B5F; Fri, 23 Feb 2024 11:29:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hrpIosHy" 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 BEE295C617; Fri, 23 Feb 2024 11:29:14 +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=1708687756; cv=none; b=cOEGFNysYPE124poQjTMdVEYyfHT6UyiRxVNnruMVK6v69/wl2e4yh+nwFPO18ZWlKzKHei9C6F28avYt3n8XA5KbPfWAk/7bTdT2a3+wtbFDcQSC/hoBK+K93z4jY/PlPH1Uuj4JeWFGjcTPxRhUvD52t7W9XFV+C3gRrGL7Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708687756; c=relaxed/simple; bh=yWyMB9bSFLQf+xKQD0mpdXL/wVdMZebQbbRlw8q5Uo8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uLRYIclSQ2W4Mvq12YE85Zhy/Dc5mMZsS5NXb42Z38krff1tpd6T7H9fxNO3EdbSByWlTZVGz+k4YBqh0KfVKOw24ZJkVa+yRYqdUWQGc4CR1rPGuxYMBg7hl1EfIXW3pURA6qbhUvzznb6vfoWR13W0z3KRzBTRcNDEArO8IfE= 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=hrpIosHy; 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 BA8EE2E7; Fri, 23 Feb 2024 12:29:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1708687744; bh=yWyMB9bSFLQf+xKQD0mpdXL/wVdMZebQbbRlw8q5Uo8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hrpIosHy8Ha0WNT6imhaL401eE1Fi1FrzUeEMhvhPckqkBnBIV3lD6493aDDK5i1z hjxpk0NFk8yU6+vuo98VPj7aR0EQJbRgOqs1VG97Dxg5rHiYGHsi8w+G81JwJ3hs0z INbUHV4701FOodAR3kDwxjDKePbDG2v39E/+D2vE= Date: Fri, 23 Feb 2024 13:29:16 +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 v2 08/20] media: i2c: ov4689: Enable runtime PM before registering sub-device Message-ID: <20240223112916.GP31348@pendragon.ideasonboard.com> References: <20231218174042.794012-1-mike.rudenko@gmail.com> <20231218174042.794012-9-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: <20231218174042.794012-9-mike.rudenko@gmail.com> Hi Mikhail, Thank you for the patch. On Mon, Dec 18, 2023 at 08:40:29PM +0300, Mikhail Rudenko wrote: > As the sensor may be accessible right after its async sub-device is > registered, enable runtime PM before doing so. > > Signed-off-by: Mikhail Rudenko Reviewed-by: Laurent Pinchart > --- > drivers/media/i2c/ov4689.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c > index 501901aad4ae..5300e621ff90 100644 > --- a/drivers/media/i2c/ov4689.c > +++ b/drivers/media/i2c/ov4689.c > @@ -876,19 +876,21 @@ 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; > + goto err_clean_subdev_pm; > } > > - pm_runtime_set_active(dev); > - pm_runtime_enable(dev); > - pm_runtime_idle(dev); > - > return 0; > > -err_clean_subdev: > +err_clean_subdev_pm: > + pm_runtime_disable(dev); > + pm_runtime_set_suspended(dev); > v4l2_subdev_cleanup(sd); > err_clean_entity: > media_entity_cleanup(&sd->entity); -- Regards, Laurent Pinchart