public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: badhri@google.com, gregkh@linuxfoundation.org,
	arnaud.ferraris@collabora.com, dsimic@manjaro.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, jun.li@nxp.com
Subject: Re: [PATCH v2 0/2] improve usb_role_switch_is_parent()
Date: Mon, 9 Mar 2026 13:32:40 +0200	[thread overview]
Message-ID: <aa6v2JcjQyEQajKh@kuha> (raw)
In-Reply-To: <20260309074313.2809867-1-xu.yang_2@nxp.com>

Mon, Mar 09, 2026 at 03:43:11PM +0800, Xu Yang kirjoitti:
> This patchset will revert a recent fix patch which will introduce another
> regression, and fix the true underlying issue.
> 
> Arnaud pushed a fix patch commit 1366cd228b0c ("tcpm: allow looking for
> role_sw device in the main node") because commit 2d8713f807a4
> ("tcpm: switch check for role_sw device with fw_node") swap the order of
> usb_role_switch_get() and fwnode_usb_role_switch_get() and this cause the
> fwnode_usb_role_switch_get() return "-EPROBE_DEFER" all the time in his
> usecase.
> 
> The said dts use below property to get role switch device: 
> 
>   fusb0: typec-portc@22 {
>   	  compatible = "fcs,fusb302";
>   	  usb-role-switch = <&typec_extcon_bridge>;
>   	  ...
>    
>   	  connector {
>   	  }
>   }
> 
> So the fix patch works because usb_role_switch_get() will correctly find
> the role switch device in case fwnode_usb_role_switch_get() is failed.
> However, usb_role_switch_get() shouldn't be called at all in this case
> because tcpc->fwnode is already correctly set to @connector. And worse
> more, this bring another issue that is once fwnode_usb_role_switch_get()
> return "-EPROBE_DEFER" this info may be lost if usb_role_switch_get()
> then return NULL.
> 
> After further research into this issue, finally I found
> usb_role_switch_is_parent() not work properly when it parse non-boolean
> "usb-role-switch" property which is for back compatibility purpose. To fix
> the issue, patch#2 is added.
> 
> Xu Yang (2):
>   Revert "tcpm: allow looking for role_sw device in the main node"
>   usb: roles: get usb role switch from parent only for usb-b-connector
> 
>  drivers/usb/roles/class.c     | 7 ++++++-
>  drivers/usb/typec/tcpm/tcpm.c | 2 +-
>  2 files changed, 7 insertions(+), 2 deletions(-)

For the series:

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

Thanks Xu!

-- 
heikki

      parent reply	other threads:[~2026-03-09 11:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09  7:43 [PATCH v2 0/2] improve usb_role_switch_is_parent() Xu Yang
2026-03-09  7:43 ` [PATCH v2 1/2] Revert "tcpm: allow looking for role_sw device in the main node" Xu Yang
2026-03-09  9:12   ` Arnaud Ferraris
2026-03-09  7:43 ` [PATCH v2 2/2] usb: roles: get usb role switch from parent only for usb-b-connector Xu Yang
2026-03-09  9:12   ` Arnaud Ferraris
2026-03-09 19:48   ` Frank Li
2026-03-10  2:47     ` Xu Yang
2026-03-09 11:32 ` 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=aa6v2JcjQyEQajKh@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=arnaud.ferraris@collabora.com \
    --cc=badhri@google.com \
    --cc=dsimic@manjaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=imx@lists.linux.dev \
    --cc=jun.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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