Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1803659pxk; Sat, 26 Sep 2020 05:47:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOY76wTbuWJ65jWL+4zj8bnOqUchdbNtlP69kMFR+WEHs0wIdkn1ErW7fkRQzSB0hJWzxH X-Received: by 2002:a17:906:24d2:: with SMTP id f18mr7125986ejb.510.1601124445176; Sat, 26 Sep 2020 05:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601124445; cv=none; d=google.com; s=arc-20160816; b=O6ZoT86oTNiXuEnVG4fi3CyAPVODd1phWIHOsUh0DiIS96wVR71oqXF1X6LkEHVEA/ XgxnAFOETVXpVNcMtLl/L56j/FyBJXXmVAlNSQOsnr1dACeMe/gstftFjgdmDBU54MHc HKnQgHsC1w1S71h201L/QfPqfhtFHeCOkTpfoZwZRMrUAs2rSQoYUiUNK73VumoOvasL WJpFlpJMFKqYtSNjmQX8Oc7DzC9sfMK1NnNad7q8YiLiZ2MQQHjSnTvu3OzMrRtDhpF1 VgQF84yGVsnJwTr+edlsiWHIpAVCsifr7K0VpACgUaYhKsKGdUZgRLQqLAi5B8F+hWmr G9lw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dSwsSSOpdoya+VElstoPs3GBEFL+PDDRdz86nL3fwYY=; b=LW+WPB4oPReTZY2IDpto+nyJLhOO2au2TM2azLAanrPc9cLark5Ecn1IzPypykajvR 9FGRsH0kNADSkWaulyS5fPlHEgONgpJsIGrlU5mEwumaLJ7K7FaaXdAeHYnA/1XyNldT mjGo7W3Us8D5ZY9gXwtrOpei1x/jEQTMnNsMmUyffjdLrQDQsKZAlqa3khDRfXHHt2RF UQDiYOfnA+wsvDIXJ6u1v/g1xMBEs4BFPaDdq+q+i3nWyYameaSEIEfDoGO0khPzOFKV EUJE/lr2EECnn2k/J7IPgW3UTTlUPmsHElTsiGLW4oTebQjdK/fSsgEGA+7uGUCxNsPr 0QCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MmffRXqx; 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 b7si3671307edz.159.2020.09.26.05.47.01; Sat, 26 Sep 2020 05:47:25 -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=MmffRXqx; 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 S1727216AbgIZMqH (ORCPT + 99 others); Sat, 26 Sep 2020 08:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbgIZMqG (ORCPT ); Sat, 26 Sep 2020 08:46:06 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FAD8C0613D5 for ; Sat, 26 Sep 2020 05:46:06 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id s13so1912056wmh.4 for ; Sat, 26 Sep 2020 05:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=dSwsSSOpdoya+VElstoPs3GBEFL+PDDRdz86nL3fwYY=; b=MmffRXqx/TQA259IWYeYPd/YW3g4ukoRQJLak9R0zqBL1iuc+1gNyFQ1LeSAHW6+kN UMY518sg4m20FvbYI5ysoEk3Fwa0u18ZFVRuZKGITO5ezzrO8Db9itX7hLvp9pCkeXI1 Pas3gQSzCrtGBB0s4wj0CnGoi+K/vKl6fPBdE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=dSwsSSOpdoya+VElstoPs3GBEFL+PDDRdz86nL3fwYY=; b=WcvZCEZkJyAc3yaAiZ9gMzos/P8QZb8BnQm+6bnsF9rUl0a0l9dbiaB7FLPg2406mJ k1FLgkSDMXIz5w74QypqwQtMT8QQitbQ+Gz+/ys8hOWyy1lSIsKFcLTpcYNY5HR1Yggi qU0mqOkHpB+EKa9ykznb472Q3qF65Jh30KkPMKRrLV0Um6bfniLq70V6g6aw4fKS666F /BQdfQyv+x1nAaxV1ZYWC0tGqBm1JPXkRSjRtyvNmOIpUyOqpZ/pDxjBoHO2XpCbTjGf lGL/tpWFsnH2jW7b0vq46qiXT7K/tq0iUKdmbzAg62Nep6OzsRbRomnExo8nWvfD5C69 JgGA== X-Gm-Message-State: AOAM5319AmtilLGNEKOxIBO6sYrm2mdvSAvZ5k/trAR6MSs52PKo0K93 nx/+BJ/Q7VD2rQ6LAA32C5Lcaw== X-Received: by 2002:a1c:e0d4:: with SMTP id x203mr2660597wmg.91.1601124365050; Sat, 26 Sep 2020 05:46:05 -0700 (PDT) Received: from chromium.org (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id r206sm2638763wma.47.2020.09.26.05.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 05:46:04 -0700 (PDT) Date: Sat, 26 Sep 2020 12:46:03 +0000 From: Tomasz Figa To: Sakari Ailus Cc: linux-i2c@vger.kernel.org, Wolfram Sang , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , rajmohan.mani@intel.com, Bartosz Golaszewski , Bingbu Cao , Chiranjeevi Rapolu , Hyungwoo Yang , linux-media@vger.kernel.org Subject: Re: [PATCH v8 0/6] Support running driver's probe for a device powered off Message-ID: <20200926124603.GB3781977@chromium.org> References: <20200903081550.6012-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200903081550.6012-1-sakari.ailus@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On Thu, Sep 03, 2020 at 11:15:44AM +0300, Sakari Ailus wrote: > > Hi all, > > These patches enable calling (and finishing) a driver's probe function > without powering on the respective device on busses where the practice is > to power on the device for probe. While it generally is a driver's job to > check the that the device is there, there are cases where it might be > undesirable. (In this case it stems from a combination of hardware design > and user expectations; see below.) The downside with this change is that > if there is something wrong with the device, it will only be found at the > time the device is used. In this case (the camera sensors + EEPROM in a > sensor) I don't see any tangible harm from that though. > > An indication both from the driver and the firmware is required to allow > the device's power state to remain off during probe (see the first patch). > > > 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 that > the camera is recording a video or capturing images. That LED also happens > 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 from > 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 they > simply have no pin to signal the camera streaming state. > > This is also what happens during driver probe: the camera will be powered > on by the I?C subsystem calling dev_pm_domain_attach() and the device is > already powered on when the driver's own probe function is called. To the > 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?C core changes > here (see below). The patches apart from that apply to Bartosz's > at24/for-next as well as Mauro's linux-media master branch. Besides the suggestion to make the defintions added less specific to i2c (but still keeping the implementation so for now), feel free to add: Reviewed-by: Tomasz Figa Best regards, Tomasz