Re: [RFC PATCH] software node: Skip duplicated software_node sysfs

From: Qian Cai
Date: Fri Nov 05 2021 - 14:47:51 EST




On 11/1/21 7:51 PM, Andy Shevchenko wrote:
> No, it’s not so easy. What you are doing is a papering over the real issue
> which is the limitation of the firmware nodes to two. What we need is to
> drop the link from struct fwnode_handle, move it to upper layer and modify
> all fwnode ops to be used over the list of fwnode:s.
>
> XHCI driver and DWC3 are sharing the primary fwnode, but at the same time
> they wanted to have _different_ secondary ones when role is switched. This
> can’t be done in the current design. And here is the symptom what you got.

Andy, thanks for the pointers so far. I was able to trace
set_primary_fwnode() and set_secondary_fwnode().

Anyway, what's the "upper layer"? Is that "struct device" or "struct
swnode"? I suppose you meant:

- Remove "secondary" field from "struct fwnode_handle".
- Replace "fwnode" from "upper layer" with
"struct list_head fwnode_head;".
- Modify all functions in "software_node_ops" to use "fwnode_head".

Is that correct?