Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1220309imu; Mon, 5 Nov 2018 16:17:59 -0800 (PST) X-Google-Smtp-Source: AJdET5ciKySom193XazvqK1FmoWxfFnoW5YYl5sEtwCdLwVnD9V/i9hdWPUstVfOQrAF3ZejbbAo X-Received: by 2002:a17:902:bc44:: with SMTP id t4-v6mr23589665plz.300.1541463479930; Mon, 05 Nov 2018 16:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541463479; cv=none; d=google.com; s=arc-20160816; b=KY7pgkR9lzrkmzruk6VTJVHLLi4BQmcT04I1JO6RwyrGoIOz0KdyTxr6c/TV3CUbmz c7o45BdAEwsT1YXUdWrm9DLxyIYhI1MHGMkL8R8UEhT79/K6ntlqanZ0FG5CZIwO59ZX Y+GLTW4DWLhmKTjqmsCEa8EKkmxySyFxeSGqgRW3lG08S1gKwB4Ly8F/tmDkKr7mSHZV hhDAeGKYq1uc6omi2A4LUNW+CdGPB1TYiM6iagaxhFqnyB5PoaFyBkaXI9gVUZKdpIK1 Rs4pgaddOMgqLGfgvMOXyq3yZaI+MO/nt2nUjvcmNwnAxG4pWPVj6V5zAEuLVD1eEW/b f1EQ== 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=0IgQmPMuONbf/jroYcUop5JoTdZG60Yj4YKkksGzoF8=; b=q+VMyK+g+5M3u2spS1G2qCoIdqYubE9qqALxSbhx9TqE9C1s8b4wMUJjTXpCC20bBr 6HXVsrVvm9l+nVLLZRKvsdo4Ma0MjLe/E/gyQiCY6iu6x4K8mYUD/V7zTaiztaF4Zj0x np6E4OJTWLwzHCHdl0rV8EPojRJhen5Dcm34KdnGNekqpROE1RyHmYyqXTvW+V0SKet8 O95HsEbaJqznob9tWzn+sM32o9AfAbwxoSV3Ia4ArMXyxfEP5owF29V49etkYpOaITHC uyJ+Aem4gf9Zz4MNXIWjtYF86oo46H92vlxq5zRrrSsPJ0NXuh5MqVG5bEU43m/fo5+6 CS6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZxKA8ICA; 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 1-v6si15437971plw.81.2018.11.05.16.17.44; Mon, 05 Nov 2018 16:17:59 -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=ZxKA8ICA; 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 S1729144AbeKFJiX (ORCPT + 99 others); Tue, 6 Nov 2018 04:38:23 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:42141 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbeKFJiX (ORCPT ); Tue, 6 Nov 2018 04:38:23 -0500 Received: by mail-oi1-f194.google.com with SMTP id x63-v6so5507052oix.9 for ; Mon, 05 Nov 2018 16:16:02 -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=0IgQmPMuONbf/jroYcUop5JoTdZG60Yj4YKkksGzoF8=; b=ZxKA8ICAjqhYhfC/l4gMeRxTW4oytZHl116F6g4IHDEWphkdZkf0LKH4mcPhtIeV98 GOfX61FTnuyk17SRO81d9VyGtiJBvYt/QMOoNpjRSLP9gmcKeF7OufzFY1UgXytp2e8I yrtmkAmoVd2p9egDVfk8Q85Ezu6Mych6qVHmBcUV4hpxvBcmm9k8gChAH0bJ0wQDu3wq 1YudZtvB30k1zkFUWzbaTcDe7Pm5oAtB4b7i0KakDEzXp02hhDDHixOylOQ5SSqvobHU lCwE2NCvZNrby7GL/qF1r7mv1+uK6pBwJA5eHHkU8h6Je9KzmHD/EIKwQPGDYkNDheOD teHQ== 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=0IgQmPMuONbf/jroYcUop5JoTdZG60Yj4YKkksGzoF8=; b=Jm8X9ma1VvPbVIEqwohoxu8bUDcvXlMYzw6wWmUilP9vQChAdl6KHXuqTfIuut16e9 TcHBNaLYx6nNd31CA2rYT7opcoPh8CUVCujdYnuWXdtaUdfQqs95o18Md8wb/5TZWv4m 7gVyDJyE/io49LzZwaJwnbpSH/uLjatrL+ACehgEpx34bfiVNt6QiVN0uA64tIW8I5JS d9SGEZkGv9E2U7iRpSyQiVched/NkKjoj1ExuHsemdMPKuMmopaErjtqVrnlDrq3Ndg7 i313xSrpHk9uiBTWck4Gh6ssv1RMKEpkZ7kr0P63V6dWJyXdG0hTrjeKZVyZeMJ1Nb2+ zDKA== X-Gm-Message-State: AGRZ1gLv7yKaIWIV4ZD9Hw5TNFvi5igEVPUPDx0zTyz2BWia+ZYweqgZ NLrrKFD4AIiHRKW8qFwjSe+r1pL0dkfLrhpWxdtgtw== X-Received: by 2002:aca:f1d6:: with SMTP id p205-v6mr14737058oih.332.1541463361388; Mon, 05 Nov 2018 16:16:01 -0800 (PST) MIME-Version: 1.0 References: <20181001194501.58338-1-badhri@google.com> <20181001194501.58338-3-badhri@google.com> <20181102132847.GC6543@kuha.fi.intel.com> In-Reply-To: <20181102132847.GC6543@kuha.fi.intel.com> From: Badhri Jagan Sridharan Date: Mon, 5 Nov 2018 16:15:24 -0800 Message-ID: Subject: Re: [PATCH v3 3/3] usb: typec: tcpm: charge current handling for sink during hard reset To: Heikki Krogerus Cc: robh+dt@kernel.org, mark.rutland@arm.com, Greg Kroah-Hartman , cw00.choi@samsung.com, a.hajda@samsung.com, jun.li@nxp.com, Guenter Roeck , jackp@codeaurora.org, devicetree@vger.kernel.org, LKML , USB 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 Hi Heikki, Rob, Thanks for reviewing ! Should I update the patchset with the Reviewed-by tag and bumpup the patchset version ? Or is that not necessary? Thanks, Badhri. On Fri, Nov 2, 2018 at 6:28 AM Heikki Krogerus wrote: > > On Mon, Oct 01, 2018 at 12:45:01PM -0700, Badhri Jagan Sridharan wrote: > > During the initial connect to a non-pd port, sink would hard reset > > twice before deeming that the port partner is non-pd. TCPM sets the > > the charge path to false during the hard reset. This causes unnecessary > > connects/disconnects of charge path and makes port take longer to > > charge from the non-pd ports. Avoid this by not setting the charge path > > to false unless the partner has already identified to be pd capable. > > > > When partner is a pd port, set the charge path to false in > > SNK_HARD_RESET_SINK_OFF. Set the current limits to default value based > > of CC pull up and resume the charge path when port enters > > SNK_HARD_RESET_SINK_ON. > > > > Signed-off-by: Badhri Jagan Sridharan > > Reviewed-by: Heikki Krogerus > > > -------- > > Changes in V3: > > Rebase on top of usb-next > > > > Changes in V2: > > Based on feedback of jackp@codeaurora.org > > - vsafe_5v_hard_reset flag from tcpc_config is removed > > - Patch only differentiates between pd port partner and non-pd port > > partner > > > > V1 version of the patch is here: > > https://lkml.org/lkml/2018/9/14/11 > > --- > > drivers/usb/typec/tcpm/tcpm.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > > index c3ac0e46106b..c25a69922ee6 100644 > > --- a/drivers/usb/typec/tcpm/tcpm.c > > +++ b/drivers/usb/typec/tcpm/tcpm.c > > @@ -3273,7 +3273,8 @@ static void run_state_machine(struct tcpm_port *port) > > case SNK_HARD_RESET_SINK_OFF: > > memset(&port->pps_data, 0, sizeof(port->pps_data)); > > tcpm_set_vconn(port, false); > > - tcpm_set_charge(port, false); > > + if (port->pd_capable) > > + tcpm_set_charge(port, false); > > tcpm_set_roles(port, port->self_powered, TYPEC_SINK, > > TYPEC_DEVICE); > > /* > > @@ -3305,6 +3306,12 @@ static void run_state_machine(struct tcpm_port *port) > > * Similar, dual-mode ports in source mode should transition > > * to PE_SNK_Transition_to_default. > > */ > > + if (port->pd_capable) { > > + tcpm_set_current_limit(port, > > + tcpm_get_current_limit(port), > > + 5000); > > + tcpm_set_charge(port, true); > > + } > > tcpm_set_attached_state(port, true); > > tcpm_set_state(port, SNK_STARTUP, 0); > > break; > > -- > > 2.19.0.605.g01d371f741-goog > > thanks, > > -- > heikki