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 C75CC246BC6 for ; Mon, 16 Mar 2026 15:47:18 +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=1773676038; cv=none; b=NUYAkvRo5YvczTJ7tTMmpGK7QkCBkQEmvFxHPD55rKTtIETpFRMzrehQnzFaS/XhXUSC3034VJcRe7i6HaYMvgVt3+BYvYnk/UTubu9iXSrXhhZZB+Z3YcyjLftD5eRK6Xn30rYJdcuS8mfR/VFxqtxHB92/gtysJnoWTslCZHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773676038; c=relaxed/simple; bh=Il8h6ZbZDwR91hhkfYH3c+g4CveJkYAcCzeJHfInFU4=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=sim/TaDWmU+FHn2faxxGFr+0T8x5uoponU6MEZ+zrTm0zidC5pbeqYVyYnLIZzN5SJhaUW5HSte00Va89cH0PaQ0Z4ymZ2e1n22dudlAne0NBvSLYMEXh0NRB8/33esvZF6BCfGp91TIoJwoECNUiwJAal3Z7fVS1Gqtn/Xgxvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HKHxawqt; 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="HKHxawqt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1AA9C19421; Mon, 16 Mar 2026 15:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773676038; bh=Il8h6ZbZDwR91hhkfYH3c+g4CveJkYAcCzeJHfInFU4=; h=Subject:To:Cc:From:Date:From; b=HKHxawqtpw50qUwyPb5fyY6SSORE96y2qHE+K+6mzDH6+4ugftg9DXo/F7ep2t/Px stdabwPXpAMLxlqOCbCmkGFmCtGu4bHyt2N0wna7r7/0SFcnvYexzrFkDtWOZ1NQ9M 2a1NO5zY3zCtcVeQsL8UzX3acFKlSlTsuphYT0e0= Subject: FAILED: patch "[PATCH] usb: roles: get usb role switch from parent only for" failed to apply to 5.15-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:47:15 +0100 Message-ID: <2026031615-celibate-diabolic-3dae@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.15-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.15.y git checkout FETCH_HEAD git cherry-pick -x 8345b1539faa49fcf9c9439c3cbd97dac6eca171 # git commit -s git send-email --to '' --in-reply-to '2026031615-celibate-diabolic-3dae@gregkh' --subject-prefix 'PATCH 5.15.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;