Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp494549pxk; Thu, 24 Sep 2020 10:30:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwklbM2I8NrQMTLIX0MKLdtz0X4jYw8AjXw5eV/JC91FPt4mjJ6MUO7px9nW9F/SbEWoVVw X-Received: by 2002:a17:906:2cd2:: with SMTP id r18mr1018534ejr.371.1600968629408; Thu, 24 Sep 2020 10:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600968629; cv=none; d=google.com; s=arc-20160816; b=NvM8m7in/HAVvBAZevW2RYmejwnEaipqsDsdwAssofwxlOW0RnzjwYVIjiYKinLogi eb+Yju3juwWqWt39IqRwJOuas9Yw0atBC1hvItGtvMXkYgqIjJJedJHOKs5LIPXQP7/P wqDgaRNsLtznGJjg2w38pLhN7TXeTRFLagXMcygx6He0o+vfgUoDyhJWw7CaEyfC0EEI LV+fXJ8pGeRS8fG+D+Du0rTFELvJGrLSwgxHHVEgagLHbS7uytANY9u0lRej6IqRK5Li BulqTv/vEYoUatS80FMBdx+M92l9kXppMxwk8Gafu/mFsFHwpiHnr6ijTnyo6bibYq1d rCLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=8sBBCWwbRz04fUzjRPhZNY8hFt8ufZLzyhNOCmygY84=; b=GqiTNKu4F6XFrBsKVT+MARY/Aepisxc8QTd6vomygS9Ydr/cc2f6ricaXutqTlwWrA XOZOcySW1UkDA7dVD42ZBwsGv56iKZe7GtS3xGjsdiIy6j8KT5mW0n7+z37ed+/yJg+P lrR+YUwyt6Dduufq1GbSV4yjRETRGa+MbGz+RgbA7rS9Fo6unfV0I3LwGlCnapH1Dbsx OzL3cAIyMlOaNVrWm10VSs+sqj9qKWSVbAevLPjzCUZ3s8tY8DlWwLAxbRHXqj9dWnn6 lb4Oc50A5YjzZD4B++ZWnTChEy0/ZnF1IxlrDrd4adU/SYI9gpkBPJGkBwtFPW931lxq fiAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si44405ejd.442.2020.09.24.10.30.05; Thu, 24 Sep 2020 10:30:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728711AbgIXR0I (ORCPT + 99 others); Thu, 24 Sep 2020 13:26:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727988AbgIXR0I (ORCPT ); Thu, 24 Sep 2020 13:26:08 -0400 Received: from hillosipuli.retiisi.eu (hillosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::81:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00FA0C0613CE; Thu, 24 Sep 2020 10:26:07 -0700 (PDT) Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.eu (Postfix) with ESMTPS id 40AD7634C87; Thu, 24 Sep 2020 20:24:45 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1kLUz7-00030R-DQ; Thu, 24 Sep 2020 20:24:45 +0300 Date: Thu, 24 Sep 2020 20:24:45 +0300 From: Sakari Ailus To: Luca Ceresoli Cc: Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, hverkuil@xs4all.nl, jacopo+renesas@jmondi.org, leonl@leopardimaging.com, robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 2/3] media: i2c: imx274: Remove stop stream i2c writes during remove Message-ID: <20200924172445.GJ8644@valkosipuli.retiisi.org.uk> References: <1600724379-7324-1-git-send-email-skomatineni@nvidia.com> <1600724379-7324-3-git-send-email-skomatineni@nvidia.com> <20200922084746.GA8644@valkosipuli.retiisi.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 12:09:22PM +0200, Luca Ceresoli wrote: > On 22/09/20 10:47, Sakari Ailus wrote: > > Hi Luca, > > > > On Tue, Sep 22, 2020 at 10:09:33AM +0200, Luca Ceresoli wrote: > >> Hi, > >> > >> On 21/09/20 23:39, Sowjanya Komatineni wrote: > >>> Sensor should already be in standby during remove and there is no > >>> need to configure sensor registers for stream stop. > >> > >> I beg your pardon for the newbie question: does the V4L2 framework > >> guarantee that the stream is stopped (.s_stream(..., 0)) before removing > >> the driver? > > > > It doesn't. That's however one of the lesser concerns, and I don't think > > it'd help if drivers tried to prepare for that. > > Thanks for the clarification. > > I've been working with hardware where the sensor is always powered. In > this case, and with this patch applied, the sensor would keep producing > frames after driver removal. This looks wrong, unless I'm overlooking > something. > > BTW at first sight it looks like the framework should take care of > stopping the stream before removal, not the individual drivers, but > maybe there are good reasons this is not done? Yes, it should. This is a complex problem area to address. The framework (V4L2) wasn't originally built with object refcounting when support was added for complex cameras that comprise multiple devices because it wasn't thought it would be really needed. And it's hard to add that later on. Either way, there's little individual drivers can do to address that; the framework support needs to be there first. The same goes with Media controller; it's not just V4L2. -- Sakari Ailus