From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752791Ab3LSEVW (ORCPT ); Wed, 18 Dec 2013 23:21:22 -0500 Received: from co1ehsobe002.messaging.microsoft.com ([216.32.180.185]:18416 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267Ab3LSEVV (ORCPT ); Wed, 18 Dec 2013 23:21:21 -0500 X-Forefront-Antispam-Report: CIP:165.204.84.222;KIP:(null);UIP:(null);IPV:NLI;H:atltwp02.amd.com;RD:none;EFVD:NLI X-SpamScore: -2 X-BigFish: VPS-2(z579ehz98dI1432Izz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah1fc6hzz1de098h8275bh1de097hz2dh839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah2222h224fh1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1fe8h1ff5h209eh2216h22d0h2336h1155h) X-WSS-ID: 0MY1D98-08-09S-02 X-M-MSG: Date: Thu, 19 Dec 2013 12:01:47 +0800 From: Huang Rui To: Roger Quadros CC: , , , , Subject: Re: [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail Message-ID: <20131219040146.GC19091@hr-dev.amd.com> References: <1387361411-15139-1-git-send-email-rogerq@ti.com> <1387361411-15139-2-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1387361411-15139-2-git-send-email-rogerq@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: amd.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 18, 2013 at 03:40:11PM +0530, Roger Quadros wrote: > 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 > Reviewed-by: Felipe Balbi Acked-by: Huang Rui > --- > 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 > >