public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>, Ray Chi <raychi@google.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"albertccwang@google.com" <albertccwang@google.com>
Subject: Re: [PATCH] usb: dwc3: add cancelled reason for dwc3 requests
Date: Thu, 25 Mar 2021 21:00:27 +0000	[thread overview]
Message-ID: <8ec7cdcc-e709-357a-b255-27018f3972f1@synopsys.com> (raw)
In-Reply-To: <87y2ebju7r.fsf@kernel.org>

Felipe Balbi wrote:
> Hi,
> 
> Ray Chi <raychi@google.com> writes:
>> diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h
>> index 0cd281949970..a23e85bd3933 100644
>> --- a/drivers/usb/dwc3/gadget.h
>> +++ b/drivers/usb/dwc3/gadget.h
>> @@ -56,6 +56,12 @@ struct dwc3;
>>  
>>  /* Frame/Microframe Number Mask */
>>  #define DWC3_FRNUMBER_MASK		0x3fff
>> +
>> +/* Cancel reason for dwc3 request */
>> +#define DWC3_REQUEST_DEQUEUED		-ECONNRESET  /* Request get dequeued */
>> +#define DWC3_REQUEST_DISCONNECTED	-ESHUTDOWN   /* Device is disconnected/disabled */
>> +#define DWC3_REQUEST_STALL		-EPIPE       /* Bus or protocol error */
> 
> this is just obfuscation, pass the errors directly. Also, make sure
> these are documented in the API.
> 

Note: we don't have documentation for error codes for gadget side, only
host. These are just the equivalent error codes from the host side.

What we currently have for host:
https://www.kernel.org/doc/html/latest/driver-api/usb/error-codes.html

Maybe someone can work on that in a separate patch.

Thanks,
Thinh

  reply	other threads:[~2021-03-25 21:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 11:54 [PATCH] usb: dwc3: add cancelled reason for dwc3 requests Ray Chi
2021-03-25 12:25 ` Felipe Balbi
2021-03-25 21:00   ` Thinh Nguyen [this message]
2021-03-25 20:52 ` Thinh Nguyen

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=8ec7cdcc-e709-357a-b255-27018f3972f1@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=albertccwang@google.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=raychi@google.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