linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: ChiYuan Huang <u0084500@gmail.com>
Cc: Jun Li <jun.li@nxp.com>, Jun Li <lijun.kernel@gmail.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	cy_huang <cy_huang@richtek.com>
Subject: Re: [PATCH] usb: typec: tcpm: Fix if vbus before cc, hard_reset_count not reset issue
Date: Sat, 10 Oct 2020 08:46:46 -0700	[thread overview]
Message-ID: <20201010154646.GA248582@roeck-us.net> (raw)
In-Reply-To: <CADiBU38-jX=4sbQ9aFoA=Xr6S7cFbfQy8tpdohoZdpaY-AK-Vw@mail.gmail.com>

On Sat, Oct 10, 2020 at 12:06:13AM +0800, ChiYuan Huang wrote:
[ ... ]
> 
> Like I mentioned before, whatever the condition is, hard_reset_count
> must be reset to zero during tcpm_detach.
> 
> But refer to Guenter's mail,  he prefer to narrow down the condition
> to reset this counter.
> 
> I think the original thought is important why to put this line there.
> 
> Hi, Guenter:
>    From the discussion, we really need to know why you put the reset
> line below port attached is false and also make some judgement.
> I think there may be ome condition that we don't considered.
> 
As I am sure I have mentioned before, it was to handle misbehaving
partners, to enforce that the system goes into error recovery state
and (hopefully) recover the partner enough to be able to reconnect.
This is the same reason why resetting the counter is commented out
in SRC_SEND_CAPABILITIES and reset in SRC_READY instead. The typical
sequence was that the state machine would process from SRC_UNATTACHED
to some point and then stall / time out, but never be in disconnected
state.

Always resetting the hard reset counter in tcpm_detach() would disable
error recovery in that situation, and affected partners would never
recover. Effectively it would disable error recovery in any state machine
cycle which involves an unattached state, which makes me really question
if it is indeed mandated by the specification to reset the hard reset
counter at that point.

Guenter

  parent reply	other threads:[~2020-10-10 22:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 15:35 [PATCH] usb: typec: tcpm: Fix if vbus before cc, hard_reset_count not reset issue cy_huang
2020-09-02 16:57 ` Guenter Roeck
2020-09-03 16:21   ` ChiYuan Huang
2020-09-04 19:41     ` Guenter Roeck
2020-09-05  1:24       ` ChiYuan Huang
2020-09-05 15:51         ` Guenter Roeck
2020-09-06 15:22           ` ChiYuan Huang
2020-09-15  3:07             ` ChiYuan Huang
2020-10-02 13:31               ` Greg KH
2020-10-02 14:26                 ` Guenter Roeck
2020-10-05 11:08                   ` Greg KH
2020-10-05 15:30                     ` Guenter Roeck
2020-10-06  4:37                       ` ChiYuan Huang
2020-10-06 16:52                         ` Jun Li
2020-10-06 17:39                           ` ChiYuan Huang
2020-10-07 10:13                             ` ChiYuan Huang
2020-10-09  6:12                               ` Jun Li
2020-10-09 16:06                                 ` ChiYuan Huang
2020-10-10 11:21                                   ` Jun Li
2020-10-10 19:31                                     ` Guenter Roeck
2020-10-12  6:22                                       ` ChiYuan Huang
2020-10-12  9:25                                         ` Jun Li
2020-10-12  8:58                                       ` Jun Li
2020-10-10 15:46                                   ` Guenter Roeck [this message]
2020-10-09  2:58                             ` Jun Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201010154646.GA248582@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=cy_huang@richtek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jun.li@nxp.com \
    --cc=lijun.kernel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=u0084500@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).