mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Thinh.Nguyen@synopsys.com, stern@rowland.harvard.edu,
	gregkh@linuxfoundation.org, vigneshr@ti.com, srk@ti.com,
	r-gunasekaran@ti.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] dt-bindings: usb: snps,dwc3: Add 'snps,gadget-keep-connect-sys-sleep'
Date: Tue, 21 Mar 2023 11:44:36 +0200	[thread overview]
Message-ID: <0f0382f0-26d0-c217-93d2-c436c5209a2b@kernel.org> (raw)
In-Reply-To: <20230320132252.GA1440894-robh@kernel.org>



On 20/03/2023 15:22, Rob Herring wrote:
> On Mon, Mar 20, 2023 at 11:34:46AM +0200, Roger Quadros wrote:
>> The current USB gadget driver behaviour is to stop the controller
>> and disconnect from the bus during System sleep.
> 
> What's USB gadget? ;)

:)

> 
>> The 'snps,gadget-keep-connect-sys-sleep' property can be used to
>> change this behaviour and keep the controller active and connected
>> to the bus during System sleep. This is useful for applications
>> that want to enter a low power state when USB is suspended but
>> remain connected so they can resume activity on USB resume.
>>
>> This feature introduces a new constraint if Gadget driver is connected
>> to USB host: i.e.  the gadget must be in USB suspend state to allow
>> a System sleep as we cannot process any USB transactions
>> when in System sleep.
>>
>> The system hardware is responsible to detect the end of USB suspend
>> and wake up the system so we can begin processing the USB transactions
>> as soon as possible.
> 
> Sounds like something the user/OS would want to choose rather than fixed 
> by your board's firmware.

Yes.

> 
> Is this somehow DWC3 specific? If not, why a DWC3 specific property?

This is not DWC3 specific. 

Should we make this a UDC class device's sysfs attribute instead?
Only concern is that in dual-role case, if a role switch from
device mode to host mode and back to device mode happens, we loose
the UDC device's attributes as we re-init the UDC device.

Or should we make it a udc_core module parameter? This should be
persistent between role switches.

> 
>>
>> Cc: devicetree@vger.kernel.org
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>> ---
>>  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 be36956af53b..1ce8008e7fef 100644
>> --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>> @@ -262,6 +262,11 @@ properties:
>>        asserts utmi_sleep_n.
>>      type: boolean
>>  
>> +  snps,gadget-keep-connect-sys-sleep:
>> +    description:
>> +      If True then gadget driver will not disconnect during system sleep.
>> +      System sleep will not be allowed if gadget is not already in USB suspend.
> 
> 'gadget' is a Linuxism.

Got it. Will avoid using it ;)

> 
>> +
>>    snps,hird-threshold:
>>      description: HIRD threshold
>>      $ref: /schemas/types.yaml#/definitions/uint8
>> -- 
>> 2.34.1
>>

cheers,
-roger

  reply	other threads:[~2023-03-21  9:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  9:34 [RFC PATCH 0/2] usb: dwc3: Support wake-up from USB suspend Roger Quadros
2023-03-20  9:34 ` [RFC PATCH 1/2] dt-bindings: usb: snps,dwc3: Add 'snps,gadget-keep-connect-sys-sleep' Roger Quadros
2023-03-20 13:11   ` Rob Herring
2023-03-20 13:22   ` Rob Herring
2023-03-21  9:44     ` Roger Quadros [this message]
2023-03-20  9:34 ` [RFC PATCH 2/2] usb: dwc3: Support 'snps,gadget-keep-connect-sys-sleep' feature Roger Quadros
2023-03-20 18:52   ` Thinh Nguyen
2023-03-21 10:20     ` Roger Quadros
2023-03-21 18:43       ` Thinh Nguyen
2023-03-21 19:05         ` Thinh Nguyen
2023-03-22  8:11           ` Roger Quadros
2023-03-22 17:31             ` Thinh Nguyen
2023-03-23  2:17               ` Thinh Nguyen
2023-03-23  9:29                 ` Roger Quadros
2023-03-23 20:51                   ` Thinh Nguyen
2023-03-31 11:05                     ` Roger Quadros
2023-04-03 23:37                       ` Thinh Nguyen
2023-04-04  8:01                         ` Roger Quadros
2023-04-04 21:53                           ` Thinh Nguyen
2023-04-05  8:56                             ` Roger Quadros
2023-04-06  1:38                               ` Thinh Nguyen
2023-04-12  7:46                                 ` Roger Quadros
2023-04-12 20:59                                   ` Thinh Nguyen
2023-04-13 11:31                                     ` Roger Quadros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f0382f0-26d0-c217-93d2-c436c5209a2b@kernel.org \
    --to=rogerq@kernel.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=r-gunasekaran@ti.com \
    --cc=robh@kernel.org \
    --cc=srk@ti.com \
    --cc=stern@rowland.harvard.edu \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome