All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	USB list <linux-usb@vger.kernel.org>
Subject: Re: Testing endpoint halt support for raw-gadget
Date: Fri, 10 Apr 2020 11:53:20 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.2004101136490.15021-100000@netrider.rowland.org> (raw)
In-Reply-To: <CAAeHK+x5-z85v97ySvX+5=sJTn=hVbpkbCiQBZCD-6BKvKPSpQ@mail.gmail.com>

On Fri, 10 Apr 2020, Andrey Konovalov wrote:

> On Fri, Apr 10, 2020 at 2:29 AM Alan Stern <stern@rowland.harvard.edu> wrote:

> > Have you implemented wedge as well as halt?  Wedge is needed for the
> > mass-storage protocol; as far as I know it isn't used anywhere else.
> 
> No, I didn't know about "wedge" at all :) Looks like the API for it is
> really simple, just usb_ep_set_wedge(). I'll need to figure out what
> it is and how it works, and I'll send a patch that adds halt/wedge
> support then.

usb_ep_set_wedge(ep) does almost the same thing as 
usb_ep_set_halt(ep).  The difference is that a Clear-Feature(halt) 
request from the host will un-halt an endpoint if it is merely halted, 
but it won't un-halt a wedged endpoint.  (I don't think this is 
documented anywhere, unfortunately.)

> > And have you given any thought to suspend/resume support?  It's a bit
> > tricky because you have to consider both gadget suspend and USB bus
> > suspend.
> 
> Hm, no. Is there something specific I need to consider to support it?
> I guess I'll need to read about how it works as well, before I can
> understand what it would require and ask meaningful questions.

The really tricky part involves a gadget that is in system suspend.  If 
the USB bus isn't also suspended, the gadget won't work properly -- it 
won't be able to respond to requests from the host.  Basically, when a 
UDC driver sees that the system is going into suspend, it has no choice 
but to disconnect from the USB bus.  This probably isn't implemented 
very well in a lot of UDC drivers.

USB bus suspend, on the other hand, _should_ be implemented.

> > Nothing else springs to mind.
> 
> Something else: I've been testing raw-gadget with various UDCs that I
> have [1] and everything seems to work, except for emulating SuperSpeed
> devices with net2280. I've just found it out yesterday night, and
> haven't had a chance to debug that yet, but if you know about some
> potential issues I could encounter with SuperSpeed/USB3+, please let
> me know.

Well, USB-3 has streams, unlike USB-2.  You may want to think about
supporting them.

Also, bear in mind that dummy-hcd doesn't support isochronous transfers 
(although all real UDCs do support them).  So perhaps you haven't given 
them as much testing.  usbtest can help a little with that.

Alan Stern


  reply	other threads:[~2020-04-10 15:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 16:48 Testing endpoint halt support for raw-gadget Andrey Konovalov
2020-04-10  0:29 ` Alan Stern
2020-04-10 15:13   ` Andrey Konovalov
2020-04-10 15:53     ` Alan Stern [this message]
2020-04-27  1:26       ` Peter Chen
2020-04-27 14:29         ` Alan Stern
2020-04-29  2:20       ` Andrey Konovalov
2020-04-29 14:06         ` Alan Stern
2020-05-04 14:16           ` Andrey Konovalov
2020-05-04 14:24             ` Alan Stern
2020-05-04 15:11               ` Andrey Konovalov
2020-05-04 15:15                 ` Alan Stern
2020-05-05  6:34                   ` Felipe Balbi
2020-05-05 12:13                     ` Andrey Konovalov
2020-05-05 16:42                       ` Thinh Nguyen
2020-05-05  6:30               ` Felipe Balbi
2020-04-24 19:36   ` Andrey Konovalov
2020-04-24 19:56     ` Andrey Konovalov
2020-04-25  1:53       ` Alan Stern
2020-04-25 14:49         ` Andrey Konovalov
2020-04-25 15:02           ` Alan Stern
2020-04-27 19:51     ` Andrey Konovalov
2020-04-27 20:47       ` Andrey Konovalov
2020-04-28  0:50         ` Andrey Konovalov
2020-04-28  1:32           ` Andrey Konovalov
2020-04-28 13:27             ` Alan Stern
2020-05-13 17:07               ` Andrey Konovalov
2020-05-13 18:14                 ` Alan Stern
2020-05-13 18:31                   ` Andrey Konovalov
2020-05-13 19:09                     ` Alan Stern
2020-05-13 19:38                       ` Andrey Konovalov

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=Pine.LNX.4.44L0.2004101136490.15021-100000@netrider.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=andreyknvl@google.com \
    --cc=gregkh@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.