From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E3893A254D for ; Mon, 16 Mar 2026 15:46:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773675995; cv=none; b=e6J5mX4M79yflPw1BukPfFLZTtIU/+nCY0CPjwRwYFwy633OnKb/c/3k66P4F4aWH+sAaAl3HMmM2b1GVeh9astyIJ6/NE7hD92/Ir7TriR9ST4CErrlYfLd9XncH7LXbIw3BkrnjxQ0xLBrbr7p+CfAbsR29QswEtIQepwG464= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773675995; c=relaxed/simple; bh=hcmcijAfZTDXsn8HFy1hMZYMdNdXANUnydw5bdD1q8Q=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=BfO2xano9tV8KcnuYK7zZVRq6btXExBmhuxwn0rjmo2Fap1Xll0ifjVThrFobxbnKlsZfkbJW/MDAD8V+Le/jaTAGfUo2Eyezyf18apgAfRP/RF9YCN9ArbB3qDcumtfngTeu4Ohf4/+lEOg1ll6P4kZZxIZUOyVK/ctT6iUlgk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SRCHlyin; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SRCHlyin" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8121C19421; Mon, 16 Mar 2026 15:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773675995; bh=hcmcijAfZTDXsn8HFy1hMZYMdNdXANUnydw5bdD1q8Q=; h=Subject:To:Cc:From:Date:From; b=SRCHlyinUU6yU3TQr/VKa3tL3tKdN1UaT+FdyKdSzjysBznaZs2eUGm/ZHFZCkesG 4LrZz6oYJ6iJOwwN/m5lwleM0c2TbVhU7oCskNZExmh3Hl/gDQwBDm8ir0dvoOiJ6u lhMW769nFMgKJT3aSmXiuRb/bJWQQ/6zstoDgHak= Subject: FAILED: patch "[PATCH] usb: roles: get usb role switch from parent only for" failed to apply to 5.10-stable tree To: xu.yang_2@nxp.com,arnaud.ferraris@collabora.com,gregkh@linuxfoundation.org,heikki.krogerus@linux.intel.com,stable@kernel.org Cc: From: Date: Mon, 16 Mar 2026 16:46:30 +0100 Message-ID: <2026031630-flier-referee-3151@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 8345b1539faa49fcf9c9439c3cbd97dac6eca171 # git commit -s git send-email --to '' --in-reply-to '2026031630-flier-referee-3151@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 8345b1539faa49fcf9c9439c3cbd97dac6eca171 Mon Sep 17 00:00:00 2001 From: Xu Yang Date: Mon, 9 Mar 2026 15:43:13 +0800 Subject: [PATCH] usb: roles: get usb role switch from parent only for usb-b-connector 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. Fixes: 6fadd72943b8 ("usb: roles: get usb-role-switch from parent") Cc: stable Signed-off-by: Xu Yang Tested-by: Arnaud Ferraris Reviewed-by: Heikki Krogerus Link: https://patch.msgid.link/20260309074313.2809867-3-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c index b8e28ceca51e..edec139b68b5 100644 --- a/drivers/usb/roles/class.c +++ b/drivers/usb/roles/class.c @@ -139,9 +139,14 @@ static void *usb_role_switch_match(const struct fwnode_handle *fwnode, const cha static struct usb_role_switch * usb_role_switch_is_parent(struct fwnode_handle *fwnode) { - struct fwnode_handle *parent = fwnode_get_parent(fwnode); + struct fwnode_handle *parent; struct device *dev; + if (!fwnode_device_is_compatible(fwnode, "usb-b-connector")) + return NULL; + + parent = fwnode_get_parent(fwnode); + if (!fwnode_property_present(parent, "usb-role-switch")) { fwnode_handle_put(parent); return NULL;