Re: [PATCH 5.10 189/491] usb: roles: get usb role switch from parent only for usb-b-connector

Greg Kroah-Hartman
2026-04-23T12:16:43Z

On Wed, Apr 15, 2026 at 01:55:42PM +0200, Ben Hutchings wrote:
> On Mon, 2026-04-13 at 17:57 +0200, Greg Kroah-Hartman wrote:
> > 5.10-stable review patch. If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Xu Yang <xu.yang_2@nxp.com>
> >
> > [ Upstream commit 8345b1539faa49fcf9c9439c3cbd97dac6eca171 ]
> >
> > usb_role_switch_is_parent() was walking up to the parent node and checking
> > for the "usb-role-switch" property regardless of the type of the passed
> > fwnode. This could cause unrelated device nodes to be probed as potential
> > role switch parent, leading to spurious matches and "-EPROBE_DEFER" being
> > returned infinitely.
> >
> > Till now only Type-B connector node will have a parent node which may
> > present "usb-role-switch" property and register the role switch device.
> > For Type-C connector node, its parent node will always be a Type-C chip
> > device which will never register the role switch device. However, it may
> > still present a non-boolean "usb-role-switch = <&usb_controller>" property
> > for historical compatibility.
> >
> > So restrict the helper to only operate on Type-B connector when attempting
> > to get the role switch from parent node.
>
> Is this safe to backport? It seems like very few device trees on older
> branches have the compatible string that will now be required.

I think it is, as it fixes a bug for those systems that did not properly
enable it.

thanks,

greg k-h