Re: [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail
On Thu, Dec 19, 2013 at 11:51:45AM +0530, Roger Quadros wrote: > On 12/19/2013 11:16 AM, Huang Rui wrote: > > On Thu, Dec 19, 2013 at 12:01:47PM +0800, Huang Rui wrote: > >> 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 > > ^^^ > > BTW, please fix these typo. > > Hi Rui, > > These patches have been already applied to Greg's usb tree without your Ack's > or the typo fix. > > Greg, > > do you want me to resend the patches? Nope, it's not a big deal, typo's in changelog comments isn't a worry. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail
On 12/19/2013 11:16 AM, Huang Rui wrote: > On Thu, Dec 19, 2013 at 12:01:47PM +0800, Huang Rui wrote: >> 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 > ^^^ > BTW, please fix these typo. Hi Rui, These patches have been already applied to Greg's usb tree without your Ack's or the typo fix. Greg, do you want me to resend the patches? cheers, -roger > > Thanks, > Rui > >>> 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 >>> >>> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-usb" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail
On Thu, Dec 19, 2013 at 12:01:47PM +0800, Huang Rui wrote: > 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 ^^^ BTW, please fix these typo. Thanks, Rui > > 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 > > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail
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 > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] usb: usbtest: Always clear halt else further tests will fail
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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html