Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp359423pxa; Fri, 14 Aug 2020 06:24:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKPcOM5fJKdBvn83HbLvXbV6lb5b9bCuWPKWKGEEc8nQlJjR1xcBOqGwyUJMxPaPk8/Mb7 X-Received: by 2002:a05:6402:2038:: with SMTP id ay24mr2262297edb.200.1597411499504; Fri, 14 Aug 2020 06:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597411499; cv=none; d=google.com; s=arc-20160816; b=c0RtXzLqZyIIU4EzwWhlLih7PKvtCdL2g5QldnKfd1StjdBEKh5qabilBjhUF04HgG nmHXYecH+O7aLWrwCr9jgAe2D5AsDKs5Fa8jMLz6DJf94xv2FAHn0FwQOSuq5S2e/QFr IMLLhzCwm05K2eaum3e0chCzOqCrdxruAavCmdcbDGO2AeDfVaeh69xIr3YdT+KOTJTt e4wAAt/fxSrVRURcrpUpfe1I8A/CFsbf7w6bphQEN0q9N5uGDniOjPWMDs/S66UX0z73 OBLXYDz6+Ty3XfU93TUHC/j/shTJXvsaXXVj9T6IAVGOZ6l36g1PoitBJWviVhZ5lfvc s0qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PJVMgjHP6gnp0mjaxlRSS4/pgm74X7VzDgM85iATqFQ=; b=yzxUEWrtHt9plUqvnD2OeQzdVidZjLd0DZkEKIesH6+Bq6lhFu7v4IYDsSSnuZOk6q qVYQ1BDo89m9YWoZirzqTee9VeQDUa09EIsRfTlDViQj4PjQ5zUteNU4f+droc4eVfZ5 vDvJ2GAVWQk0Yx1BS4OgTPNRBbT5xv9N4YO7wWifIMWvJo8A1+hAZGDG/eYen9KDAjEp NmMq9pDKM1avB9myaHT52gk1DakfbPMAwHVMaLvQmxJJWTT/gwYd5siOxNUBkgzvlBZ5 mD+qQjStLtIVJtxNKog/Fxj9IBR5Ssn6nXNUJLyUWvI8pN6yISiFQRKuMki3beTK4yOE AC3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lcPg0MJN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc4si5054361ejb.712.2020.08.14.06.24.36; Fri, 14 Aug 2020 06:24:59 -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; dkim=pass header.i=@chromium.org header.s=google header.b=lcPg0MJN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbgHNNXx (ORCPT + 99 others); Fri, 14 Aug 2020 09:23:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgHNNXx (ORCPT ); Fri, 14 Aug 2020 09:23:53 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722A1C061384 for ; Fri, 14 Aug 2020 06:23:52 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id t10so9902701ejs.8 for ; Fri, 14 Aug 2020 06:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PJVMgjHP6gnp0mjaxlRSS4/pgm74X7VzDgM85iATqFQ=; b=lcPg0MJN52u2w8bKn3vXx5YumuLzvS88Y8QDNdQmUluO/C6RRpq77tK1Xdjlr8sO4g U0MrYKPh3k1/kYr2wvIjvtqhmwNBrYYYjIxqwMpeB9viturwBe70V7hgWfv6B1zU0ogo l8it6e5ob+p2mAFjdDFkDTofZXSN5iBvshjsU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PJVMgjHP6gnp0mjaxlRSS4/pgm74X7VzDgM85iATqFQ=; b=KQ3hCCTlClLk4trOoi37rQIy7+eBkKKWdyx9AnFWnVJrgOL9JTukRM/m4eqdgy+V+T JmBVaxIpkheYFbOtsDpJcf/vBgH1CdGtDRYjxf74GMI6vbtIX2Fe5uIm+RDTj/O0VxXL 9fN3EQ0VBDP+hmW2udtlGjqWgaF3HNkJ50VqKM93MYCrMXbaZ554cRb6NrogLNW3TS7F tzDnUFf3gqTk9VvKbRoPTbHj6nH9tmqxxgeRhkLt2lyrgWAEaVCW+PnsaoKdWKlRZaEP uMggYxMNuViPaLgS96GIVIh6yGJfCHXzIiD+uCBU6ZAqXQWMpOgxQWbm+yxi4SnH7hbY zF4g== X-Gm-Message-State: AOAM533zjn/HL6x0KoGKzywfcUqPH2lPbZpnBGKIlwOUUod/aLQk4p0D kLWfzX1nxSmMvqKvNt3OoRKAaZr3fiGUeA== X-Received: by 2002:a17:906:cc48:: with SMTP id mm8mr2486558ejb.292.1597411430955; Fri, 14 Aug 2020 06:23:50 -0700 (PDT) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com. [209.85.221.41]) by smtp.gmail.com with ESMTPSA id k10sm6635626ejj.108.2020.08.14.06.23.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Aug 2020 06:23:50 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id a5so8342261wrm.6 for ; Fri, 14 Aug 2020 06:23:50 -0700 (PDT) X-Received: by 2002:a5d:6744:: with SMTP id l4mr2915962wrw.105.1597411089399; Fri, 14 Aug 2020 06:18:09 -0700 (PDT) MIME-Version: 1.0 References: <20200810142747.12400-1-sakari.ailus@linux.intel.com> <5353041e-850f-05ad-3b20-35e91fc9501e@linux.intel.com> In-Reply-To: <5353041e-850f-05ad-3b20-35e91fc9501e@linux.intel.com> From: Tomasz Figa Date: Fri, 14 Aug 2020 15:17:58 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 0/6] Support running driver's probe for a device powered off To: Bingbu Cao Cc: Sakari Ailus , linux-i2c , Wolfram Sang , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Bingbu Cao , Linux Media Mailing List , Chiranjeevi Rapolu , Hyungwoo Yang , Bartosz Golaszewski , Arnd Bergmann , Linux Kernel Mailing List , Greg Kroah-Hartman , "Mani, Rajmohan" , "Qiu, Tian Shu" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2020 at 6:12 AM Bingbu Cao wro= te: > > > > On 8/10/20 10:27 PM, Sakari Ailus wrote: > > Hi all, > > > ...snip... > > > > The use case is such that there is a privacy LED next to an integrated > > user-facing laptop camera, and this LED is there to signal the user tha= t > > the camera is recording a video or capturing images. That LED also happ= ens > > to be wired to one of the power supplies of the camera, so whenever you > > power on the camera, the LED will be lit, whether images are captured f= rom > > the camera --- or not. There's no way to implement this differently > > without additional software control (allowing of which is itself a > > hardware design decision) on most CSI-2-connected camera sensors as the= y > > simply have no pin to signal the camera streaming state. > > > > This is also what happens during driver probe: the camera will be power= ed > > on by the I=C2=B2C subsystem calling dev_pm_domain_attach() and the dev= ice is > > already powered on when the driver's own probe function is called. To t= he > > user this visible during the boot process as a blink of the privacy LED= , > > suggesting that the camera is recording without the user having used an > > application to do that. From the end user's point of view the behaviour= is > > not expected and for someone unfamiliar with internal workings of a > > computer surely seems quite suspicious --- even if images are not being > > actually captured. > > > > I've tested these on linux-next master. They also apply to Wolfram's > > i2c/for-next branch, there's a patch that affects the I=C2=B2C core cha= nges > > here (see below). The patches apart from that apply to Bartosz's > > at24/for-next as well as Mauro's linux-media master branch. > > Sakari, we meet one issue - once the vcm sub-device registered, the user = space > will try to open the VCM (I have not figure out who did that), it will al= so > trigger the acpi pm resume/suspend, as the VCM always shares same power r= ail > with camera sensor, so the privacy LED still has a blink. It's not always the case, as on some designs there are multiple power rails to the sensor and one drives the LED, while the other drives the VCM. That said, it would be still good to solve it in either case. Perhaps we need some more general discussion on the side effects of simply opening and querying a device. Most of V4L2 drivers these days are designed to avoid powering up the hardware until it's absolutely needed to do so. However, for non-streaming subdevs that are directly controlled by the userspace, like VCM, it's a common practice to power up on open and down on release. This is because they don't have a "streaming" state, so the driver has no way to determine when the power is needed. I wonder if there is a way to improve this. Best regards, Tomasz