From: Roger Quadros <roger.quadros@nokia.com>
To: gregkh@suse.de
Cc: mina86@mina86.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] usb: gadget: f_mass_storage: Fix Bulk-only RESET handling
Date: Tue, 5 Apr 2011 18:36:38 +0300 [thread overview]
Message-ID: <1302017802-16614-2-git-send-email-roger.quadros@nokia.com> (raw)
In-Reply-To: <1302017802-16614-1-git-send-email-roger.quadros@nokia.com>
The ep0 request tag was not recorded thus resulting in phase
problems while sending status/response in handle_execption() handler.
This was resulting in MSC compliance test failures with USBCV tool.
With this patch, the Bulk-Only Mass storage RESET request is
handled correctly and the MSC compliance tests pass.
Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
---
drivers/usb/gadget/f_mass_storage.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index ef6c65a..90472af 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -613,6 +613,11 @@ static int fsg_setup(struct usb_function *f,
if (!fsg_is_set(fsg->common))
return -EOPNOTSUPP;
+ ++fsg->common->ep0_req_tag; /* Record arrival of a new request */
+ req->context = NULL;
+ req->length = 0;
+ dump_msg(fsg, "ep0-setup", (u8 *) ctrl, sizeof(*ctrl));
+
switch (ctrl->bRequest) {
case USB_BULK_RESET_REQUEST:
--
1.6.0.4
next prev parent reply other threads:[~2011-04-05 15:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 15:36 [PATCH 0/5] fixes for f_mass_storage Roger Quadros
2011-04-05 15:36 ` Roger Quadros [this message]
2011-04-05 16:09 ` [PATCH 1/5] usb: gadget: f_mass_storage: Fix Bulk-only RESET handling Michal Nazarewicz
2011-04-05 15:36 ` [PATCH 2/5] usb: gadget: f_mass_storage: If 'ro'/'cdrom' specified, open file as read-only Roger Quadros
2011-04-05 16:04 ` Michal Nazarewicz
2011-04-05 15:36 ` [PATCH 3/5] usb: gadget: f_mass_storage: Prevent NULL pointer dereference Roger Quadros
2011-04-05 15:56 ` Michal Nazarewicz
2011-04-05 17:47 ` Roger Quadros
2011-04-05 15:36 ` [PATCH 4/5] usb: gadget: f_mass_storage: Fix potential memory leak Roger Quadros
2011-04-05 15:59 ` Michal Nazarewicz
2011-04-05 17:47 ` Roger Quadros
2011-04-05 15:36 ` [PATCH 5/5] usb: gadget: f_mass_storage: remove unnecessary initialization Roger Quadros
2011-04-05 16:01 ` Michal Nazarewicz
2011-04-05 16:10 ` [PATCH 0/5] fixes for f_mass_storage Michal Nazarewicz
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=1302017802-16614-2-git-send-email-roger.quadros@nokia.com \
--to=roger.quadros@nokia.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mina86@mina86.com \
/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
all inboxes | Powered by JetHome®