Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1332047imu; Tue, 11 Dec 2018 17:40:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/XPtkcprxoTI8QuliHwLu4wC2EzOI6yKvFs5hsaaK/+glksxkTz3TkjVNWERhCpjehbnVNu X-Received: by 2002:a62:e201:: with SMTP id a1mr18052384pfi.75.1544578854567; Tue, 11 Dec 2018 17:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544578854; cv=none; d=google.com; s=arc-20160816; b=XfMTDxxo8bfHs2WZJFMNyJlLuTK/+IOrBo34wZVyCPhPRtmoIAjtbILiXClPx8ViNm +ZEW578E9kNR1poowm2J/2gqiCzFiPF+fRRsdHFQDrtFc5FYqHvPmBTyroVC9MH0kdM5 /+K5Zd54R79GvvvF89GgFCen8TZtnOTyhzbKG8Yasjkm5oi87FzHUQwz3y6uH4r0Npdf rPcbbnTvIk1f6GA9zvD6YC/yndKGGEhVBMbfdZVc5/q3P6M+/v6adoN9TCHVMXKTub0N PLBd15SRLwo06Wr+MrB+PqJAZILurDDzU/Gm4tgwJTdTa843jyg8phwSZ7I5auopKV86 PoBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kRLb3PwR+JWZugChYugReqx6KbzwlhqR5I2ARRy0y9c=; b=uciEtP1RHfvVYIlcD45v5RVTDaEjg53osiLT5tR6Bw8nxpxLzVMtqiif0VBhesnoSR q61PbOeq3sxpp82U3PfaaHwuQJNUAF3BrhcCMjqBqDdshPr95lsJ6Ksanvo4QjHMXv6E snAgeLyuX4jgp2AAyzhNBy4rptY7VbqzU4V3ua7/bn/fmTBNpHaaO/r8bko0Co6bMgZj ZXuKD6q6x00OyvWVU4Vz92P7/ot+LcgPnCCKByjxm69I5fI+m7DYurSa1BR1ca06J92X 4YtFuG+mKSFGKdDycrrkN+1mi9aU1GZ4OEVB3PTe6MH4PCRG6wmjmwD68a+2FvBTvJBR 7Pqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pGMJo+AZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si14114707pfi.134.2018.12.11.17.40.39; Tue, 11 Dec 2018 17:40:54 -0800 (PST) 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=@google.com header.s=20161025 header.b=pGMJo+AZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbeLLBik (ORCPT + 99 others); Tue, 11 Dec 2018 20:38:40 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46439 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbeLLBij (ORCPT ); Tue, 11 Dec 2018 20:38:39 -0500 Received: by mail-qt1-f194.google.com with SMTP id y20so18765853qtm.13 for ; Tue, 11 Dec 2018 17:38:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kRLb3PwR+JWZugChYugReqx6KbzwlhqR5I2ARRy0y9c=; b=pGMJo+AZcdpEe4x5VhG8S/IULoZZkQZkg9q3lAbEe1v7OGxwMzceKriGKZQtoSKAOK B4OjmzmqzrnuR4ncUNI9gq0X8l3l5CJuqfk6uoABb3cRB+DuBtfTK4es1fr5SZyZpwUC awIIhPUoahgbD5MdHKOMeBOUuiUL6Tj8tHjeDNlddWBEnNyeo/8IfCDPdMBy5TW62QOg JOEaooy71Vqunxce9PP0cn2ao0NB5GckY/Ixt0qjxBml0OsFA1jESsO1NxhrffEp/jnb te+jzvbEm+85eo+c/Szv7sLabawIJ/8gNMbvhDc1Qsn5NRUmzjtDo6VUvAxzrTEz6fNA nkAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kRLb3PwR+JWZugChYugReqx6KbzwlhqR5I2ARRy0y9c=; b=Nn+n1o2hPQib2mCKhuw2NLgY04Daae0ur/3YJ/R8FM6jTSLKbO7PfK+NCywbo/fHg2 EjVwaECbWFlnhioHPrS8bmUyT9b6JR34DTpFhR1eg5zM1OGAWoJt7EK6IRoGL5fi3jSQ 9CAWg/UAyPAp/QO1zhNKN9kGTlyHLS98qijpR7znXOzFmZIadpwT/otiu3EF82OGbvIQ QEleybWfh2YBIST7jgJISb6f7mMLxWc2Mkv+Bebwh+3jlYoHA4mXkDgfMV3X65Bu00tB kQpfLwrxJKhuQnpG0yXTM3EYv9sPwU359aGubQ4mpDRw/tcU21eKe7B55F/E+JaJQ4Xh exbQ== X-Gm-Message-State: AA+aEWab7rQp9pENAvkZ83M3NMuKvK3fdQWrYWL93ZBHJ8gUedFkXhZS 5V2vJvlOZMWMG/lSKSvtPGRuxy//HcSnN6QS+sA7Lw== X-Received: by 2002:ac8:108e:: with SMTP id a14mr17188725qtj.86.1544578718224; Tue, 11 Dec 2018 17:38:38 -0800 (PST) MIME-Version: 1.0 References: <20181206030227.9507-1-kyletso@google.com> <20181206175625.GA11808@roeck-us.net> In-Reply-To: <20181206175625.GA11808@roeck-us.net> From: Kyle Tso Date: Wed, 12 Dec 2018 09:38:26 +0800 Message-ID: Subject: Re: [PATCH] usb: typec: tcpm: Extend the matching rules on PPS APDO selection To: linux@roeck-us.net Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, Badhri Jagan Sridharan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 7, 2018 at 1:56 AM Guenter Roeck wrote: > > On Thu, Dec 06, 2018 at 11:02:27AM +0800, Kyle Tso wrote: > > Current matching rules ensure that the voltage range of selected Source > > Capability is entirely within the range defined in one of the Sink > > Capabilities. This is reasonable but not practical because Sink may not > > support wide range of voltage when sinking power while Source could > > advertise its capabilities in raletively wider range. For example, a > > Source PDO advertising 3.3V-11V@3A (9V Prog of Fixed Nominal Voltage) > > will not be selected if the Sink requires 5V-12V@3A PPS power. However, > > the Sink could work well if the requested voltage range in RDOs is > > 5V-11V@3A. > > > > Maybe a graphical description would help ? > > Currently accepted: > |--------- source -----| > |----------- sink ---------------| > > Currently not accepted: > > |--------- source -----| > |----------- sink ---------------| > > |--------- source -----| > |----------- sink ---------------| > > |--------- source -----------------| > |------ sink -------| > Sorry for late reply. I was on vacation. Thanks for the suggestion. I will update the commit message. > > To improve the usability, change the matching rules to what listed > > below: > > a. The Source PDO is selectable if any portion of the voltage range > > overlaps one of the Sink PDO's voltage range. > > b. The maximum operational voltage will be the lower one between the > > selected Source PDO and the matching Sink PDO. > > c. The maximum power will be the maximum operational voltage times the > > maximum current defined in the selected Source PDO > > d. Select the Source PDO with the highest maximum power > > > > Signed-off-by: Kyle Tso > > Makes sense to me. I am a bit concerned that it might cause odd regressions, > though. Did you test it with a few adapters ? > > With the expectation that you did, > > Reviewed-by: Guenter Roeck > Yes I have tested this patch with 3 different brands of adapters with PPS capabilities. thanks, Kyle