From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754451AbdEQNCy (ORCPT ); Wed, 17 May 2017 09:02:54 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:42522 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753826AbdEQNCu (ORCPT ); Wed, 17 May 2017 09:02:50 -0400 Subject: Re: [PATCH] usb: typec: Defer checking of valid power role swap to low level drivers To: Heikki Krogerus References: <20170517073219.8315-1-Badhri@google.com> <1495006472.30577.6.camel@suse.com> <2b7e6715-35b8-0d4a-fb28-3a59bd72916e@roeck-us.net> <20170517123830.GE5322@kuha.fi.intel.com> Cc: Oliver Neukum , Badhri Jagan Sridharan , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org From: Guenter Roeck Message-ID: <0fc66212-d613-b297-68a7-722c913efedc@roeck-us.net> Date: Wed, 17 May 2017 06:02:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170517123830.GE5322@kuha.fi.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/17/2017 05:38 AM, Heikki Krogerus wrote: > Hi guys, > > On Wed, May 17, 2017 at 02:36:44AM -0700, Guenter Roeck wrote: >> On 05/17/2017 12:34 AM, Oliver Neukum wrote: >>> Am Mittwoch, den 17.05.2017, 00:32 -0700 schrieb Badhri Jagan >>> Sridharan: >>> >>> Hi, >>> >>>> "Two independent set of mechanisms are defined to allow a USB Type-C >>>> DRP to functionally swap power and data roles. When USB PD is >>>> supported, power and data role swapping is performed as a subsequent >>>> step following the initial connection process. For non-PD implementations, >>>> power/data role swapping can optionally be dealt with as part of the initial >>>> connection process." >>> >>> Well, as I read it, without PD once a connection is established, you >>> are stuck with your role. So it seems to me that blocking a later >>> attempt to change it makes sense. >>> >> >> That seems to be a harsh and not very user friendly reading of the specification. >> >> I would argue that the user doesn't care if the partner supports PD or not >> when selecting a role, and I would prefer to provide an implementation which is >> as user friendly as possible. > > I agree. But I have to point out that at least with UCSI, the role > swapping is usually not possible without USB PD connection. > > So what I'm trying to say is that we can't really promise that role > swapping will ever be possible in all cases without PD, which may mean > different behavior depending on the platform. I don't know if that is > a huge problem. > > How predictable do we want this interface to function with role > swapping? > We can only do as good as we can, but we should not preclude it either. PR_SWAP and other swap operations fail a lot in practice with many dongles, just because the PD protocol implementation isn't always stable. So even that won't be predictable for some time to come. As Badhri pointed out earlier, at least some low cost devices won't support PD. Since we are talking about high volume products, we _have_ to make it as user friendly as we can, if for nothing else to reduce the number of customer service calls, repeated bug filings, and, last but not least, to avoid bad press. Thanks, Guenter