Messages in this thread | | | From | Badhri Jagan Sridharan <> | Date | Thu, 18 Feb 2021 02:38:45 -0800 | Subject | Re: [PATCH v1] usb: typec: tcpm: Wait for vbus discharge to VSAFE0V before toggling |
| |
Hi Greg,
This patch is a bug fix for the following patch which was introduced in 5.11.
commit f321a02caebdd0c56e167610cda2fa148cd96e8b Author: Badhri Jagan Sridharan <badhri@google.com> Date: Wed Oct 28 23:31:35 2020 -0700
usb: typec: tcpm: Implement enabling Auto Discharge disconnect support
TCPCI spec allows TCPC hardware to autonomously discharge the vbus capacitance upon disconnect. The expectation is that the TCPM enables AutoDischargeDisconnect while entering SNK/SRC_ATTACHED states. Hardware then automously discharges vbus when the vbus falls below a certain threshold i.e. VBUS_SINK_DISCONNECT_THRESHOLD.
Apart from enabling the vbus discharge circuit, AutoDischargeDisconnect is also used a flag to move TCPCI based TCPC implementations into Attached.Snk/Attached.Src state as mentioned in Figure 4-15. TCPC State Diagram before a Connection of the USB Type-C Port Controller Interface Specification. In such TCPC implementations, setting AutoDischargeDisconnect would prevent TCPC into entering "Connection_Invalid" state as well.
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20201029063138.1429760-8-badhri@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks, Badhri
On Thu, Feb 18, 2021 at 2:10 AM Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > On Thu, Feb 18, 2021 at 02:02:43AM -0800, Badhri Jagan Sridharan wrote: > > When vbus auto discharge is enabled, TCPM can sometimes be faster than > > the TCPC i.e. TCPM can go ahead and move the port to unattached state > > (involves disabling vbus auto discharge) before TCPC could effectively > > discharge vbus to VSAFE0V. This leaves vbus with residual charge and > > increases the decay time which prevents tsafe0v from being met. > > This change introduces a new state VBUS_DISCHARGE where the TCPM waits > > for a maximum of tSafe0V(max) for vbus to discharge to VSAFE0V before > > transitioning to unattached state and re-enable toggling. If vbus > > discharges to vsafe0v sooner, then, transition to unattached state > > happens right away. > > > > Also, while in SNK_READY, when auto discharge is enabled, drive > > disconnect based on vbus turning off instead of Rp disappearing on > > CC pins. Rp disappearing on CC pins is almost instanteous compared > > to vbus decay. > > > > Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> > > --- > > drivers/usb/typec/tcpm/tcpm.c | 60 +++++++++++++++++++++++++++++++---- > > 1 file changed, 53 insertions(+), 7 deletions(-) > > As this seems to be a bugfix, what commit does it fix? Should it go to > stable kernels? If so, how far back? > > And as this is the merge window, I can't do anything with this until > 5.12-rc1 is out, so be prepared for the delay... > > thanks, > > greg k-h
| |