Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757658AbdIIQ6c (ORCPT ); Sat, 9 Sep 2017 12:58:32 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:38171 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757463AbdIIQ6a (ORCPT ); Sat, 9 Sep 2017 12:58:30 -0400 X-Google-Smtp-Source: ADKCNb4IPwWIETZ1s34zN5x9iJB62tzRnHrnWl0n3Omix3Sfusw/pO/EQniirot/PjvoufqH8T2aow== Subject: Re: [PATCH 1/2] staging: typec: tcpm: Validate source and sink caps From: Guenter Roeck To: Greg Kroah-Hartman , Badhri Jagan Sridharan Cc: devel@driverdev.osuosl.org, LKML References: <20170908012214.19047-1-Badhri@google.com> <20170908094559.GC2914@kroah.com> <20170908191325.GC19702@kroah.com> Message-ID: <38d93094-fb31-0f3e-0f71-d0361dd51154@roeck-us.net> Date: Sat, 9 Sep 2017 09:58:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2596 Lines: 55 On 09/09/2017 09:54 AM, Guenter Roeck wrote: > On 09/08/2017 12:13 PM, Greg Kroah-Hartman wrote: >> On Fri, Sep 08, 2017 at 10:29:52AM -0700, Badhri Jagan Sridharan wrote: >>> On Fri, Sep 8, 2017 at 2:45 AM, Greg Kroah-Hartman >>> wrote: >>>> On Thu, Sep 07, 2017 at 06:22:13PM -0700, Badhri Jagan Sridharan wrote: >>>>> The source and sink caps should follow the following rules. >>>>> This patch validates whether the src_caps/snk_caps adheres >>>>> to it. >>>>> >>>>> 6.4.1 Capabilities Message >>>>> A Capabilities message (Source Capabilities message or Sink >>>>> Capabilities message) shall have at least one Power >>>>> Data Object for vSafe5V. The Capabilities message shall also >>>>> contain the sending Port’s information followed by up to >>>>> 6 additional Power Data Objects. Power Data Objects in a >>>>> Capabilities message shall be sent in the following order: >>>>> >>>>> 1. The vSafe5V Fixed Supply Object shall always be the first object. >>>>> 2. The remaining Fixed Supply Objects, if present, shall be sent >>>>> in voltage order; lowest to highest. >>>>> 3. The Battery Supply Objects, if present shall be sent in Minimum >>>>> Voltage order; lowest to highest. >>>>> 4. The Variable Supply (non-battery) Objects, if present, shall be >>>>> sent in Minimum Voltage order; lowest to highest. >>>>> >>>>> Errors in source/sink_caps of the local port will prevent >>>>> the port registration. Whereas, errors in source caps of partner >>>>> device would only log them. >>>>> >>>>> Signed-off-by: Badhri Jagan Sridharan >>>>> --- >>>>> drivers/staging/typec/pd.h | 2 + >>>>> drivers/staging/typec/tcpm.c | 107 +++++++++++++++++++++++++++++++++++++++---- >>>>> drivers/staging/typec/tcpm.h | 16 +++---- >>>>> 3 files changed, 108 insertions(+), 17 deletions(-) >>>> >>>> Before you add more stuff to this driver, what is needed to get it out >>>> of staging? That would be more useful to do now, right? >>> >>> Actually not adding more features here. There was a bug where >>> the phone wasnt charging at the highest possible power output, >>> came up with the these patches while debugging that issue. >> >> Ok, but again, when is this going to get out of staging? >> > I have a set of patches ready to do just that. It only moves tcpm - tcpci > is still untested as far as I know, and fusb302 has unapproved devicetree > properties. > Actually, the dt properties are Acked by Rob, so we can move that driver as well (TODO is a bit misleading there). I'll add that to the patch series. Guenter