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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yfz6OUbDBXVtQzrb@kuha.fi.intel.com>
Date:   Fri, 4 Feb 2022 12:04:41 +0200
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Guenter Roeck <linux@...ck-us.net>,
        Benson Leung <bleung@...gle.com>,
        Prashant Malani <pmalani@...omium.org>,
        Jameson Thies <jthies@...gle.com>,
        "Regupathy, Rajaram" <rajaram.regupathy@...el.com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/3] usb: typec: Separate USB Power Delivery from USB
 Type-C

Hi Greg,

On Thu, Feb 03, 2022 at 03:55:19PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Feb 03, 2022 at 05:46:55PM +0300, Heikki Krogerus wrote:
> > +/* These additional details are only available with vSafe5V supplies */
> > +static struct kobj_attribute dual_role_power_attr = __ATTR_RO(dual_role_power);
> > +static struct kobj_attribute usb_suspend_supported_attr = __ATTR_RO(usb_suspend_supported);
> > +static struct kobj_attribute unconstrained_power_attr = __ATTR_RO(unconstrained_power);
> > +static struct kobj_attribute usb_communication_capable_attr = __ATTR_RO(usb_communication_capable);
> > +static struct kobj_attribute dual_role_data_attr = __ATTR_RO(dual_role_data);
> > +static struct kobj_attribute
> > +unchunked_extended_messages_supported_attr = __ATTR_RO(unchunked_extended_messages_supported);
> 
> Note, no 'struct device' should ever have a "raw" kobject hanging off of
> it.  If so, something went wrong.
> 
> If you do this, userspace will never be notified of the attributes and
> any userspace representation of the tree will be messed up.
> 
> Please, use an attribute directory with a name, or if you really need to
> go another level deep, use a real 'struct device'.  As-is here, I can't
> take it.

OK, got it. I don't think we can avoid the deeper levels, not without
making this really cryptic, and not really usable in all cases. These
objects are trying to represent (parts) of the protocol - the
messages, the objects in those messages, and later the responses to
those messages.

But I'm also trying to avoid having to claim that these objects are
"devices", because honestly, claiming that the packages used in
communication are devices is confusing, and just wrong. If we take
that road, then we really should redefine what struct device is
supposed to represent, and rename it also.

So would it be OK that, instead of registering these objects as
devices, we just introduce a kset where we can group them
(/sys/kernel/usb_power_delivery)?

thanks,

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ