Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp687050img; Fri, 22 Mar 2019 06:35:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwIjY64xIHoXLEFv3ZMY2pjH2lrZkJ66T+EikA672SennzwLbPDvThgxK1kjLG5RTFSt9h X-Received: by 2002:a63:7f0f:: with SMTP id a15mr9043311pgd.270.1553261742138; Fri, 22 Mar 2019 06:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553261742; cv=none; d=google.com; s=arc-20160816; b=vuwBqxnq0jCLcvUyMuCDlujSqGD5Eak2rKfzBtB1wd5xneW2vin4OgUrzgRZknrrJ4 LyCmweQ4PPwG7NUg1mQrvmMo95S9RqWZAhdHoRvjtnFk2i00K7muM8zOiLl6eWDBFBpT iCrXyajIfnNPULD1dSjipTmjijv/Wf2UPt4QVb2+kEzybxN38nO6D6jb5ilC/LVj8qY2 ndViPmYVDY9w6Hksmn/8OcpYY18Y6wAFxSUq3K7lxm0buD8JuCsSo5lA9JbEfMS82tsw LqEPGnmk91kFJtPOwClCtqIu2GepT9AcV4K0uuYNQWnZCAoPV8BOqIggzIc51BZUMHlC Nmww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=M+VvVjM8tEJVqNUDg1OUirSMj2THnkfYQkAdFltfPFc=; b=pnWZ1dTvydnDndpCJzHXfHri0g4hjpwru66PRZbjH8jSxHcFFS452UbnlCMcQn/mtY 5sgoKIiGJT9woH6LGBE83QEo1Ut8nxmAGFqeHSOpR07tk0A4t1RFdTqG+qzutw4jQdO1 oUUiyifr39bpQvKVbL1IDdsQTVbjrLZBXltkBjbzMd7SmkyI5cjN53xukAL8Yjaf51X3 vJ12lupMjZ/oKta+J5xBqrhdIZQ2X/+O0avx8Yo/bjU9tqdqZBp+WifcSWYe0ZpfkmJJ JIVZVsMtiUplrfhYVbaedRwFTLJwSML6U0Z6DG5gjtPfIa5TK8bkxujKGSbjaTjfLVBa 1XRw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si296261pll.268.2019.03.22.06.35.27; Fri, 22 Mar 2019 06:35:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728821AbfCVNep (ORCPT + 99 others); Fri, 22 Mar 2019 09:34:45 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:34749 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728140AbfCVNeo (ORCPT ); Fri, 22 Mar 2019 09:34:44 -0400 X-Originating-IP: 90.88.33.153 Received: from aptenodytes (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id AEAF760015; Fri, 22 Mar 2019 13:34:41 +0000 (UTC) Message-ID: Subject: Re: [PATCH] usb: musb: Support gadget mode when the port is set to dual role From: Paul Kocialkowski To: Bin Liu , Maxime Ripard Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Chen-Yu Tsai Date: Fri, 22 Mar 2019 14:34:41 +0100 In-Reply-To: <20190322132846.GD25852@uda0271908> 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> <20190321130133.zllt5pqbrhiecoch@flea> <20190321164138.GB11121@kroah.com> <20190322124622.GB25852@uda0271908> <20190322130953.kb4llrtz2nriyfbu@flea> <20190322132846.GD25852@uda0271908> Organization: Bootlin Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le vendredi 22 mars 2019 à 08:28 -0500, Bin Liu a écrit : > Again, think about an embedded product, if dr_mode is 'otg' which > indicates the peripheral mode will be used at some point, when and how > to load the gadget driver if it is not loaded automatically when Linux > boots up? the end user doesn't have access to the console. Why should we think of an embedded product where the end user doesn't have access to the console? Unless I'm mistaken, the Linux kernel doesn't target commercial products where users are powerless in particular, and leaves out all other use cases (which may or may not be commercial). I don't think this assumption makes any sense in Linux as a project (or that it's sane in any context of software development for that matter, but that's beside the point). > > Because no other controller requires it and therefore it's not > > standard and violates the principle of least surprise? > > I know no other controller does this, but this doesn't mean it is not > standard. > > > And even without taking this into account, there's also the fact that > > while the *hardware* can do dual role, the software might decide > > otherwise. If I don't want to have support for any gadget (at all) in > > the end system, then why should I be forced to compile and load > > something I don't even want to use in the first place? > > then dr_mode should be set to 'host' instead, you don't have to load a > gadget if peripheral mode will never be used. I disagree: dr_mode describes the hardware capabilities, not what the software does with it. -- Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com