RE: [RFCv1 1/1] USB: EHCI: Do not return -EPIPE when hub is disconnected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 4 Dec 2019, Erkka Talvitie wrote:

> > > So if CERR == EHCI_TUNE_CERR and the QTD_PID != 1 (not IN) then we
> > > should return -EPIPE, as the existing code does.  But if QTD_PID == 1
> > > then the code should continue, as your patch does -- with one
> > > difference: Put the additional check for EHCI_TUNE_CERR between the
> > > tests for DBE and XACT instead of after XACT (because XACT would
> > > decrement CERR whereas DBE wouldn't).
> > 
> > Good point, I agree.
> > 
> > >
> > > Can you make that change and test it?
> > 
> > Sure, I have made the change and test it as soon as possible.
> 
> I am not actually totally sure if I understood you correctly, but I tested a change where the first stall check is like this (PID_CODE_IN is defined as 1):
> 
> -               } else if (QTD_CERR(token)) {
> +               } else if (QTD_CERR(token) && (QTD_PID (token) != PID_CODE_IN)) {
>                         status = -EPIPE;
> 
> And the second stall check (now between DBE and XACT):
> +               } else if (QTD_CERR(token)) {
> +                       status = -EPIPE;
> 
> Is this what you meant? Please correct me if I am wrong.

Actually, what I meant for the first part was:

		} else if (QTD_CERR(token) &&
				(QTD_CERR(token) < EHCI_TUNE_CERR ||
				 QTD_PID(token) != PID_CODE_IN)) {

And of course there should be a comment before this line, explaining 
what it does.  By the way, the accepted format for multi-line comments 
is:

		/*
		 * Blah blah blah
		 * Blah blah blah
		 */

The second part of the patch looks okay (but again, with a comment).

> Anyways with these changes the issue does not reproduce.

Very good.

Alan Stern




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux