linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: petr.cvek@tul.cz (Petr Cvek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 42/46] usb: gadget: move ep_matches() from epautoconf to udc-core
Date: Sat, 25 Jul 2015 07:34:01 +0200	[thread overview]
Message-ID: <55B31FC9.1000407@tul.cz> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1507231542520.25082-100000@netrider.rowland.org>

On 23.7.2015 21:46, Alan Stern wrote:
> On Thu, 23 Jul 2015, Petr Cvek wrote:
> 
>> Hello,
>>
>> Is this:
>>
>> 	case USB_ENDPOINT_XFER_INT:
>> 		/* Bulk endpoints handle interrupt transfers,
>> 		 * except the toggle-quirky iso-synch kind
>> 		 */
>> 		if (!ep->caps.type_int && !ep->caps.type_bulk)
>> 			return 0;
>>
>> ... or original:
>>
>> 			switch (type) {
>> 			case USB_ENDPOINT_XFER_INT:
>> 				/* bulk endpoints handle interrupt transfers,
>> 				 * except the toggle-quirky iso-synch kind
>> 				 */
>> 				if ('s' == tmp[2])	{// == "-iso"
>> 					return 0;
>>
>> code still valid? 
> 
> It's hard to understand your question.  Are you asking whether this 
> code is still present in the current version of the kernel?  You can 
> find out for yourself easily enough.

I'm asking if there are still UDCs which require this quirk. If not, we should change it to:

	if ('n' != tmp[2])	{// != "-int"

so it will only return INT endpoints. Or if there are one or two which does not support interrupt endpoints, it would be (in my opinion) more practical to make a special case for them than force all other UDCs to use a BULK endpoint when they have an INT endpoint.

> 
>> It seems that it allows using a BULK endpoint for requested INT
>> endpoint. For my PXA27x machine the original code returns BULK EP
>> even with valid INT endpoint definition (because BULK EPs are defined
>> earlier than INT EPs).
> 
> Yes, it does allow a bulk endpoint to be used when an interrupt 
> endpoint was requested.  However, it won't return a bulk endpoint if 
> all the bulk endpoints are already in use.

A default PXA27x configuration returns BULK for requested INT. Which is unfortunate, because PXA27x supports INT endpoints and has one predefined, but this function find BULK first (one BULK is allocated and INT is never used).

> 
>> This part of the code is from pre git era
>>
>> 	1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
>>
>> before pxa27x driver was written and only few chips was supported.
>> Does anyone know if the INT endpoints works now?
> 
> What makes you think they might not work?

Because if they do, the ep_matches() function works poorly. It returns a BULK for device (gadget) side, but host side (PC) thinks that this endpoint is an INT and handles it in this way. But the PXA27x thinks the endpoint is a BULK and handles it in its way (according to datasheet, settings for a BULK and an INT transfers are not 100% compatible).

I cannot test "INT as BULK" behavior for the gadget functions, because all gadgets which works on PXA27x does not use INT endpoints (some allocate the endpoint but never use it).

> 
> Alan Stern
> 

Petr Cvek

  reply	other threads:[~2015-07-25  5:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55B07048.3000609@tul.cz>
2015-07-23 14:36 ` [PATCH v3 42/46] usb: gadget: move ep_matches() from epautoconf to udc-core Felipe Balbi
2015-07-25  5:29   ` Petr Cvek
2015-07-23 19:46 ` Alan Stern
2015-07-25  5:34   ` Petr Cvek [this message]
2015-07-25 11:04     ` Robert Jarzmik
2015-07-25 15:30       ` Alan Stern
2015-07-25 17:04         ` Robert Jarzmik
2015-07-25 18:08           ` Robert Baldyga
2015-07-25 19:25             ` Petr Cvek
2015-07-25 19:14           ` Petr Cvek
2015-07-25 21:36             ` Alan Stern
2015-07-26  0:20               ` Petr Cvek
2015-07-26 15:14                 ` Alan Stern
2015-07-26 18:58                   ` Petr Cvek
2015-07-26 19:43                   ` Robert Baldyga
2015-07-25 21:15           ` Alan Stern
2015-07-25 19:41       ` Petr Cvek
2015-07-15  6:31 [PATCH v3 00/46] usb: gadget: rework ep matching and claiming mechanism Robert Baldyga
2015-07-15  6:32 ` [PATCH v3 42/46] usb: gadget: move ep_matches() from epautoconf to udc-core Robert Baldyga

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=55B31FC9.1000407@tul.cz \
    --to=petr.cvek@tul.cz \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).