lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 5 Nov 2021 21:39:42 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Qian Cai <quic_qiancai@...cinc.com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] software node: Skip duplicated software_node sysfs

On Fri, Nov 5, 2021 at 8:47 PM Qian Cai <quic_qiancai@...cinc.com> wrote:
> 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().

Can you share the trace you have got?

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

struct device here.

> - 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?

Yes.

It might be a bit complicated taking into account how much fwnode is
spreaded in the kernel... Basically, you need to fix all direct
accesses to the dev->fwnode first.
Besides that you need to check that fwnode, which is used out of the
device scope, like in IRQ domains, doesn't use secondary pointer(s).

This nevertheless adds a lot of flexibility and we may add whatever
type of fwnodes and mix them together.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ