public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Amit Virdi <amit.virdi@st.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"rdunlap@infradead.org" <rdunlap@infradead.org>,
	"ming.lei@canonical.com" <ming.lei@canonical.com>,
	"hdegoede@redhat.com" <hdegoede@redhat.com>,
	"hsi-ss-sw-devel@lists.codex.cro.st.com" 
	<hsi-ss-sw-devel@lists.codex.cro.st.com>
Subject: Re: [PATCH] usb: core: allow zero packet flag for interrupt urbs
Date: Fri, 18 Jul 2014 17:26:15 +0530	[thread overview]
Message-ID: <53C90B5F.7010505@st.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1407171053330.1517-100000@iolanthe.rowland.org>

On 7/17/2014 8:25 PM, Alan Stern wrote:
> I can't say this is actually wrong, but have you ever encountered a
> situation where this would be needed?  How often does anyone need to do
> a multi-packet transfer over an interrupt endpoint?

Honestly, I haven't found any such real device yet. I did this change 
while I was going through the code when adding support for interrupt 
transfers in gadget zero. I'm a no expert, but the spec says it should 
be supported so this code should be added.

However, I messed up a little in this patch. It should have been
---
         case USB_ENDPOINT_XFER_ISOC:
                 allowed |= URB_ISO_ASAP;
                 break;
+       case USB_ENDPOINT_XFER_INT:
+               if (is_out)
+                       allowed |= URB_ZERO_PACKET;
+               else
+                       allowed |= URB_SHORT_NOT_OK;
+               break;
         }
         allowed &= urb->transfer_flags;

---
Otherwise, it sets zero packet flag for control out transfers too.

I'll send a V2 with this change if you agree to setting of the zero 
packet flag for interrupt transfers.

Regards
Amit Virdi

  parent reply	other threads:[~2014-07-18 11:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17  8:47 [PATCH] usb: core: allow zero packet flag for interrupt urbs Amit Virdi
2014-07-17 10:43 ` Hans de Goede
2014-07-17 14:55 ` Alan Stern
2014-07-17 17:59   ` Steve Calfee
2014-07-17 19:32     ` Alan Stern
2014-07-17 20:59       ` Steve Calfee
2014-07-18 14:34         ` Alan Stern
2014-07-18 11:56   ` Amit Virdi [this message]
2014-07-18 14:39     ` Alan Stern
2014-07-21  5:07       ` Amit Virdi
2014-07-21  5:16         ` [PATCH V2] " Amit Virdi
2014-07-21 14:06           ` Alan Stern

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=53C90B5F.7010505@st.com \
    --to=amit.virdi@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=hsi-ss-sw-devel@lists.codex.cro.st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=rdunlap@infradead.org \
    --cc=stern@rowland.harvard.edu \
    /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