public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Bauer <andreas.bauer.nexus@gmail.com>
To: Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget/legacy/ether: assume saner default power mode
Date: Fri, 17 Sep 2021 14:15:33 +0700	[thread overview]
Message-ID: <YURAlSpAWT0s9dVr@ws2> (raw)
In-Reply-To: <87pmt7ahtj.fsf@kernel.org>

Am Fri, Sep 17, 2021 at 08:28:16AM +0300 schrieb Felipe Balbi:

> Have a look at other commits to get examples of how to write commits for
> upstream. You're missing your Signed-off-by, adding extra unnecessary
> spaces and making your signature show up in the commit log. All of
> these are described in kernel documentation this
> (https://www.kernel.org/doc/html/latest/process/submitting-patches.html)
> is a good starting point.

I apologize, this was my first try at contributing based on what I 
observed on this list. Will fix all mentioned points and consult the
documentation before trying again.

> > -	.bmAttributes		= USB_CONFIG_ATT_SELFPOWER,
> > +	.bmAttributes		= 0,	/* bus powered implied */
> > +	.bMaxPower		= 250,	/* 500mA in 2mA units */
> 
> right, your "sane" default now prevents this gadget driver from working
> behind bus powered hubs. Considering that a linux-based device is likely
> to have its own battery, this is not really a sane default.

The linux-based battery-powered device I have here (Android) charges its
battery and is thus bus-powered while in gadget mode.

Are there really a lot of devices that use gadget mode and do NOT draw 
power from the USB bus? Honest question, I don't know the answer.

> The default value of "self powered", seems much saner ;-)

It violates USB specification as is for most cases I reckon.  It also 
maximize functionality when the host does not enforce USB spec which
mostly seems to be the case.

Would a CONFIG option here make sense to differentiate between 
bus-powered devices and self-powered ones? This would probably affect
most OTG drivers...

regards,

Andreas

  reply	other threads:[~2021-09-17  7:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 14:56 [PATCH] usb: gadget/legacy/ether: assume saner default power mode Andreas Bauer
2021-09-16 15:36 ` Greg KH
2021-09-17  5:28 ` Felipe Balbi
2021-09-17  7:15   ` Andreas Bauer [this message]
2021-09-17  8:29     ` Felipe Balbi
2021-09-17 17:12       ` Andreas Bauer

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=YURAlSpAWT0s9dVr@ws2 \
    --to=andreas.bauer.nexus@gmail.com \
    --cc=balbi@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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