From: Roger Quadros <rogerq@ti.com>
To: <gregkh@linuxfoundation.org>
Cc: <stern@rowland.harvard.edu>, <ray.huang@amd.com>, <balbi@ti.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Roger Quadros <rogerq@ti.com>
Subject: [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail
Date: Wed, 18 Dec 2013 15:40:11 +0530 [thread overview]
Message-ID: <1387361411-15139-2-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1387361411-15139-1-git-send-email-rogerq@ti.com>
In test_halt() we set an endpoint halt condition and return on halt verification
failure, then the enpoint will remain halted and all further tests related
to that enpoint will fail. This is because we don't tackle endpoint halt error condition
in any of the tests. To avoid that situation, make sure to clear the
halt condition before exiting test_halt().
Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/misc/usbtest.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 6294e1b..300b726 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -1545,8 +1545,17 @@ static int test_halt(struct usbtest_dev *tdev, int ep, struct urb *urb)
return retval;
}
retval = verify_halted(tdev, ep, urb);
- if (retval < 0)
+ if (retval < 0) {
+ int ret;
+
+ /* clear halt anyways, else further tests will fail */
+ ret = usb_clear_halt(urb->dev, urb->pipe);
+ if (ret)
+ ERROR(tdev, "ep %02x couldn't clear halt, %d\n",
+ ep, ret);
+
return retval;
+ }
/* clear halt (tests API + protocol), verify it worked */
retval = usb_clear_halt(urb->dev, urb->pipe);
--
1.8.3.2
next prev parent reply other threads:[~2013-12-18 10:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 10:10 [PATCH 1/2] usb: usbtest: Add timetout to simple_io() Roger Quadros
2013-12-18 10:10 ` Roger Quadros [this message]
2013-12-19 4:01 ` [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail Huang Rui
2013-12-19 5:46 ` Huang Rui
2013-12-19 6:21 ` Roger Quadros
2013-12-19 6:35 ` Greg KH
2013-12-18 14:46 ` [PATCH 1/2] usb: usbtest: Add timetout to simple_io() Huang Rui
2013-12-18 16:37 ` Felipe Balbi
2013-12-19 4:00 ` Huang Rui
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=1387361411-15139-2-git-send-email-rogerq@ti.com \
--to=rogerq@ti.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ray.huang@amd.com \
--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
all inboxes | Powered by JetHome®