Received: by 10.192.165.148 with SMTP id m20csp4869810imm; Tue, 1 May 2018 05:26:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoNvSe0A5LY7ELn8oGjOZuYFPSsks7PbmUoaX/dHItFDyssQ7pdQwB8KeSxwBOE51EUkOPr X-Received: by 10.98.18.17 with SMTP id a17mr15580975pfj.104.1525177586070; Tue, 01 May 2018 05:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525177586; cv=none; d=google.com; s=arc-20160816; b=vdM9b8SglfIbcAKmygblMJszx+D4R3+aQt6X1MpWtTEd2evTTt0Oz+klYjQKkvlgfm H9QaTQ0vElpjvhRaY/nEb+O47i188PJzl7dZkkv3v+qbUsL7j7QcBC6eQG3JTOHW96YY Um2vO6NHB7E20u9oYBTrWrweh6gTyQi++lVRSQ3tnARBUs6CZcS8VxGL338psLI1Gndw NCxn20/fyzMfT4TlXvNINUBA7qnfDTl1B6yYPoo6SQL9PBou9alXkOZjd2FIRsBWO6YG iq5NvHius7KA7PUJL8MY1zJkJIZl9/knrS7MVWoivEjhtRk7HPdmiWKPelvoWEItPset ng6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=iHZDJtu2xxQQrKkRdRiUpI8vu3qfi+NOLoALL5VSRbM=; b=aJjfZdTZb7CUIAjQRqsQLU6ULcdzFOD8oYrAw5cRd7/MX5MHaYJ/THyW7rDiZmlN+8 +bn2dyavK/Tgt7YYVe23O3JGlTpDz5vJQZ/8d/cPY91HyaKFD1uLKDUMGb69fPs4w228 Nszkq0DvPSXuZdA1MNn9BJtxSrmiVdRDkD0Osq/WBJrWRNdD5VgZHs7RhhXmIXkdNo+w 5COsm994KG8cI+SJ3uAglULBKm705SHRCsEjZNlyncXEyChX2vOdC+rebuIhZK9ZrhrP /rU2BHFZAqivdyLDWJbXEBgplX7stMLvYd02g2U5G9JfwRSXcccFCLxPnVRZuJp19O0O iiqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NMNujenx; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si9472001plb.336.2018.05.01.05.26.11; Tue, 01 May 2018 05:26:26 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=NMNujenx; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755236AbeEAMZv (ORCPT + 99 others); Tue, 1 May 2018 08:25:51 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:40620 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754827AbeEAMZt (ORCPT ); Tue, 1 May 2018 08:25:49 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w41CPX3u014371; Tue, 1 May 2018 07:25:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1525177533; bh=lglc8Q12WnlXuwy7a7dq2EZxiyusvIkTivKNTpnHp9I=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=NMNujenxq3ivB5hVvZYMYeFu60NqLZ0VZuSsiH05RNS8ZEq0MLlGBiVUfF297Us9t XE1oAzTcAR7rhUp89abJbgs+yAbvCKE3NMGKSVs1mYy6T7U72b8N5J99eLUpjHl55Q MLDNJxLTjUJIV0uYavj2VBsl6+8yxgr9dwIpB8gY= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w41CPXPm013678; Tue, 1 May 2018 07:25:33 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 1 May 2018 07:25:33 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 1 May 2018 07:25:33 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w41CPX9E013090; Tue, 1 May 2018 07:25:33 -0500 Date: Tue, 1 May 2018 07:25:33 -0500 From: Bin Liu To: Paul Kocialkowski CC: Paul Kocialkowski , Maxime Ripard , , , Greg Kroah-Hartman , Chen-Yu Tsai Subject: Re: [PATCH] usb: musb: Support gadget mode when the port is set to dual role Message-ID: <20180501122533.GD21238@uda0271908> Mail-Followup-To: Bin Liu , Paul Kocialkowski , Paul Kocialkowski , Maxime Ripard , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Greg Kroah-Hartman , Chen-Yu Tsai References: <20180328215213.29538-1-contact@paulk.fr> <20180329092326.dayuccomq5zrywqo@flea> <1522324644.1746.19.camel@bootlin.com> <20180420142524.GB29011@uda0271908> <2db056d6f65ecbcdc4f31a37fe2e1b1ddfb93c87.camel@paulk.fr> <20180421143426.GA10632@LTA0271908.dhcp.ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 30, 2018 at 11:08:42PM +0200, Paul Kocialkowski wrote: > Hi, > > Le samedi 21 avril 2018 ? 09:34 -0500, Bin Liu a ?crit : > > Okay, this came down to an argument that whether we should require > > loading a gadget driver on a dual-role port to work in host mode, > > which is currently required on musb since a long long time ago. > > > > I understand the requirement is kinda unnecessary, but since it > > already > > exists on musb stack for a long time, I don't plan to change it. > > Because I > > cannot think of a use case in real products that doesn't automatically > > load a gadget function on the dual-role port. > > > > If you can explain a use case in real world (not a engineering lab) > > that the gadget driver will not be loaded at linux booting up, but > > later based on user's input, I will reconsider my decision. To remove > > this requirement from musb stack, the work is more than this patch. > > My use case here is to support common GNU/Linux-based distributions, not > use-case-specific varieties of GNU/Linux-based rootfs. So my point here > would be that most distros will (and probably should) ship g_ether as a > module but without any particular reason to autoload it, or any other > gadget module in particular, since the system is general-purpose. This is the case I called it "in a engineering lab", not a real product. > Then, imagine a user wants to plug a USB device through OTG (say, > because it's the only USB port available at all on the tablet they're > using), it simply won't work. It won't be obvious to that user that this > is because no gadget is loaded, since what they want to do does not > involve using gadget mode at any point. If a tablet has a dual-role usb port, it is designed to use a gadget driver, which has to be loaded at some point. In the case you described above, when the gadget driver will be loaded? and how? If a gadget driver will never be used, a host-only port should be on the board, not a dual-role port. > Do you think this is a valid use case? It surely is a common one and > perfectly depicts my situation. As I explained above, I don't think so. > Note that in addition to Allwinner devices, I also have omap3/4/5 > devices for testing things. I don't think I have other MUSB-enabled Much more than what I have ;) > devices in my collection though, but I would be willing to test fixes to > this issue on the ones I have. Appreciated it, but someone has to make the patches first. The one you posted might be a good start, but it is not complete. The first problem I see is that musb_start() will be called twice, one in the place you patched, the other is when the gadget driver is bound to the UDC. Regards, -Bin.