Soundwire: clean up sysfs group creation
Subsystems (2)
Greg Kroah-Hartman
maintainercover Soundwire: clean up sysfs group creation
Note, this is a redone version of a very old series I wrote back in 2022:
https://lore.kernel.org/r/[email protected]
but everyone has forgotten about it now, and I've reworked it, so I'm considering it a "new" version, and not v2.
Here's a series that adds the functionality to the driver core to hide entire attribute groups, in a much saner way than we have attempted in the past (i.e. dynamically figuring it out.) Many thanks to Dan for this patch. I'll also be taking this into my driver-core branch and creating a stable tag for anyone else to pull from to get it into their trees, as I think it will want to be in many for this development cycle.
After the driver core change, there's cleanups to the soundwire core for how the attribute groups are created, to remove the "manual" creation of them, and allow the driver core to create them correctly, as needed, when needed, which makes things much smaller for the soundwire code to manage.
Comments appreciated!
thanks,
greg k-h
Dan Williams (1):
sysfs: Introduce a mechanism to hide static attribute_groups
Greg Kroah-Hartman (5):
soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list
of groups
soundwire: sysfs: cleanup the logic for creating the dp0 sysfs
attributes
soundwire: sysfs: have the driver core handle the creation of the
device groups
soundwire: sysfs: remove sdw_slave_sysfs_init()
soundwire: sysfs: remove unneeded ATTRIBUTE_GROUPS() comments
drivers/soundwire/bus_type.c | 5 ++- drivers/soundwire/sysfs_local.h | 4 +- drivers/soundwire/sysfs_slave.c | 64 ++++++++++++++--------------- drivers/soundwire/sysfs_slave_dpn.c | 3 ++ fs/sysfs/group.c | 45 ++++++++++++++++---- include/linux/sysfs.h | 63 ++++++++++++++++++++++------ 6 files changed, 126 insertions(+), 58 deletions(-)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 1/6 sysfs: Introduce a mechanism to hide static attribute_groups
From: Dan Williams <[email protected]>
Add a mechanism for named attribute_groups to hide their directory at sysfs_update_group() time, or otherwise skip emitting the group directory when the group is first registered. It piggybacks on is_visible() in a similar manner as SYSFS_PREALLOC, i.e. special flags in the upper bits of the returned mode. To use it, specify a symbol prefix to DEFINE_SYSFS_GROUP_VISIBLE(), and then pass that same prefix to SYSFS_GROUP_VISIBLE() when assigning the @is_visible() callback:
DEFINE_SYSFS_GROUP_VISIBLE($prefix)
struct attribute_group $prefix_group = {
.name = $name,
.is_visible = SYSFS_GROUP_VISIBLE($prefix),
};SYSFS_GROUP_VISIBLE() expects a definition of $prefix_group_visible() and $prefix_attr_visible(), where $prefix_group_visible() just returns true / false and $prefix_attr_visible() behaves as normal.
The motivation for this capability is to centralize PCI device authentication in the PCI core with a named sysfs group while keeping that group hidden for devices and platforms that do not meet the requirements. In a PCI topology, most devices will not support authentication, a small subset will support just PCI CMA (Component Measurement and Authentication), a smaller subset will support PCI CMA + PCIe IDE (Link Integrity and Encryption), and only next generation server hosts will start to include a platform TSM (TEE Security Manager).
Without this capability the alternatives are:
* Check if all attributes are invisible and if so, hide the directory. Beyond trouble getting this to work [1], this is an ABI change for scenarios if userspace happens to depend on group visibility absent any attributes. I.e. this new capability avoids regression since it does not retroactively apply to existing cases.
* Publish an empty /sys/bus/pci/devices/$pdev/tsm/ directory for all PCI devices (i.e. for the case when TSM platform support is present, but device support is absent). Unfortunate that this will be a vestigial empty directory in the vast majority of cases.
* Reintroduce usage of runtime calls to sysfs_{create,remove}_group() in the PCI core. Bjorn has already indicated that he does not want to see any growth of pci_sysfs_init() [2].
* Drop the named group and simulate a directory by prefixing all TSM-related attributes with "tsm_". Unfortunate to not use the naming capability of a sysfs group as intended.
In comparison, there is a small potential for regression if for some reason an @is_visible() callback had dependencies on how many times it was called. Additionally, it is no longer an error to update a group that does not have its directory already present, and it is no longer a WARN() to remove a group that was never visible.
--- fs/sysfs/group.c | 45 ++++++++++++++++++++++++------- include/linux/sysfs.h | 63 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 87 insertions(+), 21 deletions(-)
fs/sysfs/group.c +36 -9
@@ -31,6 +31,17 @@ static void remove_files(struct kernfs_node *parent,kernfs_remove_by_name (parent, (*bin_attr)->attr.name); } +static umode_t __first_visible (const struct attribute_group *grp,struct kobject *kobj) +{ +if (grp->attrs && grp->is_visible) +return grp->is_visible (kobj, grp->attrs[0 ],0 ); + +if (grp->bin_attrs && grp->is_bin_visible) +return grp->is_bin_visible (kobj, grp->bin_attrs[0 ],0 ); + +return 0 ; +} +static int create_files (struct kernfs_node *parent,struct kobject *kobj,kuid_t uid,kgid_t gid,const struct attribute_group *grp,int update)
@@ -52,6 +63,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,kernfs_remove_by_name (parent, (*attr)->name);if (grp->is_visible) { mode = grp->is_visible (kobj, *attr, i); + mode &= ~SYSFS_GROUP_INVISIBLE ;if (!mode)continue ; }
@@ -81,6 +93,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj, (*bin_attr)->attr.name);if (grp->is_bin_visible) { mode = grp->is_bin_visible (kobj, *bin_attr, i); + mode &= ~SYSFS_GROUP_INVISIBLE ;if (!mode)continue ; }
@@ -127,16 +140,31 @@ static int internal_create_group(struct kobject *kobj, int update,kobject_get_ownership (kobj, &uid, &gid);if (grp->name) { +umode_t mode =__first_visible (grp, kobj); + +if (mode &SYSFS_GROUP_INVISIBLE ) + mode =0 ; +else + mode =S_IRWXU |S_IRUGO |S_IXUGO ; +if (update) { kn =kernfs_find_and_get (kobj->sd, grp->name);if (!kn) { -pr_warn ("Can't update unknown attr grp name: %s/%s\n" , - kobj->name, grp->name); -return -EINVAL ; +pr_debug ("attr grp %s/%s not created yet\n" , + kobj->name, grp->name); +/* may have been invisible prior to this update */ + update =0 ; + }else if (!mode) { +sysfs_remove_group (kobj, grp); +kernfs_put (kn); +return 0 ; } - }else { - kn =kernfs_create_dir_ns (kobj->sd, grp->name, -S_IRWXU |S_IRUGO |S_IXUGO , + } + +if (!update) { +if (!mode) +return 0 ; + kn =kernfs_create_dir_ns (kobj->sd, grp->name, mode, uid, gid, kobj,NULL );if (IS_ERR (kn)) {if (PTR_ERR (kn) == -EEXIST )
@@ -279,9 +307,8 @@ void sysfs_remove_group(struct kobject *kobj,if (grp->name) { kn =kernfs_find_and_get (parent, grp->name);if (!kn) { -WARN (!kn,KERN_WARNING -"sysfs group '%s' not found for kobject '%s'\n" , - grp->name,kobject_name (kobj)); +pr_debug ("sysfs group '%s' not found for kobject '%s'\n" , + grp->name,kobject_name (kobj));return ; } }else {
include/linux/sysfs.h +51 -12
86 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 2/6 soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups
In reply to Greg Kroah-HartmanThe sysfs logic already creates a list of groups for the device, so add the sdw_slave_dev_attr_group group to that list instead of having to do a two-step process of adding a group list and then an individual group.
This is a step on the way to moving all of the sysfs attribute handling into the default driver core attribute group logic so that the soundwire core does not have to do any of it manually.
--- drivers/soundwire/sysfs_slave.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/soundwire/sysfs_slave.c +10 -5
@@ -105,7 +105,10 @@ static struct attribute *slave_attrs[] = { &dev_attr_modalias.attr, NULL, }; -ATTRIBUTE_GROUPS (slave); + +static const struct attribute_group slave_attr_group = { + .attrs = slave_attrs, +};static struct attribute *slave_dev_attrs[] = { &dev_attr_mipi_revision.attr,
@@ -190,6 +193,12 @@ static const struct attribute_group dp0_group = { .name = "dp0", }; +static const struct attribute_group *slave_groups[] = { + &slave_attr_group, + &sdw_slave_dev_attr_group, +NULL , +}; +int sdw_slave_sysfs_init (struct sdw_slave *slave) {int ret;
@@ -198,10 +207,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave)if (ret <0 )return ret; - ret =devm_device_add_group (&slave->dev, &sdw_slave_dev_attr_group); -if (ret <0 ) -return ret; -if (slave->prop.dp0_prop) { ret =devm_device_add_group (&slave->dev, &dp0_group);if (ret <0 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 3/6 soundwire: sysfs: cleanup the logic for creating the dp0 sysfs attributes
In reply to Greg Kroah-HartmanThere's no need to special-case the dp0 sysfs attributes, the is_visible() callback in the attribute group can handle that for us, so add that and add it to the attribute group list making the logic simpler overall.
This is a step on the way to moving all of the sysfs attribute handling into the default driver core attribute group logic so that the soundwire core does not have to do any of it manually.
--- drivers/soundwire/sysfs_slave.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)
drivers/soundwire/sysfs_slave.c +22 -6
@@ -184,18 +184,40 @@ static struct attribute *dp0_attrs[] = { NULL, }; +static umode_t dp0_attr_visible (struct kobject *kobj,struct attribute *attr, +int n) +{ +struct sdw_slave *slave =dev_to_sdw_dev (kobj_to_dev (kobj)); + +if (slave->prop.dp0_prop) +return attr->mode; +return 0 ; +} + +static bool dp0_group_visible (struct kobject *kobj) +{ +struct sdw_slave *slave =dev_to_sdw_dev (kobj_to_dev (kobj)); + +if (slave->prop.dp0_prop) +return true; +return false; +} +DEFINE_SYSFS_GROUP_VISIBLE (dp0); +/* * we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory * for dp0-level properties */ static const struct attribute_group dp0_group = { .attrs = dp0_attrs, + .is_visible =SYSFS_GROUP_VISIBLE (dp0), .name ="dp0" , };static const struct attribute_group *slave_groups[] = { &slave_attr_group, &sdw_slave_dev_attr_group, + &dp0_group,NULL , };
@@ -207,12 +229,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave)if (ret <0 )return ret; -if (slave->prop.dp0_prop) { - ret =devm_device_add_group (&slave->dev, &dp0_group); -if (ret <0 ) -return ret; - } -if (slave->prop.source_ports || slave->prop.sink_ports) { ret =sdw_slave_sysfs_dpn_init (slave);if (ret <0 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 4/6 soundwire: sysfs: have the driver core handle the creation of the device groups
In reply to Greg Kroah-HartmanThe driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Take advantage of that by converting this driver to use this by moving the sysfs attributes into a group and assigning the dev_groups pointer to it.
--- drivers/soundwire/bus_type.c | 1 + drivers/soundwire/sysfs_local.h | 3 +++ drivers/soundwire/sysfs_slave.c | 6 +----- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/soundwire/bus_type.c +1 -0
@@ -221,6 +221,7 @@ int __sdw_register_driver(struct sdw_driver *drv, struct module *owner) drv->driver.probe = sdw_drv_probe; drv->driver.remove = sdw_drv_remove; drv->driver.shutdown = sdw_drv_shutdown; + drv->driver.dev_groups = sdw_attr_groups;return driver_register (&drv->driver); }
drivers/soundwire/sysfs_local.h +3 -0
@@ -11,6 +11,9 @@/* basic attributes to report status of Slave (attachment, dev_num) */ extern const struct attribute_group *sdw_slave_status_attr_groups[]; +/* attributes for all soundwire devices */ +extern const struct attribute_group *sdw_attr_groups[]; +/* additional device-managed properties reported after driver probe */ int sdw_slave_sysfs_init (struct sdw_slave *slave);int sdw_slave_sysfs_dpn_init (struct sdw_slave *slave);
drivers/soundwire/sysfs_slave.c +1 -5
@@ -214,7 +214,7 @@ static const struct attribute_group dp0_group = { .name = "dp0", }; -static const struct attribute_group *slave_groups[] = { +const struct attribute_group *sdw_attr_groups[] = { &slave_attr_group, &sdw_slave_dev_attr_group, &dp0_group,
@@ -225,10 +225,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave) {int ret; - ret =devm_device_add_groups (&slave->dev, slave_groups); -if (ret <0 ) -return ret; -if (slave->prop.source_ports || slave->prop.sink_ports) { ret =sdw_slave_sysfs_dpn_init (slave);if (ret <0 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/6 soundwire: sysfs: remove sdw_slave_sysfs_init()
In reply to Greg Kroah-HartmanNow that sdw_slave_sysfs_init() only calls sdw_slave_sysfs_dpn_init(), just do that instead and remove sdw_slave_sysfs_init() to get it out of the way to save a bit of logic and code size.
--- drivers/soundwire/bus_type.c | 4 ++-- drivers/soundwire/sysfs_local.h | 1 - drivers/soundwire/sysfs_slave.c | 13 ------------- drivers/soundwire/sysfs_slave_dpn.c | 3 +++ 4 files changed, 5 insertions(+), 16 deletions(-)
drivers/soundwire/bus_type.c +2 -2
@@ -126,8 +126,8 @@ static int sdw_drv_probe(struct device *dev)if (slave->prop.use_domain_irq)sdw_irq_create_mapping (slave); -/* init the sysfs as we have properties now */ - ret =sdw_slave_sysfs_init (slave); +/* init the dynamic sysfs attributes we need */ + ret =sdw_slave_sysfs_dpn_init (slave);if (ret <0 )dev_warn (dev,"Slave sysfs init failed:%d\n" , ret);
drivers/soundwire/sysfs_local.h +0 -1
@@ -15,7 +15,6 @@ extern const struct attribute_group *sdw_slave_status_attr_groups[];extern const struct attribute_group *sdw_attr_groups[];/* additional device-managed properties reported after driver probe */ -int sdw_slave_sysfs_init (struct sdw_slave *slave);int sdw_slave_sysfs_dpn_init (struct sdw_slave *slave);#endif /* __SDW_SYSFS_LOCAL_H */
drivers/soundwire/sysfs_slave.c +0 -13
@@ -221,19 +221,6 @@ const struct attribute_group *sdw_attr_groups[] = { NULL, }; -int sdw_slave_sysfs_init (struct sdw_slave *slave) -{ -int ret; - -if (slave->prop.source_ports || slave->prop.sink_ports) { - ret =sdw_slave_sysfs_dpn_init (slave); -if (ret <0 ) -return ret; - } - -return 0 ; -} -/* * the status is shown in capital letters for UNATTACHED and RESERVED * on purpose, to highligh users to the fact that these status values
drivers/soundwire/sysfs_slave_dpn.c +3 -0
@@ -283,6 +283,9 @@ int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave)int ret;int i; +if (!slave->prop.source_ports && !slave->prop.sink_ports) +return 0 ; + mask = slave->prop.source_ports;for_each_set_bit (i, &mask,32 ) { ret =add_all_attributes (&slave->dev, i,1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/6 soundwire: sysfs: remove unneeded ATTRIBUTE_GROUPS() comments
In reply to Greg Kroah-HartmanNow that we manually created our own attribute group list, the outdated ATTRIBUTE_GROUPS() comments can be removed as they are not needed at all.
--- drivers/soundwire/sysfs_slave.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/soundwire/sysfs_slave.c +0 -8
@@ -129,10 +129,6 @@ static struct attribute *slave_dev_attrs[] = { NULL, }; -/* -* we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory -* for device-level properties -*/ static const struct attribute_group sdw_slave_dev_attr_group = { .attrs = slave_dev_attrs, .name ="dev-properties" ,
@@ -204,10 +200,6 @@ static bool dp0_group_visible(struct kobject *kobj) }DEFINE_SYSFS_GROUP_VISIBLE (dp0); -/* -* we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory -* for dp0-level properties -*/ static const struct attribute_group dp0_group = { .attrs = dp0_attrs, .is_visible =SYSFS_GROUP_VISIBLE (dp0),
Signature · 1 line
2.43.0
Re: [PATCH 2/6] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups
In reply to Greg Kroah-HartmanQuoted 49 lines · Greg Kroah-Hartman
The sysfs logic already creates a list of groups for the device, so add the
sdw_slave_dev_attr_groupgroup to that list instead of having to do a two-step process of adding a group list and then an individual group.This is a step on the way to moving all of the sysfs attribute handling into the default driver core attribute group logic so that the soundwire core does not have to do any of it manually.
Cc Vinod Koul <[email protected]>Cc Bard Liao <[email protected]>Cc Pierre-Louis Bossart <[email protected]>Cc Sanyog Kale <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/soundwire/sysfs_slave.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/soundwire/sysfs_slave.c +10
-1@@ -105,7 +105,10 @@ static struct attribute *slave_attrs[] = { &dev_attr_modalias.attr, NULL, }; -ATTRIBUTE_GROUPS (slave); + +static const struct attribute_group slave_attr_group = { + .attrs = slave_attrs, +};static struct attribute *slave_dev_attrs[] = { &dev_attr_mipi_revision.attr,@@ -190,6 +193,12 @@ static const struct attribute_group dp0_group = { .name = "dp0", }; +static const struct attribute_group *slave_groups[] = { + &slave_attr_group, + &sdw_slave_dev_attr_group, +NULL , +}; +int sdw_slave_sysfs_init (struct sdw_slave *slave) {int ret;
drivers/soundwire/sysfs_slave.c int sdw_slave_sysfs_init(struct sdw_slave *slave) · line 204
Quoted 7 lines
drivers/soundwire/sysfs_slave.c +0
-4@@ -198,10 +207,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave)if (ret <0 )return ret; - ret =devm_device_add_group (&slave->dev, &sdw_slave_dev_attr_group); -if (ret <0 ) -return ret; -
Yeah, open-coding the groups, much better than dynamically adding one.
drivers/soundwire/sysfs_slave.c int sdw_slave_sysfs_init(struct sdw_slave *slave) · line 212
Quoted 3 lines
drivers/soundwire/sysfs_slave.c +0
-0if (slave->prop.dp0_prop) { ret =devm_device_add_group (&slave->dev, &dp0_group);if (ret <0 )
Makes sense. I won't say "looks good" as this file has "slave" all over the place, but I checked and it entered the kernel just before the CodingStyle changed.
Re: [PATCH 3/6] soundwire: sysfs: cleanup the logic for creating the dp0 sysfs attributes
In reply to Greg Kroah-HartmanQuoted 37 lines · Greg Kroah-Hartman
There's no need to special-case the dp0 sysfs attributes, the
is_visible()callback in the attribute group can handle that for us, so add that and add it to the attribute group list making the logic simpler overall.This is a step on the way to moving all of the sysfs attribute handling into the default driver core attribute group logic so that the soundwire core does not have to do any of it manually.
Cc Vinod Koul <[email protected]>Cc Bard Liao <[email protected]>Cc Pierre-Louis Bossart <[email protected]>Cc Sanyog Kale <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/soundwire/sysfs_slave.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)drivers/soundwire/sysfs_slave.c +9
-0@@ -184,18 +184,40 @@ static struct attribute *dp0_attrs[] = { NULL, }; +static umode_t dp0_attr_visible (struct kobject *kobj,struct attribute *attr, +int n) +{ +struct sdw_slave *slave =dev_to_sdw_dev (kobj_to_dev (kobj)); + +if (slave->prop.dp0_prop) +return attr->mode; +return 0 ; +}
drivers/soundwire/sysfs_slave.c static struct attribute *dp0_attrs[] = { · line 205
Quoted 10 lines
drivers/soundwire/sysfs_slave.c +10
-0+ +static bool dp0_group_visible (struct kobject *kobj) +{ +struct sdw_slave *slave =dev_to_sdw_dev (kobj_to_dev (kobj)); + +if (slave->prop.dp0_prop) +return true; +return false; +} +DEFINE_SYSFS_GROUP_VISIBLE (dp0);
What do you think of the following for cases like these where attr_visible is trivially derivable from group_visible?
include/linux/sysfs.h +9 -0
@@ -117,6 +117,15 @@ struct attribute_group { return name##_attr_visible(kobj, attr, n); \ } +#define DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE (name) \ + static inline umode_t sysfs_group_visible_##name( \ + struct kobject *kobj, struct attribute *a, int n) \ + { \ + if (n == 0 && !name##_group_visible(kobj)) \ + return SYSFS_GROUP_INVISIBLE; \ + return a->mode; \ + } +/* * Same as DEFINE_SYSFS_GROUP_VISIBLE, but for groups with only binary * attributes
...i.e. don't require $prefix_attr_visible() to be defined?
With or without that:
Re: [PATCH 4/6] soundwire: sysfs: have the driver core handle the creation of the device groups
In reply to Greg Kroah-HartmanQuoted 58 lines · Greg Kroah-Hartman
The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Take advantage of that by converting this driver to use this by moving the sysfs attributes into a group and assigning the
dev_groupspointer to it.Cc Vinod Koul <[email protected]>Cc Bard Liao <[email protected]>Cc Pierre-Louis Bossart <[email protected]>Cc Sanyog Kale <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/soundwire/bus_type.c | 1 + drivers/soundwire/sysfs_local.h | 3 +++ drivers/soundwire/sysfs_slave.c | 6 +----- 3 files changed, 5 insertions(+), 5 deletions(-)drivers/soundwire/bus_type.c +1
-0@@ -221,6 +221,7 @@ int __sdw_register_driver(struct sdw_driver *drv, struct module *owner) drv->driver.probe = sdw_drv_probe; drv->driver.remove = sdw_drv_remove; drv->driver.shutdown = sdw_drv_shutdown; + drv->driver.dev_groups = sdw_attr_groups;return driver_register (&drv->driver); }drivers/soundwire/sysfs_local.h +3
-0@@ -11,6 +11,9 @@/* basic attributes to report status of Slave (attachment, dev_num) */ extern const struct attribute_group *sdw_slave_status_attr_groups[]; +/* attributes for all soundwire devices */ +extern const struct attribute_group *sdw_attr_groups[]; +/* additional device-managed properties reported after driver probe */ int sdw_slave_sysfs_init (struct sdw_slave *slave);int sdw_slave_sysfs_dpn_init (struct sdw_slave *slave);drivers/soundwire/sysfs_slave.c +1
-1@@ -214,7 +214,7 @@ static const struct attribute_group dp0_group = { .name = "dp0", }; -static const struct attribute_group *slave_groups[] = { +const struct attribute_group *sdw_attr_groups[] = { &slave_attr_group, &sdw_slave_dev_attr_group, &dp0_group,
drivers/soundwire/sysfs_slave.c int sdw_slave_sysfs_init(struct sdw_slave *slave) · line 231
Quoted 7 lines
drivers/soundwire/sysfs_slave.c +0
-4@@ -225,10 +225,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave) {int ret; - ret =devm_device_add_groups (&slave->dev, slave_groups); -if (ret <0 ) -return ret; -
The subtle scary thing about this usage in general is that this makes the sysfs attributes live before it is known that the driver probe succeeded. So beyond the cleanup of using devm to do something that the driver-core already handles it removes a hard to reason about race compared to the well known lifetime of driver->dev_groups.
Re: [PATCH 5/6] soundwire: sysfs: remove sdw_slave_sysfs_init()
In reply to Greg Kroah-HartmanQuoted 11 lines · Greg Kroah-Hartman
Now that
sdw_slave_sysfs_init()only callssdw_slave_sysfs_dpn_init(), just do that instead and removesdw_slave_sysfs_init()to get it out of the way to save a bit of logic and code size.Cc Vinod Koul <[email protected]>Cc Bard Liao <[email protected]>Cc Pierre-Louis Bossart <[email protected]>Cc Sanyog Kale <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Looks correct.
Re: [PATCH 6/6] soundwire: sysfs: remove unneeded ATTRIBUTE_GROUPS() comments
In reply to Greg Kroah-HartmanQuoted 31 lines · Greg Kroah-Hartman
Now that we manually created our own attribute group list, the outdated
ATTRIBUTE_GROUPS()comments can be removed as they are not needed at all.Cc Vinod Koul <[email protected]>Cc Bard Liao <[email protected]>Cc Pierre-Louis Bossart <[email protected]>Cc Sanyog Kale <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/soundwire/sysfs_slave.c | 8 -------- 1 file changed, 8 deletions(-)drivers/soundwire/sysfs_slave.c +0
-4@@ -129,10 +129,6 @@ static struct attribute *slave_dev_attrs[] = { NULL, }; -/* -* we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory -* for device-level properties -*/ static const struct attribute_group sdw_slave_dev_attr_group = { .attrs = slave_dev_attrs, .name ="dev-properties" ,
drivers/soundwire/sysfs_slave.c static bool dp0_group_visible(struct kobject *kobj) · line 205
Quoted 10 lines
drivers/soundwire/sysfs_slave.c +0
-4@@ -204,10 +200,6 @@ static bool dp0_group_visible(struct kobject *kobj) }DEFINE_SYSFS_GROUP_VISIBLE (dp0); -/* -* we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory -* for dp0-level properties -*/ static const struct attribute_group dp0_group = { .attrs = dp0_attrs, .is_visible =SYSFS_GROUP_VISIBLE (dp0),
Not a great look when there are comments around avoiding common idioms.
Vinod Koul
maintainerQuoted 13 lines · Greg Kroah-Hartman
Note, this is a redone version of a very old series I wrote back in 2022:
https://lore.kernel.org/r/[email protected]but everyone has forgotten about it now, and I've reworked it, so I'm considering it a "new" version, and not v2.
Here's a series that adds the functionality to the driver core to hide entire attribute groups, in a much saner way than we have attempted in the past (i.e. dynamically figuring it out.) Many thanks to Dan for this patch. I'll also be taking this into my driver-core branch and creating a stable tag for anyone else to pull from to get it into their trees, as I think it will want to be in many for this development cycle.
Quoted 5 lines
After the driver core change, there's cleanups to the soundwire core for how the attribute groups are created, to remove the "manual" creation of them, and allow the driver core to create them correctly, as needed, when needed, which makes things much smaller for the soundwire code to manage.
The series lgtm, having the core handle these would be good. I will wait couple of days for people to test this and give a t-b and apply. I hope it is okay if patch1 goes thru sdw tree?
BR
Signature · 1 line
~Vinod
Re: [PATCH 1/6] sysfs: Introduce a mechanism to hide static attribute_groups
In reply to Greg Kroah-HartmanQuoted 58 lines · Greg Kroah-Hartman
From: Dan Williams <[email protected]>
Add a mechanism for named
attribute_groupsto hide their directory atsysfs_update_group()time, or otherwise skip emitting the group directory when the group is first registered. It piggybacks onis_visible()in a similar manner asSYSFS_PREALLOC, i.e. special flags in the upper bits of the returned mode. To use it, specify a symbol prefix toDEFINE_SYSFS_GROUP_VISIBLE(), and then pass that same prefix toSYSFS_GROUP_VISIBLE()when assigning the @is_visible() callback:DEFINE_SYSFS_GROUP_VISIBLE($prefix) struct attribute_group $prefix_group = { .name = $name, .is_visible = SYSFS_GROUP_VISIBLE($prefix), };
SYSFS_GROUP_VISIBLE()expects a definition of $prefix_group_visible() and $prefix_attr_visible(), where $prefix_group_visible() just returns true / false and $prefix_attr_visible() behaves as normal.The motivation for this capability is to centralize PCI device authentication in the PCI core with a named sysfs group while keeping that group hidden for devices and platforms that do not meet the requirements. In a PCI topology, most devices will not support authentication, a small subset will support just PCI CMA (Component Measurement and Authentication), a smaller subset will support PCI CMA + PCIe IDE (Link Integrity and Encryption), and only next generation server hosts will start to include a platform TSM (TEE Security Manager).
Without this capability the alternatives are:
* Check if all attributes are invisible and if so, hide the directory. Beyond trouble getting this to work [1], this is an ABI change for scenarios if userspace happens to depend on group visibility absent any attributes. I.e. this new capability avoids regression since it does not retroactively apply to existing cases.
* Publish an empty
/sys/bus/pci/devices/$pdev/tsm/directory for all PCI devices (i.e. for the case when TSM platform support is present, but device support is absent). Unfortunate that this will be a vestigial empty directory in the vast majority of cases.* Reintroduce usage of runtime calls to sysfs_{create,remove}_group() in the PCI core. Bjorn has already indicated that he does not want to see any growth of
pci_sysfs_init()[2].* Drop the named group and simulate a directory by prefixing all TSM-related attributes with "
tsm_". Unfortunate to not use the naming capability of a sysfs group as intended.In comparison, there is a small potential for regression if for some reason an @is_visible() callback had dependencies on how many times it was called. Additionally, it is no longer an error to update a group that does not have its directory already present, and it is no longer a
WARN()to remove a group that was never visible.
Quoted 4 lines
This patch seems to introduce a regression on our Lunar Lake test devices, where we can't boot to an ssh shell. No issues on older devices [1]. Bard Liao and I reproduced the same results on different boards.
We'll need to find someone with direct device access to provide more information on the problem, remote testing without ssh is a self-negating proposition.
Is there a dependency on other patches? Our tests are still based on 6.7.0-rc3 due to other upstream issues we're currently working through.
Greg Kroah-Hartman
maintainerRe: [PATCH 1/6] sysfs: Introduce a mechanism to hide static attribute_groups
Quoted 70 lines · Pierre-Louis Bossart
Quoted 58 lines · Greg Kroah-Hartman
From: Dan Williams <[email protected]>
Add a mechanism for named
attribute_groupsto hide their directory atsysfs_update_group()time, or otherwise skip emitting the group directory when the group is first registered. It piggybacks onis_visible()in a similar manner asSYSFS_PREALLOC, i.e. special flags in the upper bits of the returned mode. To use it, specify a symbol prefix toDEFINE_SYSFS_GROUP_VISIBLE(), and then pass that same prefix toSYSFS_GROUP_VISIBLE()when assigning the @is_visible() callback:DEFINE_SYSFS_GROUP_VISIBLE($prefix) struct attribute_group $prefix_group = { .name = $name, .is_visible = SYSFS_GROUP_VISIBLE($prefix), };
SYSFS_GROUP_VISIBLE()expects a definition of $prefix_group_visible() and $prefix_attr_visible(), where $prefix_group_visible() just returns true / false and $prefix_attr_visible() behaves as normal.The motivation for this capability is to centralize PCI device authentication in the PCI core with a named sysfs group while keeping that group hidden for devices and platforms that do not meet the requirements. In a PCI topology, most devices will not support authentication, a small subset will support just PCI CMA (Component Measurement and Authentication), a smaller subset will support PCI CMA + PCIe IDE (Link Integrity and Encryption), and only next generation server hosts will start to include a platform TSM (TEE Security Manager).
Without this capability the alternatives are:
* Check if all attributes are invisible and if so, hide the directory. Beyond trouble getting this to work [1], this is an ABI change for scenarios if userspace happens to depend on group visibility absent any attributes. I.e. this new capability avoids regression since it does not retroactively apply to existing cases.
* Publish an empty
/sys/bus/pci/devices/$pdev/tsm/directory for all PCI devices (i.e. for the case when TSM platform support is present, but device support is absent). Unfortunate that this will be a vestigial empty directory in the vast majority of cases.* Reintroduce usage of runtime calls to sysfs_{create,remove}_group() in the PCI core. Bjorn has already indicated that he does not want to see any growth of
pci_sysfs_init()[2].* Drop the named group and simulate a directory by prefixing all TSM-related attributes with "
tsm_". Unfortunate to not use the naming capability of a sysfs group as intended.In comparison, there is a small potential for regression if for some reason an @is_visible() callback had dependencies on how many times it was called. Additionally, it is no longer an error to update a group that does not have its directory already present, and it is no longer a
WARN()to remove a group that was never visible.Quoted 4 lines
This patch seems to introduce a regression on our Lunar Lake test devices, where we can't boot to an ssh shell. No issues on older devices [1]. Bard Liao and I reproduced the same results on different boards.
Quoted 6 lines
We'll need to find someone with direct device access to provide more information on the problem, remote testing without ssh is a self-negating proposition.
Is there a dependency on other patches? Our tests are still based on 6.7.0-rc3 due to other upstream issues we're currently working through.
This should be totally stand-alone and not cause any problems, especially if you don't have any other patches applied.
I did make this against 6.8-rc2, perhaps that's the issue?
thanks,
greg k-h
Re: [PATCH 1/6] sysfs: Introduce a mechanism to hide static attribute_groups
In reply to Pierre-Louis BossartQuoted 70 lines · Pierre-Louis Bossart
Quoted 58 lines · Greg Kroah-Hartman
From: Dan Williams <[email protected]>
Add a mechanism for named
attribute_groupsto hide their directory atsysfs_update_group()time, or otherwise skip emitting the group directory when the group is first registered. It piggybacks onis_visible()in a similar manner asSYSFS_PREALLOC, i.e. special flags in the upper bits of the returned mode. To use it, specify a symbol prefix toDEFINE_SYSFS_GROUP_VISIBLE(), and then pass that same prefix toSYSFS_GROUP_VISIBLE()when assigning the @is_visible() callback:DEFINE_SYSFS_GROUP_VISIBLE($prefix) struct attribute_group $prefix_group = { .name = $name, .is_visible = SYSFS_GROUP_VISIBLE($prefix), };
SYSFS_GROUP_VISIBLE()expects a definition of $prefix_group_visible() and $prefix_attr_visible(), where $prefix_group_visible() just returns true / false and $prefix_attr_visible() behaves as normal.The motivation for this capability is to centralize PCI device authentication in the PCI core with a named sysfs group while keeping that group hidden for devices and platforms that do not meet the requirements. In a PCI topology, most devices will not support authentication, a small subset will support just PCI CMA (Component Measurement and Authentication), a smaller subset will support PCI CMA + PCIe IDE (Link Integrity and Encryption), and only next generation server hosts will start to include a platform TSM (TEE Security Manager).
Without this capability the alternatives are:
* Check if all attributes are invisible and if so, hide the directory. Beyond trouble getting this to work [1], this is an ABI change for scenarios if userspace happens to depend on group visibility absent any attributes. I.e. this new capability avoids regression since it does not retroactively apply to existing cases.
* Publish an empty
/sys/bus/pci/devices/$pdev/tsm/directory for all PCI devices (i.e. for the case when TSM platform support is present, but device support is absent). Unfortunate that this will be a vestigial empty directory in the vast majority of cases.* Reintroduce usage of runtime calls to sysfs_{create,remove}_group() in the PCI core. Bjorn has already indicated that he does not want to see any growth of
pci_sysfs_init()[2].* Drop the named group and simulate a directory by prefixing all TSM-related attributes with "
tsm_". Unfortunate to not use the naming capability of a sysfs group as intended.In comparison, there is a small potential for regression if for some reason an @is_visible() callback had dependencies on how many times it was called. Additionally, it is no longer an error to update a group that does not have its directory already present, and it is no longer a
WARN()to remove a group that was never visible.Quoted 4 lines
This patch seems to introduce a regression on our Lunar Lake test devices, where we can't boot to an ssh shell. No issues on older devices [1]. Bard Liao and I reproduced the same results on different boards.
Quoted 6 lines
We'll need to find someone with direct device access to provide more information on the problem, remote testing without ssh is a self-negating proposition.
Is there a dependency on other patches? Our tests are still based on 6.7.0-rc3 due to other upstream issues we're currently working through.
The only behavior change I can imagine with this patch is that ->is_visble() callbacks get called extra times for named attribute groups.
...or if an is_visible() callback was inadvertantly already using the SYSFS_GROUP_INVISIBLE flag in umode_t result.
Re: [PATCH 1/6] sysfs: Introduce a mechanism to hide static attribute_groups
Quoted 78 lines · Dan Williams
Quoted 70 lines · Pierre-Louis Bossart
Quoted 58 lines · Greg Kroah-Hartman
From: Dan Williams <[email protected]>
Add a mechanism for named
attribute_groupsto hide their directory atsysfs_update_group()time, or otherwise skip emitting the group directory when the group is first registered. It piggybacks onis_visible()in a similar manner asSYSFS_PREALLOC, i.e. special flags in the upper bits of the returned mode. To use it, specify a symbol prefix toDEFINE_SYSFS_GROUP_VISIBLE(), and then pass that same prefix toSYSFS_GROUP_VISIBLE()when assigning the @is_visible() callback:DEFINE_SYSFS_GROUP_VISIBLE($prefix) struct attribute_group $prefix_group = { .name = $name, .is_visible = SYSFS_GROUP_VISIBLE($prefix), };
SYSFS_GROUP_VISIBLE()expects a definition of $prefix_group_visible() and $prefix_attr_visible(), where $prefix_group_visible() just returns true / false and $prefix_attr_visible() behaves as normal.The motivation for this capability is to centralize PCI device authentication in the PCI core with a named sysfs group while keeping that group hidden for devices and platforms that do not meet the requirements. In a PCI topology, most devices will not support authentication, a small subset will support just PCI CMA (Component Measurement and Authentication), a smaller subset will support PCI CMA + PCIe IDE (Link Integrity and Encryption), and only next generation server hosts will start to include a platform TSM (TEE Security Manager).
Without this capability the alternatives are:
* Check if all attributes are invisible and if so, hide the directory. Beyond trouble getting this to work [1], this is an ABI change for scenarios if userspace happens to depend on group visibility absent any attributes. I.e. this new capability avoids regression since it does not retroactively apply to existing cases.
* Publish an empty
/sys/bus/pci/devices/$pdev/tsm/directory for all PCI devices (i.e. for the case when TSM platform support is present, but device support is absent). Unfortunate that this will be a vestigial empty directory in the vast majority of cases.* Reintroduce usage of runtime calls to sysfs_{create,remove}_group() in the PCI core. Bjorn has already indicated that he does not want to see any growth of
pci_sysfs_init()[2].* Drop the named group and simulate a directory by prefixing all TSM-related attributes with "
tsm_". Unfortunate to not use the naming capability of a sysfs group as intended.In comparison, there is a small potential for regression if for some reason an @is_visible() callback had dependencies on how many times it was called. Additionally, it is no longer an error to update a group that does not have its directory already present, and it is no longer a
WARN()to remove a group that was never visible.Quoted 4 lines
This patch seems to introduce a regression on our Lunar Lake test devices, where we can't boot to an ssh shell. No issues on older devices [1]. Bard Liao and I reproduced the same results on different boards.
Quoted 6 lines
We'll need to find someone with direct device access to provide more information on the problem, remote testing without ssh is a self-negating proposition.
Is there a dependency on other patches? Our tests are still based on 6.7.0-rc3 due to other upstream issues we're currently working through.
Quoted 6 lines
The only behavior change I can imagine with this patch is that ->is_visble() callbacks get called extra times for named attribute groups.
...or if an
is_visible()callback was inadvertantly already using theSYSFS_GROUP_INVISIBLEflag inumode_tresult.
Are you able to get kernel logs? A before and after with this patch applied might highlight which attribute does not appreciate the extra callback...
fs/sysfs/group.c +12 -2
@@ -33,11 +33,17 @@ static void remove_files(struct kernfs_node *parent,static umode_t __first_visible (const struct attribute_group *grp,struct kobject *kobj) { -if (grp->attrs && grp->is_visible) +if (grp->attrs && grp->is_visible) { +pr_info ("kobj: %s is_visible: %pS\n" , kobj->name, + grp->is_visible);return grp->is_visible (kobj, grp->attrs[0 ],0 ); + } -if (grp->bin_attrs && grp->is_bin_visible) +if (grp->bin_attrs && grp->is_bin_visible) { +pr_info ("kobj: %s is_bin_visible: %pS\n" , kobj->name, + grp->is_bin_visible);return grp->is_bin_visible (kobj, grp->bin_attrs[0 ],0 ); + }return 0 ; }
@@ -62,6 +68,8 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,if (update)kernfs_remove_by_name (parent, (*attr)->name);if (grp->is_visible) { +pr_info ("kobj: %s is_visible: %pS\n" , + kobj->name, grp->is_visible); mode = grp->is_visible (kobj, *attr, i); mode &= ~SYSFS_GROUP_INVISIBLE ;if (!mode)
@@ -92,6 +100,8 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,kernfs_remove_by_name (parent, (*bin_attr)->attr.name);if (grp->is_bin_visible) { +pr_info ("kobj: %s is_bin_visible: %pS\n" , + kobj->name, grp->is_bin_visible); mode = grp->is_bin_visible (kobj, *bin_attr, i); mode &= ~SYSFS_GROUP_INVISIBLE ;if (!mode)
Re: [PATCH 2/6] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups
In reply to Dan WilliamsQuoted 4 lines
Makes sense. I won't say "looks good" as this file has "slave" all over the place, but I checked and it entered the kernel just before the CodingStyle changed.
SoundWire 1.2.1 introduced the terms "Manager" and "Peripheral", I had a patchset to rename everything maybe two years ago already but it's been difficult to add without getting in the way of development and backports. Maybe a gradual replacement makes more sense, not sure how to go about this.
Greg Kroah-Hartman
maintainerRe: [PATCH 2/6] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups
Quoted 8 lines · Pierre-Louis Bossart
Quoted 4 lines
Makes sense. I won't say "looks good" as this file has "slave" all over the place, but I checked and it entered the kernel just before the CodingStyle changed.
SoundWire 1.2.1 introduced the terms "Manager" and "Peripheral", I had a patchset to rename everything maybe two years ago already but it's been difficult to add without getting in the way of development and backports.
Don't worry about backports for stable, we can handle that. Development for fixes or changes should NEVER worry about stable kernels, worst case, we can just take all of the same changes into them, no problem.
Quoted 1 line
Maybe a gradual replacement makes more sense, not sure how to go about this.
Just rename it all.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerQuoted 20 lines · Vinod Koul
Quoted 13 lines · Greg Kroah-Hartman
Note, this is a redone version of a very old series I wrote back in 2022:
https://lore.kernel.org/r/[email protected]but everyone has forgotten about it now, and I've reworked it, so I'm considering it a "new" version, and not v2.
Here's a series that adds the functionality to the driver core to hide entire attribute groups, in a much saner way than we have attempted in the past (i.e. dynamically figuring it out.) Many thanks to Dan for this patch. I'll also be taking this into my driver-core branch and creating a stable tag for anyone else to pull from to get it into their trees, as I think it will want to be in many for this development cycle.
Quoted 5 lines
After the driver core change, there's cleanups to the soundwire core for how the attribute groups are created, to remove the "manual" creation of them, and allow the driver core to create them correctly, as needed, when needed, which makes things much smaller for the soundwire code to manage.
Quoted 3 lines
The series lgtm, having the core handle these would be good. I will wait couple of days for people to test this and give a t-b and apply. I hope it is okay if patch1 goes thru sdw tree?
patch 1 is now in Linus's tree, so the remaining ones can go through the your tree now if you want. Or I can resend them if needed, just let me know.
thanks,
greg k-h
Vinod Koul
maintainerQuoted 21 lines · Greg Kroah-Hartman
Quoted 20 lines · Vinod Koul
Quoted 18 lines · Greg Kroah-Hartman
Note, this is a redone version of a very old series I wrote back in 2022:
https://lore.kernel.org/r/[email protected]but everyone has forgotten about it now, and I've reworked it, so I'm considering it a "new" version, and not v2.
Here's a series that adds the functionality to the driver core to hide entire attribute groups, in a much saner way than we have attempted in the past (i.e. dynamically figuring it out.) Many thanks to Dan for this patch. I'll also be taking this into my driver-core branch and creating a stable tag for anyone else to pull from to get it into their trees, as I think it will want to be in many for this development cycle.
After the driver core change, there's cleanups to the soundwire core for how the attribute groups are created, to remove the "manual" creation of them, and allow the driver core to create them correctly, as needed, when needed, which makes things much smaller for the soundwire code to manage.
Quoted 7 lines
Quoted 3 lines
The series lgtm, having the core handle these would be good. I will wait couple of days for people to test this and give a t-b and apply. I hope it is okay if patch1 goes thru sdw tree?
patch 1 is now in Linus's tree, so the remaining ones can go through the your tree now if you want. Or I can resend them if needed, just let me know.
Great, I was about to ask about this. If there is no conflicts I can pick this series (looking at folks for giving me a t-b)
Signature · 1 line
~Vinod
Quoted 21 lines · Vinod Koul
Quoted 20 lines · Greg Kroah-Hartman
Quoted 19 lines · Vinod Koul
Quoted 18 lines · Greg Kroah-Hartman
Note, this is a redone version of a very old series I wrote back in 2022:
https://lore.kernel.org/r/[email protected]but everyone has forgotten about it now, and I've reworked it, so I'm considering it a "new" version, and not v2.
Here's a series that adds the functionality to the driver core to hide entire attribute groups, in a much saner way than we have attempted in the past (i.e. dynamically figuring it out.) Many thanks to Dan for this patch. I'll also be taking this into my driver-core branch and creating a stable tag for anyone else to pull from to get it into their trees, as I think it will want to be in many for this development cycle.
After the driver core change, there's cleanups to the soundwire core for how the attribute groups are created, to remove the "manual" creation of them, and allow the driver core to create them correctly, as needed, when needed, which makes things much smaller for the soundwire code to manage.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
The series lgtm, having the core handle these would be good. I will wait couple of days for people to test this and give a t-b and apply. I hope it is okay if patch1 goes thru sdw tree?
patch 1 is now in Linus's tree, so the remaining ones can go through the your tree now if you want. Or I can resend them if needed, just let me know.
Great, I was about to ask about this. If there is no conflicts I can pick this series (looking at folks for giving me a t-b)
Applied this patch series on top of soundwire git tree and validated SoundWire stack on AMD platform using command line alsa utils. All use cases are working fine. Tested-By: Vijendar Mukunda <[email protected]>
Quoted 1 line
Re: (subset) [PATCH 0/7] Soundwire: clean up sysfs group creation
In reply to Greg Kroah-HartmanQuoted 6 lines · Greg Kroah-Hartman
Note, this is a redone version of a very old series I wrote back in 2022:
https://lore.kernel.org/r/[email protected]but everyone has forgotten about it now, and I've reworked it, so I'm considering it a "new" version, and not v2.
Quoted 8 lines
Here's a series that adds the functionality to the driver core to hide entire attribute groups, in a much saner way than we have attempted in the past (i.e. dynamically figuring it out.) Many thanks to Dan for this patch. I'll also be taking this into my driver-core branch and creating a stable tag for anyone else to pull from to get it into their trees, as I think it will want to be in many for this development cycle.
[...]
Applied, thanks!
[2/6] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups
commit: b1b11bb07898b7e0313438734c310100219e676f
[3/6] soundwire: sysfs: cleanup the logic for creating the dp0 sysfs attributes
commit: 3ee43f7cc9841cdf3f2bec2de4b1e729fd17e303
[4/6] soundwire: sysfs: have the driver core handle the creation of the device groups
commit: fc7e56017b51482f1b9da2e778eedb4bd1deb6b3
[5/6] soundwire: sysfs: remove sdw_slave_sysfs_init()
commit: f88c1afe338edbcbfd23743742c45581075fb86c
[6/6] soundwire: sysfs: remove unneeded ATTRIBUTE_GROUPS() comments
commit: 91c4dd2e5c9066577960c7eef7dd8e699220c85eBest regards,
Signature · 1 line
~Vinod