Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp483914pxb; Wed, 14 Apr 2021 22:09:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV410T7v5Lc/jgGD48A95TOCUMmcSuPXF2CrazQ8YoKDYPS5wu9+msTbSxdP89s+mt1wmz X-Received: by 2002:a17:90a:5998:: with SMTP id l24mr1826344pji.76.1618463398418; Wed, 14 Apr 2021 22:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618463398; cv=none; d=google.com; s=arc-20160816; b=IGmAaL18u/nZwjhogR5gzLLgQuvxw73FM24X9JErisjV5qfzEulnGe0fwpSarculkj ImmhlGwrpStAFx7dAKrbfJFS8Gp+WrnZZ+Lqy90QQe5GQJXPyC8wBHDPttWayuDc/Pb6 nAURmADppcOPq71W7hVTUAK4y8E5nB+70Qusnroi87u3V9WjmXmD72zfsOgwQ4q2CVz5 i4WV0dSYjNEDsy+ozns76OXogoLckT1KO1Kj4T9fE9FqHEv68JFlVuuKshcutRALSz/i 1WIOdCzYXcmZejIZcYIjsxfSmvJQecCqKZKJKHYu+PKbOcWwy0esJTZNOUgFqFWqy/Ih M2Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=wHXzK63q7f3Ph2jTuZ2S2HL4D1pNx0GhiiLf2ScqMB8=; b=T1RDYK9iJpWQ60rHIKBzztjztczFOfJthz06nBCNsaWeuWeJd7USfi1AKFsxk2qjvI a2i87Ghq/MXrAE+WOp8p4Zbht4VQU4jz0rMtC1lb0BiSHcftUqZvVx9jmczwj8gFshiS 9WmntrIHuaCbPQ9/XvZ7KOCtkB5mlxPB/9WBqubHNOEdj3vNW7hNl3GtC9lfqNNsgxn+ 02lkZuedlG0+5M61fzuffk1M7OzQX/o64TTzeSwiIHNg0AVv9sfk9kPodWtPdfei05Kd NkEM4R+E6gffQqh3163f2+LzXt0Xzm2E0/NFwpaXK/Ym6nBqMlO10HMgLft3mu1VwyXP LrnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hsacU01v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si2137874plk.56.2021.04.14.22.09.45; Wed, 14 Apr 2021 22:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hsacU01v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbhDOFI2 (ORCPT + 99 others); Thu, 15 Apr 2021 01:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbhDOFI0 (ORCPT ); Thu, 15 Apr 2021 01:08:26 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D937DC061574; Wed, 14 Apr 2021 22:08:02 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id o13-20020a9d404d0000b029028e0a0ae6b4so2473675oti.10; Wed, 14 Apr 2021 22:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wHXzK63q7f3Ph2jTuZ2S2HL4D1pNx0GhiiLf2ScqMB8=; b=hsacU01vV36Kn0EU1gyeRa3WBq/eDvljiiMKI2DInVqFCUecshLDS9NheIeAxSc+b1 n06rBU3tkiD15gXkKXq3dG+thy4hxdGnlnf/r4hW3L5Hrio6uIBNrKKh5xHEwdicvG65 xNfzPyy8qB1fCuKXWB+XZZy/HARASezNZklxreA6EUHbciCjQ3AId4qRRSn1IpMTjBwm JQxuVQpysp2aNDVV8YEnS3d0uC29d+5YR0iPg3dW9FQ3jOrPFYM10cnEBcOghLsAqBhE FQoxe6C3GXSZ+9MDGtNIPOKdQx4esC70WDZ3cxXAsD7BseA3j1WPhz3N2L8PleWS5IeQ Nk+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=wHXzK63q7f3Ph2jTuZ2S2HL4D1pNx0GhiiLf2ScqMB8=; b=IeyuXkSUJyL7LsNZbrEmaC0zyvpduM00qwQ8k3e5zUAHwbc4haGIpXKzMAzZAGQ358 IoQxnfU4ZKmVFwhoSO45m7Sko+6pwi9S/nmXDGseHZCsXukVflpohS+xTWaqMiASjc+q NdNSLsxSNDRtHBYDECMsB8Oa2lgXMckBg7Tn+jcJmql9NPmkBUtRjS1MLc+R4YO8DKjX w/5qOmCg+3UIX7tORL/hDntUE1NEnoOvszASRzr/5+15aD/46kXt/XrJ7lW5YGtNNIDo rsz0RMMQJDvSHbHi+m+WiALAL7HD6kcJc9cBm3kDSN6lH6KMiXnkEHkHZNJCPCOLxo4v etgw== X-Gm-Message-State: AOAM530BRI2Y2wnG6wZkhthLfyjin9Av7DPdKMQNsTht8UosmPL3TW7G ETvFeaOJbvslmW+OdpTPOUA= X-Received: by 2002:a9d:204:: with SMTP id 4mr32182otb.352.1618463282281; Wed, 14 Apr 2021 22:08:02 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c22sm421569otf.13.2021.04.14.22.08.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Apr 2021 22:08:01 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH v1] usb: typec: tcpm: Fix error while calculating PPS out values To: Badhri Jagan Sridharan , Heikki Krogerus , Greg Kroah-Hartman , Adam Thomson Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kyle Tso References: <20210415050121.1928298-1-badhri@google.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3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nBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: Date: Wed, 14 Apr 2021 22:07:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210415050121.1928298-1-badhri@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/14/21 10:01 PM, Badhri Jagan Sridharan wrote: > "usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply" > introduced a regression for req_out_volt and req_op_curr calculation. > > req_out_volt should consider the newly calculated max voltage instead > of previously accepted max voltage by the port partner. Likewise, > req_op_curr should consider the newly calculated max current instead > of previously accepted max current by the port partner. > > Fixes: e3a072022487 ("usb: typec: tcpm: Address incorrect values of tcpm psy for pps supply") > Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 1c32bdf62852..04652aa1f54e 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -3132,10 +3132,10 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port) > port->pps_data.req_max_volt = min(pdo_pps_apdo_max_voltage(src), > pdo_pps_apdo_max_voltage(snk)); > port->pps_data.req_max_curr = min_pps_apdo_current(src, snk); > - port->pps_data.req_out_volt = min(port->pps_data.max_volt, > - max(port->pps_data.min_volt, > + port->pps_data.req_out_volt = min(port->pps_data.req_max_volt, > + max(port->pps_data.req_min_volt, > port->pps_data.req_out_volt)); > - port->pps_data.req_op_curr = min(port->pps_data.max_curr, > + port->pps_data.req_op_curr = min(port->pps_data.req_max_curr, > port->pps_data.req_op_curr); > } > >