Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3043985rdh; Mon, 27 Nov 2023 05:27:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnaKIglFLRBGewTZOeJjJBtxDql9b0TQUZzMzv8ifv0A6jzugDwEysqqTP9cF7QXCh4KWx X-Received: by 2002:a17:902:d2c5:b0:1cf:cd73:557 with SMTP id n5-20020a170902d2c500b001cfcd730557mr3270493plc.14.1701091668380; Mon, 27 Nov 2023 05:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701091668; cv=none; d=google.com; s=arc-20160816; b=Z5WF1Q3es8VS4g1AntYDQUcwWvmLkttjeCcaff0DI43Q8zgD09MY/4PvZr41GVB/l/ pYshoGfmrEqO8u/NFxnzBH5IgsItviH+LqOe4EuvDu9gNbhh6dkGEICs3T+LMd8EzoOo bXcYZZ04NVO4Ebhs2BFfzK/fngkcPlI/DOwE91WpulXZGNKgdhQ2X2xAL7UPCCOmCIT1 jCZtM/TubZ/jTmEziERnnStVm54hKZzyirstUCYo0MIowNCpF3jflfYqC0bYK4cFJXUw Qxsr5iuYnc2PBUPi64W1mh/vyAtcpyTccuJt6CFcMEz9S7vtPViV027rMgVmIgAT5OS+ gi/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:subject:from:to :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=A2YChlyfbMPmIhM4ZAtNvRzQpOjcTZdxdAoI6XnzuAM=; fh=qL37jpYMeSsKBU5lrl6bX+wNUCGhgt7OJE7nHx/jWIo=; b=OQ1SvSP5hZQW0JPEjHMIblXWlOspqSh4m0Y9MH+XMZ1QjPt4KIPSsstZMqvRfl//eY xJjbF4cSfztiv9Zo+9n1RDF50vCCVQiJwd2dRbp1gQPerBEzLrNswPaWN+GCGlnnlKrT 5kRuBAzIsHMRTrkuY6AXl/O9h2XwmY9mKLzhREetVACw3mteI1+uBlc1GcHIiQLTFFfp 1qoqFVOl3KeYr/M+zhu6CDUWq9MGojRCt+ciSkqpXxxeThrKQIYt/r1eWmyHOerElWHa nCNIcAJrCZTIIfzdcUIwPnnzV/IHhLpZXQfqABnvtRwDdjqeIa19LUrKdj+PlIJV4unu qk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eY5eglF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h3-20020a63df43000000b005a9c40151b3si9823085pgj.804.2023.11.27.05.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 05:27:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eY5eglF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 15C078094D45; Mon, 27 Nov 2023 05:27:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232913AbjK0N1V (ORCPT + 99 others); Mon, 27 Nov 2023 08:27:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233276AbjK0NZ4 (ORCPT ); Mon, 27 Nov 2023 08:25:56 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E65485; Mon, 27 Nov 2023 05:26:01 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 608B7C000D; Mon, 27 Nov 2023 13:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701091560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A2YChlyfbMPmIhM4ZAtNvRzQpOjcTZdxdAoI6XnzuAM=; b=eY5eglF9GmoTKCK3yOrebScc9pb2iRDEQFN2aINDLK4+baN8wZ41yC4OrCcEpBqUHqG2qJ CMIPi8PMAIl5AsfSZiEKZC7Je3gUH+B6tak719ivTd3DCtml+YoMscAw7XPAK5wHJCnu4o uo0a9lPsRwfdFzR5kg1hmTTF/M1+NALjQjcY1KzX2uBxJgyxnx7GqmZt8FjLlv2e6Ytr4F PPeq95Qb69Jb33tuyNXQ7qJ1DPFXjuQeDxlaS+a42yaHxVGVtTRIpMuOI1tFkhT8qY/I+B SGavC6PPR1ICEe7NgXliY+GHENhMQWXlhkvAPJQ/8oNgY+Kt76754c780+9bqg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 27 Nov 2023 14:25:58 +0100 Message-Id: To: "Kevin Hilman" , "Roger Quadros" , "Greg Kroah-Hartman" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Peter Chen" , "Pawel Laszczak" , "Nishanth Menon" , "Vignesh Raghavendra" , "Tero Kristo" , "Vardhan, Vibhore" From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH 3/6] usb: cdns3-ti: add suspend/resume procedures for J7200 Cc: , , , , =?utf-8?q?Gr=C3=A9gory_Clement?= , "Thomas Petazzoni" X-Mailer: aerc 0.15.2 References: <20231113-j7200-usb-suspend-v1-0-ad1ee714835c@bootlin.com> <20231113-j7200-usb-suspend-v1-3-ad1ee714835c@bootlin.com> <5080372b-1f48-4cbc-a6c4-8689c28983cb@kernel.org> <3e00b2ad-b58f-4b09-9230-683c58d3bb92@kernel.org> <7h34wxfmwn.fsf@baylibre.com> <7hil5odtwl.fsf@baylibre.com> In-Reply-To: <7hil5odtwl.fsf@baylibre.com> X-GND-Sasl: theo.lebrun@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 05:27:41 -0800 (PST) Hello, On Sun Nov 26, 2023 at 11:36 PM CET, Kevin Hilman wrote: > Th=C3=A9o Lebrun writes: > > On Wed Nov 22, 2023 at 11:23 PM CET, Kevin Hilman wrote: > >> Th=C3=A9o Lebrun writes: > >> The point is to signal to the power domain the device is in that it ca= n > >> 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. - 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". - If a device uses RPM & has a refcount strictly positive, its associated power-domain gets turned off either way at suspend_noirq. That feels non-intuitive as well. What I naively expect: check for RPM refcounts of attached devices when doing suspend_noirq of power-domains. Benefit: control of what power-domains do from attached devices is done through the RPM API. Regards, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com