From: Alan Stern <stern@rowland.harvard.edu>
To: Peter Stuge <peter@stuge.se>
Cc: "Noralf Trønnes" <noralf@tronnes.org>,
balbi@kernel.org, linux-usb@vger.kernel.org, sam@ravnborg.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 4/6] drm: Add Generic USB Display driver
Date: Mon, 1 Jun 2020 22:32:54 -0400 [thread overview]
Message-ID: <20200602023254.GB15540@rowland.harvard.edu> (raw)
In-Reply-To: <20200602001207.17171.qmail@stuge.se>
On Tue, Jun 02, 2020 at 12:12:07AM +0000, Peter Stuge wrote:
...
> The way I read composite_setup() after try_fun_setup: it calls f->setup()
> when available, and that can return < 0 to stall.
>
> I expect that composite_setup() and thus f->setup() run when the
> SETUP packet has arrived, thus before the data packet arrives, and if
> composite_setup() stalls then the device/function should never see the
> data packet.
>
> For an OUT transaction I think the host controller might still send
> the DATA packet, but the device controllers that I know don't make it
> visible to the application in that case.
...
Are you guys interested in comments from other people who know more
about the kernel and how it works with USB? Your messages have been
far too long to go into in any detail, but I will address this one issue.
The USB protocol forbids a device from sending a STALL response to a
SETUP packet. The only valid response is ACK. Thus, there is no way
to prevent the host from sending its DATA packet for a control-OUT
transfer.
A gadget driver can STALL in response to a control-OUT data packet,
but only before it has seen the packet. Once the driver knows what
the data packet contains, the gadget API doesn't provide any way to
STALL the status stage. There has been a proposal to change the API
to make this possible, but so far it hasn't gone forward.
Alan Stern
WARNING: multiple messages have this Message-ID (diff)
From: Alan Stern <stern@rowland.harvard.edu>
To: Peter Stuge <peter@stuge.se>
Cc: balbi@kernel.org, sam@ravnborg.org, linux-usb@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 4/6] drm: Add Generic USB Display driver
Date: Mon, 1 Jun 2020 22:32:54 -0400 [thread overview]
Message-ID: <20200602023254.GB15540@rowland.harvard.edu> (raw)
In-Reply-To: <20200602001207.17171.qmail@stuge.se>
On Tue, Jun 02, 2020 at 12:12:07AM +0000, Peter Stuge wrote:
...
> The way I read composite_setup() after try_fun_setup: it calls f->setup()
> when available, and that can return < 0 to stall.
>
> I expect that composite_setup() and thus f->setup() run when the
> SETUP packet has arrived, thus before the data packet arrives, and if
> composite_setup() stalls then the device/function should never see the
> data packet.
>
> For an OUT transaction I think the host controller might still send
> the DATA packet, but the device controllers that I know don't make it
> visible to the application in that case.
...
Are you guys interested in comments from other people who know more
about the kernel and how it works with USB? Your messages have been
far too long to go into in any detail, but I will address this one issue.
The USB protocol forbids a device from sending a STALL response to a
SETUP packet. The only valid response is ACK. Thus, there is no way
to prevent the host from sending its DATA packet for a control-OUT
transfer.
A gadget driver can STALL in response to a control-OUT data packet,
but only before it has seen the packet. Once the driver knows what
the data packet contains, the gadget API doesn't provide any way to
STALL the status stage. There has been a proposal to change the API
to make this possible, but so far it hasn't gone forward.
Alan Stern
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-06-02 2:32 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 17:56 [PATCH v3 0/6] Generic USB Display driver Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-05-29 17:56 ` [PATCH v3 1/6] drm/client: Add drm_client_init_from_id() Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-05-29 17:56 ` [PATCH v3 2/6] drm/client: Add drm_client_modeset_disable() Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-05-29 17:56 ` [PATCH v3 3/6] drm/client: Add a way to set modeset, properties and rotation Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-05-29 17:56 ` [PATCH v3 4/6] drm: Add Generic USB Display driver Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-05-29 22:45 ` Peter Stuge
2020-05-29 22:45 ` Peter Stuge
2020-06-01 16:57 ` Noralf Trønnes
2020-06-01 16:57 ` Noralf Trønnes
2020-06-02 0:12 ` Peter Stuge
2020-06-02 0:12 ` Peter Stuge
2020-06-02 2:32 ` Alan Stern [this message]
2020-06-02 2:32 ` Alan Stern
2020-06-02 5:21 ` Peter Stuge
2020-06-02 5:21 ` Peter Stuge
2020-06-02 15:27 ` Alan Stern
2020-06-02 15:27 ` Alan Stern
2020-06-02 18:38 ` Peter Stuge
2020-06-02 18:38 ` Peter Stuge
2020-06-05 12:03 ` Noralf Trønnes
2020-06-05 12:03 ` Noralf Trønnes
2020-06-02 11:46 ` Noralf Trønnes
2020-06-02 11:46 ` Noralf Trønnes
2020-07-14 15:30 ` Noralf Trønnes
2020-07-14 15:30 ` Noralf Trønnes
2020-06-03 19:17 ` Noralf Trønnes
2020-06-03 19:17 ` Noralf Trønnes
2020-05-29 17:56 ` [PATCH v3 5/6] drm/gud: Add functionality for the USB gadget side Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-05-29 17:56 ` [PATCH v3 6/6] usb: gadget: function: Add Generic USB Display support Noralf Trønnes
2020-05-29 17:56 ` Noralf Trønnes
2020-06-02 17:05 ` Felipe Balbi
2020-06-02 17:05 ` Felipe Balbi
2020-06-02 19:14 ` Noralf Trønnes
2020-06-02 19:14 ` Noralf Trønnes
2020-06-03 7:10 ` Felipe Balbi
2020-06-03 7:10 ` Felipe Balbi
2020-07-09 16:32 ` [PATCH v3 0/6] Generic USB Display driver Lubomir Rintel
2020-07-09 16:32 ` Lubomir Rintel
2020-07-14 13:33 ` Noralf Trønnes
2020-07-14 13:33 ` Noralf Trønnes
2020-07-14 17:40 ` Peter Stuge
2020-07-14 17:40 ` Peter Stuge
2020-07-14 19:03 ` Noralf Trønnes
2020-07-14 19:03 ` Noralf Trønnes
2020-07-14 19:38 ` Peter Stuge
2020-07-14 19:38 ` Peter Stuge
2020-07-16 17:43 ` Noralf Trønnes
2020-07-16 17:43 ` Noralf Trønnes
2020-07-15 7:30 ` Lubomir Rintel
2020-07-15 7:30 ` Lubomir Rintel
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=20200602023254.GB15540@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=balbi@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-usb@vger.kernel.org \
--cc=noralf@tronnes.org \
--cc=peter@stuge.se \
--cc=sam@ravnborg.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.