Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6567315ybc; Thu, 28 Nov 2019 01:30:05 -0800 (PST) X-Google-Smtp-Source: APXvYqx4JiaZrj5SxMWPoKs+YVfGHnaq6uT5sDHFKj0G5XIzNdF3q6Fp6LxdYaWrNLWHLdCQG/HZ X-Received: by 2002:aa7:d346:: with SMTP id m6mr37652374edr.234.1574933405235; Thu, 28 Nov 2019 01:30:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1574933405; cv=pass; d=google.com; s=arc-20160816; b=xKsgX/k7qmbmw5tTADdRq1hl9cedA8O3jy/KqK6zFQz0FHvza0ryEZ9pT8WwTOYLjT eY/h3DG3jPlJ+31td1qoayKqHForfZJcNSCPoUKdPgoftACWllgcBlJ/mPxxOlSRRJ6d bntsptD91iBRlvRvgNiWaBXKGWxQlCwMWrwOVx2eq4mVeETC1xDv5EzRLjtpIWrz/fR8 Ib1SiD2yVlQvtGNUFkIUS+2heaqBorvVfXTC5MxfI3V/42B3JO5GLU8eCm898yQg4d8R qezawt7IlUKu39TaBMyKBVjUyRkZG1I1SVr2sUbnbvayhddB106CaSpmS27kbroOULTV 4C5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=4JMLzyvCGZHK1RpUvZ6VPRGWWmw1cSMq1Le/FIwyFaQ=; b=cVG3eDK5ci0P+ebXGq0L7vXJox6aZVT4zjODGMhAbazztQ8+ewH5ya4RKevRoXgSxq O9YR1POD+GiNubZRA/yVzOj+D5vaKqEcCxuzyEj/z1YjyEgpZUEbGvuQ6WVc+rhyEmNQ JSAEb+wXPP0S61zTzQCeiAEuzboY3ECBQQPMRBKQYxpZE7CghWiVaEgI4croRS8eHlOq g1rA6bprHcf32e79+a3i/wlAuP/iYQCLlaJLV+bxIbbnn6ZBa7XHSOlldvwbruVX4Cti riu2zyIOGVq0+w6EiscEhHu4FMNq5MqzN1ef4IfnaW1mZMetD8Hqu159848v9vvOoxmx slxQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rZyz3lnZ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cz21si6233312edb.185.2019.11.28.01.29.41; Thu, 28 Nov 2019 01:30:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rZyz3lnZ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbfK1J2h (ORCPT + 99 others); Thu, 28 Nov 2019 04:28:37 -0500 Received: from mail-eopbgr50066.outbound.protection.outlook.com ([40.107.5.66]:49038 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726191AbfK1J2g (ORCPT ); Thu, 28 Nov 2019 04:28:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WEYf80RMc7KD2MmuaQWf/0K6SKNhVia2N1SIRU2Oh4FVs4puvCnKwzo/ZU1a1z3kKKtDk4ewYewtgnHANfYY1/wGgC5LmZ5x73QwdkvzPYUQGlIGXcEpPaJitTZPhOD6X0DBD3Hq3oi1yh4/o4ijV0LVT3w1AzgqW7kYfBax7Ss/l3tHFnjSbj0UbSQ8v7E/WqPZQV5TVAPhxENIPbjxBe7Lt/DL2aea7ipM6BxsnCYvczOHa6jpUsuzWQyfja/5l51fM36zNrd+j+cBb5GjBP1HHV6b1ogJ3R8/6mWPpZcVCBaHFwy+t1FwN34NOvtZgkewfDPL7/ZTCqFSE9GeOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4JMLzyvCGZHK1RpUvZ6VPRGWWmw1cSMq1Le/FIwyFaQ=; b=fTqkWIRFKXiyLNewQ3wwHkJjK8ranLtgXVPnVbYBBjt3f/8B0729177pOBdnpNDcFQV3MUc770dG3IPFWSyV7ssvScec1BSbxt+ajRt9XyiRGKeVmoEeycyuzDPyYjKDqzmRg2P72sonMkQrC1J6O7usZ2TipZiN/2qX3xJ15x+awHh4Qr4BTAzUWliD7hD6I9D/nh3gt/afsQ3H4KoGJr60b4v6EWOKT9CAHms4I27CTQPjS2IC5WCctaYNa8QWUCSVgYq+oi9VQbGo4BxIezI/c/ovVTg0YKFZryQmKdR73+9iCB4NdkJIBnAptiLttlowHGGaFFXWvroLmzqjaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4JMLzyvCGZHK1RpUvZ6VPRGWWmw1cSMq1Le/FIwyFaQ=; b=rZyz3lnZLg+YFIg0luAhv8KaSunhF6uESqqDmNgQApjzn6p2+TdlvCQJDD3t5MxXnYGuVsWcmCgIOiixa9+ZDL4lx0qYlv/enM9eRxKCZhI1qRd41GX+t/ZLMJrxf5cYAK4oOJlfzUkKOeiQu8Xz4sN9CC9GGlGCpmplvzfvMts= Received: from VI1PR04MB5327.eurprd04.prod.outlook.com (20.177.51.23) by VI1PR04MB4063.eurprd04.prod.outlook.com (52.133.13.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20; Thu, 28 Nov 2019 09:28:32 +0000 Received: from VI1PR04MB5327.eurprd04.prod.outlook.com ([fe80::cd33:501f:b25:51a9]) by VI1PR04MB5327.eurprd04.prod.outlook.com ([fe80::cd33:501f:b25:51a9%7]) with mapi id 15.20.2474.023; Thu, 28 Nov 2019 09:28:32 +0000 From: Peter Chen To: Henry Lin CC: Felipe Balbi , Greg Kroah-Hartman , Romain Izard , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , EJ Hsu Subject: RE: [PATCH] usb: gadget: f_ncm: fix wrong usb_ep Thread-Topic: [PATCH] usb: gadget: f_ncm: fix wrong usb_ep Thread-Index: AQHVoCLqKGYVyVjGs0eFFEwrEIcffKebTxyAgAHGIQCAAAb9cIAAJQiAgAEJN3CAAg+WAIAAAccg Date: Thu, 28 Nov 2019 09:28:32 +0000 Message-ID: References: <20191121041858.15746-1-henryl@nvidia.com>,<20191125042039.GA10953@b29397-desktop> , , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4e7da355-f8f4-474e-e16c-08d773e55621 x-ms-traffictypediagnostic: VI1PR04MB4063: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0235CBE7D0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(396003)(346002)(39860400002)(136003)(366004)(189003)(199004)(54906003)(81166006)(99286004)(66066001)(229853002)(81156014)(8936002)(8676002)(6436002)(186003)(6506007)(71200400001)(71190400001)(6916009)(256004)(76176011)(14444005)(7696005)(11346002)(102836004)(44832011)(446003)(33656002)(26005)(52536014)(7736002)(4326008)(6246003)(5660300002)(305945005)(3846002)(6116002)(2906002)(74316002)(9686003)(55016002)(316002)(25786009)(86362001)(4744005)(66476007)(76116006)(66946007)(478600001)(14454004)(64756008)(66556008)(66446008);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4063;H:VI1PR04MB5327.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JGmGlMyktmQLujbOt+GFcKiMyHi7JJXGA6rpXQpo/3biCKi+hPjbXciMAl1U/ebhHFhF8/17SHu55Y2cH/yVqNQVbMQh/1PV6Vo1uBBg1RVa69Somio872im8resDhpArRKkrLgvK+ZXTS/+aLK2h1+Ky092WFaOPsWDcAHEJfuXetLlUui+ir2iTY275COXaPztVKTSA0iQDQTf2KEP6O425anSjh3lhdq19922AZ6Di+tHSwyPjf24ez/Xo63+v3SpKsyHaAmFOSBJiTan0VvV/Ix1Inqosbg/gsS9iwBWkkbVaDjK9p4uekoblvXZnI1jTry2wT0D0wB9qv3Ay6UercYjWofRxX3kRxBXfkDpu6aw0KaOPVEJG8pNi3aZr4hvtBElO+HOxrDTFH+xdZF3p4xXunjLLiGF7vlbly/W5o9cYBRr0+SZbRIZREVs x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e7da355-f8f4-474e-e16c-08d773e55621 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2019 09:28:32.5031 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0Rj1IwThvYjEw+EDHviAHweTLAuxrhQz2kO22cuulM2ZIDUg58W/AdeuR9F06duPnafgO3YyHaZ3M005fHzfHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4063 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =20 > >> >It should set all desc to NULL at related function ->disable. > >> > >> For ECM case, if ecm_set_alt() gets called with alt =3D=3D 0, in_ep->d= esc > >> 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 calle= d to set desc > to NULL. >=20 > >Would you please share your test case? I use Linux host, and the host > >will always set alt for 1, and doesn't have this issue. > Using Windows host (without any proprietary NCM/ECM driver installed) can > reproduce set alt to 0. We just used Win10 to confirm this. Ok, feel free to submit a patch to fix it. Peter