Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2126992rwb; Sun, 15 Jan 2023 09:37:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXvmx4uKx5DeXiAa/FOfXLPuvBDFW0xvqkmPgNLLCG0INGFm2elfxJ2WYhh1REiXp9x0W4de X-Received: by 2002:a05:6a20:6d1a:b0:b6:597f:66a1 with SMTP id fv26-20020a056a206d1a00b000b6597f66a1mr16099421pzb.60.1673804221536; Sun, 15 Jan 2023 09:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673804221; cv=none; d=google.com; s=arc-20160816; b=ldWesFqEWEtQfE3HbHSAzAAHGf4fGKy1in5zayMSD0FjDVYFntv9BNLJn/rEfVC2iE U/ZawVPT6gdsEtv4lpKj+fANFf8GADVO4MaaHgKpQxA+o/4x67ANwKv+cHuOGZzZXzVG 8lqWB91kY3r/T3PK02PaJdefG46h/hypZz3W0zZJdH/e/IKsskppubbhm8GHnJ4hwNpq 8YCw5wAKdb9UcpXG8KNbEtN5cRe4m0HAPtLkOPAu9EtaBhe9VVH5bLYsHzTgCHbf3mci w9AVlRxBlL0dstlRNpNH5X2dD88gVImWBFFOuWXpKDbkOSsVmEgCJo34rr2AJ9YdsvcQ YbkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=c/u5b58vi7ukxjgtKxQWSLW7jloOtXQYZaxK1kJZ+6Q=; b=algNCJ+/cjNNvNU0ujDG6BKZnH7xFSc8CIGken+3TaiJ0a2Pqzo5VaLw6RhHZ6WLdu EHIf4Vfi4lh8jmtpL5uMiJuYHi8k+PW/EB3CedT/6eGr4TnrXXCSWcPZtO1YNitB4H/T BaIK4azZy1IglSI1xk6RkZgmAdxiHRAwcavTQRiSH+492l/WoFQSDOSVR/zR/RoOmt7k xYiqdlWddvewUw48z73xNkbZSkmcvlkVEXBXdnHwhpR7fFSDBrK8M2XRN2ZSUMuge5EE lG3lfDYtprVxnN/5HEPPrPxyqsLYGEUWLQXaKjRVToxJe9qliwBPkCv+rdKk6Rql2Pwq ea8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Nxjdp7dJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r23-20020a63ce57000000b004c76e49e14fsi5560351pgi.161.2023.01.15.09.36.52; Sun, 15 Jan 2023 09:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Nxjdp7dJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbjAOR2s (ORCPT + 54 others); Sun, 15 Jan 2023 12:28:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231179AbjAOR2q (ORCPT ); Sun, 15 Jan 2023 12:28:46 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB0FC647; Sun, 15 Jan 2023 09:28:44 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id g13so39825378lfv.7; Sun, 15 Jan 2023 09:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=c/u5b58vi7ukxjgtKxQWSLW7jloOtXQYZaxK1kJZ+6Q=; b=Nxjdp7dJf5rB3ybkMD2q9pd0Fxd2XsPAj04CmjMH0E9vnq5YHFYQuZYn+hTmus8GN7 ZpgXZREScOU3O0NcEc6ALhtbRS4aaXaT7NOSQuacsSs1TvfVOS7Iox/VCVAkOFV4hTCV TD39MLh9WosinAqW4j0OzMQr6MOclQHRREKIp3gWn/uECdYv60jwmZk1aYZwHUV1ktOo 0dooxA1g7Mm/Mlm6O/NZvfoKRzKLwfbuWOVrm1IC1SPk6JPtFygMommkj1RV/edlLnfq Y2kWrcI5O35OA/HdQ2PDZlJK6+vN7gJ4cd5AYetFX0Lsqq8SyeZyuK3ohJY/VZOIYQEy +OaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c/u5b58vi7ukxjgtKxQWSLW7jloOtXQYZaxK1kJZ+6Q=; b=w09BGzD42GXZeD1DGRCyRpWUgeigTCNKNjtx4oNa6eUelCL2swFmC1D2KsYtX9h5xt 5E7wP97juzokHqlghSCXwYxI54Mrj6FCSSGWt75Bh21zTV8I04bSYEkOD4/P3frNdZbu Da2Z6eoAvZ6WdxUIILMAA6cgJkvqUp70VdvsvmI6brxdptSGvu+v4LqBUjNcHJf49u88 rnrQAdpq1Mf3LTvjCv0+KK8ORrFBvHEtyp/FFaQXnK48cgN6w5JyrMoANKzGS4jSGW5i 9Afr+HLfcdmQBH2lF96SeiyHrJPV0upBz5+EvM8+c5K4qy1CmfK4CtgU+2mi/ujs+zwK 3KLA== X-Gm-Message-State: AFqh2krXk4damdggyTyjRW92EFPC8Qsg+atLiGBD2tGjK8hEZ8hxcfgw N9KFc4/ZtXthxKAuCPTNBP+Gap29ick= X-Received: by 2002:a05:6512:3b87:b0:4a4:68b7:d623 with SMTP id g7-20020a0565123b8700b004a468b7d623mr31037548lfv.10.1673803723107; Sun, 15 Jan 2023 09:28:43 -0800 (PST) Received: from localhost ([2a05:3580:f312:6c02:b940:4283:cb3e:a3e8]) by smtp.gmail.com with ESMTPSA id p7-20020ac24ec7000000b004b587e37265sm4751101lfr.58.2023.01.15.09.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 09:28:42 -0800 (PST) Date: Sun, 15 Jan 2023 20:28:41 +0300 From: Andrey Skvortsov To: Sakari Ailus Cc: Steve Longerbeam , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: ov5640: Update last busy timestamp to reset autosuspend timer Message-ID: Mail-Followup-To: Andrey Skvortsov , Sakari Ailus , Steve Longerbeam , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230114112109.982005-1-andrej.skvortzov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-01-14 14:29, Sakari Ailus wrote: > Hi Andrey, > > On Sat, Jan 14, 2023 at 02:21:09PM +0300, Andrey Skvortsov wrote: > > Otherwise autosuspend delay doesn't work and power is cut off > > immediately as device is freed. > > > > Signed-off-by: Andrey Skvortsov > > --- > > drivers/media/i2c/ov5640.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c > > index ac35350..f71c0f7 100644 > > --- a/drivers/media/i2c/ov5640.c > > +++ b/drivers/media/i2c/ov5640.c > > @@ -1238,6 +1238,7 @@ static int ov5640_write_reg(struct ov5640_dev *sensor, u16 reg, u8 val) > > return ret; > > } > > > > + pm_runtime_mark_last_busy(&sensor->i2c_client->dev); > > return 0; > > } > > > > @@ -1305,6 +1306,7 @@ static int ov5640_read_reg(struct ov5640_dev *sensor, u16 reg, u8 *val) > > } > > > > *val = buf[0]; > > + pm_runtime_mark_last_busy(&sensor->i2c_client->dev); > > I wouldn't add these calls to register accesses. It's generally relevant > with autosuspend_put(). > > The rest seems fine to me. > Thanks, Sakari, for the feedback. I wasn't sure about these calls either, I'll remove them in the v2. -- Best regards, Andrey Skvortsov