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 32A0413DBA0 for ; Mon, 16 Mar 2026 15:47:26 +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=1773676047; cv=none; b=PKTtju3kX21c5jRnAxQ7NFyqHZyF8VTPEGR7Cv+5YZISyvui4/kGxyLKfPMsKVaommN1HatD+ZL9xXvnstfb+JphG6dw6twDOf33m/nUfs1b8EKUrQF9+NygApbSPfoVZ20pTpNq1sciO9rmc3dcue6UpGxUwu3soeeKgrCInTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773676047; c=relaxed/simple; bh=7QElDQ031R/n6el9tMvmeNI2VRkdg9ydIOhWB0VJpsE=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=H8qjpxUVII9VarH3i1ykTxmB0b3OiqDi65km+QYK27xsGB1Am4W9WyeWuqZOmvb3n+fBldawGuKvF2wGdykyN2E1hzAGq7ZLIrqtyX958Gjq6He/7kBT2wtEaVYT9YIV4xlTjtM0njhTseigqm63kjJNdnzrGjk9DNIds3Uibb4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dk6e925I; 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="dk6e925I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 744D5C19421; Mon, 16 Mar 2026 15:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773676046; bh=7QElDQ031R/n6el9tMvmeNI2VRkdg9ydIOhWB0VJpsE=; h=Subject:To:Cc:From:Date:From; b=dk6e925IaHE3dq0LM0eA+vE2MdDHcc3QCPPjJYUC26+4gEkg9CHCEi+Ifo2dMcNt0 Bfgt9HXpeOi3i/5SCLeJcIhziiDCLOLuEp0qKlpJfP7uXN3MBCB+g2b8yQlO3BfnpT UqwkUoWriGeUtG5j4B2P5jb2rFDRRRbqBQ6A9ZUo= Subject: FAILED: patch "[PATCH] usb: roles: get usb role switch from parent only for" failed to apply to 6.1-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-parted-wrecker-f718@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 6.1-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-6.1.y git checkout FETCH_HEAD git cherry-pick -x 8345b1539faa49fcf9c9439c3cbd97dac6eca171 # git commit -s git send-email --to '' --in-reply-to '2026031615-parted-wrecker-f718@gregkh' --subject-prefix 'PATCH 6.1.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;