linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henry Lin <henryl@nvidia.com>
To: Peter Chen <peter.chen@nxp.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Romain Izard <romain.izard.pro@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: f_ncm: fix wrong usb_ep
Date: Tue, 26 Nov 2019 10:03:35 +0000	[thread overview]
Message-ID: <MN2PR12MB33894E3D1D9AC14B8C9E2966AC450@MN2PR12MB3389.namprd12.prod.outlook.com> (raw)
In-Reply-To: <VI1PR04MB53277359AF0E283AE948F34C8B450@VI1PR04MB5327.eurprd04.prod.outlook.com>

>> >Would you please share the use case how to reproduce it?
>> We checked again and found NCM gadget driver should not have this issue.
>> Please ignore this patch.
>>
>> However, we still observe similar issue in ECM and RNDIS gadget driver. Take
>> ECM as example, if we plug ECM gadget in high-speed host port first. And, the host
>> only set interface with alternate setting != 1 (alt != 1 in ecm_set_alt()) for ECM
>> gadget. Then, if we unplug gadget from high-speed host port to another super-
>> speed host port afterwards, we will see both in_ep->desc and out_ep->desc in ecm-
> >port keep values for high-speed endpoints. Although NCM's implementation is
>> similar to ECM in this part, NCM doesn't have same issue as it only does
>> config_ep_by_speed() under if alt is 1.

>Does your UDC driver call composite_disconnect when disconnect from the host?
>It should set all desc to NULL at related function ->disable.

For ECM case, if ecm_set_alt() gets called with alt == 0, in_ep->desc and
out_ep->desc will be set up. But these two ep will not be enabled as gether_connect()
is not executed. During disconnect from the host, ecm_disable() gets called with ep
disabled. In this case, gether_disconnect() will not get called to set desc to NULL.

  reply	other threads:[~2019-11-26 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21  4:18 [PATCH] usb: gadget: f_ncm: fix wrong usb_ep Henry Lin
2019-11-25  4:20 ` Peter Chen
2019-11-26  7:26   ` Henry Lin
2019-11-26  7:55     ` Peter Chen
2019-11-26 10:03       ` Henry Lin [this message]
2019-11-27  1:54         ` Peter Chen
2019-11-28  9:21           ` Henry Lin
2019-11-28  9:28             ` Peter Chen

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=MN2PR12MB33894E3D1D9AC14B8C9E2966AC450@MN2PR12MB3389.namprd12.prod.outlook.com \
    --to=henryl@nvidia.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    --cc=romain.izard.pro@gmail.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;
as well as URLs for NNTP newsgroup(s).