Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3984135pxf; Tue, 6 Apr 2021 05:24:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzifArL/vZANqTTrx51Q/c89zBR+Dqxkugva0YIqSuVq3GWqkOFtbnPrivin31Z/CSRMZmo X-Received: by 2002:a05:6e02:1d01:: with SMTP id i1mr22957121ila.171.1617711861523; Tue, 06 Apr 2021 05:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617711861; cv=none; d=google.com; s=arc-20160816; b=hK1AAn42Xz/3iWZk5lt8N2dsVeqdOqT1XDutFh6Z8ZMJHfVuyskm0o0jMOh0jwwNoJ P1RCX69k1ABKZLdwQsMhFSneSUSpzXQNL2Jv8p4lOdYcQNBD28Lw+n1HPESL9yDG+Rjs pDka5v2vis3Zvwi1o2Ex4T4sCd8BEIC7vh2jZoIWzEhyF9c1TtdQmuKZnwKmhOA6Hzuu eHzaYKsZb/zxd+iQ3FzDWRNh+LWxgblnIlAMway+jxeZ3r/YzQ+ZopHWatSNMMx9Y/oW 5lEsA6L3CFQm2ULVo2wAAsHKOeiwGkFJQBzaTILm3FUBgjdclhAU4Xwp7gHf/qiDs8M5 YlvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rgcv33+UDp0u2Q6Hp6HLXP+tMsI0iE4Muyp0O3zsJ1g=; b=Re9LGKA4Q5T4cfU3wASsbI8/Wwbb+VQvL0AttfCQTFe5f64dqGlVkESY58FjpQ9pl9 BPv7ZLrbD42Pi/+JLoD/UU3XilxnsWr5BrOJEhBg1Yn645ddFc/gBdYdVzSuCLadSsTv nkLQpuPq1NJdOlfbjCiZvouQfFENR+kV7JjUyJ++zXUjTIx6fKYzyP2PD3ZFk6AGSPAh IPtUJCozgTUlTr3GudRavR4Bu+6wWKPLNoLgAgRmZnRRQo68J79ynv/c0RFc41EepNWp azwlkOkkXpS+NZG9ppiT84nJzkbMEQxBWepVffr3Oz71zn7eAMOQjr8ry62/Gt3xGGf6 7hYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WzH5CDdh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h4si18153526jav.44.2021.04.06.05.24.07; Tue, 06 Apr 2021 05:24:21 -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=@google.com header.s=20161025 header.b=WzH5CDdh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239293AbhDFBop (ORCPT + 99 others); Mon, 5 Apr 2021 21:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239501AbhDFBon (ORCPT ); Mon, 5 Apr 2021 21:44:43 -0400 Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94C4CC061760 for ; Mon, 5 Apr 2021 18:44:33 -0700 (PDT) Received: by mail-vk1-xa2d.google.com with SMTP id f11so2840887vkl.9 for ; Mon, 05 Apr 2021 18:44:33 -0700 (PDT) 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=rgcv33+UDp0u2Q6Hp6HLXP+tMsI0iE4Muyp0O3zsJ1g=; b=WzH5CDdhkWte9pD3FsLaA3CmZCzZc5M20EXUZpl76FPfYEjuvw0/C9BLjx/lD5j1t8 Y0yty4ko3PvYyX5R+HIaMWTcZdvFuViNeJsWBaGPyTgMG5dRriFFozSLjtyJWFU9iIR0 GSOcpLzDmS4irrU+X2/mKsvFbP85MqM12sXEUYWzeAV80/7eTRujLI0EAmmCbGsqnFDT v1wMVN51xmSYQvew8zt5seaPcRPwQFFK0tqk5nBKRky54c6EHba+1Tjn+iQnSo+gwfeN TkOQ2L+EbKzqjfFhYFizh3KdG/+u0bxnmBx8HTZ4Fnd+DT3k4ZylhGWh9ffoaa5V1sUI Pffw== 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=rgcv33+UDp0u2Q6Hp6HLXP+tMsI0iE4Muyp0O3zsJ1g=; b=Zg/sudHm78HKRAV/MhSmMNn6+UOenX9w8vCA4XX2y9ntYLKGPgjXvNx0b/XR7l/mZz pW2qXA1osoXwjek5AO0qQBRZSH1SaQzEx/z+vWiW7Nd6+WjpaKusqBk06SuLPs1PgJ34 9VirD+Ngid61wIIh1dQL8lHIvBjgIpdqCy0Dl4UWqEgMq1i/683Zj3oCWcSiSAro/Ltf 4ycrE6uKDTvjDiOyKCnuPM/NWRSEkGlchsZxVXmlgg2F1w7Ude/Rg5XWWB1kJ3eR+LP3 kFudercJE41R7XbNSTBdwevCOrl5z25BRJ5VgiR8q4Qn5THLue+777I59hZ4x87l43nw qizw== X-Gm-Message-State: AOAM530oHuCHymM7V7mQ3gEoKNkaLFgyYAmoPNldpw5MDK9AdFulfdpN e8nxdpsBbG6Yr43zMuQixlwPQAKmJg9Dhb8jfJE62A== X-Received: by 2002:a05:6122:11a6:: with SMTP id y6mr16290548vkn.6.1617673472563; Mon, 05 Apr 2021 18:44:32 -0700 (PDT) MIME-Version: 1.0 References: <20210317181249.1062995-1-badhri@google.com> In-Reply-To: From: Badhri Jagan Sridharan Date: Mon, 5 Apr 2021 18:43:58 -0700 Message-ID: Subject: Re: [PATCH v2] usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy- To: Adam Thomson Cc: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Adam, Just sent out a patch stack https://patchwork.kernel.org/project/linux-usb/list/?series=461087 to address the issue that you mentioned here. Thanks, Badhri On Mon, Apr 5, 2021 at 6:43 PM Badhri Jagan Sridharan wrote: > > Hi Adam, > > Just sent out a patch stack https://patchwork.kernel.org/project/linux-usb/list/?series=461087 > to address the issue that you mentioned here. > > Thanks, > Badhri > > On Fri, Mar 19, 2021 at 9:32 AM Adam Thomson wrote: >> >> On 18 March 2021 20:40, Badhri Jagan Sridharan wrote: >> >> > > Regarding selecting PDOs or PPS APDOs, surely we should only notify of a >> > change >> > > when we reach SNK_READY which means a new contract has been established? >> > Until >> > > that point it's possible any requested change could be rejected so why inform >> > > clients before we know the settings have taken effect? I could be missing >> > > something here as it's been a little while since I delved into this, but this >> > > doesn't seem to make sense to me. >> > >> > I was trying to keep the power_supply_changed call close to the >> > variables which are used to infer the power supply property values. >> > Since port->pps_data.max_curr is already updated here and that's used >> > to infer the CURRENT_MAX a client could still read this before the >> > request goes through right ? >> >> Actually that's fair but I think the problem here relates to 'max_curr' not >> being reset if the SRC rejects our request when we're swapping between one PPS >> APDO and another PPS APDO. I think the 'max_curr' value should be reverted back >> to the value for the existing PPS APDO we were already using. I suspect the same >> might be true of 'min_volt' and 'max_volt' as well, now I look at it. It might >> actually be prudent to have pending PPS data based on a request, which is only >> committed as active once ACCEPT has been received. >> >> Regarding power_supply_changed() though, I still think we should only notify of >> a change when the requested change has been accepted by the source, in relation >> to these values as they should reflect the real, in-use voltage and current >> values. >>