Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp546481rdb; Fri, 17 Nov 2023 06:21:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1ra057azKt7KrhzAClB0q4F7s+piUXwmPdqnKQ9BPQ1y1DBt2XEQOzEKLzU4sW+s/+3OQ X-Received: by 2002:a17:90a:356:b0:281:5b8:15e with SMTP id 22-20020a17090a035600b0028105b8015emr20021008pjf.12.1700230865602; Fri, 17 Nov 2023 06:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700230865; cv=none; d=google.com; s=arc-20160816; b=ltcZKdo0u+eUEaZoBUxAuajIf9pjnz9kC+scm9E76vRyPair2bkD/16X73EFVm7vuI XPD8Wv4VP4+MWnntUgdDphDzxM33J3qzc2mOE1/GJtVt7g1JgTZqqYyKx8VGX5wpESoh 2xzLe5mql+YmCQ8ClUSfuAaIinlx76NK/HDbv5k7WGLswHdDQwjTaLnROzx9NMVaANDY tGBsKkuo9sbOo4UjrYbIH3QydMkU5Mo9L4uKIo+SokNhSVuDjqC0ezzNU/5z2wN60EiS CTLIOj0pKtV0ulPfdFwzNUn7QO+5DChw53qar0Nb4Tdea5ksE2yCy+96upabAamn7Xd6 F1YA== 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:from:to:cc:subject :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=A7DGBR0dkS+OrVfnBIKiOX0inpfDHFx2Yamqr04yBT8=; fh=4W9mmQyknMrj+YMHTVJEYWIAumBJmHsMZMpQEj+92NU=; b=HUldWKPk49zcrbkYNn0Zmspfe9WeXQpcvcfj7DRq7oLCykQUXbh1JbcIZo2iUDVKDg CUATaHMtlCmEYt/95n7yls9XRmlQ2Gqt1hjdJwy8EsiJlSaOYQjQsRZnfzxQVNLSUoUh Qlwm8HkOiWB5y93AjwZhgeKAY3Hz3Xsoo6VOQu6zI7zwMjXvL2wXzL41nQVhVqT9tVQ2 yKXQvefnM0yStilZKuluk12RsC6jrQNv1rjKo1BgnTCsN5MuXSFknNKgzwVHfS1rl1Ww ipzp+Vk6OikM+n8+HL0q7HkmLUna0SA+ZvZPipi9P5m1FcZ3hhYhuzsFesxX8FU38adq nrBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=AY3jmh9h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b23-20020a17090acc1700b0027e022bd420si4462105pju.77.2023.11.17.06.21.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 06:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=AY3jmh9h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id A8391815CD9C; Fri, 17 Nov 2023 06:21:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231767AbjKQOUy (ORCPT + 99 others); Fri, 17 Nov 2023 09:20:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231179AbjKQOUw (ORCPT ); Fri, 17 Nov 2023 09:20:52 -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 1935DD63; Fri, 17 Nov 2023 06:20:47 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 45106C0005; Fri, 17 Nov 2023 14:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700230846; 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=A7DGBR0dkS+OrVfnBIKiOX0inpfDHFx2Yamqr04yBT8=; b=AY3jmh9h98qwoUR+Hqo7x9nmLegoG7h9iwphY783CZ6nJnE0zvCSGVp3HL1s5aNewLRO6+ EsB72lNlzT7C5GDQXUcwyGk6tc8gibBCQDmcnYXBnMpatGc1q3h2sk70PafLsPdUgF6FvB rQa7JYrfm7P4b135D8rQCS8HwarDOQXLpECUfW/ID72q6pL3p1kJdf30yNyMo0eI+SyOa2 3UNCNyxlK8eCkIQWMG909DcAMTqQLLHGj8xZP1yYoNq+yTko5I0NL+BHgZnTTaWrN4rW9B CDcD9OTEdqm9JH1E5X6WO5oo+ZTGF+ss7VGaCSVvOQ8HrdUHGpnBLBKKY+hSFg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 17 Nov 2023 15:20:44 +0100 Message-Id: Subject: Re: [PATCH 3/6] usb: cdns3-ti: add suspend/resume procedures for J7200 Cc: , , , , =?utf-8?q?Gr=C3=A9gory_Clement?= , "Thomas Petazzoni" To: "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?= 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> In-Reply-To: <3e00b2ad-b58f-4b09-9230-683c58d3bb92@kernel.org> 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 06:21:02 -0800 (PST) Hi Roger, On Fri Nov 17, 2023 at 12:51 PM CET, Roger Quadros wrote: > On 17/11/2023 12:17, Th=C3=A9o Lebrun wrote: > > On Thu Nov 16, 2023 at 10:44 PM CET, Roger Quadros wrote: > >> On 16/11/2023 20:56, Th=C3=A9o Lebrun wrote: > >>> On Thu Nov 16, 2023 at 1:40 PM CET, Roger Quadros wrote: > >>>> On 15/11/2023 17:02, Th=C3=A9o Lebrun wrote: > >>>>> On Wed Nov 15, 2023 at 12:37 PM CET, Roger Quadros wrote: > >>>>>> You might want to check suspend/resume ops in cdns3-plat and > >>>>>> do something similar here. > >>>>> > >>>>> I'm unsure what you are referring to specifically in cdns3-plat? > >>>> > >>>> What I meant is, calling pm_runtime_get/put() from system suspend/re= sume > >>>> hooks doesn't seem right. > >>>> > >>>> How about using something like pm_runtime_forbid(dev) on devices whi= ch > >>>> loose USB context on runtime suspend e.g. J7200. > >>>> So at probe we can get rid of the pm_runtime_get_sync() call. > >>> > >>> What is the goal of enabling PM runtime to then block (ie forbid) it = in > >>> its enabled state until system suspend? > >> > >> If USB controller retains context on runtime_suspend on some platforms > >> then we don't want to forbid PM runtime. > >=20 > > What's the point of runtime PM if nothing is done based on it? This is > > the current behavior of the driver. > > Even if driver doesn't have runtime_suspend/resume hooks, wouldn't=20 > the USB Power domain turn off if we enable runtime PM and allow runtime > autosuspend and all children have runtime suspended? That cannot be the currently desired behavior as it would require a runtime_resume implementation that restores this wrapper to its desired state. It could however be something that could be implemented. It would be a matter of enabling PM runtime and that is it in the probe. No need to even init the hardware in the probe. Then the runtime_resume implementation would call the new cdns_ti_init_hw. This is what the cdns3-imx wrapper is doing in a way, though what they need is clocks rather than some registers to be written. That all feels like outside the scope of the current patch series though. My suggestion for V2 would still therefore be to remove all PM runtime as it has no impact. It could be added later down the road if cutting the power-domain is a goal of yours. Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com