From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB9BAEE49B0 for ; Wed, 23 Aug 2023 06:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjHWGeb (ORCPT ); Wed, 23 Aug 2023 02:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232950AbjHWGea (ORCPT ); Wed, 23 Aug 2023 02:34:30 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B5BE51 for ; Tue, 22 Aug 2023 23:34:27 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-52a1ce529fdso1639525a12.1 for ; Tue, 22 Aug 2023 23:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692772466; x=1693377266; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MU3Isdowj+DsCsRlrrGGs3GBgTkRvi+kExV2JBgHR90=; b=o23yHBgavqwsKfMWauqdS8zT9YMRxkVFjiEKXjmj4j6hUI4WdoccYudq9NvCIxELcf QCej+RLHtSFdaoUMy9FcdIkhhaJgAryOukZvsAPAgf9YjDKf/Ric/YkAth8km0XawcUK oVyn635o9URUI8KhCuHpYeprJiQFPBdcWdy5V2bq3Msv1t1+Rp7+o4YZc28AfIgDEmNc TKhGGhelBDLji1b+CKOVCt52KRPDE0UvroOydQUzC2MrMq4R+8udpgYls8zju9SW3kAl +dGWWz+tskr9KiNtfSLSKfVuMWWkzt4Z9Lsc2g05a1azi2p8jozV6xJzY8/3A5TtZMOX ILcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692772466; x=1693377266; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MU3Isdowj+DsCsRlrrGGs3GBgTkRvi+kExV2JBgHR90=; b=dzmYljk6NjRrMSNJnZcrr4u0bP6y3aNf14YQjqwEb6u3I7MHgEbqAS8CthXIuulmJ/ /g3MkFY6zamWWsap+s9YyPoEKk29ey2cEE1b6uY2cWylFDwVOHMZV63iwsvv3rBdHf02 DjXpF6FzmMxrUxHlt4mMoVU+Zc4oR8KNI0nDirvXhk3IhktgwdrC4CxKbRa0uKij+gi2 WrGfmRfBxbgh3BF4h9s9drPHyQA+iVB8DfsDOFixOenxRRnOuOiyht0L7BGNhkhb3hrX h/IeEATTH40GU0T+u1efFfBNsrUEoEYix+GdS2kLx8UW0GwrujG3ZVG2mecOBR4s/etY mOBQ== X-Gm-Message-State: AOJu0Yz/lDp62LDeDUPCptSsB0wlKFoenHiWb3uIfkYKJBEwrGolnZGs nl95DeQ4xO0CPm88AqHankO1WQ== X-Google-Smtp-Source: AGHT+IHhCJI/QD2v/0J0GgF4dGdn1D5mczy3eQQZvyXb4T25R/URjCtxqGab14wd0CHLKC83O5A11A== X-Received: by 2002:aa7:d3d2:0:b0:525:528d:836f with SMTP id o18-20020aa7d3d2000000b00525528d836fmr8428350edr.18.1692772466186; Tue, 22 Aug 2023 23:34:26 -0700 (PDT) Received: from [192.168.0.22] ([77.252.47.198]) by smtp.gmail.com with ESMTPSA id w3-20020a056402128300b005222c6fb512sm8862885edv.1.2023.08.22.23.34.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Aug 2023 23:34:25 -0700 (PDT) Message-ID: <5dfae814-7233-eb1f-cae7-f335e54ce1b6@linaro.org> Date: Wed, 23 Aug 2023 08:34:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v4 2/3] dt-bindings: usb: snps,dwc3: Add runtime-suspend-on-usb-suspend property Content-Language: en-US To: Elson Serrao , gregkh@linuxfoundation.org, Thinh.Nguyen@synopsys.com, rogerq@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org References: <20230814185043.9252-1-quic_eserrao@quicinc.com> <20230814185043.9252-3-quic_eserrao@quicinc.com> <6b27cd55-4e44-7a26-30ff-9692344cae4c@quicinc.com> <31fa930a-51fb-6a7f-300d-e71f6b399eb1@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 23/08/2023 01:58, Elson Serrao wrote: > > > On 8/19/2023 2:35 AM, Krzysztof Kozlowski wrote: >> On 18/08/2023 21:16, Elson Serrao wrote: >>> >>> >>> On 8/15/2023 10:44 PM, Krzysztof Kozlowski wrote: >>>> On 14/08/2023 20:50, Elson Roy Serrao wrote: >>>>> This property allows dwc3 runtime suspend when bus suspend interrupt >>>>> is received even with cable connected. This would allow the dwc3 >>>>> controller to enter low power mode during bus suspend scenario. >>>>> >>>>> This property would particularly benefit dwc3 IPs where hibernation is >>>>> not enabled and the dwc3 low power mode entry/exit is handled by the >>>>> glue driver. The assumption here is that the platform using this dt >>>>> property is capable of detecting resume events to bring the controller >>>>> out of suspend. >>>>> >>>>> Signed-off-by: Elson Roy Serrao >>>>> --- >>>>> Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 5 +++++ >>>>> 1 file changed, 5 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml >>>>> index a696f23730d3..e19a60d06d2b 100644 >>>>> --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml >>>>> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml >>>>> @@ -403,6 +403,11 @@ properties: >>>>> description: >>>>> Enable USB remote wakeup. >>>>> >>>>> + snps,runtime-suspend-on-usb-suspend: >>>>> + description: >>>>> + If True then dwc3 runtime suspend is allowed during bus suspend >>>>> + case even with the USB cable connected. >>>> >>>> This was no tested... but anyway, this is no a DT property but OS >>>> policy. There is no such thing as "runtime suspend" in the hardware, >>>> because you describe one particular OS. >>>> >>>> Sorry, no a DT property, drop the change entirely. >>>> >>>> >>> Hi Krzysztof >>> >>> Sorry my local dt checker had some issue and it did not catch these >>> errors. I have rectified it now. >>> >>> This dt property is mainly for skipping dwc3 controller halt when a USB >>> suspend interrupt is received with usb cable connected, so that we dont >>> trigger a DISCONNECT event. Perhaps a better name would reflect the true >>> usage of this? >>> >>> Something like snps,skip-dwc3-halt-on-usb-suspend. dwc3 cores where >>> hibernation feature is not enabled/supported can use this property >> >> So this is specific to DWC3 core, thus should be just implied by compatible. >> > > Hi Krzysztof > > Apologies for not being clear. Below is the reasoning behind this dt entry. > > When bus suspend interrupt is received and if usb cable is connected, > dwc3 driver does not suspend. The aim of this series is to handle this > interrupt when USB cable is connected to achieve power savings. OEMs > might have their own implementation in their glue driver to turn off > clocks and other resources when USB is not in use, thus saving power. > But since glue layer has dependency on dwc3 driver (parent-child > relationship) we need to allow dwc3 driver to NOT ignore the bus suspend > interrupt and let the dwc3 driver suspend (so that glue driver can > suspend as well) All this describes current OS implementation so has nothing to do with bindings. > > Now it is the responsibility of glue driver to detect USB wakeup signal > from the host during resume (since dwc3 driver is suspended at this > point and cannot handle interrupts). Every OEM may not have the > capability to detect wakeup signal. Again, driver architecture. > The goal of this dt property is for > the dwc3 driver to allow handling of the bus suspend interrupt when such DT properties are not "for the drivers". > a capability exists on a given HW platform. When this property is Each platform has this capability. If not, then it is compatible-related, as I said before which you did not address. > defined dwc3 driver knows that the low power mode entry/exit is > controlled by the glue driver and thus it can allow the suspend > operation when bus suspend interrupt is received. > > For example on Qualcomm platforms there is a phy sideband signalling > which detects the wakeup signal when resume is initiated by the host. So compatible-specific. > Thus qcom platforms can benefit from this feature by defining this dt > property. (in a parallel discussion with Thinh N to come up with a > better name for this dt entry). Thanks, with quite a long message you at the end admitted this is compatible-specific. Exactly what I wrote it one sentence previously. Best regards, Krzysztof