Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4870063rdb; Tue, 12 Dec 2023 11:31:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKzv9SQgHSdCjJvsU2CUYCVacYKioEKaUHoHxGGwyEsLmevA7D5qAAs0DP+L6775f+9JxJ X-Received: by 2002:a17:903:11c5:b0:1d0:c7f:8eed with SMTP id q5-20020a17090311c500b001d00c7f8eedmr7099752plh.58.1702409499988; Tue, 12 Dec 2023 11:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702409499; cv=none; d=google.com; s=arc-20160816; b=B/Us7EYaugogvWpP3nApIEZxAb8zOKFxUObcLcm602KMTXVB4cPRltkjickV1RZH53 opsk7b+RwtD2sJgKCDSa5uPwrwF4zYf1ec3V61lL1H5IImDRAKnjn/VNjy6hiRDfsJpw 9vxCdPhQQBj2woEeKKatYGTnpNSK3peMR/UKcrW7TW0QNecCqxf98wmzu2xmxuBw4XDB Rxk+mRuM9ggBfB6+ZTtAGod1Lw7NPyBPyLXYWAL9p7Decqt/9oCcJuyat8b4VMETsnkY lPn8U0gZU3may/8/vAv+ly7diwB8sCuflu9f+Df6ol7r3qEWJwjKjX3PjB2x57FtmoYr sjMg== 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; bh=CFTJnYpFcXSn8hqEtFtrNzMlUt3OkXw+pErxyfH3dJM=; fh=AWribdmABPoh+QTrMbl6dOGmaJ4jiOx1JkpQWwmbOd4=; b=l+I5xjiplnfHrdQShNjwyuxDpX157XL5dFhGQfArbwRN2g2rejVZpmJ6eB4ybtFn0Y E/iGOVjl+CP0K/v/y1CUkTyzclXu5ORGquUjPZPLLXaIEeSlYeap0VtaUe3ORIktd7UG 4+d9UWd8vZwWTed4J2TKzAMZUKz36qjvcaU61gqOYBU8o5bpX8eOrryNimpBA0nW9SSl Ymlffz0nEMBoBkbgZqTH7t8xE6r2m95DYQ1BEF2/h9zg99wbfuwz9Ak/Zysi0xAlIfAl OoXTCZR2Yg9hfTpAPQPPHfINBz9tftoD3/CPsboxQ3KzOBmLeHGDGfmCm4dOSRSp/yCg JrZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i3-20020a170902c94300b001cffce3a2e2si8400217pla.426.2023.12.12.11.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:31:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 90A6A8047567; Tue, 12 Dec 2023 11:31:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233052AbjLLTb3 (ORCPT + 99 others); Tue, 12 Dec 2023 14:31:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233067AbjLLTb2 (ORCPT ); Tue, 12 Dec 2023 14:31:28 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 60BD69B for ; Tue, 12 Dec 2023 11:31:33 -0800 (PST) Received: (qmail 175710 invoked by uid 1000); 12 Dec 2023 14:31:31 -0500 Date: Tue, 12 Dec 2023 14:31:31 -0500 From: Alan Stern To: Kevin Hilman Cc: =?iso-8859-1?Q?Th=E9o?= Lebrun , Roger Quadros , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Chen , Pawel Laszczak , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , "Vardhan, Vibhore" , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?iso-8859-1?Q?Gr=E9gory?= Clement , Thomas Petazzoni Subject: Re: [PATCH 3/6] usb: cdns3-ti: add suspend/resume procedures for J7200 Message-ID: References: <3e00b2ad-b58f-4b09-9230-683c58d3bb92@kernel.org> <7h34wxfmwn.fsf@baylibre.com> <7hil5odtwl.fsf@baylibre.com> <7h7cljcm6a.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7h7cljcm6a.fsf@baylibre.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS, SPF_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:31:38 -0800 (PST) On Tue, Dec 12, 2023 at 10:26:05AM -0800, Kevin Hilman wrote: > Th?o Lebrun writes: > > > Hello, > > > > On Sun Nov 26, 2023 at 11:36 PM CET, Kevin Hilman wrote: > >> Th?o Lebrun writes: > >> > On Wed Nov 22, 2023 at 11:23 PM CET, Kevin Hilman wrote: > >> >> Th?o Lebrun writes: > >> >> The point is to signal to the power domain the device is in that it can > >> >> power on/off. These IP blocks are (re)used on many different SoCs, so > >> >> the driver should not make any assumptions about what power domain it is > >> >> in (if any.) > >> > > >> > On my platform, when the device is attached to the PD it gets turned on. > >> > That feels logical to me: if a driver is not RPM aware it "just works". > >> > >> It "just works"... until the domain gets turned off. > >> > >> > Are there platforms where RPM must get enabled for the attached > >> > power-domains to be turned on? > >> > >> Yes, but but more importantly, there are platforms where RPM must get > >> enabled for the power domain to *stay* on. For example, the power > >> domain might get turned on due to devices probing etc, but as soon as > >> all the RPM-enabled drivers drop their refcount, the domain will turn > >> off. If there is a device in that domain with a non-RPM enabled driver, > >> that device will be powered off anc cause a crash. > > > > OK, that makes sense, thanks for taking the time to explain. This topic > > makes me see two things that I feel are close to being bugs. I'd be > > curious to get your view on both. > > TL;DR; they are features, not bugs. ;) > > > - If a device does not use RPM but its children do, it might get its > > associated power-domain turned off. That forces every single driver > > that want to stay alive to enable & increment RPM. > > > > What I naively expect: a genpd with a device attached to it that is > > not using RPM should mean that it should not be powered off at > > runtime_suspend. Benefit: no RPM calls in drivers that do not use > > it, and the behavior is that the genpd associated stays alive "as > > expected". > > Your expectation makes sense, but unfortunately, that's not how RPM was > designed. I'm not sure how runtime PM is meant to work with power domains. However, from the very beginning of runtime PM the intention was that device drivers and subsystems could safely ignore it. Their devices would have a permanently nonzero disable_depth (permanent because the driver/subsystem would not know to change it) and therefore would always remain in the active state (see rpm_check_suspend_allowed()). It would be very surprising if runtime PM for power domains was written in a way that would subvert this intention. Alan Stern