Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: EJ Hsu <ejh@nvidia.com>
To: Felipe Balbi <balbi@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH] usb: gadget: fix wrong endpoint desc
Date: Wed, 4 Dec 2019 02:58:14 +0000
Message-ID: <MN2PR12MB4126C72DAA5292DA99477FAACF5D0@MN2PR12MB4126.namprd12.prod.outlook.com> (raw)
In-Reply-To: <87y2vt8ua9.fsf@gmail.com>

Hi,

Felipe Balb writes:
>EJ Hsu <ejh@nvidia.com> writes:
>> Gadget driver should always use config_ep_by_speed() to initialize 
>> usb_ep struct according to usb device's operating speed. Otherwise, 
>> usb_ep struct may be wrong if usb devcie's operating speed is changed.
>
>your commit log doesn't match the patch body. What gives?

The key point in this patch is that we want to make sure the desc pointer in
usb_ep struct will be set to NULL when gadget is disconnected. This will force
it to call config_ep_by_speed() to correctly initialize usb_ep struct based on 
the new operating speed when gadget is re-connected later.

>> Signed-off-by: EJ Hsu <ejh@nvidia.com>
>> ---
>>  drivers/usb/gadget/function/f_ecm.c   | 4 ++++
>>  drivers/usb/gadget/function/f_rndis.c | 1 +
>>  2 files changed, 5 insertions(+)
>>
>> diff --git a/drivers/usb/gadget/function/f_ecm.c 
>> b/drivers/usb/gadget/function/f_ecm.c
>> index 6ce044008cf6..494fe4e38a65 100644
>> --- a/drivers/usb/gadget/function/f_ecm.c
>> +++ b/drivers/usb/gadget/function/f_ecm.c
>> @@ -623,6 +623,10 @@ static void ecm_disable(struct usb_function *f)
>>  
>>  	if (ecm->port.in_ep->enabled)
>>  		gether_disconnect(&ecm->port);
>> +	else {
>
>coding style. If one branch has {}, both branches should have {} ;-)

Thanks. Will correct it.

EJ
--nvpublic

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 10:46 EJ Hsu
2019-12-03 12:31 ` Felipe Balbi
2019-12-04  2:58   ` EJ Hsu [this message]
2019-12-04 12:15     ` Felipe Balbi

Reply instructions:

You may reply publically 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=MN2PR12MB4126C72DAA5292DA99477FAACF5D0@MN2PR12MB4126.namprd12.prod.outlook.com \
    --to=ejh@nvidia.com \
    --cc=balbi@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git