Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1336429rwb; Fri, 19 Aug 2022 01:39:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR61P1dYjX3YzV+aAyKNexsEh61czqBC9m2CplS5T5d6h8Oyaqq9SykdtKlz6sYX/yPxDd2d X-Received: by 2002:a17:90a:5b:b0:1fa:b78b:ad73 with SMTP id 27-20020a17090a005b00b001fab78bad73mr7339563pjb.107.1660898367304; Fri, 19 Aug 2022 01:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660898367; cv=none; d=google.com; s=arc-20160816; b=PZ/lFp3l3osz8TYUEGr6phtGjDU0jNeGtdnbHtmF853Dw/PiXmZy/Vt4FcJ+vousNH QiNRLJiTxGwOOt+X43yCV0ZE7x1czPXSVB8fsT+HUVuiAHzKWWUteap/RijLq3sIZsJS H0x8KlfvuhmDbi5W0cHQ8mR3/4NPeh4/eSC275895HqW+5lOfmaylhz6N9sCy+MF9xUV wlvoezB7yXX52zeKLg+W3m1FzwTBxrDsJ4fxxkDz8WzRR+4SBjUr/RolE+/C3+YvBiJ7 cuqUtsaEVeK6oWIOeGSLhDDytOK5VJ5MNwsKwQwWWsaoqcmkX/UrLXNFJV4T/Vt+GJYs pDJQ== 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:message-id:subject:cc:to:from:date; bh=lTUpXzM0BoFHAlqNBzHtZ8KH3Su9QJBgiukaiR0Lvho=; b=Rj7B57dIyOHOHUE6pNvFFk6leOMWfZG2r6hna5btF55ZfhGscOL8eRuytFm5QbL0Wb R2i3NxInOUcDXPwXMDOLCUg/us2G5YtMach4XUH1uXLsbojoZ2QWVGEmxDlruAhA6epn sEQ4k1Cl1DnC4cMt/1k7aU73MhZQmZcblTR2E9iE5n2IztFiTW1Yv6Go1Lq0MzuMDEv7 Ib76Vlb+TYTT7VpQ8vAuLt7mG8PejuXymh2dgcUig8YFwLDsZTnlq5Z+ZvmUlNwo2ejm OTYZifuX817EoM1bUdQ5mN4fBGXEM/a6DMVFf882UFsKC7oi73dA9K0zRl0yQJZ97EHt UPeQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a170902760200b00172be58c758si1530328pll.48.2022.08.19.01.39.12; Fri, 19 Aug 2022 01:39:27 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347592AbiHSIS6 (ORCPT + 99 others); Fri, 19 Aug 2022 04:18:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347260AbiHSISV (ORCPT ); Fri, 19 Aug 2022 04:18:21 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02A0E990D; Fri, 19 Aug 2022 01:18:01 -0700 (PDT) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id DDF9120007; Fri, 19 Aug 2022 08:17:56 +0000 (UTC) Date: Fri, 19 Aug 2022 10:17:55 +0200 From: Jacopo Mondi To: Marco Felsch Cc: mchehab@kernel.org, sakari.ailus@linux.intel.com, laurent.pinchart+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, akinobu.mita@gmail.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH 4/4] media: mt9m111: remove .s_power callback Message-ID: <20220819081755.wlsryhcr7xjouor5@uno.localdomain> References: <20220818144712.997477-1-m.felsch@pengutronix.de> <20220818144712.997477-4-m.felsch@pengutronix.de> <20220818161408.76ofg2rjvp5whtof@uno.localdomain> <20220819071832.3mr7u7jhp2ud4fv6@pengutronix.de> <20220819073512.ulud7ppnrudxewdn@uno.localdomain> <20220819080626.34ghffj6hmkk5ntm@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220819080626.34ghffj6hmkk5ntm@pengutronix.de> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,TVD_SUBJ_WIPE_DEBT,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Marco On Fri, Aug 19, 2022 at 10:06:26AM +0200, Marco Felsch wrote: > On 22-08-19, Jacopo Mondi wrote: > > Hi Marco > > > > On Fri, Aug 19, 2022 at 09:18:32AM +0200, Marco Felsch wrote: > > > Hi Jacopo, > > > > > > thanks for your fast feedback :) > > > > > > On 22-08-18, Jacopo Mondi wrote: > > > > Hi Marco > > > > > > > > On Thu, Aug 18, 2022 at 04:47:12PM +0200, Marco Felsch wrote: > > > > > This is in preparation of switching to the generic dev PM mechanism. > > > > > Since the .s_power callback will be removed in the near future move the > > > > > powering into the .s_stream callback. So this driver no longer depends > > > > > on the .s_power mechanism. > > > > > > > > > > Signed-off-by: Marco Felsch > > > > > > > > If you want to move to runtime_pm, I would implement it first and have > > > > s_power call the _resume and _suspend routines, as some platform > > > > drivers still use s_power() and some of them might depend on it. > > > > > > Do we really have platforms which depend on this? IMHO if that is the > > > > $ git grep "v4l2_subdev_call(.*, s_power" drivers/media/platform/ | cut -d : -f1 | uniq | wc -l > > 8 > > > > > case than we should fix those platfoms. Since new drivers shouldn't use > > > this callback anymore. > > > > Patches are clearly welcome I guess.. > > :) > > > > In my case, I worked on [1] and wondered why the sensor was enabled > > > before I told him to do so. Since I didn't implement the s_power() > > > callback, I had no chance to get enabled before. > > > > > > > I'm not sure I got this part > > What I mean is, that the MT9M131 sensor gets enabled and immediately > start sending frames before I told him to do so e.g. by calling Why does this happen ? > s_stream(). This can confuse the downstream device. The only way to get > enable the downstream device first is to add the s_power() callback. > > > > Can we please decide: > > > - Do we wanna get rid of the s_power() callback? > > > > I think that would be everyone's desire, but drivers have to be moved > > away from it > > > > > - If not, how do we handle those devices then with drivers not > > > implementing this callback? > > > > By maintaining compatibility. I suggested to move to runtime_pm() and > > wrap _resume/_suspend in s_power(). > > But then you're introducing new drivers with s_power() callbacks and so > the behaviour isn't really changed. > I only meant in existing ones > > My understanding is that the two (runtime_pm/s_power) are mutually > > exclusive, but even if that was not the case, runtime_pm is reference > > counted, hence as long as calls are balanced this should work, right ? > > Right but the s_power() behaviour is not changed and drivers still rely > on it to work as right now. As long as we have bridge drivers using it, isn't this what we want ? > > Regards, > Marco