From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbcBPJWq (ORCPT ); Tue, 16 Feb 2016 04:22:46 -0500 Received: from mga04.intel.com ([192.55.52.120]:36129 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754321AbcBPJWl (ORCPT ); Tue, 16 Feb 2016 04:22:41 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,454,1449561600"; d="scan'208";a="915854809" Date: Tue, 16 Feb 2016 11:22:38 +0200 From: Heikki Krogerus To: Oliver Neukum Cc: Greg KH , Felipe Balbi , Mathias Nyman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 2/3] usb: type-c: USB Type-C Connector System Software Interface Message-ID: <20160216092238.GA18565@kuha.fi.intel.com> References: <1455037283-106479-1-git-send-email-heikki.krogerus@linux.intel.com> <1455037283-106479-3-git-send-email-heikki.krogerus@linux.intel.com> <20160209182155.GC31787@kroah.com> <20160210103042.GB5270@kuha.fi.intel.com> <20160210172035.GA28335@kroah.com> <20160211135011.GA32213@kuha.fi.intel.com> <1455550218.22176.11.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455550218.22176.11.camel@suse.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Feb 15, 2016 at 04:30:18PM +0100, Oliver Neukum wrote: > On Thu, 2016-02-11 at 15:50 +0200, Heikki Krogerus wrote: > > Because USB Type-C ports (DRP ones) will select the data role randomly > > when you connect (to an other DRP port). USB Type-C spec defines that > > you can "prefer" host mode, but when both ends prefer host mode, it's > > +-0. > > That question has not been answered. It would be awkward for the OS > to find itself in the slave role, which it is ill equipped for. So > the data role should be switched before the new device is announced > to user space. How is that handled? In the class driver, once we add support for preselecting the role, when the connection happens we compare the initial role to the preselected one and execute swap if it differs. Only after that we notify userspace. Thanks, -- heikki