Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp231858rdd; Wed, 22 Nov 2023 14:23:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFf5GbYtgy6IsUM5UCNysuBDUrvMdCRr5trIAkXeuWJ0DF2O7Ybx1ZUuBb0s9reKvdvCrXn X-Received: by 2002:a17:90b:1810:b0:283:22f0:33a6 with SMTP id lw16-20020a17090b181000b0028322f033a6mr3839528pjb.42.1700691812875; Wed, 22 Nov 2023 14:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700691812; cv=none; d=google.com; s=arc-20160816; b=iIquCGp6Q61NsDG3AvKbc/cn6IAI5A9iJeBWT7bHkXKwj5uSqbC6SGLWV4fAytJwTK 9EuaQmKoMZWYtwQoCejd4ieX8mmCNePQo0l1hnJHxxq6h9wCB2aVVcGdIRqcdE8m1xAT lTWbiQjbsULZVkyqqBsQc5B4G2XUWZUZNflJAaGMubmxB1ZXqeNWLUeMpn060IgUfXDa KPpdMbejMG2mt8h8CkmhmmuVXQUQ0/HJllIveTWvV3tTjbHqySMHj8b0IiM4bZimvUeq eVrdTSSig/bLgvEgNYt9ijJwEhPHQT4LilF7A5iJ56gknUK5amsbm5roFei6lLUPoTqV /xow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=OL5Rc/9LPDX/JBuXgvAqaMir5wTAlHP3HtpA4T6fttM=; fh=n9KzoazXESe2LNGk1922uNIFFRASa0uXzZmmZowXAvM=; b=gV+Ta16NT1ZQHs44NZVXXaXygL7WN59YPXWSIGFI4Ht9q7EBZqRH1rfK5pe1jorwzc XtflcLwJuEaaJGVH1ZpGEd3tlwW6rgRhnOoSXqOtmLHad4QcvC4uoasD45X/AS+5tIYc 4v+aNhm6WSVQXYnKmwiEysRrnoIbDcCBeJQUzm9ZILX8qE0hdakAN94RfBD4DZ9KxDqg KUHDPTNFFa8+/Me87NGCJnJJ8EBjHF/d2nMjt3fGcUheK9A5aIlwsEmeuu459MILEoHC i4897m2VgFBrbUVYBR5rBGAXMZTNrQci51ug+3LLpfh1bAEBa694T74ifiVfRMwoc/rT MAlw== 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:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id pg18-20020a17090b1e1200b002800c1493c5si39448pjb.29.2023.11.22.14.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 14:23:32 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id F3CC78065335; Wed, 22 Nov 2023 14:23:26 -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 S1344652AbjKVWXL convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Nov 2023 17:23:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235132AbjKVWXJ (ORCPT ); Wed, 22 Nov 2023 17:23:09 -0500 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB0412A for ; Wed, 22 Nov 2023 14:23:05 -0800 (PST) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5bcfc508d14so174591a12.3 for ; Wed, 22 Nov 2023 14:23:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700691785; x=1701296585; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5XRVoVLXVomBjORXYYQ/VVU9eLMC0qK+hh0p5N9qvqQ=; b=RdkmuFIV4Rn24IIxZZFMQC+JTMNKuBbD1hX5Vw1oYcXq3A9L4XgryMRLC5e6VafJqW smszIuMf/FJoal2laH81jOncdXgO8LbZ+hmutRG2uw2eCYm61/PLRfIAbMTmzNwO81yR GSZ7nRVHL073/GpEaHUWZj29GbMpWQI6OIOCZh4/Cuo5I4mPsSQ6WfGfVjN/9xXKcxxi HC9iHAlfJ78zvvTicQTeekGJ+uQW8vnJFIuGd9nf2pTcLTajNU5LZN66wLk1EsL4n6MV Us/iwixbe5hY+mMnUR17iQ/NbRomF3jNTSDD4lXmhTA5J6uPQfMKiZlPzbn6xUqvId4e QfKA== X-Gm-Message-State: AOJu0Yy2hpEhs3oStxnEA2PTXik49tVlj/ESyXNBvvBek0x4tjD4xHUL VZo8NEqs817YkwTbG0imJiXxOA== X-Received: by 2002:a17:90b:1b51:b0:27d:97e5:f3fa with SMTP id nv17-20020a17090b1b5100b0027d97e5f3famr4335607pjb.29.1700691785297; Wed, 22 Nov 2023 14:23:05 -0800 (PST) Received: from localhost (75-172-121-199.tukw.qwest.net. [75.172.121.199]) by smtp.gmail.com with ESMTPSA id q8-20020a17090a2dc800b0027ce48022cbsm262914pjm.14.2023.11.22.14.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 14:23:04 -0800 (PST) From: Kevin Hilman To: =?utf-8?Q?Th=C3=A9o?= Lebrun , Roger Quadros , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Chen , Pawel Laszczak , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , "Vardhan, Vibhore" Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?Q?Gr=C3=A9gory?= Clement , Thomas Petazzoni Subject: Re: [PATCH 3/6] usb: cdns3-ti: add suspend/resume procedures for J7200 In-Reply-To: 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> Date: Wed, 22 Nov 2023 14:23:04 -0800 Message-ID: <7h34wxfmwn.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=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]); Wed, 22 Nov 2023 14:23:27 -0800 (PST) Théo Lebrun writes: > Hi Roger, > > On Fri Nov 17, 2023 at 12:51 PM CET, Roger Quadros wrote: >> On 17/11/2023 12:17, Théo Lebrun wrote: >> > On Thu Nov 16, 2023 at 10:44 PM CET, Roger Quadros wrote: >> >> On 16/11/2023 20:56, Théo Lebrun wrote: >> >>> On Thu Nov 16, 2023 at 1:40 PM CET, Roger Quadros wrote: >> >>>> On 15/11/2023 17:02, Théo 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/resume >> >>>> hooks doesn't seem right. >> >>>> >> >>>> How about using something like pm_runtime_forbid(dev) on devices which >> >>>> 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. >> > >> > What's the point of runtime PM if nothing is done based on it? This is >> > the current behavior of the driver. 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.) >> Even if driver doesn't have runtime_suspend/resume hooks, wouldn't >> 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. Or, for this USB IP block to be in a power domain that has memory retention, in which case the power domain can still go off to save power, but not lose context. > 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 the way. > 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. It may have no impact on the platform you are on, but it's very likely to have an impact on other platforms with this same IP. Kevin