Linux USB
 help / color / mirror / Atom feed
From: Krishna Kurapati PSSNV <quic_kriskura@quicinc.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Badhri Jagan Sridharan <badhri@google.com>,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	Ivan Orlov <ivan.orlov0322@gmail.com>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_ppratap@quicinc.com>, <quic_wcheng@quicinc.com>,
	<quic_jackp@quicinc.com>
Subject: Re: [PATCH v5] usb: gadget: udc: Handle gadget_connect failure during bind operation
Date: Wed, 27 Sep 2023 14:17:14 +0530	[thread overview]
Message-ID: <3c18614f-eb77-4eff-be1d-068cde655b0a@quicinc.com> (raw)
In-Reply-To: <2023092701-facelift-projector-d1d4@gregkh>



On 9/27/2023 1:46 PM, Greg Kroah-Hartman wrote:
> On Wed, Sep 27, 2023 at 01:00:27PM +0530, Krishna Kurapati wrote:
>> In the event gadget_connect call (which invokes pullup) fails,
>> propagate the error to udc bind operation which in turn sends the
>> error to configfs. The userspace can then retry enumeration if
>> it chooses to.
> 
> Will this break userspace that is not expecting error codes to be
> returned?  What userspace code will now be modified to handle this?
> Where is that work happening?
> 
> thanks,

Hi Greg,

  This only handles cases where the pullup failed but the error code 
wasn't returned to configfs_udc_store approrpiately. In userspace when 
we do the following:

echo "UDC NAME" > /usb_gadget/<>/UDC

in the issue I was facing, the core soft reset was failing and we return 
-110 from dwc3/core.c to udc's bind_to_driver call, but it is not 
checked any where today and we return 0 to udc_store in configfs. The 
userspace assumes the UDC write went through (and enum happened) but it 
actually doesn't. If we propagate the -ETIMEDOUT coming from dwc3-core 
all the way to configfs_udc_store, it will reach userspace as well 
indicating that the echo command was not successful which then the user 
can choose to retry or not. On Android devices, I saw userspace retry 
happening when we propagate dwc3-core error to userspace. So nothing in 
userspace breaks. It can stay as it but this time, the echo in userspace 
will fail if pullup fails for some reason.

Regards,
Krishna,

  reply	other threads:[~2023-09-27  8:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27  7:30 [PATCH v5] usb: gadget: udc: Handle gadget_connect failure during bind operation Krishna Kurapati
2023-09-27  8:16 ` Greg Kroah-Hartman
2023-09-27  8:47   ` Krishna Kurapati PSSNV [this message]
2023-09-27 13:38 ` Alan Stern

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=3c18614f-eb77-4eff-be1d-068cde655b0a@quicinc.com \
    --to=quic_kriskura@quicinc.com \
    --cc=badhri@google.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ivan.orlov0322@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_ppratap@quicinc.com \
    --cc=quic_wcheng@quicinc.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