Skip to content

Commit 28ec344

Browse files
Saravana Kannangregkh
authored andcommitted
usb: typec: tcpm: Don't block probing of consumers of "connector" nodes
fw_devlink expects DT device nodes with "compatible" property to have struct devices created for them. Since the connector node might not be populated as a device, mark it as such so that fw_devlink knows not to wait on this fwnode being populated as a struct device. Without this patch, USB functionality can be broken on some boards. Fixes: f7514a6 ("of: property: fw_devlink: Add support for remote-endpoint") Reported-by: John Stultz <[email protected]> Tested-by: John Stultz <[email protected]> Signed-off-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6efb943 commit 28ec344

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

drivers/base/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void fwnode_links_purge(struct fwnode_handle *fwnode)
150150
fwnode_links_purge_consumers(fwnode);
151151
}
152152

153-
static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
153+
void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
154154
{
155155
struct fwnode_handle *child;
156156

@@ -164,6 +164,7 @@ static void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
164164
fwnode_for_each_available_child_node(fwnode, child)
165165
fw_devlink_purge_absent_suppliers(child);
166166
}
167+
EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
167168

168169
#ifdef CONFIG_SRCU
169170
static DEFINE_MUTEX(device_links_lock);

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5754,6 +5754,15 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
57545754
if (!fwnode)
57555755
return -EINVAL;
57565756

5757+
/*
5758+
* This fwnode has a "compatible" property, but is never populated as a
5759+
* struct device. Instead we simply parse it to read the properties.
5760+
* This it breaks fw_devlink=on. To maintain backward compatibility
5761+
* with existing DT files, we work around this by deleting any
5762+
* fwnode_links to/from this fwnode.
5763+
*/
5764+
fw_devlink_purge_absent_suppliers(fwnode);
5765+
57575766
/* USB data support is optional */
57585767
ret = fwnode_property_read_string(fwnode, "data-role", &cap_str);
57595768
if (ret == 0) {

include/linux/fwnode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,6 @@ extern u32 fw_devlink_get_flags(void);
187187
extern bool fw_devlink_is_strict(void);
188188
int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup);
189189
void fwnode_links_purge(struct fwnode_handle *fwnode);
190+
void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
190191

191192
#endif

0 commit comments

Comments
 (0)