From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Michael Wu <michael@allwinnertech.com>
Cc: gregkh@linuxfoundation.org, linux@roeck-us.net,
badhri@google.com, kyletso@google.com, frank.wang@rock-chips.com,
rdbabiera@google.com, xu.yang_2@nxp.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: tcpm: support sink port for debounce
Date: Tue, 12 Mar 2024 13:07:59 +0200 [thread overview]
Message-ID: <ZfA3jzTqn8jNIsLZ@kuha.fi.intel.com> (raw)
In-Reply-To: <20240312011300.75081-1-michael@allwinnertech.com>
On Tue, Mar 12, 2024 at 09:13:00AM +0800, Michael Wu wrote:
> When both CC1 and CC2 pins are simultaneously pulled up, it often leads
> to the double Rp to Vbus cable being stuck in the SNK_ATTACH_WAIT state.
> And the state machine fails to transition to the SNK_ATTACHED state.
>
> Therefore, it is recommended to focus on transitioning the sink port to
> the SNK_DEBOUNCED state instead. By doing so, the desired outcome can be
> achieved more effectively.
Recommended by whom (or what)?
> [ 134.525750] VBUS on
> [ 134.713240] CC1: 0 -> 3, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected]
> [ 134.713249] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
>
> Signed-off-by: Michael Wu <michael@allwinnertech.com>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 0965972310275..9228dbd78bf2b 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4197,6 +4197,8 @@ static void run_state_machine(struct tcpm_port *port)
> else if (tcpm_port_is_disconnected(port))
> tcpm_set_state(port, SNK_UNATTACHED,
> PD_T_PD_DEBOUNCE);
> + else if (tcpm_port_is_sink(port))
> + tcpm_set_state(port, SNK_DEBOUNCED, 0);
> break;
> case SNK_DEBOUNCED:
> if (tcpm_port_is_disconnected(port))
> --
> 2.29.0
--
heikki
prev parent reply other threads:[~2024-03-12 11:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 1:13 [PATCH] usb: typec: tcpm: support sink port for debounce Michael Wu
2024-03-12 11:07 ` Heikki Krogerus [this message]
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=ZfA3jzTqn8jNIsLZ@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=badhri@google.com \
--cc=frank.wang@rock-chips.com \
--cc=gregkh@linuxfoundation.org \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=michael@allwinnertech.com \
--cc=rdbabiera@google.com \
--cc=xu.yang_2@nxp.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).