Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6775926rwl; Mon, 9 Jan 2023 12:55:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDhpgn9ulDZoUMKZI3DUXiWZGarTV7hNvavGo2SMBL05yX7JGLUDB+G8VQmPUsGQNFri6q X-Received: by 2002:a17:907:d604:b0:7ad:d62d:9d31 with SMTP id wd4-20020a170907d60400b007add62d9d31mr59610310ejc.67.1673297737285; Mon, 09 Jan 2023 12:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673297737; cv=none; d=google.com; s=arc-20160816; b=SgDCRakLqVWODqWcxdcMy6nPPdAMunrBL7NjCIwA/FgQNO7+FLzcZbkKIsiQYITd21 jn2AIdXIisObwii2k246smbR90WL4rgJG2INfraQKKTcqXfYqELcaV++w89KCZDiuiX8 gHnkvRsSCPe6otvnBpRPIxD1I7dkU3eV6FYMFMNO/Lk9tRUxgM4QYJvecFw/weXIx983 47SGS5z/OovnyN8u493PSJJg09BCp2aPjiAmLNcxlowKx6rZJjDSgnbrq+QX+dVc5qlA dnD1ZWwkvkbXMzEzBYAoriJey1Fbp1tCJY3B3d/faDACC5bmIQenaHcZrYDvQbuv1xrQ stsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UWZEpTdv14vMe06i8gQQKpgut5P7lwqmwLmLHAxUi1M=; b=jV19Ot+kpXvW+XbrnNnF9njJR5dG64jNOczL4lDFwsj9chW1BtTpn7iS0tE5puBvNT ZnBaJls/Bi4GQ2wngUG6j5SYwC+zlcEJ9a1lN3Myore6rNno9E7vlK7y4xQBJxqkQrhf yvMt8Ij09qgxeA5bKyFSn7ZgleAaZXbC9XatG3+ZiM375JUk7QGj0h7BBWBsk6fRxkSK 0kAhaZjVvorHnA8I3j/4OSIaR2jM/Tvg/jITMs1u2O6bbP1/BirnWDYZaryLKkXvAVD2 LSETQZM/Ha3Qxdp8kCjdDhjh2X++gAVtocwCi/mNiTHLd1iXzGlamhYeTrD1ZAX2zzus i5WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kA3tlsjN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a17090699c400b007c16e4d5e9esi10711417ejn.412.2023.01.09.12.55.24; Mon, 09 Jan 2023 12:55:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kA3tlsjN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236183AbjAIUnO (ORCPT + 53 others); Mon, 9 Jan 2023 15:43:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237085AbjAIUnN (ORCPT ); Mon, 9 Jan 2023 15:43:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C190A559FA; Mon, 9 Jan 2023 12:43:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4BE0F613E9; Mon, 9 Jan 2023 20:43:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82420C433F0; Mon, 9 Jan 2023 20:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673296990; bh=8Le0HxyQ1hvS52eAoweCLxxf9X4TqmN17EpbgjPbkhQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kA3tlsjNZxtuRffwjcyWZjv9MwD9h8wHCPiHmolj/RHcDPDHnqYt6+ABAbYzB5RTR YNkDS8gLFLoQrVaor8JNsPjY2AoxLFZC4WSX3vKL/8jTevgyJTwBKROMeJBls8vxs4 mdoKwp5lpylrBMRumvWRvLCcUZzEpwP6V4ivQpSefZEV1HnIVnDWOfSV36aJOMu32U 3FUHN8p+IQIBoEcIWGs2BGjKF+J5XOhLBQAKQVlsc9ENbKTcbvmbWSipUY+/LlZP/Z z1oYbz0h4mWlvb21yxG1I7W0tEGvUsZrl/qbKx0x0nidSkScbYNzPzbNa+6lRSgHrs swug+t0xVeVJQ== Received: by mail-vk1-f170.google.com with SMTP id t2so4584589vkk.9; Mon, 09 Jan 2023 12:43:10 -0800 (PST) X-Gm-Message-State: AFqh2kr6pR8ugxpSyV5dtLD0kejb/sa0L1iuu34kLEg8T+T/VpDKbGV0 t3dV17T9AhYFZJU1RzLkpZVpU78PcxyacjAHtg== X-Received: by 2002:a1f:1c55:0:b0:3d5:d30f:81c2 with SMTP id c82-20020a1f1c55000000b003d5d30f81c2mr3979357vkc.14.1673296989386; Mon, 09 Jan 2023 12:43:09 -0800 (PST) MIME-Version: 1.0 References: <20221219191038.1973807-1-robh@kernel.org> <87edsua5q4.fsf@balbi.sh> <878riy9ztm.fsf@balbi.sh> <20221223235712.h54lggnjjuu3weol@synopsys.com> <87o7rlffi7.fsf@balbi.sh> <87k028g6ol.fsf@balbi.sh> <20230109194004.yqaqslcwnqqywkr3@synopsys.com> In-Reply-To: <20230109194004.yqaqslcwnqqywkr3@synopsys.com> From: Rob Herring Date: Mon, 9 Jan 2023 14:42:57 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: usb: snps,dwc3: Allow power-domains property To: Thinh Nguyen Cc: Felipe Balbi , Heiko Stuebner , Greg Kroah-Hartman , Krzysztof Kozlowski , "linux-rockchip@lists.infradead.org" , Johan Jonker , "linux-arm-kernel@lists.infradead.org" , "linux-usb@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Mon, Jan 9, 2023 at 1:40 PM Thinh Nguyen wrote: > > On Tue, Jan 03, 2023, Rob Herring wrote: > > On Fri, Dec 30, 2022 at 11:09 AM Felipe Balbi wrote: > > > > > > > > > Hi, > > > > > > Rob Herring writes: > > > >> >> > >> > Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 3 +++ > > > >> >> > >> > 1 file changed, 3 insertions(+) > > > >> >> > >> > > > > >> >> > >> > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > >> >> > >> > index 6d78048c4613..bcefd1c2410a 100644 > > > >> >> > >> > --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > >> >> > >> > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml > > > >> >> > >> > @@ -91,6 +91,9 @@ properties: > > > >> >> > >> > - usb2-phy > > > >> >> > >> > - usb3-phy > > > >> >> > >> > > > > >> >> > >> > + power-domains: > > > >> >> > >> > + maxItems: 1 > > > >> >> > >> > > > >> >> > >> AFAICT this can be incorrect. Also, you could have Cc the dwc3 > > > >> >> > >> maintainer to get comments. > > > >> >> > > > >> >> Felipe is correct. We have 2 power-domains: Core domain and PMU. > > > >> > > > > >> > Power management unit? Performance management unit? > > > >> > > > > >> > That doesn't change that the rk3399 is 1 and we're stuck with it. So I > > > >> > can say 1 or 2 domains, or we add the 2nd domain when someone needs > > > >> > it. > > > >> > > > >> Isn't the snps,dwc3.yaml document supposed to document dwc3's view of > > > >> the world? In that case, dwc3 expects 2 power domains. It just so > > > >> happens that in rk3399 they are fed from the same power supply, but > > > >> dwc3' still thinks there are two of them. No? > > > > > > > > Yes. That is how bindings *should* be. However, RK3399 defined one PD > > > > long ago and it's an ABI. So we are stuck with it. Everyone else put > > > > > > Are you confusing things, perhaps? DWC3, the block Synopsys licenses, > > > has, as Thinh confirmed, 2 internal power domains. How OEMs (TI, Intel, > > > Rockchip, Allwinner, etc) decide to integrate the IP into their systems > > > is something different. That is part of the (so-called) > > > wrapper. Different integrators will wrap Synopsys IP however they see > > > fit, as long as they can provide a suitable translation layer between > > > Synopsys own view of the world (its own interconnect implementation, of > > > which there are 3 to choose from, IIRC) and the rest of the SoC. > > > > > > Perhaps what RK3399 did was provide a single power domain at the wrapper > > > level that feeds both of DWC3's own power domains, but DWC3 itself still > > Just for some additional context/use case, the power to the PMU (power > management unit) must always be on. If the device supports hibernation, > in hibernation, the power supply to the core can be turned off. Things in an always-on PD may or may not be described in 'power-domains', so from a DT perspective I would say 1 domain is perfectly valid here. I suppose the PMU could be in a PD which can be gated off, but any hibernation features would be lost. > > > has 2 power domains, that's not something rockchip can change without > > > risking the loss of support from Synopsys, as it would not be Synopsys > > > IP anymore. > > > > Again, none of this matters. I'm documenting what is already in use > > and an ABI, not what is correct. The time for correctness was when > > this binding was added. > > That's unfortunate. That makes this very difficult to maintain if we > can't rectify a mistake. Shrug. What's unfortunate is only a limited number of people can review bindings to be correct in this aspect. And I'm not one of them. We deal with this all the time already. It's just amplified when it is shared IP. Would I like less variation? Yes, but it's not a showstopper. > > To move forward, how about something like this: > > > > power-domains: > > description: Really there are 2 PDs, but some implementations > > defined a single PD. > > minItems: 1 > > items: > > - description: core > > - description: PMU > > > > We unfortunately can't constrain this to Rockchip in the schema > > because that specific information is in the parent node. > > > > (kind of crappy descriptions too, but that's the amount of information I have.) > > Can we omit mentioning min or maxItems? While it may not be desired, > it's not a hard requirement right? This can help avoid some confusion > with devicetree documentation and dwc3 databook. Why? Don't you want to catch someone defining 3 domains? Rob