From 8988bacd6045adf39719e5057e43170f83bd1709 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 31 Aug 2021 17:30:44 +0800 Subject: [PATCH 001/122] kobject: unexport kobject_create() in kobject.h The function kobject_create() is only used by one caller, kobject_create_and_add(), no other driver uses it, nor is exported to other modules. However it's still exported in kobject.h, and can sometimes confuse users of kobject.h. Since all users should call kobject_create_and_add(), or if extra attributes are needed, should alloc the memory manually then call kobject_init_and_add(). Signed-off-by: Qu Wenruo Link: https://lore.kernel.org/r/20210831093044.110729-1-wqu@suse.com Signed-off-by: Greg Kroah-Hartman --- include/linux/kobject.h | 1 - lib/kobject.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index ea30529fba08..efd56f990a46 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -101,7 +101,6 @@ int kobject_init_and_add(struct kobject *kobj, extern void kobject_del(struct kobject *kobj); -extern struct kobject * __must_check kobject_create(void); extern struct kobject * __must_check kobject_create_and_add(const char *name, struct kobject *parent); diff --git a/lib/kobject.c b/lib/kobject.c index ea53b30cf483..4a56f519139d 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -777,7 +777,7 @@ static struct kobj_type dynamic_kobj_ktype = { * call to kobject_put() and not kfree(), as kobject_init() has * already been called on this structure. */ -struct kobject *kobject_create(void) +static struct kobject *kobject_create(void) { struct kobject *kobj; From 86854b4379d43aaffdbe1fac0879cce543247e9b Mon Sep 17 00:00:00 2001 From: Cai Huoqing Date: Sat, 28 Aug 2021 17:02:19 +0800 Subject: [PATCH 002/122] driver core: platform: Make use of the helper macro SET_RUNTIME_PM_OPS() Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/.runtime_resume", because the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought in to make code a little clearer, a little more concise. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210828090219.1177-1-caihuoqing@baidu.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/platform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 652531f67135..598acf93a360 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -1466,8 +1466,7 @@ int platform_dma_configure(struct device *dev) } static const struct dev_pm_ops platform_dev_pm_ops = { - .runtime_suspend = pm_generic_runtime_suspend, - .runtime_resume = pm_generic_runtime_resume, + SET_RUNTIME_PM_OPS(pm_generic_runtime_suspend, pm_generic_runtime_resume, NULL) USE_PLATFORM_PM_SLEEP_OPS }; From 2935662449dfa4467d2e769a70801c608fd510c3 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Sep 2021 07:41:10 +0200 Subject: [PATCH 003/122] kernfs: remove kernfs_create_file and kernfs_create_file_ns All callers actually use __kernfs_create_file. Acked-by: Christian Brauner Acked-by: Tejun Heo Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210913054121.616001-3-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- include/linux/kernfs.h | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 1093abf7c28c..cecfeedb7361 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -568,30 +568,6 @@ kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode, priv, NULL); } -static inline struct kernfs_node * -kernfs_create_file_ns(struct kernfs_node *parent, const char *name, - umode_t mode, kuid_t uid, kgid_t gid, - loff_t size, const struct kernfs_ops *ops, - void *priv, const void *ns) -{ - struct lock_class_key *key = NULL; - -#ifdef CONFIG_DEBUG_LOCK_ALLOC - key = (struct lock_class_key *)&ops->lockdep_key; -#endif - return __kernfs_create_file(parent, name, mode, uid, gid, - size, ops, priv, ns, key); -} - -static inline struct kernfs_node * -kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode, - loff_t size, const struct kernfs_ops *ops, void *priv) -{ - return kernfs_create_file_ns(parent, name, mode, - GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, - size, ops, priv, NULL); -} - static inline int kernfs_remove_by_name(struct kernfs_node *parent, const char *name) { From eaf501e0d8af691e532b6b9aee511659cf5ee00c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Sep 2021 07:41:11 +0200 Subject: [PATCH 004/122] kernfs: remove the unused lockdep_key field in struct kernfs_ops Not actually used anywhere. Acked-by: Christian Brauner Acked-by: Tejun Heo Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210913054121.616001-4-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- include/linux/kernfs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index cecfeedb7361..3ccce6f24548 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -269,10 +269,6 @@ struct kernfs_ops { struct poll_table_struct *pt); int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); - -#ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lock_class_key lockdep_key; -#endif }; /* From 5cf3bb0d3a2d0de94f3f551f0e4211068818aabf Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Sep 2021 07:41:12 +0200 Subject: [PATCH 005/122] sysfs: split out binary attribute handling from sysfs_add_file_mode_ns Split adding binary attributes into a separate handler instead of overloading sysfs_add_file_mode_ns. Acked-by: Christian Brauner Acked-by: Tejun Heo Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210913054121.616001-5-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/file.c | 120 ++++++++++++++++++++++++++--------------------- fs/sysfs/group.c | 15 +++--- fs/sysfs/sysfs.h | 8 ++-- 3 files changed, 78 insertions(+), 65 deletions(-) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index d019d6ac6ad0..f737bd61f71b 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -255,59 +255,38 @@ static const struct kernfs_ops sysfs_bin_kfops_mmap = { }; int sysfs_add_file_mode_ns(struct kernfs_node *parent, - const struct attribute *attr, bool is_bin, - umode_t mode, kuid_t uid, kgid_t gid, const void *ns) + const struct attribute *attr, umode_t mode, kuid_t uid, + kgid_t gid, const void *ns) { + struct kobject *kobj = parent->priv; + const struct sysfs_ops *sysfs_ops = kobj->ktype->sysfs_ops; struct lock_class_key *key = NULL; const struct kernfs_ops *ops; struct kernfs_node *kn; - loff_t size; - if (!is_bin) { - struct kobject *kobj = parent->priv; - const struct sysfs_ops *sysfs_ops = kobj->ktype->sysfs_ops; + /* every kobject with an attribute needs a ktype assigned */ + if (WARN(!sysfs_ops, KERN_ERR + "missing sysfs attribute operations for kobject: %s\n", + kobject_name(kobj))) + return -EINVAL; - /* every kobject with an attribute needs a ktype assigned */ - if (WARN(!sysfs_ops, KERN_ERR - "missing sysfs attribute operations for kobject: %s\n", - kobject_name(kobj))) - return -EINVAL; - - if (sysfs_ops->show && sysfs_ops->store) { - if (mode & SYSFS_PREALLOC) - ops = &sysfs_prealloc_kfops_rw; - else - ops = &sysfs_file_kfops_rw; - } else if (sysfs_ops->show) { - if (mode & SYSFS_PREALLOC) - ops = &sysfs_prealloc_kfops_ro; - else - ops = &sysfs_file_kfops_ro; - } else if (sysfs_ops->store) { - if (mode & SYSFS_PREALLOC) - ops = &sysfs_prealloc_kfops_wo; - else - ops = &sysfs_file_kfops_wo; - } else - ops = &sysfs_file_kfops_empty; - - size = PAGE_SIZE; - } else { - struct bin_attribute *battr = (void *)attr; - - if (battr->mmap) - ops = &sysfs_bin_kfops_mmap; - else if (battr->read && battr->write) - ops = &sysfs_bin_kfops_rw; - else if (battr->read) - ops = &sysfs_bin_kfops_ro; - else if (battr->write) - ops = &sysfs_bin_kfops_wo; + if (sysfs_ops->show && sysfs_ops->store) { + if (mode & SYSFS_PREALLOC) + ops = &sysfs_prealloc_kfops_rw; else - ops = &sysfs_file_kfops_empty; - - size = battr->size; - } + ops = &sysfs_file_kfops_rw; + } else if (sysfs_ops->show) { + if (mode & SYSFS_PREALLOC) + ops = &sysfs_prealloc_kfops_ro; + else + ops = &sysfs_file_kfops_ro; + } else if (sysfs_ops->store) { + if (mode & SYSFS_PREALLOC) + ops = &sysfs_prealloc_kfops_wo; + else + ops = &sysfs_file_kfops_wo; + } else + ops = &sysfs_file_kfops_empty; #ifdef CONFIG_DEBUG_LOCK_ALLOC if (!attr->ignore_lockdep) @@ -315,7 +294,42 @@ int sysfs_add_file_mode_ns(struct kernfs_node *parent, #endif kn = __kernfs_create_file(parent, attr->name, mode & 0777, uid, gid, - size, ops, (void *)attr, ns, key); + PAGE_SIZE, ops, (void *)attr, ns, key); + if (IS_ERR(kn)) { + if (PTR_ERR(kn) == -EEXIST) + sysfs_warn_dup(parent, attr->name); + return PTR_ERR(kn); + } + return 0; +} + +int sysfs_add_bin_file_mode_ns(struct kernfs_node *parent, + const struct bin_attribute *battr, umode_t mode, + kuid_t uid, kgid_t gid, const void *ns) +{ + const struct attribute *attr = &battr->attr; + struct lock_class_key *key = NULL; + const struct kernfs_ops *ops; + struct kernfs_node *kn; + + if (battr->mmap) + ops = &sysfs_bin_kfops_mmap; + else if (battr->read && battr->write) + ops = &sysfs_bin_kfops_rw; + else if (battr->read) + ops = &sysfs_bin_kfops_ro; + else if (battr->write) + ops = &sysfs_bin_kfops_wo; + else + ops = &sysfs_file_kfops_empty; + +#ifdef CONFIG_DEBUG_LOCK_ALLOC + if (!attr->ignore_lockdep) + key = attr->key ?: (struct lock_class_key *)&attr->skey; +#endif + + kn = __kernfs_create_file(parent, attr->name, mode & 0777, uid, gid, + battr->size, ops, (void *)attr, ns, key); if (IS_ERR(kn)) { if (PTR_ERR(kn) == -EEXIST) sysfs_warn_dup(parent, attr->name); @@ -340,9 +354,7 @@ int sysfs_create_file_ns(struct kobject *kobj, const struct attribute *attr, return -EINVAL; kobject_get_ownership(kobj, &uid, &gid); - return sysfs_add_file_mode_ns(kobj->sd, attr, false, attr->mode, - uid, gid, ns); - + return sysfs_add_file_mode_ns(kobj->sd, attr, attr->mode, uid, gid, ns); } EXPORT_SYMBOL_GPL(sysfs_create_file_ns); @@ -385,8 +397,8 @@ int sysfs_add_file_to_group(struct kobject *kobj, return -ENOENT; kobject_get_ownership(kobj, &uid, &gid); - error = sysfs_add_file_mode_ns(parent, attr, false, - attr->mode, uid, gid, NULL); + error = sysfs_add_file_mode_ns(parent, attr, attr->mode, uid, gid, + NULL); kernfs_put(parent); return error; @@ -555,8 +567,8 @@ int sysfs_create_bin_file(struct kobject *kobj, return -EINVAL; kobject_get_ownership(kobj, &uid, &gid); - return sysfs_add_file_mode_ns(kobj->sd, &attr->attr, true, - attr->attr.mode, uid, gid, NULL); + return sysfs_add_bin_file_mode_ns(kobj->sd, attr, attr->attr.mode, uid, + gid, NULL); } EXPORT_SYMBOL_GPL(sysfs_create_bin_file); diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index f29d62004527..eeb0e3099421 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -61,8 +61,8 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj, (*attr)->name, mode); mode &= SYSFS_PREALLOC | 0664; - error = sysfs_add_file_mode_ns(parent, *attr, false, - mode, uid, gid, NULL); + error = sysfs_add_file_mode_ns(parent, *attr, mode, uid, + gid, NULL); if (unlikely(error)) break; } @@ -90,10 +90,9 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj, (*bin_attr)->attr.name, mode); mode &= SYSFS_PREALLOC | 0664; - error = sysfs_add_file_mode_ns(parent, - &(*bin_attr)->attr, true, - mode, - uid, gid, NULL); + error = sysfs_add_bin_file_mode_ns(parent, *bin_attr, + mode, uid, gid, + NULL); if (error) break; } @@ -340,8 +339,8 @@ int sysfs_merge_group(struct kobject *kobj, kobject_get_ownership(kobj, &uid, &gid); for ((i = 0, attr = grp->attrs); *attr && !error; (++i, ++attr)) - error = sysfs_add_file_mode_ns(parent, *attr, false, - (*attr)->mode, uid, gid, NULL); + error = sysfs_add_file_mode_ns(parent, *attr, (*attr)->mode, + uid, gid, NULL); if (error) { while (--i >= 0) kernfs_remove_by_name(parent, (*--attr)->name); diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index 0050cc0c0236..3f28c9af5756 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -28,9 +28,11 @@ void sysfs_warn_dup(struct kernfs_node *parent, const char *name); * file.c */ int sysfs_add_file_mode_ns(struct kernfs_node *parent, - const struct attribute *attr, bool is_bin, - umode_t amode, kuid_t uid, kgid_t gid, - const void *ns); + const struct attribute *attr, umode_t amode, kuid_t uid, + kgid_t gid, const void *ns); +int sysfs_add_bin_file_mode_ns(struct kernfs_node *parent, + const struct bin_attribute *battr, umode_t mode, + kuid_t uid, kgid_t gid, const void *ns); /* * symlink.c From d1a1a9606e080c9767e229742f5b331b3b551c0c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Sep 2021 07:41:13 +0200 Subject: [PATCH 006/122] sysfs: refactor sysfs_add_file_mode_ns Regroup the code so that preallocated attributes and normal attributes are handled in clearly separate blocks. Acked-by: Christian Brauner Acked-by: Tejun Heo Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210913054121.616001-6-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/file.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index f737bd61f71b..74a2a8021c8b 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -261,7 +261,7 @@ int sysfs_add_file_mode_ns(struct kernfs_node *parent, struct kobject *kobj = parent->priv; const struct sysfs_ops *sysfs_ops = kobj->ktype->sysfs_ops; struct lock_class_key *key = NULL; - const struct kernfs_ops *ops; + const struct kernfs_ops *ops = NULL; struct kernfs_node *kn; /* every kobject with an attribute needs a ktype assigned */ @@ -270,22 +270,23 @@ int sysfs_add_file_mode_ns(struct kernfs_node *parent, kobject_name(kobj))) return -EINVAL; - if (sysfs_ops->show && sysfs_ops->store) { - if (mode & SYSFS_PREALLOC) + if (mode & SYSFS_PREALLOC) { + if (sysfs_ops->show && sysfs_ops->store) ops = &sysfs_prealloc_kfops_rw; - else - ops = &sysfs_file_kfops_rw; - } else if (sysfs_ops->show) { - if (mode & SYSFS_PREALLOC) + else if (sysfs_ops->show) ops = &sysfs_prealloc_kfops_ro; - else - ops = &sysfs_file_kfops_ro; - } else if (sysfs_ops->store) { - if (mode & SYSFS_PREALLOC) + else if (sysfs_ops->store) ops = &sysfs_prealloc_kfops_wo; - else + } else { + if (sysfs_ops->show && sysfs_ops->store) + ops = &sysfs_file_kfops_rw; + else if (sysfs_ops->show) + ops = &sysfs_file_kfops_ro; + else if (sysfs_ops->store) ops = &sysfs_file_kfops_wo; - } else + } + + if (!ops) ops = &sysfs_file_kfops_empty; #ifdef CONFIG_DEBUG_LOCK_ALLOC From 820879ee1865f7010ec3a949322f643f008c9feb Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 13 Sep 2021 07:41:14 +0200 Subject: [PATCH 007/122] sysfs: simplify sysfs_kf_seq_show Contrary to the comment ->show is never called from lseek for sysfs, given that sysfs does not use seq_lseek. So remove the NULL ->show case and just WARN and return an error if some future code path ends up here. Acked-by: Tejun Heo Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20210913054121.616001-7-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/file.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 74a2a8021c8b..42dcf96881b6 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -45,6 +45,9 @@ static int sysfs_kf_seq_show(struct seq_file *sf, void *v) ssize_t count; char *buf; + if (WARN_ON_ONCE(!ops->show)) + return -EINVAL; + /* acquire buffer and ensure that it's >= PAGE_SIZE and clear */ count = seq_get_buf(sf, &buf); if (count < PAGE_SIZE) { @@ -53,15 +56,9 @@ static int sysfs_kf_seq_show(struct seq_file *sf, void *v) } memset(buf, 0, PAGE_SIZE); - /* - * Invoke show(). Control may reach here via seq file lseek even - * if @ops->show() isn't implemented. - */ - if (ops->show) { - count = ops->show(kobj, of->kn->priv, buf); - if (count < 0) - return count; - } + count = ops->show(kobj, of->kn->priv, buf); + if (count < 0) + return count; /* * The code works fine with PAGE_SIZE return but it's likely to From 7065f92255bb2468dbb9aa0537ff186ef64d5a02 Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Thu, 16 Sep 2021 16:19:40 -0700 Subject: [PATCH 008/122] driver core: Clarify that dev_err_probe() is OK even w/out -EPROBE_DEFER There is some debate about whether it's deemed acceptable to call dev_err_probe() if you know that the error code can never be -EPROBE_DEFER. Clarify in the function comments that this is OK. Specifically this makes us able to transform code like this: ret = do_something_that_cant_defer(); if (ret < 0) { dev_err(dev, "The foo failed to bar (%pe)\n", ERR_PTR(ret)); return ret; } to code like this: ret = do_something_that_cant_defer(); if (ret < 0) return dev_err_probe(dev, ret, "The foo failed to bar\n"); It is also possible that in the future folks might want a CONFIG option to strip out all probe error strings to save space (keeping non-probe errors) with the argument that probe errors rarely happen after bringup. Having probe errors reported with a consistent function would allow that. Cc: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20210916161931.1.I32bea713bd6c6fb419a24da73686145742b6c117@changeid Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index e65dd803a453..85b8955717fc 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4653,6 +4653,11 @@ define_dev_printk_level(_dev_info, KERN_INFO); * * return dev_err_probe(dev, err, ...); * + * Note that it is deemed acceptable to use this function for error + * prints during probe even if the @err is known to never be -EPROBE_DEFER. + * The benefit compared to a normal dev_err() is the standardized format + * of the error code and the fact that the error code is returned. + * * Returns @err. * */ From 3628f573423711579053deae68657e4512cf7659 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:28 +0200 Subject: [PATCH 009/122] ABI: sysfs-bus-usb: better document variable argument On almost all ABI documents, variable arguments are declared as . Change it here too, in order to allow replacing such wildcards by regexes on a scriptable way. Acked-by: Heikki Krogerus Acked-by: Rajat Jain Acked-by: Bjorn Helgaas Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2f7e4e874677dbd82693a6b219decefa18802e8f.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-usb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 73eb23bc1f34..42103f0f54d6 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb @@ -166,14 +166,14 @@ Description: The file will be present for all speeds of USB devices, and will always read "no" for USB 1.1 and USB 2.0 devices. -What: /sys/bus/usb/devices/.../(hub interface)/portX +What: /sys/bus/usb/devices/...//port Date: August 2012 Contact: Lan Tianyu Description: - The /sys/bus/usb/devices/.../(hub interface)/portX + The /sys/bus/usb/devices/...//port is usb port device's sysfs directory. -What: /sys/bus/usb/devices/.../(hub interface)/portX/connect_type +What: /sys/bus/usb/devices/...//port/connect_type Date: January 2013 Contact: Lan Tianyu Description: @@ -182,7 +182,7 @@ Description: The file will read "hotplug", "hardwired" and "not used" if the information is available, and "unknown" otherwise. -What: /sys/bus/usb/devices/.../(hub interface)/portX/location +What: /sys/bus/usb/devices/...//port/location Date: October 2018 Contact: Bjørn Mork Description: @@ -192,7 +192,7 @@ Description: raw location value as a hex integer. -What: /sys/bus/usb/devices/.../(hub interface)/portX/quirks +What: /sys/bus/usb/devices/...//port/quirks Date: May 2018 Contact: Nicolas Boichat Description: @@ -216,7 +216,7 @@ Description: used to help make enumeration work better on some high speed devices. -What: /sys/bus/usb/devices/.../(hub interface)/portX/over_current_count +What: /sys/bus/usb/devices/...//port/over_current_count Date: February 2018 Contact: Richard Leitner Description: @@ -230,10 +230,10 @@ Description: Any time this value changes the corresponding hub device will send a udev event with the following attributes:: - OVER_CURRENT_PORT=/sys/bus/usb/devices/.../(hub interface)/portX + OVER_CURRENT_PORT=/sys/bus/usb/devices/...//port OVER_CURRENT_COUNT=[current value of this sysfs attribute] -What: /sys/bus/usb/devices/.../(hub interface)/portX/usb3_lpm_permit +What: /sys/bus/usb/devices/...//port/usb3_lpm_permit Date: November 2015 Contact: Lu Baolu Description: From 05d2024ad1e24aa0e57d1e24bfc0bc46158566e3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:29 +0200 Subject: [PATCH 010/122] ABI: sysfs-tty: better document module name parameter On almost all ABI documents, variable arguments are declared as . Change it here too, in order to allow replacing such wildcards by regexes on a scriptable way. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6280edfacdbcbf8db1aeb7bf11e899187c11ac4c.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-tty | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-tty b/Documentation/ABI/testing/sysfs-tty index e157130a6792..820e412d38a8 100644 --- a/Documentation/ABI/testing/sysfs-tty +++ b/Documentation/ABI/testing/sysfs-tty @@ -9,7 +9,7 @@ Description: The file supports poll() to detect virtual console switches. -What: /sys/class/tty/tty0/active +What: /sys/class/tty/tty/active Date: Nov 2010 Contact: Kay Sievers Description: @@ -18,7 +18,7 @@ Description: The file supports poll() to detect virtual console switches. -What: /sys/class/tty/ttyS0/uartclk +What: /sys/class/tty/ttyS/uartclk Date: Sep 2012 Contact: Tomas Hlavacek Description: @@ -29,7 +29,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/type +What: /sys/class/tty/ttyS/type Date: October 2012 Contact: Alan Cox Description: @@ -38,7 +38,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/line +What: /sys/class/tty/ttyS/line Date: October 2012 Contact: Alan Cox Description: @@ -47,7 +47,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/port +What: /sys/class/tty/ttyS/port Date: October 2012 Contact: Alan Cox Description: @@ -56,7 +56,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/irq +What: /sys/class/tty/ttyS/irq Date: October 2012 Contact: Alan Cox Description: @@ -65,7 +65,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/flags +What: /sys/class/tty/ttyS/flags Date: October 2012 Contact: Alan Cox Description: @@ -74,7 +74,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/xmit_fifo_size +What: /sys/class/tty/ttyS/xmit_fifo_size Date: October 2012 Contact: Alan Cox Description: @@ -83,7 +83,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/close_delay +What: /sys/class/tty/ttyS/close_delay Date: October 2012 Contact: Alan Cox Description: @@ -92,7 +92,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/closing_wait +What: /sys/class/tty/ttyS/closing_wait Date: October 2012 Contact: Alan Cox Description: @@ -101,7 +101,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/custom_divisor +What: /sys/class/tty/ttyS/custom_divisor Date: October 2012 Contact: Alan Cox Description: @@ -110,7 +110,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/io_type +What: /sys/class/tty/ttyS/io_type Date: October 2012 Contact: Alan Cox Description: @@ -120,7 +120,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/iomem_base +What: /sys/class/tty/ttyS/iomem_base Date: October 2012 Contact: Alan Cox Description: @@ -129,7 +129,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/iomem_reg_shift +What: /sys/class/tty/ttyS/iomem_reg_shift Date: October 2012 Contact: Alan Cox Description: @@ -139,7 +139,7 @@ Description: These sysfs values expose the TIOCGSERIAL interface via sysfs rather than via ioctls. -What: /sys/class/tty/ttyS0/rx_trig_bytes +What: /sys/class/tty/ttyS/rx_trig_bytes Date: May 2014 Contact: Yoshihiro YUNOMAE Description: @@ -155,7 +155,7 @@ Description: 16550A, which has 1/4/8/14 bytes trigger, the RX trigger is automatically changed to 4 bytes. -What: /sys/class/tty/ttyS0/console +What: /sys/class/tty/ttyS/console Date: February 2020 Contact: Andy Shevchenko Description: From a19ea9e3c809e95b89a11fd8c7de43307b8f9a9a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:30 +0200 Subject: [PATCH 011/122] ABI: sysfs-kernel-slab: use a wildcard for the cache name the "cache" part of the description is actually a wildcard, as, in practice, this will use per-subsystem names: /sys/kernel/slab/Acpi-Namespace/align /sys/kernel/slab/Acpi-Operand/align /sys/kernel/slab/Acpi-Parse/align ... /sys/kernel/slab/zswap_entry/align Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/64095cc0a38d0f675ab798d4f04d8631674b59f7.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-kernel-slab | 94 ++++++++++----------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab index c9f12baf8baa..77e5840b00a5 100644 --- a/Documentation/ABI/testing/sysfs-kernel-slab +++ b/Documentation/ABI/testing/sysfs-kernel-slab @@ -10,7 +10,7 @@ Description: any cache it aliases, if any). Users: kernel memory tuning tools -What: /sys/kernel/slab/cache/aliases +What: /sys/kernel/slab//aliases Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -19,7 +19,7 @@ Description: The aliases file is read-only and specifies how many caches have merged into this cache. -What: /sys/kernel/slab/cache/align +What: /sys/kernel/slab//align Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -28,7 +28,7 @@ Description: The align file is read-only and specifies the cache's object alignment in bytes. -What: /sys/kernel/slab/cache/alloc_calls +What: /sys/kernel/slab//alloc_calls Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -39,7 +39,7 @@ Description: The alloc_calls file only contains information if debugging is enabled for that cache (see Documentation/vm/slub.rst). -What: /sys/kernel/slab/cache/alloc_fastpath +What: /sys/kernel/slab//alloc_fastpath Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -50,7 +50,7 @@ Description: current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/alloc_from_partial +What: /sys/kernel/slab//alloc_from_partial Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -62,7 +62,7 @@ Description: count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/alloc_refill +What: /sys/kernel/slab//alloc_refill Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -73,7 +73,7 @@ Description: remote cpu frees. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/alloc_slab +What: /sys/kernel/slab//alloc_slab Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -84,7 +84,7 @@ Description: clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/alloc_slowpath +What: /sys/kernel/slab//alloc_slowpath Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -96,7 +96,7 @@ Description: clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/cache_dma +What: /sys/kernel/slab//cache_dma Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -106,7 +106,7 @@ Description: are from ZONE_DMA. Available when CONFIG_ZONE_DMA is enabled. -What: /sys/kernel/slab/cache/cpu_slabs +What: /sys/kernel/slab//cpu_slabs Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -115,7 +115,7 @@ Description: The cpu_slabs file is read-only and displays how many cpu slabs are active and their NUMA locality. -What: /sys/kernel/slab/cache/cpuslab_flush +What: /sys/kernel/slab//cpuslab_flush Date: April 2009 KernelVersion: 2.6.31 Contact: Pekka Enberg , @@ -128,7 +128,7 @@ Description: current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/ctor +What: /sys/kernel/slab//ctor Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -138,7 +138,7 @@ Description: constructor function, which is invoked for each object when a new slab is allocated. -What: /sys/kernel/slab/cache/deactivate_empty +What: /sys/kernel/slab//deactivate_empty Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -148,7 +148,7 @@ Description: was deactivated. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/deactivate_full +What: /sys/kernel/slab//deactivate_full Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -158,7 +158,7 @@ Description: was deactivated. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/deactivate_remote_frees +What: /sys/kernel/slab//deactivate_remote_frees Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -169,7 +169,7 @@ Description: remotely. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/deactivate_to_head +What: /sys/kernel/slab//deactivate_to_head Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -180,7 +180,7 @@ Description: list. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/deactivate_to_tail +What: /sys/kernel/slab//deactivate_to_tail Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -191,7 +191,7 @@ Description: list. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/destroy_by_rcu +What: /sys/kernel/slab//destroy_by_rcu Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -200,7 +200,7 @@ Description: The destroy_by_rcu file is read-only and specifies whether slabs (not objects) are freed by rcu. -What: /sys/kernel/slab/cache/free_add_partial +What: /sys/kernel/slab//free_add_partial Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -211,7 +211,7 @@ Description: partial list. It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/free_calls +What: /sys/kernel/slab//free_calls Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -221,7 +221,7 @@ Description: object frees if slab debugging is enabled (see Documentation/vm/slub.rst). -What: /sys/kernel/slab/cache/free_fastpath +What: /sys/kernel/slab//free_fastpath Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -232,7 +232,7 @@ Description: It can be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/free_frozen +What: /sys/kernel/slab//free_frozen Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -243,7 +243,7 @@ Description: clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/free_remove_partial +What: /sys/kernel/slab//free_remove_partial Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -255,7 +255,7 @@ Description: count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/free_slab +What: /sys/kernel/slab//free_slab Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -266,7 +266,7 @@ Description: the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/free_slowpath +What: /sys/kernel/slab//free_slowpath Date: February 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -277,7 +277,7 @@ Description: be written to clear the current count. Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/hwcache_align +What: /sys/kernel/slab//hwcache_align Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -286,7 +286,7 @@ Description: The hwcache_align file is read-only and specifies whether objects are aligned on cachelines. -What: /sys/kernel/slab/cache/min_partial +What: /sys/kernel/slab//min_partial Date: February 2009 KernelVersion: 2.6.30 Contact: Pekka Enberg , @@ -297,7 +297,7 @@ Description: allocating new slabs. Such slabs may be reclaimed by utilizing the shrink file. -What: /sys/kernel/slab/cache/object_size +What: /sys/kernel/slab//object_size Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -306,7 +306,7 @@ Description: The object_size file is read-only and specifies the cache's object size. -What: /sys/kernel/slab/cache/objects +What: /sys/kernel/slab//objects Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -315,7 +315,7 @@ Description: The objects file is read-only and displays how many objects are active and from which nodes they are from. -What: /sys/kernel/slab/cache/objects_partial +What: /sys/kernel/slab//objects_partial Date: April 2008 KernelVersion: 2.6.26 Contact: Pekka Enberg , @@ -325,7 +325,7 @@ Description: objects are on partial slabs and from which nodes they are from. -What: /sys/kernel/slab/cache/objs_per_slab +What: /sys/kernel/slab//objs_per_slab Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -333,9 +333,9 @@ Contact: Pekka Enberg , Description: The file objs_per_slab is read-only and specifies how many objects may be allocated from a single slab of the order - specified in /sys/kernel/slab/cache/order. + specified in /sys/kernel/slab//order. -What: /sys/kernel/slab/cache/order +What: /sys/kernel/slab//order Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -352,7 +352,7 @@ Description: order is used and this sysfs entry can not be used to change the order at run time. -What: /sys/kernel/slab/cache/order_fallback +What: /sys/kernel/slab//order_fallback Date: April 2008 KernelVersion: 2.6.26 Contact: Pekka Enberg , @@ -365,7 +365,7 @@ Description: Available when CONFIG_SLUB_STATS is enabled. -What: /sys/kernel/slab/cache/partial +What: /sys/kernel/slab//partial Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -374,7 +374,7 @@ Description: The partial file is read-only and displays how long many partial slabs there are and how long each node's list is. -What: /sys/kernel/slab/cache/poison +What: /sys/kernel/slab//poison Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -383,7 +383,7 @@ Description: The poison file specifies whether objects should be poisoned when a new slab is allocated. -What: /sys/kernel/slab/cache/reclaim_account +What: /sys/kernel/slab//reclaim_account Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -392,7 +392,7 @@ Description: The reclaim_account file specifies whether the cache's objects are reclaimable (and grouped by their mobility). -What: /sys/kernel/slab/cache/red_zone +What: /sys/kernel/slab//red_zone Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -401,7 +401,7 @@ Description: The red_zone file specifies whether the cache's objects are red zoned. -What: /sys/kernel/slab/cache/remote_node_defrag_ratio +What: /sys/kernel/slab//remote_node_defrag_ratio Date: January 2008 KernelVersion: 2.6.25 Contact: Pekka Enberg , @@ -415,7 +415,7 @@ Description: Available when CONFIG_NUMA is enabled. -What: /sys/kernel/slab/cache/sanity_checks +What: /sys/kernel/slab//sanity_checks Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -426,7 +426,7 @@ Description: checks. Caches that enable sanity_checks cannot be merged with caches that do not. -What: /sys/kernel/slab/cache/shrink +What: /sys/kernel/slab//shrink Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -442,7 +442,7 @@ Description: adversely impact other running applications. So it should be used with care. -What: /sys/kernel/slab/cache/slab_size +What: /sys/kernel/slab//slab_size Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -451,7 +451,7 @@ Description: The slab_size file is read-only and specifies the object size with metadata (debugging information and alignment) in bytes. -What: /sys/kernel/slab/cache/slabs +What: /sys/kernel/slab//slabs Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -461,7 +461,7 @@ Description: there are (both cpu and partial) and from which nodes they are from. -What: /sys/kernel/slab/cache/store_user +What: /sys/kernel/slab//store_user Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -470,7 +470,7 @@ Description: The store_user file specifies whether the location of allocation or free should be tracked for a cache. -What: /sys/kernel/slab/cache/total_objects +What: /sys/kernel/slab//total_objects Date: April 2008 KernelVersion: 2.6.26 Contact: Pekka Enberg , @@ -479,7 +479,7 @@ Description: The total_objects file is read-only and displays how many total objects a cache has and from which nodes they are from. -What: /sys/kernel/slab/cache/trace +What: /sys/kernel/slab//trace Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , @@ -488,7 +488,7 @@ Description: The trace file specifies whether object allocations and frees should be traced. -What: /sys/kernel/slab/cache/validate +What: /sys/kernel/slab//validate Date: May 2007 KernelVersion: 2.6.22 Contact: Pekka Enberg , From 18e49b304633fab4253718173ea36e6605fd1036 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:31 +0200 Subject: [PATCH 012/122] ABI: security: fix location for evm and ima_policy The What: definitions there are wrong, pointing to different locations than what's expected. Reviewed-by: Mimi Zohar Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/b2563ac34c2e234cdd728f0c701b57ac9023c45a.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/evm | 4 ++-- Documentation/ABI/testing/ima_policy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/ABI/testing/evm b/Documentation/ABI/testing/evm index 553fd8a33e56..4b76a19b7bb4 100644 --- a/Documentation/ABI/testing/evm +++ b/Documentation/ABI/testing/evm @@ -1,4 +1,4 @@ -What: security/evm +What: /sys/kernel/security/evm /sys/kernel/security/*/evm Date: March 2011 Contact: Mimi Zohar Description: @@ -93,7 +93,7 @@ Description: core/ima-setup) have support for loading keys at boot time. -What: security/integrity/evm/evm_xattrs +What: /sys/kernel/security/*/evm/evm_xattrs Date: April 2018 Contact: Matthew Garrett Description: diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy index 5c2798534950..2d84063d196f 100644 --- a/Documentation/ABI/testing/ima_policy +++ b/Documentation/ABI/testing/ima_policy @@ -1,4 +1,4 @@ -What: security/ima/policy +What: /sys/kernel/security/*/ima/policy Date: May 2008 Contact: Mimi Zohar Description: From ea84409f88f82477b89f5468fc1a5faffa15bd7b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:32 +0200 Subject: [PATCH 013/122] ABI: sysfs-class-tpm: use wildcards for pcr-* nodes Change how this expression is defined: /sys/class/tpm/tpmX/pcr-H/N in order to allow get_abi.pl to convert it into this regex: /sys/class/tpm/tpmX/pcr-.*/.* Reviewed-by: Jarkko Sakkinen Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/4ab3fce91ea2bd7c36a07e6c646bf7bd6f4f8634.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/stable/sysfs-class-tpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/stable/sysfs-class-tpm b/Documentation/ABI/stable/sysfs-class-tpm index d897ecb9615f..411d5895bed4 100644 --- a/Documentation/ABI/stable/sysfs-class-tpm +++ b/Documentation/ABI/stable/sysfs-class-tpm @@ -195,7 +195,7 @@ Description: The "tpm_version_major" property shows the TCG spec major version 2 -What: /sys/class/tpm/tpmX/pcr-H/N +What: /sys/class/tpm/tpmX/pcr-/ Date: March 2021 KernelVersion: 5.12 Contact: linux-integrity@vger.kernel.org From 08981d29c33aa9eddeaf1fa7b414db51b4764be4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:33 +0200 Subject: [PATCH 014/122] ABI: sysfs-bus-rapidio: use wildcards on What definitions While humans may be able to understand that something like: /sys/bus/rapidio/devices/nn:d:iiii could actually mean: /sys/bus/rapidio/devices/00:e:0000 This is something that computers can't easily identify. As get_abi.pl needs to convert it into a regex, change What: lines to: /sys/bus/rapidio/devices/:: Which is the commonly-used pattern on ABI files for wildcards. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/207762e994d50eec0bf8d61c3adf153030c821eb.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-rapidio | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-rapidio b/Documentation/ABI/testing/sysfs-bus-rapidio index 634ea207a50a..f8b6728dac10 100644 --- a/Documentation/ABI/testing/sysfs-bus-rapidio +++ b/Documentation/ABI/testing/sysfs-bus-rapidio @@ -1,4 +1,4 @@ -What: /sys/bus/rapidio/devices/nn:d:iiii +What: /sys/bus/rapidio/devices/:: Description: For each RapidIO device, the RapidIO subsystem creates files in an individual subdirectory with the following name format of @@ -29,7 +29,7 @@ Description: Attributes Common for All RapidIO Devices ----------------------------------------- -What: /sys/bus/rapidio/devices/nn:d:iiii/did +What: /sys/bus/rapidio/devices/::/did Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -37,7 +37,7 @@ Contact: Matt Porter , Description: (RO) returns the device identifier -What: /sys/bus/rapidio/devices/nn:d:iiii/vid +What: /sys/bus/rapidio/devices/::/vid Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -45,7 +45,7 @@ Contact: Matt Porter , Description: (RO) returns the device vendor identifier -What: /sys/bus/rapidio/devices/nn:d:iiii/device_rev +What: /sys/bus/rapidio/devices/::/device_rev Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -53,7 +53,7 @@ Contact: Matt Porter , Description: (RO) returns the device revision level -What: /sys/bus/rapidio/devices/nn:d:iiii/asm_did +What: /sys/bus/rapidio/devices/::/asm_did Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -61,7 +61,7 @@ Contact: Matt Porter , Description: (RO) returns identifier for the assembly containing the device -What: /sys/bus/rapidio/devices/nn:d:iiii/asm_rev +What: /sys/bus/rapidio/devices/::/asm_rev Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -70,7 +70,7 @@ Description: (RO) returns revision level of the assembly containing the device -What: /sys/bus/rapidio/devices/nn:d:iiii/asm_vid +What: /sys/bus/rapidio/devices/::/asm_vid Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -79,7 +79,7 @@ Description: (RO) returns vendor identifier of the assembly containing the device -What: /sys/bus/rapidio/devices/nn:d:iiii/destid +What: /sys/bus/rapidio/devices/::/destid Date: Mar, 2011 KernelVersion: v2.6.3 Contact: Matt Porter , @@ -88,7 +88,7 @@ Description: (RO) returns device destination ID assigned by the enumeration routine -What: /sys/bus/rapidio/devices/nn:d:iiii/lprev +What: /sys/bus/rapidio/devices/::/lprev Date: Mar, 2011 KernelVersion: v2.6.39 Contact: Matt Porter , @@ -97,7 +97,7 @@ Description: (RO) returns name of previous device (switch) on the path to the device that that owns this attribute -What: /sys/bus/rapidio/devices/nn:d:iiii/modalias +What: /sys/bus/rapidio/devices/::/modalias Date: Jul, 2013 KernelVersion: v3.11 Contact: Matt Porter , @@ -105,7 +105,7 @@ Contact: Matt Porter , Description: (RO) returns the device modalias -What: /sys/bus/rapidio/devices/nn:d:iiii/config +What: /sys/bus/rapidio/devices/::/config Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -128,7 +128,7 @@ device-specific sysfs attributes by specifying a callback function that may be set by the switch initialization routine during enumeration or discovery process. -What: /sys/bus/rapidio/devices/nn:s:iiii/routes +What: /sys/bus/rapidio/devices/::/routes Date: Nov, 2005 KernelVersion: v2.6.15 Contact: Matt Porter , @@ -138,7 +138,7 @@ Description: This attribute reports only valid routing table entries, one line for each entry. -What: /sys/bus/rapidio/devices/nn:s:iiii/destid +What: /sys/bus/rapidio/devices/::/destid Date: Mar, 2011 KernelVersion: v2.6.3 Contact: Matt Porter , @@ -147,7 +147,7 @@ Description: (RO) device destination ID of the associated device that defines a route to the switch -What: /sys/bus/rapidio/devices/nn:s:iiii/hopcount +What: /sys/bus/rapidio/devices/::/hopcount Date: Mar, 2011 KernelVersion: v2.6.39 Contact: Matt Porter , @@ -155,7 +155,7 @@ Contact: Matt Porter , Description: (RO) number of hops on the path to the switch -What: /sys/bus/rapidio/devices/nn:s:iiii/lnext +What: /sys/bus/rapidio/devices/::/lnext Date: Mar, 2011 KernelVersion: v2.6.39 Contact: Matt Porter , @@ -172,7 +172,7 @@ Device-specific Switch Attributes IDT_GEN2- -What: /sys/bus/rapidio/devices/nn:s:iiii/errlog +What: /sys/bus/rapidio/devices/::/errlog Date: Oct, 2010 KernelVersion: v2.6.37 Contact: Matt Porter , From 1e0349f6d8848ea0cc5d20f75548810e9b1b403d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:34 +0200 Subject: [PATCH 015/122] ABI: sysfs-class-cxl: place "not in a guest" at description The What: field should have just the location of the ABI. Anything else should be inside the description. This fixes its parsing by get_abi.pl script. Acked-by: Andrew Donnellan Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/cb1f2af183369d682a46efa4e5c01ad5f66e99c4.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-cxl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-cxl b/Documentation/ABI/testing/sysfs-class-cxl index 818f55970efb..3c77677e0ca7 100644 --- a/Documentation/ABI/testing/sysfs-class-cxl +++ b/Documentation/ABI/testing/sysfs-class-cxl @@ -166,10 +166,11 @@ Description: read only Decimal value of the Per Process MMIO space length. Users: https://github.com/ibm-capi/libcxl -What: /sys/class/cxl/m/pp_mmio_off (not in a guest) +What: /sys/class/cxl/m/pp_mmio_off Date: September 2014 Contact: linuxppc-dev@lists.ozlabs.org Description: read only + (not in a guest) Decimal value of the Per Process MMIO space offset. Users: https://github.com/ibm-capi/libcxl @@ -190,28 +191,31 @@ Description: read only Identifies the revision level of the PSL. Users: https://github.com/ibm-capi/libcxl -What: /sys/class/cxl//base_image (not in a guest) +What: /sys/class/cxl//base_image Date: September 2014 Contact: linuxppc-dev@lists.ozlabs.org Description: read only + (not in a guest) Identifies the revision level of the base image for devices that support loadable PSLs. For FPGAs this field identifies the image contained in the on-adapter flash which is loaded during the initial program load. Users: https://github.com/ibm-capi/libcxl -What: /sys/class/cxl//image_loaded (not in a guest) +What: /sys/class/cxl//image_loaded Date: September 2014 Contact: linuxppc-dev@lists.ozlabs.org Description: read only + (not in a guest) Will return "user" or "factory" depending on the image loaded onto the card. Users: https://github.com/ibm-capi/libcxl -What: /sys/class/cxl//load_image_on_perst (not in a guest) +What: /sys/class/cxl//load_image_on_perst Date: December 2014 Contact: linuxppc-dev@lists.ozlabs.org Description: read/write + (not in a guest) Valid entries are "none", "user", and "factory". "none" means PERST will not cause image to be loaded to the card. A power cycle is required to load the image. @@ -235,10 +239,11 @@ Description: write only contexts on the card AFUs. Users: https://github.com/ibm-capi/libcxl -What: /sys/class/cxl//perst_reloads_same_image (not in a guest) +What: /sys/class/cxl//perst_reloads_same_image Date: July 2015 Contact: linuxppc-dev@lists.ozlabs.org Description: read/write + (not in a guest) Trust that when an image is reloaded via PERST, it will not have changed. From 6f0e4651832785f50992e922c49aeeee2b120cb7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:35 +0200 Subject: [PATCH 016/122] ABI: sysfs-class-devfreq-event: use the right wildcards on What On most ABI files, the wildcards are used as , instead of (x). Replace it to make it using a more standard wildcard. That helps get_abi.pl to convert it into a regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3a0b6aa8f740c3dea78463f4256eafea6e973f92.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-devfreq-event | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-devfreq-event b/Documentation/ABI/testing/sysfs-class-devfreq-event index ceaf0f686d4a..dbe48495e55a 100644 --- a/Documentation/ABI/testing/sysfs-class-devfreq-event +++ b/Documentation/ABI/testing/sysfs-class-devfreq-event @@ -1,25 +1,25 @@ -What: /sys/class/devfreq-event/event(x)/ +What: /sys/class/devfreq-event/event/ Date: January 2017 Contact: Chanwoo Choi Description: Provide a place in sysfs for the devfreq-event objects. This allows accessing various devfreq-event specific variables. - The name of devfreq-event object denoted as 'event(x)' which + The name of devfreq-event object denoted as 'event' which includes the unique number of 'x' for each devfreq-event object. -What: /sys/class/devfreq-event/event(x)/name +What: /sys/class/devfreq-event/event/name Date: January 2017 Contact: Chanwoo Choi Description: - The /sys/class/devfreq-event/event(x)/name attribute contains + The /sys/class/devfreq-event/event/name attribute contains the name of the devfreq-event object. This attribute is read-only. -What: /sys/class/devfreq-event/event(x)/enable_count +What: /sys/class/devfreq-event/event/enable_count Date: January 2017 Contact: Chanwoo Choi Description: - The /sys/class/devfreq-event/event(x)/enable_count attribute + The /sys/class/devfreq-event/event/enable_count attribute contains the reference count to enable the devfreq-event object. If the device is enabled, the value of attribute is greater than zero. From 743e4636b7892b6d664a04e98a0b65934ccc5baa Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:36 +0200 Subject: [PATCH 017/122] ABI: sysfs-class-mic: use the right wildcards on What definitions On most ABI files, the wildcards are used as , instead of (x). Replace it to make it using a more standard wildcard. That helps get_abi.pl to convert it into a regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d0713698c609410506f9e520fa879c0592a5e11d.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-mic | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-mic b/Documentation/ABI/testing/sysfs-class-mic index bd0e780c3760..5e5f36d10055 100644 --- a/Documentation/ABI/testing/sysfs-class-mic +++ b/Documentation/ABI/testing/sysfs-class-mic @@ -8,7 +8,7 @@ Description: PCIe form factor add-in Coprocessor card based on the Intel Many Integrated Core (MIC) architecture that runs a Linux OS. -What: /sys/class/mic/mic(x) +What: /sys/class/mic/mic Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -17,7 +17,7 @@ Description: represent MIC devices (0,1,..etc). Each directory has information specific to that MIC device. -What: /sys/class/mic/mic(x)/family +What: /sys/class/mic/mic/family Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -25,7 +25,7 @@ Description: Provides information about the Coprocessor family for an Intel MIC device. For example - "x100" -What: /sys/class/mic/mic(x)/stepping +What: /sys/class/mic/mic/stepping Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -33,7 +33,7 @@ Description: Provides information about the silicon stepping for an Intel MIC device. For example - "A0" or "B0" -What: /sys/class/mic/mic(x)/state +What: /sys/class/mic/mic/state Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -69,7 +69,7 @@ Description: "shutdown" Initiates card OS shutdown. ========== =================================================== -What: /sys/class/mic/mic(x)/shutdown_status +What: /sys/class/mic/mic/shutdown_status Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -88,7 +88,7 @@ Description: "restart" Shutdown because of a restart command. ========== =================================================== -What: /sys/class/mic/mic(x)/cmdline +What: /sys/class/mic/mic/cmdline Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -104,7 +104,7 @@ Description: or modify existing ones and then write the whole kernel command line back to this entry. -What: /sys/class/mic/mic(x)/firmware +What: /sys/class/mic/mic/firmware Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -114,7 +114,7 @@ Description: card can be found. The entry can be written to change the firmware image location under /lib/firmware/. -What: /sys/class/mic/mic(x)/ramdisk +What: /sys/class/mic/mic/ramdisk Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -124,7 +124,7 @@ Description: OS boot can be found. The entry can be written to change the ramdisk image location under /lib/firmware/. -What: /sys/class/mic/mic(x)/bootmode +What: /sys/class/mic/mic/bootmode Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -135,7 +135,7 @@ Description: a) linux - Boot a Linux image. b) flash - Boot an image for flash updates. -What: /sys/class/mic/mic(x)/log_buf_addr +What: /sys/class/mic/mic/log_buf_addr Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -149,7 +149,7 @@ Description: log buffer address to be written can be found in the System.map file of the card OS. -What: /sys/class/mic/mic(x)/log_buf_len +What: /sys/class/mic/mic/log_buf_len Date: October 2013 KernelVersion: 3.13 Contact: Sudeep Dutt @@ -163,7 +163,7 @@ Description: buffer length address to be written can be found in the System.map file of the card OS. -What: /sys/class/mic/mic(x)/heartbeat_enable +What: /sys/class/mic/mic/heartbeat_enable Date: March 2015 KernelVersion: 4.4 Contact: Ashutosh Dixit From 9fc3678e478412c897fc33200a3a656c8ee14431 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:37 +0200 Subject: [PATCH 018/122] ABI: pstore: Fix What field If both /sys/fs/pstore/... and /dev/pstore/... are possible, it should use, instead, two What: fields. Acked-by: Kees Cook Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e19daafb779bd3a8f9ae1c15f670752355e5d40f.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/pstore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/pstore b/Documentation/ABI/testing/pstore index 5b02540781a2..d3cff4a7ee10 100644 --- a/Documentation/ABI/testing/pstore +++ b/Documentation/ABI/testing/pstore @@ -1,4 +1,5 @@ -What: /sys/fs/pstore/... (or /dev/pstore/...) +What: /sys/fs/pstore/... +What: /dev/pstore/... Date: March 2011 KernelVersion: 2.6.39 Contact: tony.luck@intel.com From 4e25928cf8549cda2d8c030dc35cfe0d6e521987 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:38 +0200 Subject: [PATCH 019/122] ABI: sysfs-class-typec: fix a typo on a What field This what: /sys/class/typec/-partner>/identity/ Contains an extra ">" character. Remove it. Reviewed-by: Heikki Krogerus Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/bff0e7c137fb4f41ac0b2ed9c5a21c0948203f15.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-typec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-class-typec b/Documentation/ABI/testing/sysfs-class-typec index 40122d915ae1..75088ecad202 100644 --- a/Documentation/ABI/testing/sysfs-class-typec +++ b/Documentation/ABI/testing/sysfs-class-typec @@ -200,7 +200,7 @@ Description: USB Power Delivery Specification defines a set of product types amc Alternate Mode Controller ====================== ========================== -What: /sys/class/typec/-partner>/identity/ +What: /sys/class/typec/-partner/identity/ Date: April 2017 Contact: Heikki Krogerus Description: From 2e6a0323944095df2f3a8bd2bba5151b88e95d4b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:39 +0200 Subject: [PATCH 020/122] ABI: sysfs-ata: use a proper wildcard for ata_* In order to let script/get_abi.pl to convert it into a Regex, replace the three "..." at the end, meaning a wildcard to a real filesystem wildcard. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/72f783bc0287411f11d6640368926f8a357c002d.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-ata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-ata b/Documentation/ABI/testing/sysfs-ata index 9ab0ef1dd1c7..2f726c914752 100644 --- a/Documentation/ABI/testing/sysfs-ata +++ b/Documentation/ABI/testing/sysfs-ata @@ -1,4 +1,4 @@ -What: /sys/class/ata_... +What: /sys/class/ata_* Description: Provide a place in sysfs for storing the ATA topology of the system. This allows retrieving various information about ATA From 92d35cdc9a30dc2cabc8b0adff44744f7c7e7ac2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:40 +0200 Subject: [PATCH 021/122] ABI: sysfs-class-infiniband: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Acked-by: Jason Gunthorpe Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3cb5cad69f457ed92b38d719ff7f6f0fc9364285.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/stable/sysfs-class-infiniband | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Documentation/ABI/stable/sysfs-class-infiniband b/Documentation/ABI/stable/sysfs-class-infiniband index 9b1bdfa43354..ebf08c604336 100644 --- a/Documentation/ABI/stable/sysfs-class-infiniband +++ b/Documentation/ABI/stable/sysfs-class-infiniband @@ -232,10 +232,10 @@ Description: The RoCE type of the associated GID resides at index . or "RoCE v2" for RoCE v2 based GIDs. -What: /sys/class/infiniband_mad/umadN/ibdev -What: /sys/class/infiniband_mad/umadN/port -What: /sys/class/infiniband_mad/issmN/ibdev -What: /sys/class/infiniband_mad/issmN/port +What: /sys/class/infiniband_mad/umad/ibdev +What: /sys/class/infiniband_mad/umad/port +What: /sys/class/infiniband_mad/issm/ibdev +What: /sys/class/infiniband_mad/issm/port Date: Apr, 2005 KernelVersion: v2.6.12 Contact: linux-rdma@vger.kernel.org @@ -261,8 +261,8 @@ Description: userspace ABI compatibility of umad & issm devices. -What: /sys/class/infiniband_verbs/uverbsN/ibdev -What: /sys/class/infiniband_verbs/uverbsN/abi_version +What: /sys/class/infiniband_verbs/uverbs/ibdev +What: /sys/class/infiniband_verbs/uverbs/abi_version Date: Sept, 2005 KernelVersion: v2.6.14 Contact: linux-rdma@vger.kernel.org @@ -471,7 +471,7 @@ Description: =============== ====================================================== -What: /sys/class/infiniband/qibX/ports/N/sl2vl/[0-15] +What: /sys/class/infiniband/qibX/ports//sl2vl/[0-15] Date: May, 2010 KernelVersion: v2.6.35 Contact: linux-rdma@vger.kernel.org @@ -480,8 +480,8 @@ Description: the Service Level (SL). Listing the SL files returns the Virtual Lane (VL) as programmed by the SL. -What: /sys/class/infiniband/qibX/ports/N/CCMgtA/cc_settings_bin -What: /sys/class/infiniband/qibX/ports/N/CCMgtA/cc_table_bin +What: /sys/class/infiniband/qibX/ports//CCMgtA/cc_settings_bin +What: /sys/class/infiniband/qibX/ports//CCMgtA/cc_table_bin Date: May, 2010 KernelVersion: v2.6.35 Contact: linux-rdma@vger.kernel.org @@ -499,11 +499,11 @@ Description: delay. =============== ================================================ -What: /sys/class/infiniband/qibX/ports/N/linkstate/loopback -What: /sys/class/infiniband/qibX/ports/N/linkstate/led_override -What: /sys/class/infiniband/qibX/ports/N/linkstate/hrtbt_enable -What: /sys/class/infiniband/qibX/ports/N/linkstate/status -What: /sys/class/infiniband/qibX/ports/N/linkstate/status_str +What: /sys/class/infiniband/qibX/ports//linkstate/loopback +What: /sys/class/infiniband/qibX/ports//linkstate/led_override +What: /sys/class/infiniband/qibX/ports//linkstate/hrtbt_enable +What: /sys/class/infiniband/qibX/ports//linkstate/status +What: /sys/class/infiniband/qibX/ports//linkstate/status_str Date: May, 2010 KernelVersion: v2.6.35 Contact: linux-rdma@vger.kernel.org @@ -523,16 +523,16 @@ Description: "Fatal_Hardware_Error". =============== =============================================== -What: /sys/class/infiniband/qibX/ports/N/diag_counters/rc_resends -What: /sys/class/infiniband/qibX/ports/N/diag_counters/seq_naks -What: /sys/class/infiniband/qibX/ports/N/diag_counters/rdma_seq -What: /sys/class/infiniband/qibX/ports/N/diag_counters/rnr_naks -What: /sys/class/infiniband/qibX/ports/N/diag_counters/other_naks -What: /sys/class/infiniband/qibX/ports/N/diag_counters/rc_timeouts -What: /sys/class/infiniband/qibX/ports/N/diag_counters/look_pkts -What: /sys/class/infiniband/qibX/ports/N/diag_counters/pkt_drops -What: /sys/class/infiniband/qibX/ports/N/diag_counters/dma_wait -What: /sys/class/infiniband/qibX/ports/N/diag_counters/unaligned +What: /sys/class/infiniband/qibX/ports//diag_counters/rc_resends +What: /sys/class/infiniband/qibX/ports//diag_counters/seq_naks +What: /sys/class/infiniband/qibX/ports//diag_counters/rdma_seq +What: /sys/class/infiniband/qibX/ports//diag_counters/rnr_naks +What: /sys/class/infiniband/qibX/ports//diag_counters/other_naks +What: /sys/class/infiniband/qibX/ports//diag_counters/rc_timeouts +What: /sys/class/infiniband/qibX/ports//diag_counters/look_pkts +What: /sys/class/infiniband/qibX/ports//diag_counters/pkt_drops +What: /sys/class/infiniband/qibX/ports//diag_counters/dma_wait +What: /sys/class/infiniband/qibX/ports//diag_counters/unaligned Date: May, 2010 KernelVersion: v2.6.35 Contact: linux-rdma@vger.kernel.org @@ -650,9 +650,9 @@ Description: =============== ============================================= -What: /sys/class/infiniband/hfi1_X/ports/N/CCMgtA/cc_settings_bin -What: /sys/class/infiniband/hfi1_X/ports/N/CCMgtA/cc_table_bin -What: /sys/class/infiniband/hfi1_X/ports/N/CCMgtA/cc_prescan +What: /sys/class/infiniband/hfi1_X/ports//CCMgtA/cc_settings_bin +What: /sys/class/infiniband/hfi1_X/ports//CCMgtA/cc_table_bin +What: /sys/class/infiniband/hfi1_X/ports//CCMgtA/cc_prescan Date: May, 2016 KernelVersion: v4.6 Contact: linux-rdma@vger.kernel.org @@ -675,9 +675,9 @@ Description: disable. =============== ================================================ -What: /sys/class/infiniband/hfi1_X/ports/N/sc2vl/[0-31] -What: /sys/class/infiniband/hfi1_X/ports/N/sl2sc/[0-31] -What: /sys/class/infiniband/hfi1_X/ports/N/vl2mtu/[0-15] +What: /sys/class/infiniband/hfi1_X/ports//sc2vl/[0-31] +What: /sys/class/infiniband/hfi1_X/ports//sl2sc/[0-31] +What: /sys/class/infiniband/hfi1_X/ports//vl2mtu/[0-15] Date: May, 2016 KernelVersion: v4.6 Contact: linux-rdma@vger.kernel.org @@ -691,8 +691,8 @@ Description: =============== =================================================== -What: /sys/class/infiniband/hfi1_X/sdma_N/cpu_list -What: /sys/class/infiniband/hfi1_X/sdma_N/vl +What: /sys/class/infiniband/hfi1_X/sdma_/cpu_list +What: /sys/class/infiniband/hfi1_X/sdma_/vl Date: Sept, 2016 KernelVersion: v4.8 Contact: linux-rdma@vger.kernel.org From 24d732a908637c80c678962ad78850bd07227232 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:41 +0200 Subject: [PATCH 022/122] ABI: sysfs-bus-pci: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Acked-by: Bjorn Helgaas Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/4ede4ec98e295f054f3e5a6f3f9393b5e3d5d2a7.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-pci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci index d4ae03296861..191cbe9ae5ed 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci +++ b/Documentation/ABI/testing/sysfs-bus-pci @@ -160,7 +160,7 @@ Description: If the underlying VPD has a writable section then the corresponding section of this file will be writable. -What: /sys/bus/pci/devices/.../virtfnN +What: /sys/bus/pci/devices/.../virtfn Date: March 2009 Contact: Yu Zhao Description: From 5475cd780cc91f8de75d6e69cdb806d1a7f93667 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:42 +0200 Subject: [PATCH 023/122] ABI: sysfs-bus-soundwire-master: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/eb62c19ce92c0dc1a50eb57c1052866256250644.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/sysfs-bus-soundwire-master | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-soundwire-master b/Documentation/ABI/testing/sysfs-bus-soundwire-master index 46ef038d8722..d2342911ffbb 100644 --- a/Documentation/ABI/testing/sysfs-bus-soundwire-master +++ b/Documentation/ABI/testing/sysfs-bus-soundwire-master @@ -1,13 +1,13 @@ -What: /sys/bus/soundwire/devices/sdw-master-N/revision - /sys/bus/soundwire/devices/sdw-master-N/clk_stop_modes - /sys/bus/soundwire/devices/sdw-master-N/clk_freq - /sys/bus/soundwire/devices/sdw-master-N/clk_gears - /sys/bus/soundwire/devices/sdw-master-N/default_col - /sys/bus/soundwire/devices/sdw-master-N/default_frame_rate - /sys/bus/soundwire/devices/sdw-master-N/default_row - /sys/bus/soundwire/devices/sdw-master-N/dynamic_shape - /sys/bus/soundwire/devices/sdw-master-N/err_threshold - /sys/bus/soundwire/devices/sdw-master-N/max_clk_freq +What: /sys/bus/soundwire/devices/sdw-master-/revision + /sys/bus/soundwire/devices/sdw-master-/clk_stop_modes + /sys/bus/soundwire/devices/sdw-master-/clk_freq + /sys/bus/soundwire/devices/sdw-master-/clk_gears + /sys/bus/soundwire/devices/sdw-master-/default_col + /sys/bus/soundwire/devices/sdw-master-/default_frame_rate + /sys/bus/soundwire/devices/sdw-master-/default_row + /sys/bus/soundwire/devices/sdw-master-/dynamic_shape + /sys/bus/soundwire/devices/sdw-master-/err_threshold + /sys/bus/soundwire/devices/sdw-master-/max_clk_freq Date: April 2020 From c5c0c4ea0ed57a3ddfe67e88ac1d6d1850613240 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:43 +0200 Subject: [PATCH 024/122] ABI: sysfs-bus-soundwire-slave: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/416f4a746c116147abb08fb0155a6a4ed065dfd7.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/sysfs-bus-soundwire-slave | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-soundwire-slave b/Documentation/ABI/testing/sysfs-bus-soundwire-slave index d324aa0b678f..fbf55834dfee 100644 --- a/Documentation/ABI/testing/sysfs-bus-soundwire-slave +++ b/Documentation/ABI/testing/sysfs-bus-soundwire-slave @@ -64,37 +64,37 @@ Description: SoundWire Slave Data Port-0 DisCo properties. Data port 0 are used by the bus to configure the Data Port 0. -What: /sys/bus/soundwire/devices/sdw:.../dpN_src/max_word - /sys/bus/soundwire/devices/sdw:.../dpN_src/min_word - /sys/bus/soundwire/devices/sdw:.../dpN_src/words - /sys/bus/soundwire/devices/sdw:.../dpN_src/type - /sys/bus/soundwire/devices/sdw:.../dpN_src/max_grouping - /sys/bus/soundwire/devices/sdw:.../dpN_src/simple_ch_prep_sm - /sys/bus/soundwire/devices/sdw:.../dpN_src/ch_prep_timeout - /sys/bus/soundwire/devices/sdw:.../dpN_src/imp_def_interrupts - /sys/bus/soundwire/devices/sdw:.../dpN_src/min_ch - /sys/bus/soundwire/devices/sdw:.../dpN_src/max_ch - /sys/bus/soundwire/devices/sdw:.../dpN_src/channels - /sys/bus/soundwire/devices/sdw:.../dpN_src/ch_combinations - /sys/bus/soundwire/devices/sdw:.../dpN_src/max_async_buffer - /sys/bus/soundwire/devices/sdw:.../dpN_src/block_pack_mode - /sys/bus/soundwire/devices/sdw:.../dpN_src/port_encoding +What: /sys/bus/soundwire/devices/sdw:.../dp_src/max_word + /sys/bus/soundwire/devices/sdw:.../dp_src/min_word + /sys/bus/soundwire/devices/sdw:.../dp_src/words + /sys/bus/soundwire/devices/sdw:.../dp_src/type + /sys/bus/soundwire/devices/sdw:.../dp_src/max_grouping + /sys/bus/soundwire/devices/sdw:.../dp_src/simple_ch_prep_sm + /sys/bus/soundwire/devices/sdw:.../dp_src/ch_prep_timeout + /sys/bus/soundwire/devices/sdw:.../dp_src/imp_def_interrupts + /sys/bus/soundwire/devices/sdw:.../dp_src/min_ch + /sys/bus/soundwire/devices/sdw:.../dp_src/max_ch + /sys/bus/soundwire/devices/sdw:.../dp_src/channels + /sys/bus/soundwire/devices/sdw:.../dp_src/ch_combinations + /sys/bus/soundwire/devices/sdw:.../dp_src/max_async_buffer + /sys/bus/soundwire/devices/sdw:.../dp_src/block_pack_mode + /sys/bus/soundwire/devices/sdw:.../dp_src/port_encoding - /sys/bus/soundwire/devices/sdw:.../dpN_sink/max_word - /sys/bus/soundwire/devices/sdw:.../dpN_sink/min_word - /sys/bus/soundwire/devices/sdw:.../dpN_sink/words - /sys/bus/soundwire/devices/sdw:.../dpN_sink/type - /sys/bus/soundwire/devices/sdw:.../dpN_sink/max_grouping - /sys/bus/soundwire/devices/sdw:.../dpN_sink/simple_ch_prep_sm - /sys/bus/soundwire/devices/sdw:.../dpN_sink/ch_prep_timeout - /sys/bus/soundwire/devices/sdw:.../dpN_sink/imp_def_interrupts - /sys/bus/soundwire/devices/sdw:.../dpN_sink/min_ch - /sys/bus/soundwire/devices/sdw:.../dpN_sink/max_ch - /sys/bus/soundwire/devices/sdw:.../dpN_sink/channels - /sys/bus/soundwire/devices/sdw:.../dpN_sink/ch_combinations - /sys/bus/soundwire/devices/sdw:.../dpN_sink/max_async_buffer - /sys/bus/soundwire/devices/sdw:.../dpN_sink/block_pack_mode - /sys/bus/soundwire/devices/sdw:.../dpN_sink/port_encoding + /sys/bus/soundwire/devices/sdw:.../dp_sink/max_word + /sys/bus/soundwire/devices/sdw:.../dp_sink/min_word + /sys/bus/soundwire/devices/sdw:.../dp_sink/words + /sys/bus/soundwire/devices/sdw:.../dp_sink/type + /sys/bus/soundwire/devices/sdw:.../dp_sink/max_grouping + /sys/bus/soundwire/devices/sdw:.../dp_sink/simple_ch_prep_sm + /sys/bus/soundwire/devices/sdw:.../dp_sink/ch_prep_timeout + /sys/bus/soundwire/devices/sdw:.../dp_sink/imp_def_interrupts + /sys/bus/soundwire/devices/sdw:.../dp_sink/min_ch + /sys/bus/soundwire/devices/sdw:.../dp_sink/max_ch + /sys/bus/soundwire/devices/sdw:.../dp_sink/channels + /sys/bus/soundwire/devices/sdw:.../dp_sink/ch_combinations + /sys/bus/soundwire/devices/sdw:.../dp_sink/max_async_buffer + /sys/bus/soundwire/devices/sdw:.../dp_sink/block_pack_mode + /sys/bus/soundwire/devices/sdw:.../dp_sink/port_encoding Date: May 2020 From c84aaa4da1459295e17ee29d7dd2b5c8d1158f5c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:44 +0200 Subject: [PATCH 025/122] ABI: sysfs-class-gnss: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Acked-by: Johan Hovold Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/80b7f60a6bac7bb1938d60dca509d75dff3c2c62.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-gnss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-class-gnss b/Documentation/ABI/testing/sysfs-class-gnss index c8553d972edd..9650f3a7fc03 100644 --- a/Documentation/ABI/testing/sysfs-class-gnss +++ b/Documentation/ABI/testing/sysfs-class-gnss @@ -1,4 +1,4 @@ -What: /sys/class/gnss/gnssN/type +What: /sys/class/gnss/gnss/type Date: May 2018 KernelVersion: 4.18 Contact: Johan Hovold From 0d502366d621fd9e087934c55112446c1f32bc6c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:45 +0200 Subject: [PATCH 026/122] ABI: sysfs-class-mei: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3789f936a637f1b4059400099ae7a592cd4df8f5.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-mei | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-mei b/Documentation/ABI/testing/sysfs-class-mei index 5c52372b43cb..1db36ddf8e58 100644 --- a/Documentation/ABI/testing/sysfs-class-mei +++ b/Documentation/ABI/testing/sysfs-class-mei @@ -6,7 +6,7 @@ Description: The mei/ class sub-directory belongs to mei device class -What: /sys/class/mei/meiN/ +What: /sys/class/mei/mei/ Date: May 2014 KernelVersion: 3.17 Contact: Tomas Winkler @@ -14,7 +14,7 @@ Description: The /sys/class/mei/meiN directory is created for each probed mei device -What: /sys/class/mei/meiN/fw_status +What: /sys/class/mei/mei/fw_status Date: Nov 2014 KernelVersion: 3.19 Contact: Tomas Winkler @@ -29,7 +29,7 @@ Description: Display fw status registers content Also number of registers varies between 1 and 6 depending on generation. -What: /sys/class/mei/meiN/hbm_ver +What: /sys/class/mei/mei/hbm_ver Date: Aug 2016 KernelVersion: 4.9 Contact: Tomas Winkler @@ -38,7 +38,7 @@ Description: Display the negotiated HBM protocol version. The HBM protocol version negotiated between the driver and the device. -What: /sys/class/mei/meiN/hbm_ver_drv +What: /sys/class/mei/mei/hbm_ver_drv Date: Aug 2016 KernelVersion: 4.9 Contact: Tomas Winkler @@ -46,7 +46,7 @@ Description: Display the driver HBM protocol version. The HBM protocol version supported by the driver. -What: /sys/class/mei/meiN/tx_queue_limit +What: /sys/class/mei/mei/tx_queue_limit Date: Jan 2018 KernelVersion: 4.16 Contact: Tomas Winkler @@ -55,7 +55,7 @@ Description: Configure tx queue limit Set maximal number of pending writes per opened session. -What: /sys/class/mei/meiN/fw_ver +What: /sys/class/mei/mei/fw_ver Date: May 2018 KernelVersion: 4.18 Contact: Tomas Winkler @@ -66,7 +66,7 @@ Description: Display the ME firmware version. There can be up to three such blocks for different FW components. -What: /sys/class/mei/meiN/dev_state +What: /sys/class/mei/mei/dev_state Date: Mar 2019 KernelVersion: 5.1 Contact: Tomas Winkler @@ -81,7 +81,7 @@ Description: Display the ME device state. POWER_DOWN POWER_UP -What: /sys/class/mei/meiN/trc +What: /sys/class/mei/mei/trc Date: Nov 2019 KernelVersion: 5.5 Contact: Tomas Winkler @@ -91,7 +91,7 @@ Description: Display trc status register content status information into trc status register for BIOS and OS to monitor fw health. -What: /sys/class/mei/meiN/kind +What: /sys/class/mei/mei/kind Date: Jul 2020 KernelVersion: 5.8 Contact: Tomas Winkler From 03f5721ac2e6c75bf34f5a9e496c29ecee30fad7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:46 +0200 Subject: [PATCH 027/122] ABI: sysfs-class-mux: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Acked-by: Peter Rosin Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/7e8ff8601d5b44b76c5c7f77b6dcf3b1d45bc5be.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-mux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-class-mux b/Documentation/ABI/testing/sysfs-class-mux index 8715f9c7bd4f..c58b7b6e1aa6 100644 --- a/Documentation/ABI/testing/sysfs-class-mux +++ b/Documentation/ABI/testing/sysfs-class-mux @@ -7,7 +7,7 @@ Description: Framework and provides a sysfs interface for using MUX controllers. -What: /sys/class/mux/muxchipN/ +What: /sys/class/mux/muxchip/ Date: April 2017 KernelVersion: 4.13 Contact: Peter Rosin From 24e83d415edd7a03554808e19c1a6fefcdb26050 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:47 +0200 Subject: [PATCH 028/122] ABI: sysfs-class-pwm: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/eb3edca0f3cf693d8d28ee7bd00339cac2039014.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-pwm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-pwm b/Documentation/ABI/testing/sysfs-class-pwm index c20e61354561..3d65285bcd5f 100644 --- a/Documentation/ABI/testing/sysfs-class-pwm +++ b/Documentation/ABI/testing/sysfs-class-pwm @@ -7,7 +7,7 @@ Description: Framework and provides a sysfs interface for using PWM channels. -What: /sys/class/pwm/pwmchipN/ +What: /sys/class/pwm/pwmchip/ Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten @@ -16,14 +16,14 @@ Description: probed PWM controller/chip where N is the base of the PWM chip. -What: /sys/class/pwm/pwmchipN/npwm +What: /sys/class/pwm/pwmchip/npwm Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten Description: The number of PWM channels supported by the PWM chip. -What: /sys/class/pwm/pwmchipN/export +What: /sys/class/pwm/pwmchip/export Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten @@ -31,14 +31,14 @@ Description: Exports a PWM channel from the PWM chip for sysfs control. Value is between 0 and /sys/class/pwm/pwmchipN/npwm - 1. -What: /sys/class/pwm/pwmchipN/unexport +What: /sys/class/pwm/pwmchip/unexport Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten Description: Unexports a PWM channel. -What: /sys/class/pwm/pwmchipN/pwmX +What: /sys/class/pwm/pwmchip/pwmX Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten @@ -47,21 +47,21 @@ Description: each exported PWM channel where X is the exported PWM channel number. -What: /sys/class/pwm/pwmchipN/pwmX/period +What: /sys/class/pwm/pwmchip/pwmX/period Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten Description: Sets the PWM signal period in nanoseconds. -What: /sys/class/pwm/pwmchipN/pwmX/duty_cycle +What: /sys/class/pwm/pwmchip/pwmX/duty_cycle Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten Description: Sets the PWM signal duty cycle in nanoseconds. -What: /sys/class/pwm/pwmchipN/pwmX/polarity +What: /sys/class/pwm/pwmchip/pwmX/polarity Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten @@ -69,7 +69,7 @@ Description: Sets the output polarity of the PWM signal to "normal" or "inversed". -What: /sys/class/pwm/pwmchipN/pwmX/enable +What: /sys/class/pwm/pwmchip/pwmX/enable Date: May 2013 KernelVersion: 3.11 Contact: H Hartley Sweeten @@ -78,7 +78,7 @@ Description: 0 is disabled 1 is enabled -What: /sys/class/pwm/pwmchipN/pwmX/capture +What: /sys/class/pwm/pwmchip/pwmX/capture Date: June 2016 KernelVersion: 4.8 Contact: Lee Jones From fa1d8fdd238b889a36ec80c631990838a29b3c2e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:48 +0200 Subject: [PATCH 029/122] ABI: sysfs-class-rc: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/42778ca4b2f9bf73fafecb9b388a8fcd0e66be26.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-rc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-rc b/Documentation/ABI/testing/sysfs-class-rc index 9c8ff7910858..84e46d70d82b 100644 --- a/Documentation/ABI/testing/sysfs-class-rc +++ b/Documentation/ABI/testing/sysfs-class-rc @@ -7,7 +7,7 @@ Description: core and provides a sysfs interface for configuring infrared remote controller receivers. -What: /sys/class/rc/rcN/ +What: /sys/class/rc/rc/ Date: Apr 2010 KernelVersion: 2.6.35 Contact: Mauro Carvalho Chehab @@ -15,7 +15,7 @@ Description: A /sys/class/rc/rcN directory is created for each remote control receiver device where N is the number of the receiver. -What: /sys/class/rc/rcN/protocols +What: /sys/class/rc/rc/protocols Date: Jun 2010 KernelVersion: 2.6.36 Contact: Mauro Carvalho Chehab @@ -40,7 +40,7 @@ Description: Write fails with EINVAL if an invalid protocol combination or unknown protocol name is used. -What: /sys/class/rc/rcN/filter +What: /sys/class/rc/rc/filter Date: Jan 2014 KernelVersion: 3.15 Contact: Mauro Carvalho Chehab @@ -55,7 +55,7 @@ Description: This value may be reset to 0 if the current protocol is altered. -What: /sys/class/rc/rcN/filter_mask +What: /sys/class/rc/rc/filter_mask Date: Jan 2014 KernelVersion: 3.15 Contact: Mauro Carvalho Chehab @@ -72,7 +72,7 @@ Description: This value may be reset to 0 if the current protocol is altered. -What: /sys/class/rc/rcN/wakeup_protocols +What: /sys/class/rc/rc/wakeup_protocols Date: Feb 2017 KernelVersion: 4.11 Contact: Mauro Carvalho Chehab @@ -98,7 +98,7 @@ Description: unknown protocol name is used, or if wakeup is not supported by the hardware. -What: /sys/class/rc/rcN/wakeup_filter +What: /sys/class/rc/rc/wakeup_filter Date: Jan 2014 KernelVersion: 3.15 Contact: Mauro Carvalho Chehab @@ -117,7 +117,7 @@ Description: This value may be reset to 0 if the wakeup protocol is altered. -What: /sys/class/rc/rcN/wakeup_filter_mask +What: /sys/class/rc/rc/wakeup_filter_mask Date: Jan 2014 KernelVersion: 3.15 Contact: Mauro Carvalho Chehab From a5d01b5fcebfa077bee0faaa9bd2512e2f6b74d1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:49 +0200 Subject: [PATCH 030/122] ABI: sysfs-class-rc-nuvoton: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/8cfb786e625bfe8f1c73837cf76107af187c9d85.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-rc-nuvoton | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-class-rc-nuvoton b/Documentation/ABI/testing/sysfs-class-rc-nuvoton index d3abe45f8690..f7bad8ecd08f 100644 --- a/Documentation/ABI/testing/sysfs-class-rc-nuvoton +++ b/Documentation/ABI/testing/sysfs-class-rc-nuvoton @@ -1,4 +1,4 @@ -What: /sys/class/rc/rcN/wakeup_data +What: /sys/class/rc/rc/wakeup_data Date: Mar 2016 KernelVersion: 4.6 Contact: Mauro Carvalho Chehab From c8d4b62def4dfbe06ff448ba279fd6314b3ddf73 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:50 +0200 Subject: [PATCH 031/122] ABI: sysfs-class-uwb_rc: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e723a4d9ea835f02e820142909499c752dab21b7.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-uwb_rc | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-uwb_rc b/Documentation/ABI/testing/sysfs-class-uwb_rc index 6c5dcad21e19..a7ea169dc4eb 100644 --- a/Documentation/ABI/testing/sysfs-class-uwb_rc +++ b/Documentation/ABI/testing/sysfs-class-uwb_rc @@ -18,14 +18,14 @@ Description: and it will be removed. The default is 3 superframes (~197 ms) as required by the specification. -What: /sys/class/uwb_rc/uwbN/ +What: /sys/class/uwb_rc/uwb/ Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org Description: An individual UWB radio controller. -What: /sys/class/uwb_rc/uwbN/beacon +What: /sys/class/uwb_rc/uwb/beacon Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -43,7 +43,7 @@ Description: Reading returns the currently active channel, or -1 if the radio controller is not beaconing. -What: /sys/class/uwb_rc/uwbN/ASIE +What: /sys/class/uwb_rc/uwb/ASIE Date: August 2014 KernelVersion: 3.18 Contact: linux-usb@vger.kernel.org @@ -56,7 +56,7 @@ Description: Reading returns the current ASIE. Writing replaces the current ASIE with the one written. -What: /sys/class/uwb_rc/uwbN/scan +What: /sys/class/uwb_rc/uwb/scan Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -75,7 +75,7 @@ Description: 4 scan (with start time of ) == ======================================= -What: /sys/class/uwb_rc/uwbN/mac_address +What: /sys/class/uwb_rc/uwb/mac_address Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -85,7 +85,7 @@ Description: controller's EUI-48 but only do so while the device is not beaconing or scanning. -What: /sys/class/uwb_rc/uwbN/wusbhc +What: /sys/class/uwb_rc/uwb/wusbhc Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -93,7 +93,7 @@ Description: A symlink to the device (if any) of the WUSB Host Controller PAL using this radio controller. -What: /sys/class/uwb_rc/uwbN// +What: /sys/class/uwb_rc/uwb// Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -102,7 +102,7 @@ Description: as part of a scan or is a member of the radio controllers beacon group. -What: /sys/class/uwb_rc/uwbN//BPST +What: /sys/class/uwb_rc/uwb//BPST Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -111,7 +111,7 @@ Description: interval superframe timer) of the last beacon from this device was received. -What: /sys/class/uwb_rc/uwbN//DevAddr +What: /sys/class/uwb_rc/uwb//DevAddr Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -119,7 +119,7 @@ Description: The current DevAddr of this device in colon separated hex octets. -What: /sys/class/uwb_rc/uwbN//EUI_48 +What: /sys/class/uwb_rc/uwb//EUI_48 Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -128,7 +128,7 @@ Description: The EUI-48 of this device in colon separated hex octets. -What: /sys/class/uwb_rc/uwbN//IEs +What: /sys/class/uwb_rc/uwb//IEs Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -136,7 +136,7 @@ Description: The latest IEs included in this device's beacon, in space separated hex octets with one IE per line. -What: /sys/class/uwb_rc/uwbN//LQE +What: /sys/class/uwb_rc/uwb//LQE Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org @@ -146,7 +146,7 @@ Description: This gives an estimate on a suitable PHY rate. Refer to [ECMA-368] section 13.3 for more details. -What: /sys/class/uwb_rc/uwbN//RSSI +What: /sys/class/uwb_rc/uwb//RSSI Date: July 2008 KernelVersion: 2.6.27 Contact: linux-usb@vger.kernel.org From 6b85d2f71574115ae155fe1c283668e190a7c4ee Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:51 +0200 Subject: [PATCH 032/122] ABI: sysfs-class-uwb_rc-wusbhc: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/89dfa95676376f48a7191e1d34264d48a72b3f6a.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc index 5977e2875325..55eb55cac92e 100644 --- a/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc +++ b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc @@ -1,4 +1,4 @@ -What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_chid +What: /sys/class/uwb_rc/uwb/wusbhc/wusb_chid Date: July 2008 KernelVersion: 2.6.27 Contact: David Vrabel @@ -9,7 +9,7 @@ Description: Set an all zero CHID to stop the host controller. -What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_trust_timeout +What: /sys/class/uwb_rc/uwb/wusbhc/wusb_trust_timeout Date: July 2008 KernelVersion: 2.6.27 Contact: David Vrabel @@ -24,7 +24,7 @@ Description: lifetime of PTKs and GTKs) it should not be changed from the default. -What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_phy_rate +What: /sys/class/uwb_rc/uwb/wusbhc/wusb_phy_rate Date: August 2009 KernelVersion: 2.6.32 Contact: David Vrabel @@ -37,7 +37,7 @@ Description: Refer to [ECMA-368] section 10.3.1.1 for the value to use. -What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_dnts +What: /sys/class/uwb_rc/uwb/wusbhc/wusb_dnts Date: June 2013 KernelVersion: 3.11 Contact: Thomas Pugliese @@ -47,7 +47,7 @@ Description: often the devices will have the opportunity to send notifications to the host. -What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_retry_count +What: /sys/class/uwb_rc/uwb/wusbhc/wusb_retry_count Date: June 2013 KernelVersion: 3.11 Contact: Thomas Pugliese From 5097586d21f07291648068c8ed64d919966155d5 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:52 +0200 Subject: [PATCH 033/122] ABI: sysfs-devices-platform-dock: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/56790ba596b34c234da1e0d17ca7f19435df87ff.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-devices-platform-dock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-devices-platform-dock b/Documentation/ABI/testing/sysfs-devices-platform-dock index 1d8c18f905c7..411c174de830 100644 --- a/Documentation/ABI/testing/sysfs-devices-platform-dock +++ b/Documentation/ABI/testing/sysfs-devices-platform-dock @@ -1,4 +1,4 @@ -What: /sys/devices/platform/dock.N/docked +What: /sys/devices/platform/dock./docked Date: Dec, 2006 KernelVersion: 2.6.19 Contact: linux-acpi@vger.kernel.org @@ -6,7 +6,7 @@ Description: (RO) Value 1 or 0 indicates whether the software believes the laptop is docked in a docking station. -What: /sys/devices/platform/dock.N/undock +What: /sys/devices/platform/dock./undock Date: Dec, 2006 KernelVersion: 2.6.19 Contact: linux-acpi@vger.kernel.org @@ -14,14 +14,14 @@ Description: (WO) Writing to this file causes the software to initiate an undock request to the firmware. -What: /sys/devices/platform/dock.N/uid +What: /sys/devices/platform/dock./uid Date: Feb, 2007 KernelVersion: v2.6.21 Contact: linux-acpi@vger.kernel.org Description: (RO) Displays the docking station the laptop is docked to. -What: /sys/devices/platform/dock.N/flags +What: /sys/devices/platform/dock./flags Date: May, 2007 KernelVersion: v2.6.21 Contact: linux-acpi@vger.kernel.org @@ -30,7 +30,7 @@ Description: request has been made by the user (from the immediate_undock option). -What: /sys/devices/platform/dock.N/type +What: /sys/devices/platform/dock./type Date: Aug, 2008 KernelVersion: v2.6.27 Contact: linux-acpi@vger.kernel.org From 26d6ba2f89c315a1987fb66a8f21a685201fdba4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:53 +0200 Subject: [PATCH 034/122] ABI: sysfs-devices-system-cpu: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d18385a391b6797373a5d1382ea024857fb29987.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/sysfs-devices-system-cpu | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu index b46ef147616a..4ffc7e6ef403 100644 --- a/Documentation/ABI/testing/sysfs-devices-system-cpu +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu @@ -135,7 +135,7 @@ Description: Discover cpuidle policy and mechanism Documentation/driver-api/pm/cpuidle.rst for more information. -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/name +What: /sys/devices/system/cpu/cpuX/cpuidle/state/name /sys/devices/system/cpu/cpuX/cpuidle/stateN/latency /sys/devices/system/cpu/cpuX/cpuidle/stateN/power /sys/devices/system/cpu/cpuX/cpuidle/stateN/time @@ -174,7 +174,7 @@ Description: (a count). ======== ==== ================================================= -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/desc +What: /sys/devices/system/cpu/cpuX/cpuidle/state/desc Date: February 2008 KernelVersion: v2.6.25 Contact: Linux power management list @@ -182,7 +182,7 @@ Description: (RO) A small description about the idle state (string). -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/disable +What: /sys/devices/system/cpu/cpuX/cpuidle/state/disable Date: March 2012 KernelVersion: v3.10 Contact: Linux power management list @@ -195,14 +195,14 @@ Description: does not reflect it. Likewise, if one enables a deep state but a lighter state still is disabled, then this has no effect. -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/default_status +What: /sys/devices/system/cpu/cpuX/cpuidle/state/default_status Date: December 2019 KernelVersion: v5.6 Contact: Linux power management list Description: (RO) The default status of this state, "enabled" or "disabled". -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/residency +What: /sys/devices/system/cpu/cpuX/cpuidle/state/residency Date: March 2014 KernelVersion: v3.15 Contact: Linux power management list @@ -211,7 +211,7 @@ Description: time (in microseconds) this cpu should spend in this idle state to make the transition worth the effort. -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/s2idle/ +What: /sys/devices/system/cpu/cpuX/cpuidle/state/s2idle/ Date: March 2018 KernelVersion: v4.17 Contact: Linux power management list @@ -221,7 +221,7 @@ Description: This attribute group is only present for states that can be used in suspend-to-idle with suspended timekeeping. -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/s2idle/time +What: /sys/devices/system/cpu/cpuX/cpuidle/state/s2idle/time Date: March 2018 KernelVersion: v4.17 Contact: Linux power management list @@ -229,7 +229,7 @@ Description: Total time spent by the CPU in suspend-to-idle (with scheduler tick suspended) after requesting this state. -What: /sys/devices/system/cpu/cpuX/cpuidle/stateN/s2idle/usage +What: /sys/devices/system/cpu/cpuX/cpuidle/state/s2idle/usage Date: March 2018 KernelVersion: v4.17 Contact: Linux power management list From 3d253b99125875d581519f503b8dc551c45a10c9 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:54 +0200 Subject: [PATCH 035/122] ABI: sysfs-firmware-efi-esrt: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/44f63335333d019490297903609a8a1754a66183.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/sysfs-firmware-efi-esrt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-firmware-efi-esrt b/Documentation/ABI/testing/sysfs-firmware-efi-esrt index 31b57676d4ad..4c2d440487dd 100644 --- a/Documentation/ABI/testing/sysfs-firmware-efi-esrt +++ b/Documentation/ABI/testing/sysfs-firmware-efi-esrt @@ -24,14 +24,14 @@ Date: February 2015 Contact: Peter Jones Description: The version of the ESRT structure provided by the firmware. -What: /sys/firmware/efi/esrt/entries/entry$N/ +What: /sys/firmware/efi/esrt/entries/entry/ Date: February 2015 Contact: Peter Jones Description: Each ESRT entry is identified by a GUID, and each gets a subdirectory under entries/ . example: /sys/firmware/efi/esrt/entries/entry0/ -What: /sys/firmware/efi/esrt/entries/entry$N/fw_type +What: /sys/firmware/efi/esrt/entries/entry/fw_type Date: February 2015 Contact: Peter Jones Description: What kind of firmware entry this is: @@ -43,33 +43,33 @@ Description: What kind of firmware entry this is: 3 UEFI Driver == =============== -What: /sys/firmware/efi/esrt/entries/entry$N/fw_class +What: /sys/firmware/efi/esrt/entries/entry/fw_class Date: February 2015 Contact: Peter Jones Description: This is the entry's guid, and will match the directory name. -What: /sys/firmware/efi/esrt/entries/entry$N/fw_version +What: /sys/firmware/efi/esrt/entries/entry/fw_version Date: February 2015 Contact: Peter Jones Description: The version of the firmware currently installed. This is a 32-bit unsigned integer. -What: /sys/firmware/efi/esrt/entries/entry$N/lowest_supported_fw_version +What: /sys/firmware/efi/esrt/entries/entry/lowest_supported_fw_version Date: February 2015 Contact: Peter Jones Description: The lowest version of the firmware that can be installed. -What: /sys/firmware/efi/esrt/entries/entry$N/capsule_flags +What: /sys/firmware/efi/esrt/entries/entry/capsule_flags Date: February 2015 Contact: Peter Jones Description: Flags that must be passed to UpdateCapsule() -What: /sys/firmware/efi/esrt/entries/entry$N/last_attempt_version +What: /sys/firmware/efi/esrt/entries/entry/last_attempt_version Date: February 2015 Contact: Peter Jones Description: The last firmware version for which an update was attempted. -What: /sys/firmware/efi/esrt/entries/entry$N/last_attempt_status +What: /sys/firmware/efi/esrt/entries/entry/last_attempt_status Date: February 2015 Contact: Peter Jones Description: The result of the last firmware update attempt for the From 3f6b07adb506f06897534fa455f920415087b504 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:55 +0200 Subject: [PATCH 036/122] ABI: sysfs-platform-sst-atom: use wildcards on What definitions %x is not a valid wildcard. Use instead, as this allows script/get_abi.pl to convert it into a regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ca1f384f1e77210e2807f97abe77a36ac5fa284a.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-platform-sst-atom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-platform-sst-atom b/Documentation/ABI/testing/sysfs-platform-sst-atom index d5f6e21f0e42..0154b0fba759 100644 --- a/Documentation/ABI/testing/sysfs-platform-sst-atom +++ b/Documentation/ABI/testing/sysfs-platform-sst-atom @@ -1,4 +1,4 @@ -What: /sys/devices/platform/8086%x:00/firmware_version +What: /sys/devices/platform/8086:00/firmware_version Date: November 2016 KernelVersion: 4.10 Contact: "Sebastien Guiriec" From 64b609fd684a22a656fa1f37f1fc36d9f6606fa9 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:56 +0200 Subject: [PATCH 037/122] ABI: sysfs-ptp: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Acked-by: Richard Cochran Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/03dcf9985244f8f9d8202af1ba203abb1f405e7d.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-ptp | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-ptp b/Documentation/ABI/testing/sysfs-ptp index d378f57c1b73..9c317ac7c47a 100644 --- a/Documentation/ABI/testing/sysfs-ptp +++ b/Documentation/ABI/testing/sysfs-ptp @@ -6,7 +6,7 @@ Description: providing a standardized interface to the ancillary features of PTP hardware clocks. -What: /sys/class/ptp/ptpN/ +What: /sys/class/ptp/ptp/ Date: September 2010 Contact: Richard Cochran Description: @@ -14,7 +14,7 @@ Description: hardware clock registered into the PTP class driver subsystem. -What: /sys/class/ptp/ptpN/clock_name +What: /sys/class/ptp/ptp/clock_name Date: September 2010 Contact: Richard Cochran Description: @@ -25,7 +25,7 @@ Description: MAC based ones. The string does not necessarily have to be any kind of unique id. -What: /sys/class/ptp/ptpN/max_adjustment +What: /sys/class/ptp/ptp/max_adjustment Date: September 2010 Contact: Richard Cochran Description: @@ -33,42 +33,42 @@ Description: frequency adjustment value (a positive integer) in parts per billion. -What: /sys/class/ptp/ptpN/max_vclocks +What: /sys/class/ptp/ptp/max_vclocks Date: May 2021 Contact: Yangbo Lu Description: This file contains the maximum number of ptp vclocks. Write integer to re-configure it. -What: /sys/class/ptp/ptpN/n_alarms +What: /sys/class/ptp/ptp/n_alarms Date: September 2010 Contact: Richard Cochran Description: This file contains the number of periodic or one shot alarms offer by the PTP hardware clock. -What: /sys/class/ptp/ptpN/n_external_timestamps +What: /sys/class/ptp/ptp/n_external_timestamps Date: September 2010 Contact: Richard Cochran Description: This file contains the number of external timestamp channels offered by the PTP hardware clock. -What: /sys/class/ptp/ptpN/n_periodic_outputs +What: /sys/class/ptp/ptp/n_periodic_outputs Date: September 2010 Contact: Richard Cochran Description: This file contains the number of programmable periodic output channels offered by the PTP hardware clock. -What: /sys/class/ptp/ptpN/n_pins +What: /sys/class/ptp/ptp/n_pins Date: March 2014 Contact: Richard Cochran Description: This file contains the number of programmable pins offered by the PTP hardware clock. -What: /sys/class/ptp/ptpN/n_vclocks +What: /sys/class/ptp/ptp/n_vclocks Date: May 2021 Contact: Yangbo Lu Description: @@ -81,7 +81,7 @@ Description: switches the physical clock back to normal, adjustable operation. -What: /sys/class/ptp/ptpN/pins +What: /sys/class/ptp/ptp/pins Date: March 2014 Contact: Richard Cochran Description: @@ -94,7 +94,7 @@ Description: assignment may be changed by two writing numbers into the file. -What: /sys/class/ptp/ptpN/pps_available +What: /sys/class/ptp/ptp/pps_available Date: September 2010 Contact: Richard Cochran Description: @@ -103,7 +103,7 @@ Description: "1" means that the PPS is supported, while "0" means not supported. -What: /sys/class/ptp/ptpN/extts_enable +What: /sys/class/ptp/ptp/extts_enable Date: September 2010 Contact: Richard Cochran Description: @@ -113,7 +113,7 @@ Description: To disable external timestamps, write the channel index followed by a "0" into the file. -What: /sys/class/ptp/ptpN/fifo +What: /sys/class/ptp/ptp/fifo Date: September 2010 Contact: Richard Cochran Description: @@ -121,7 +121,7 @@ Description: the form of three integers: channel index, seconds, and nanoseconds. -What: /sys/class/ptp/ptpN/period +What: /sys/class/ptp/ptp/period Date: September 2010 Contact: Richard Cochran Description: @@ -132,7 +132,7 @@ Description: period nanoseconds. To disable a periodic output, set all the seconds and nanoseconds values to zero. -What: /sys/class/ptp/ptpN/pps_enable +What: /sys/class/ptp/ptp/pps_enable Date: September 2010 Contact: Richard Cochran Description: From eb74c39abd76262e890512db65439df62818041e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 16 Sep 2021 10:59:57 +0200 Subject: [PATCH 038/122] ABI: sysfs-class-rapidio: use wildcards on What definitions An "N" upper letter is not a wildcard, nor can easily be identified by script, specially since the USB sysfs define things like. bNumInterfaces. Use, instead, , in order to let script/get_abi.pl to convert it into a Regex. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/aa073b85ab04b5b201d40f747ccdb6806f38eb66.1631782432.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-rapidio | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-rapidio b/Documentation/ABI/testing/sysfs-class-rapidio index 19aefb21b639..81e09145525a 100644 --- a/Documentation/ABI/testing/sysfs-class-rapidio +++ b/Documentation/ABI/testing/sysfs-class-rapidio @@ -10,7 +10,7 @@ Description: NOTE: An mport ID is not a RapidIO destination ID assigned to a given local mport device. -What: /sys/class/rapidio_port/rapidioN/sys_size +What: /sys/class/rapidio_port/rapidio/sys_size Date: Apr, 2014 KernelVersion: v3.15 Contact: Matt Porter , @@ -22,7 +22,7 @@ Description: 1 = large (16-bit destination ID, max. 65536 devices). -What: /sys/class/rapidio_port/rapidioN/port_destid +What: /sys/class/rapidio_port/rapidio/port_destid Date: Apr, 2014 KernelVersion: v3.15 Contact: Matt Porter , From ab9c14805b379b7890f2e162149b6978b2a75986 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:11 +0200 Subject: [PATCH 039/122] scripts: get_abi.pl: Better handle multiple What parameters Using a comma here is problematic, as some What: expressions may already contain a comma. So, use \xac character instead. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e83e7ffaf3429f8dfca00d1d01653ecfa36f6119.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index d7aa82094296..cfc107df59f4 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -129,12 +129,12 @@ sub parse_abi { push @{$symbols{$content}->{file}}, " $file:" . ($ln - 1); if ($tag =~ m/what/) { - $what .= ", " . $content; + $what .= "\xac" . $content; } else { if ($what) { parse_error($file, $ln, "What '$what' doesn't have a description", "") if (!$data{$what}->{description}); - foreach my $w(split /, /, $what) { + foreach my $w(split /\xac/, $what) { $symbols{$w}->{xref} = $what; }; } @@ -239,7 +239,7 @@ sub parse_abi { if ($what) { parse_error($file, $ln, "What '$what' doesn't have a description", "") if (!$data{$what}->{description}); - foreach my $w(split /, /,$what) { + foreach my $w(split /\xac/,$what) { $symbols{$w}->{xref} = $what; }; } @@ -328,7 +328,7 @@ sub output_rest { printf ".. _%s:\n\n", $data{$what}->{label}; - my @names = split /, /,$w; + my @names = split /\xac/,$w; my $len = 0; foreach my $name (@names) { From f090db43958a0a0b6a920d25f56a79cce2ec8d1b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:12 +0200 Subject: [PATCH 040/122] scripts: get_abi.pl: Check for missing symbols at the ABI specs Check for the symbols that exists under /sys but aren't defined at Documentation/ABI. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/958e4f3a319148af6d847c0df95e35426f9c4c5f.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 90 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index cfc107df59f4..78364c4c4967 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -13,7 +13,9 @@ my $help = 0; my $man = 0; my $debug = 0; my $enable_lineno = 0; +my $show_warnings = 1; my $prefix="Documentation/ABI"; +my $sysfs_prefix="/sys"; # # If true, assumes that the description is formatted with ReST @@ -36,7 +38,7 @@ pod2usage(2) if (scalar @ARGV < 1 || @ARGV > 2); my ($cmd, $arg) = @ARGV; -pod2usage(2) if ($cmd ne "search" && $cmd ne "rest" && $cmd ne "validate"); +pod2usage(2) if ($cmd ne "search" && $cmd ne "rest" && $cmd ne "validate" && $cmd ne "undefined"); pod2usage(2) if ($cmd eq "search" && !$arg); require Data::Dumper if ($debug); @@ -50,6 +52,8 @@ my %symbols; sub parse_error($$$$) { my ($file, $ln, $msg, $data) = @_; + return if (!$show_warnings); + $data =~ s/\s+$/\n/; print STDERR "Warning: file $file#$ln:\n\t$msg"; @@ -521,11 +525,88 @@ sub search_symbols { } } +# Exclude /sys/kernel/debug and /sys/kernel/tracing from the search path +sub skip_debugfs { + if (($File::Find::dir =~ m,^/sys/kernel,)) { + return grep {!/(debug|tracing)/ } @_; + } + + if (($File::Find::dir =~ m,^/sys/fs,)) { + return grep {!/(pstore|bpf|fuse)/ } @_; + } + + return @_ +} + +my %leaf; + +my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\xff]) }x; +sub parse_existing_sysfs { + my $file = $File::Find::name; + + my $mode = (stat($file))[2]; + return if ($mode & S_IFDIR); + + my $leave = $file; + $leave =~ s,.*/,,; + + if (defined($leaf{$leave})) { + # FIXME: need to check if the path makes sense + my $what = $leaf{$leave}; + + $what =~ s/,/ /g; + + $what =~ s/\<[^\>]+\>/.*/g; + $what =~ s/\{[^\}]+\}/.*/g; + $what =~ s/\[[^\]]+\]/.*/g; + $what =~ s,/\.\.\./,/.*/,g; + $what =~ s,/\*/,/.*/,g; + + $what =~ s/\s+/ /g; + + # Escape all other symbols + $what =~ s/$escape_symbols/\\$1/g; + + foreach my $i (split / /,$what) { + if ($file =~ m#^$i$#) { +# print "$file: $i: OK!\n"; + return; + } + } + + print "$file: $leave is defined at $what\n"; + + return; + } + + print "$file not found.\n"; +} + +sub undefined_symbols { + foreach my $w (sort keys %data) { + foreach my $what (split /\xac /,$w) { + my $leave = $what; + $leave =~ s,.*/,,; + + if (defined($leaf{$leave})) { + $leaf{$leave} .= " " . $what; + } else { + $leaf{$leave} = $what; + } + } + } + + find({wanted =>\&parse_existing_sysfs, preprocess =>\&skip_debugfs, no_chdir => 1}, $sysfs_prefix); +} + # Ensure that the prefix will always end with a slash # While this is not needed for find, it makes the patch nicer # with --enable-lineno $prefix =~ s,/?$,/,; +if ($cmd eq "undefined" || $cmd eq "search") { + $show_warnings = 0; +} # # Parses all ABI files located at $prefix dir # @@ -536,7 +617,9 @@ print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug); # # Handles the command # -if ($cmd eq "search") { +if ($cmd eq "undefined") { + undefined_symbols; +} elsif ($cmd eq "search") { search_symbols; } else { if ($cmd eq "rest") { @@ -575,6 +658,9 @@ B - output the ABI in ReST markup language B - validate the ABI contents +B - existing symbols at the system that aren't + defined at Documentation/ABI + =back =head1 OPTIONS From ab02c5150b3164bad777d882fe324cbca3cc9d1d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:13 +0200 Subject: [PATCH 041/122] scripts: get_abi.pl: detect softlinks The way sysfs works is that the same leave may be present under /sys/devices, /sys/bus and /sys/class, etc, linked via soft symlinks. To make it harder to parse, the ABI definition usually refers only to one of those locations. So, improve the logic in order to retrieve the symlinks. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/77c49f7d158d88e17f18d40652b75cdde9e179eb.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 207 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 165 insertions(+), 42 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 78364c4c4967..b0ca4f4e56f2 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -8,8 +8,10 @@ use Pod::Usage; use Getopt::Long; use File::Find; use Fcntl ':mode'; +use Cwd 'abs_path'; my $help = 0; +my $hint = 0; my $man = 0; my $debug = 0; my $enable_lineno = 0; @@ -28,6 +30,7 @@ GetOptions( "rst-source!" => \$description_is_rst, "dir=s" => \$prefix, 'help|?' => \$help, + "show-hints" => \$hint, man => \$man ) or pod2usage(2); @@ -526,7 +529,7 @@ sub search_symbols { } # Exclude /sys/kernel/debug and /sys/kernel/tracing from the search path -sub skip_debugfs { +sub dont_parse_special_attributes { if (($File::Find::dir =~ m,^/sys/kernel,)) { return grep {!/(debug|tracing)/ } @_; } @@ -539,64 +542,178 @@ sub skip_debugfs { } my %leaf; +my %aliases; +my @files; -my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\xff]) }x; +my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\xfe]) }x; sub parse_existing_sysfs { my $file = $File::Find::name; + my $mode = (lstat($file))[2]; + my $abs_file = abs_path($file); - my $mode = (stat($file))[2]; - return if ($mode & S_IFDIR); - - my $leave = $file; - $leave =~ s,.*/,,; - - if (defined($leaf{$leave})) { - # FIXME: need to check if the path makes sense - my $what = $leaf{$leave}; - - $what =~ s/,/ /g; - - $what =~ s/\<[^\>]+\>/.*/g; - $what =~ s/\{[^\}]+\}/.*/g; - $what =~ s/\[[^\]]+\]/.*/g; - $what =~ s,/\.\.\./,/.*/,g; - $what =~ s,/\*/,/.*/,g; - - $what =~ s/\s+/ /g; - - # Escape all other symbols - $what =~ s/$escape_symbols/\\$1/g; - - foreach my $i (split / /,$what) { - if ($file =~ m#^$i$#) { -# print "$file: $i: OK!\n"; - return; - } - } - - print "$file: $leave is defined at $what\n"; - + if (S_ISLNK($mode)) { + $aliases{$file} = $abs_file; return; } - print "$file not found.\n"; + return if (S_ISDIR($mode)); + + # Trivial: file is defined exactly the same way at ABI What: + return if (defined($data{$file})); + return if (defined($data{$abs_file})); + + push @files, $abs_file; +} + +sub check_undefined_symbols { + foreach my $file (sort @files) { + + # sysfs-module is special, as its definitions are inside + # a text. For now, just ignore them. + next if ($file =~ m#^/sys/module/#); + + # Ignore cgroup and firmware + next if ($file =~ m#^/sys/(fs/cgroup|firmware)/#); + + my $defined = 0; + my $exact = 0; + my $whats = ""; + + my $leave = $file; + $leave =~ s,.*/,,; + + my $path = $file; + $path =~ s,(.*/).*,$1,; + + if (defined($leaf{$leave})) { + my $what = $leaf{$leave}; + $whats .= " $what" if (!($whats =~ m/$what/)); + + foreach my $w (split / /, $what) { + if ($file =~ m#^$w$#) { + $exact = 1; + last; + } + } + # Check for aliases + # + # TODO: this algorithm is O(w * n²). It can be + # improved in the future in order to handle it + # faster, by changing parse_existing_sysfs to + # store the sysfs inside a tree, at the expense + # on making the code less readable and/or using some + # additional perl library. + foreach my $a (keys %aliases) { + my $new = $aliases{$a}; + my $len = length($new); + + if (substr($file, 0, $len) eq $new) { + my $newf = $a . substr($file, $len); + + foreach my $w (split / /, $what) { + if ($newf =~ m#^$w$#) { + $exact = 1; + last; + } + } + } + } + + $defined++; + } + next if ($exact); + + # Ignore some sysfs nodes + next if ($file =~ m#/(sections|notes)/#); + + # Would need to check at + # Documentation/admin-guide/kernel-parameters.txt, but this + # is not easily parseable. + next if ($file =~ m#/parameters/#); + + if ($hint && $defined) { + print "$leave at $path might be one of:$whats\n"; + next; + } + print "$file not found.\n"; + } } sub undefined_symbols { + find({ + wanted =>\&parse_existing_sysfs, + preprocess =>\&dont_parse_special_attributes, + no_chdir => 1 + }, $sysfs_prefix); + foreach my $w (sort keys %data) { foreach my $what (split /\xac /,$w) { + next if (!($what =~ m/^$sysfs_prefix/)); + + # Convert what into regular expressions + + $what =~ s,/\.\.\./,/*/,g; + $what =~ s,\*,.*,g; + + # Temporarily change [0-9]+ type of patterns + $what =~ s/\[0\-9\]\+/\xff/g; + + # Temporarily change [\d+-\d+] type of patterns + $what =~ s/\[0\-\d+\]/\xff/g; + $what =~ s/\[(\d+)\]/\xf4$1\xf5/g; + + # Temporarily change [0-9] type of patterns + $what =~ s/\[(\d)\-(\d)\]/\xf4$1-$2\xf5/g; + + # Handle multiple option patterns + $what =~ s/[\{\<\[]([\w_]+)(?:[,|]+([\w_]+)){1,}[\}\>\]]/($1|$2)/g; + + # Handle wildcards + $what =~ s/\<[^\>]+\>/.*/g; + $what =~ s/\{[^\}]+\}/.*/g; + $what =~ s/\[[^\]]+\]/.*/g; + + $what =~ s/[XYZ]/.*/g; + + # Recover [0-9] type of patterns + $what =~ s/\xf4/[/g; + $what =~ s/\xf5/]/g; + + # Remove duplicated spaces + $what =~ s/\s+/ /g; + + # Special case: this ABI has a parenthesis on it + $what =~ s/sqrt\(x^2\+y^2\+z^2\)/sqrt\(x^2\+y^2\+z^2\)/; + + # Special case: drop comparition as in: + # What: foo = + # (this happens on a few IIO definitions) + $what =~ s,\s*\=.*$,,; + my $leave = $what; $leave =~ s,.*/,,; - if (defined($leaf{$leave})) { - $leaf{$leave} .= " " . $what; - } else { - $leaf{$leave} = $what; + next if ($leave =~ m/^\.\*/ || $leave eq ""); + + # Escape all other symbols + $what =~ s/$escape_symbols/\\$1/g; + $what =~ s/\\\\/\\/g; + $what =~ s/\\([\[\]\(\)\|])/$1/g; + $what =~ s/(\d+)\\(-\d+)/$1$2/g; + + $leave =~ s/[\(\)]//g; + + foreach my $l (split /\|/, $leave) { + if (defined($leaf{$l})) { + next if ($leaf{$l} =~ m/$what/); + $leaf{$l} .= " " . $what; + } else { + $leaf{$l} = $what; + } } } } - - find({wanted =>\&parse_existing_sysfs, preprocess =>\&skip_debugfs, no_chdir => 1}, $sysfs_prefix); + check_undefined_symbols; } # Ensure that the prefix will always end with a slash @@ -646,7 +763,8 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. =head1 SYNOPSIS B [--debug] [--enable-lineno] [--man] [--help] - [--(no-)rst-source] [--dir=] [] + [--(no-)rst-source] [--dir=] [--show-hints] + [] Where can be: @@ -688,6 +806,11 @@ Enable output of #define LINENO lines. Put the script in verbose mode, useful for debugging. Can be called multiple times, to increase verbosity. +=item B<--show-hints> + +Show hints about possible definitions for the missing ABI symbols. +Used only when B. + =item B<--help> Prints a brief help message and exits. From 14c942578e19f5760319da3371193c1bc6242f7f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:14 +0200 Subject: [PATCH 042/122] scripts: get_abi.pl: add an option to filter undefined results The output of this script can be too big. Add an option to filter out results, in order to help finding issues at the ABI files. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/7b56c10195bb5e5dfd8b5838a3db8d361231d884.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index b0ca4f4e56f2..f5f2f664e336 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -18,6 +18,7 @@ my $enable_lineno = 0; my $show_warnings = 1; my $prefix="Documentation/ABI"; my $sysfs_prefix="/sys"; +my $search_string; # # If true, assumes that the description is formatted with ReST @@ -31,6 +32,7 @@ GetOptions( "dir=s" => \$prefix, 'help|?' => \$help, "show-hints" => \$hint, + "search-string=s" => \$search_string, man => \$man ) or pod2usage(2); @@ -568,16 +570,13 @@ sub parse_existing_sysfs { sub check_undefined_symbols { foreach my $file (sort @files) { - # sysfs-module is special, as its definitions are inside - # a text. For now, just ignore them. - next if ($file =~ m#^/sys/module/#); - # Ignore cgroup and firmware next if ($file =~ m#^/sys/(fs/cgroup|firmware)/#); my $defined = 0; my $exact = 0; my $whats = ""; + my $found_string; my $leave = $file; $leave =~ s,.*/,,; @@ -585,6 +584,12 @@ sub check_undefined_symbols { my $path = $file; $path =~ s,(.*/).*,$1,; + if ($search_string) { + next if (!($file =~ m#$search_string#)); + $found_string = 1; + } + + print "--> $file\n" if ($found_string && $hint); if (defined($leaf{$leave})) { my $what = $leaf{$leave}; $whats .= " $what" if (!($whats =~ m/$what/)); @@ -610,6 +615,7 @@ sub check_undefined_symbols { if (substr($file, 0, $len) eq $new) { my $newf = $a . substr($file, $len); + print " $newf\n" if ($found_string && $hint); foreach my $w (split / /, $what) { if ($newf =~ m#^$w$#) { $exact = 1; @@ -632,10 +638,10 @@ sub check_undefined_symbols { next if ($file =~ m#/parameters/#); if ($hint && $defined) { - print "$leave at $path might be one of:$whats\n"; + print "$leave at $path might be one of:$whats\n" if (!$search_string || $found_string); next; } - print "$file not found.\n"; + print "$file not found.\n" if (!$search_string || $found_string); } } @@ -701,16 +707,29 @@ sub undefined_symbols { $what =~ s/\\([\[\]\(\)\|])/$1/g; $what =~ s/(\d+)\\(-\d+)/$1$2/g; + $what =~ s/\xff/\\d+/g; + + + # Special case: IIO ABI which a parenthesis. + $what =~ s/sqrt(.*)/sqrt\(.*\)/; + $leave =~ s/[\(\)]//g; + my $added = 0; foreach my $l (split /\|/, $leave) { if (defined($leaf{$l})) { next if ($leaf{$l} =~ m/$what/); $leaf{$l} .= " " . $what; + $added = 1; } else { $leaf{$l} = $what; + $added = 1; } } + if ($search_string && $added) { + print "What: $what\n" if ($what =~ m#$search_string#); + } + } } check_undefined_symbols; @@ -764,6 +783,7 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. B [--debug] [--enable-lineno] [--man] [--help] [--(no-)rst-source] [--dir=] [--show-hints] + [--search-string ] [] Where can be: @@ -811,6 +831,11 @@ times, to increase verbosity. Show hints about possible definitions for the missing ABI symbols. Used only when B. +=item B<--search-string> [regex string] + +Show only occurences that match a search string. +Used only when B. + =item B<--help> Prints a brief help message and exits. From 50116aec11debf6dec6295856f3b9368a6a04edf Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:15 +0200 Subject: [PATCH 043/122] scripts: get_abi.pl: don't skip what that ends with wildcards The search algorithm used inside check_undefined_symbols has an optimization: it seeks only whats that have the same leave name. This helps not only to speedup the search, but it also allows providing a hint about a partial match. There's a drawback, however: when "what:" finishes with a wildcard, the logic will skip the what, reporting it as "not found". Fix it by grouping the remaining cases altogether, and disabing any hints for such cases. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/79ba5139643355230e3bba136b20991cfc92020f.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 74 +++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index f5f2f664e336..fe83f295600c 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -589,44 +589,47 @@ sub check_undefined_symbols { $found_string = 1; } + if ($leave =~ /^\d+$/ || !defined($leaf{$leave})) { + $leave = "others"; + } + print "--> $file\n" if ($found_string && $hint); - if (defined($leaf{$leave})) { - my $what = $leaf{$leave}; - $whats .= " $what" if (!($whats =~ m/$what/)); + my $what = $leaf{$leave}; + $whats .= " $what" if (!($whats =~ m/$what/)); - foreach my $w (split / /, $what) { - if ($file =~ m#^$w$#) { - $exact = 1; - last; - } + foreach my $w (split / /, $what) { + if ($file =~ m#^$w$#) { + $exact = 1; + last; } - # Check for aliases - # - # TODO: this algorithm is O(w * n²). It can be - # improved in the future in order to handle it - # faster, by changing parse_existing_sysfs to - # store the sysfs inside a tree, at the expense - # on making the code less readable and/or using some - # additional perl library. - foreach my $a (keys %aliases) { - my $new = $aliases{$a}; - my $len = length($new); + } + # Check for aliases + # + # TODO: this algorithm is O(w * n²). It can be + # improved in the future in order to handle it + # faster, by changing parse_existing_sysfs to + # store the sysfs inside a tree, at the expense + # on making the code less readable and/or using some + # additional perl library. + foreach my $a (keys %aliases) { + my $new = $aliases{$a}; + my $len = length($new); - if (substr($file, 0, $len) eq $new) { - my $newf = $a . substr($file, $len); + if (substr($file, 0, $len) eq $new) { + my $newf = $a . substr($file, $len); - print " $newf\n" if ($found_string && $hint); - foreach my $w (split / /, $what) { - if ($newf =~ m#^$w$#) { - $exact = 1; - last; - } + print " $newf\n" if ($found_string && $hint); + foreach my $w (split / /, $what) { + if ($newf =~ m#^$w$#) { + $exact = 1; + last; } } } - - $defined++; } + + $defined++; + next if ($exact); # Ignore some sysfs nodes @@ -637,7 +640,7 @@ sub check_undefined_symbols { # is not easily parseable. next if ($file =~ m#/parameters/#); - if ($hint && $defined) { + if ($hint && $defined && $leave ne "others") { print "$leave at $path might be one of:$whats\n" if (!$search_string || $found_string); next; } @@ -699,7 +702,16 @@ sub undefined_symbols { my $leave = $what; $leave =~ s,.*/,,; - next if ($leave =~ m/^\.\*/ || $leave eq ""); + # $leave is used to improve search performance at + # check_undefined_symbols, as the algorithm there can seek + # for a small number of "what". It also allows giving a + # hint about a leave with the same name somewhere else. + # However, there are a few occurences where the leave is + # either a wildcard or a number. Just group such cases + # altogether. + if ($leave =~ m/^\.\*/ || $leave eq "" || $leave =~ /^\d+$/) { + $leave = "others" ; + } # Escape all other symbols $what =~ s/$escape_symbols/\\$1/g; From 0b87a1b81ba9b9e2d1d2bc65b3b4318bb645a6e7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:16 +0200 Subject: [PATCH 044/122] scripts: get_abi.pl: Ignore fs/cgroup sysfs nodes earlier In order to speedup the parser and store less data, handle fs/cgroup exceptions a lot earlier. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/caa37831c9e02ae58677d1515ed7cee94f52ea9d.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index fe83f295600c..aa0a751563ba 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -550,6 +550,10 @@ my @files; my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\xfe]) }x; sub parse_existing_sysfs { my $file = $File::Find::name; + + # Ignore cgroup and firmware + return if ($file =~ m#^/sys/(fs/cgroup|firmware)/#); + my $mode = (lstat($file))[2]; my $abs_file = abs_path($file); @@ -570,9 +574,6 @@ sub parse_existing_sysfs { sub check_undefined_symbols { foreach my $file (sort @files) { - # Ignore cgroup and firmware - next if ($file =~ m#^/sys/(fs/cgroup|firmware)/#); - my $defined = 0; my $exact = 0; my $whats = ""; From ca8e055c22155b262e14409a555bab41a52edfea Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 18 Sep 2021 11:52:17 +0200 Subject: [PATCH 045/122] scripts: get_abi.pl: add a graph to speedup the undefined algorithm Searching for symlinks is an expensive operation with the current logic, as it is at the order of O(n^3). In practice, running the check spends 2-3 minutes to check all symbols. Fix it by storing the directory tree into a graph, and using a Breadth First Search (BFS) to find the links for each sysfs node. With such improvement, it can now report issues with ~11 seconds on my machine. It comes with a price, though: there are more symbols reported as undefined after this change. I suspect it is due to some sysfs circular loops that are dropped by BFS. Despite such increase, it seems that the reports are now more coherent. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/f5c1e7b14a27132821c08f0459ba9aea3ed69028.1631957565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 188 ++++++++++++++++++++++++++++++--------------- 1 file changed, 127 insertions(+), 61 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index aa0a751563ba..c52a1cf0f49d 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -546,6 +546,73 @@ sub dont_parse_special_attributes { my %leaf; my %aliases; my @files; +my %root; + +sub graph_add_file { + my $file = shift; + my $type = shift; + + my $dir = $file; + $dir =~ s,^(.*/).*,$1,; + $file =~ s,.*/,,; + + my $name; + my $file_ref = \%root; + foreach my $edge(split "/", $dir) { + $name .= "$edge/"; + if (!defined ${$file_ref}{$edge}) { + ${$file_ref}{$edge} = { }; + } + $file_ref = \%{$$file_ref{$edge}}; + ${$file_ref}{"__name"} = [ $name ]; + } + $name .= "$file"; + ${$file_ref}{$file} = { + "__name" => [ $name ] + }; + + return \%{$$file_ref{$file}}; +} + +sub graph_add_link { + my $file = shift; + my $link = shift; + + # Traverse graph to find the reference + my $file_ref = \%root; + foreach my $edge(split "/", $file) { + $file_ref = \%{$$file_ref{$edge}} || die "Missing node!"; + } + + # do a BFS + + my @queue; + my %seen; + my $base_name; + my $st; + + push @queue, $file_ref; + $seen{$start}++; + + while (@queue) { + my $v = shift @queue; + my @child = keys(%{$v}); + + foreach my $c(@child) { + next if $seen{$$v{$c}}; + next if ($c eq "__name"); + + # Add new name + my $name = @{$$v{$c}{"__name"}}[0]; + if ($name =~ s#^$file/#$link/#) { + push @{$$v{$c}{"__name"}}, $name; + } + # Add child to the queue and mark as seen + push @queue, $$v{$c}; + $seen{$c}++; + } + } +} my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\xfe]) }x; sub parse_existing_sysfs { @@ -568,19 +635,50 @@ sub parse_existing_sysfs { return if (defined($data{$file})); return if (defined($data{$abs_file})); - push @files, $abs_file; + push @files, graph_add_file($abs_file, "file"); +} + +sub get_leave($) +{ + my $what = shift; + my $leave; + + my $l = $what; + my $stop = 1; + + $leave = $l; + $leave =~ s,/$,,; + $leave =~ s,.*/,,; + $leave =~ s/[\(\)]//g; + + # $leave is used to improve search performance at + # check_undefined_symbols, as the algorithm there can seek + # for a small number of "what". It also allows giving a + # hint about a leave with the same name somewhere else. + # However, there are a few occurences where the leave is + # either a wildcard or a number. Just group such cases + # altogether. + if ($leave =~ m/^\.\*/ || $leave eq "" || $leave =~ /^\d+$/) { + $leave = "others"; + } + + return $leave; } sub check_undefined_symbols { - foreach my $file (sort @files) { + foreach my $file_ref (sort @files) { + my @names = @{$$file_ref{"__name"}}; + my $file = $names[0]; my $defined = 0; my $exact = 0; - my $whats = ""; my $found_string; - my $leave = $file; - $leave =~ s,.*/,,; + my $leave = get_leave($file); + if (!defined($leaf{$leave})) { + $leave = "others"; + } + my $what = $leaf{$leave}; my $path = $file; $path =~ s,(.*/).*,$1,; @@ -590,41 +688,12 @@ sub check_undefined_symbols { $found_string = 1; } - if ($leave =~ /^\d+$/ || !defined($leaf{$leave})) { - $leave = "others"; - } - - print "--> $file\n" if ($found_string && $hint); - my $what = $leaf{$leave}; - $whats .= " $what" if (!($whats =~ m/$what/)); - - foreach my $w (split / /, $what) { - if ($file =~ m#^$w$#) { - $exact = 1; - last; - } - } - # Check for aliases - # - # TODO: this algorithm is O(w * n²). It can be - # improved in the future in order to handle it - # faster, by changing parse_existing_sysfs to - # store the sysfs inside a tree, at the expense - # on making the code less readable and/or using some - # additional perl library. - foreach my $a (keys %aliases) { - my $new = $aliases{$a}; - my $len = length($new); - - if (substr($file, 0, $len) eq $new) { - my $newf = $a . substr($file, $len); - - print " $newf\n" if ($found_string && $hint); - foreach my $w (split / /, $what) { - if ($newf =~ m#^$w$#) { - $exact = 1; - last; - } + foreach my $a (@names) { + print "--> $a\n" if ($found_string && $hint); + foreach my $w (split /\xac/, $what) { + if ($a =~ m#^$w$#) { + $exact = 1; + last; } } } @@ -641,8 +710,13 @@ sub check_undefined_symbols { # is not easily parseable. next if ($file =~ m#/parameters/#); - if ($hint && $defined && $leave ne "others") { - print "$leave at $path might be one of:$whats\n" if (!$search_string || $found_string); + if ($hint && $defined && (!$search_string || $found_string)) { + $what =~ s/\xac/\n\t/g; + if ($leave ne "others") { + print " more likely regexes:\n\t$what\n"; + } else { + print " tested regexes:\n\t$what\n"; + } next; } print "$file not found.\n" if (!$search_string || $found_string); @@ -656,8 +730,10 @@ sub undefined_symbols { no_chdir => 1 }, $sysfs_prefix); + $leaf{"others"} = ""; + foreach my $w (sort keys %data) { - foreach my $what (split /\xac /,$w) { + foreach my $what (split /\xac/,$w) { next if (!($what =~ m/^$sysfs_prefix/)); # Convert what into regular expressions @@ -700,19 +776,7 @@ sub undefined_symbols { # (this happens on a few IIO definitions) $what =~ s,\s*\=.*$,,; - my $leave = $what; - $leave =~ s,.*/,,; - - # $leave is used to improve search performance at - # check_undefined_symbols, as the algorithm there can seek - # for a small number of "what". It also allows giving a - # hint about a leave with the same name somewhere else. - # However, there are a few occurences where the leave is - # either a wildcard or a number. Just group such cases - # altogether. - if ($leave =~ m/^\.\*/ || $leave eq "" || $leave =~ /^\d+$/) { - $leave = "others" ; - } + my $leave = get_leave($what); # Escape all other symbols $what =~ s/$escape_symbols/\\$1/g; @@ -722,17 +786,14 @@ sub undefined_symbols { $what =~ s/\xff/\\d+/g; - # Special case: IIO ABI which a parenthesis. $what =~ s/sqrt(.*)/sqrt\(.*\)/; - $leave =~ s/[\(\)]//g; - my $added = 0; foreach my $l (split /\|/, $leave) { if (defined($leaf{$l})) { - next if ($leaf{$l} =~ m/$what/); - $leaf{$l} .= " " . $what; + next if ($leaf{$l} =~ m/\b$what\b/); + $leaf{$l} .= "\xac" . $what; $added = 1; } else { $leaf{$l} = $what; @@ -745,6 +806,11 @@ sub undefined_symbols { } } + # Take links into account + foreach my $link (keys %aliases) { + my $abs_file = $aliases{$link}; + graph_add_link($abs_file, $link); + } check_undefined_symbols; } From e27c42a52e374b8bad02797ddb32a35348c7e00b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:12 +0200 Subject: [PATCH 046/122] scripts: get_abi.pl: Fix get_abi.pl search output Currently, the get_abi.pl will print an invalid symbol (\xac character). Fix it. Fixes: ab9c14805b37 ("scripts: get_abi.pl: Better handle multiple What parameters") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/fb27ac372e38f5ae9d088f9f4e9710c659e0b9e8.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index c52a1cf0f49d..65261f464e25 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -501,6 +501,7 @@ sub search_symbols { my $file = $data{$what}->{filepath}; + $what =~ s/\xac/, /g; my $bar = $what; $bar =~ s/./-/g; From 45495db9790fd9247f31a79c433e1723a1bdf039 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:13 +0200 Subject: [PATCH 047/122] scripts: get_abi.pl: call get_leave() a little late The $what conversions need to replace some characters to avoid breaking regex expressions found on some What:. only after replacing them back, the script should get the $leave devnode. Fixes: ca8e055c2215 ("scripts: get_abi.pl: add a graph to speedup the undefined algorithm") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a21631f8a884f50a962beafdd800f27891348d95.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 65261f464e25..9eb8a033d363 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -777,8 +777,6 @@ sub undefined_symbols { # (this happens on a few IIO definitions) $what =~ s,\s*\=.*$,,; - my $leave = get_leave($what); - # Escape all other symbols $what =~ s/$escape_symbols/\\$1/g; $what =~ s/\\\\/\\/g; @@ -790,6 +788,7 @@ sub undefined_symbols { # Special case: IIO ABI which a parenthesis. $what =~ s/sqrt(.*)/sqrt\(.*\)/; + my $leave = get_leave($what); my $added = 0; foreach my $l (split /\|/, $leave) { if (defined($leaf{$l})) { From 46f661fd0faf7f518b6760ac15f02fa36896c126 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:14 +0200 Subject: [PATCH 048/122] scripts: get_abi.pl: improve debug logic Add a level for debug, in order to allow it to be extended to debug other parts of the script. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/0203416c6c418abb4fc20577a5f48d0d2a41bae7.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 9eb8a033d363..bb80303fea22 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -9,6 +9,7 @@ use Getopt::Long; use File::Find; use Fcntl ':mode'; use Cwd 'abs_path'; +use Data::Dumper; my $help = 0; my $hint = 0; @@ -20,13 +21,18 @@ my $prefix="Documentation/ABI"; my $sysfs_prefix="/sys"; my $search_string; +# Debug options +my $dbg_what_parsing = 1; +my $dbg_what_open = 2; +my $dbg_dump_abi_structs = 4; + # # If true, assumes that the description is formatted with ReST # my $description_is_rst = 1; GetOptions( - "debug|d+" => \$debug, + "debug=i" => \$debug, "enable-lineno" => \$enable_lineno, "rst-source!" => \$description_is_rst, "dir=s" => \$prefix, @@ -46,7 +52,7 @@ my ($cmd, $arg) = @ARGV; pod2usage(2) if ($cmd ne "search" && $cmd ne "rest" && $cmd ne "validate" && $cmd ne "undefined"); pod2usage(2) if ($cmd eq "search" && !$arg); -require Data::Dumper if ($debug); +require Data::Dumper if ($debug & $dbg_dump_abi_structs); my %data; my %symbols; @@ -106,7 +112,7 @@ sub parse_abi { my @labels; my $label = ""; - print STDERR "Opening $file\n" if ($debug > 1); + print STDERR "Opening $file\n" if ($debug & $dbg_what_open); open IN, $file; while() { $ln++; @@ -178,7 +184,7 @@ sub parse_abi { $data{$what}->{filepath} .= " " . $file; } } - print STDERR "\twhat: $what\n" if ($debug > 1); + print STDERR "\twhat: $what\n" if ($debug & $dbg_what_parsing); $data{$what}->{line_no} = $ln; } else { $data{$what}->{line_no} = $ln if (!defined($data{$what}->{line_no})); @@ -827,7 +833,7 @@ if ($cmd eq "undefined" || $cmd eq "search") { # find({wanted =>\&parse_abi, no_chdir => 1}, $prefix); -print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug); +print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug & $dbg_dump_abi_structs); # # Handles the command @@ -860,7 +866,7 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. =head1 SYNOPSIS -B [--debug] [--enable-lineno] [--man] [--help] +B [--debug ] [--enable-lineno] [--man] [--help] [--(no-)rst-source] [--dir=] [--show-hints] [--search-string ] [] @@ -900,10 +906,14 @@ logic (--no-rst-source). Enable output of #define LINENO lines. -=item B<--debug> +=item B<--debug> I -Put the script in verbose mode, useful for debugging. Can be called multiple -times, to increase verbosity. +Print debug information according with the level, which is given by the +following bitmask: + + - 1: Debug parsing What entries from ABI files; + - 2: Shows what files are opened from ABI files; + - 4: Dump the structs used to store the contents of the ABI files. =item B<--show-hints> From 9263589422fe176d377b912145e64ee02bf5c813 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:15 +0200 Subject: [PATCH 049/122] scripts: get_abi.pl: Better handle leaves with wildcards When the the leaf of a regex ends with a wildcard, the speedup algorithm to reduce the number of regexes to seek won't work. So, when those are found, place at the "others" exception. That slows down the search from 0.14s to 1 minute on my machine, but the results are a lot more consistent. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/60bb97cf337333783f9f52e114b896439e9cc215.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index bb80303fea22..3c0063d0e05e 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -665,7 +665,7 @@ sub get_leave($) # However, there are a few occurences where the leave is # either a wildcard or a number. Just group such cases # altogether. - if ($leave =~ m/^\.\*/ || $leave eq "" || $leave =~ /^\d+$/) { + if ($leave =~ m/\.\*/ || $leave eq "" || $leave =~ /\\d/) { $leave = "others"; } From 0cd9e25b08132bb275fb5c1e753d3f13abfeb463 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:16 +0200 Subject: [PATCH 050/122] scripts: get_abi.pl: ignore some sysfs nodes earlier When checking for undefined symbols, some nodes aren't easy or don't make sense to be checked right now. Prevent allocating memory for those, as they'll be ignored anyway. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5228789cbef8241d44504ad29fca5cab356cdc53.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 3c0063d0e05e..42eb16eb78e9 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -628,6 +628,14 @@ sub parse_existing_sysfs { # Ignore cgroup and firmware return if ($file =~ m#^/sys/(fs/cgroup|firmware)/#); + # Ignore some sysfs nodes + return if ($file =~ m#/(sections|notes)/#); + + # Would need to check at + # Documentation/admin-guide/kernel-parameters.txt, but this + # is not easily parseable. + return if ($file =~ m#/parameters/#); + my $mode = (lstat($file))[2]; my $abs_file = abs_path($file); @@ -709,14 +717,6 @@ sub check_undefined_symbols { next if ($exact); - # Ignore some sysfs nodes - next if ($file =~ m#/(sections|notes)/#); - - # Would need to check at - # Documentation/admin-guide/kernel-parameters.txt, but this - # is not easily parseable. - next if ($file =~ m#/parameters/#); - if ($hint && $defined && (!$search_string || $found_string)) { $what =~ s/\xac/\n\t/g; if ($leave ne "others") { From cb06b8ddeb4790cb6caf744316ebea99d53996ee Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:17 +0200 Subject: [PATCH 051/122] scripts: get_abi.pl: stop check loop earlier when regex is found Right now, there are two loops used to seek for a regex. Make sure that both will be skip when a match is found. While here, drop the unused $defined variable. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2ba722d2cdbe7c7d0f1d1b58d350052576d1d703.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 42eb16eb78e9..d45e5ba56f9c 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -685,7 +685,6 @@ sub check_undefined_symbols { my @names = @{$$file_ref{"__name"}}; my $file = $names[0]; - my $defined = 0; my $exact = 0; my $found_string; @@ -711,13 +710,11 @@ sub check_undefined_symbols { last; } } + last if ($exact); } - - $defined++; - next if ($exact); - if ($hint && $defined && (!$search_string || $found_string)) { + if ($hint && (!$search_string || $found_string)) { $what =~ s/\xac/\n\t/g; if ($leave ne "others") { print " more likely regexes:\n\t$what\n"; From f34f67292b5aab7907ec7a694d5733dbc1593b3b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:18 +0200 Subject: [PATCH 052/122] scripts: get_abi.pl: precompile what match regexes In order to earn some time during matches, pre-compile regexes. Before this patch: $ time ./scripts/get_abi.pl undefined |wc -l 6970 real 0m54,751s user 0m54,022s sys 0m0,592s Afterwards: $ time ./scripts/get_abi.pl undefined |wc -l 6970 real 0m5,888s user 0m5,310s sys 0m0,562s Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/ec45de8fcae791aab0880644974a110424423e68.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index d45e5ba56f9c..f2b5efef9c30 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -25,6 +25,7 @@ my $search_string; my $dbg_what_parsing = 1; my $dbg_what_open = 2; my $dbg_dump_abi_structs = 4; +my $dbg_undefined = 8; # # If true, assumes that the description is formatted with ReST @@ -692,7 +693,8 @@ sub check_undefined_symbols { if (!defined($leaf{$leave})) { $leave = "others"; } - my $what = $leaf{$leave}; + my @expr = @{$leaf{$leave}->{expr}}; + die ("missing rules for $leave") if (!defined($leaf{$leave})); my $path = $file; $path =~ s,(.*/).*,$1,; @@ -702,10 +704,17 @@ sub check_undefined_symbols { $found_string = 1; } - foreach my $a (@names) { - print "--> $a\n" if ($found_string && $hint); - foreach my $w (split /\xac/, $what) { - if ($a =~ m#^$w$#) { + for (my $i = 0; $i < @names; $i++) { + if ($found_string && $hint) { + if (!$i) { + print "--> $names[$i]\n"; + } else { + print " $names[$i]\n"; + } + } + foreach my $re (@expr) { + print "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); + if ($names[$i] =~ $re) { $exact = 1; last; } @@ -715,6 +724,7 @@ sub check_undefined_symbols { next if ($exact); if ($hint && (!$search_string || $found_string)) { + my $what = $leaf{$leave}->{what}; $what =~ s/\xac/\n\t/g; if ($leave ne "others") { print " more likely regexes:\n\t$what\n"; @@ -734,7 +744,7 @@ sub undefined_symbols { no_chdir => 1 }, $sysfs_prefix); - $leaf{"others"} = ""; + $leaf{"others"}->{what} = ""; foreach my $w (sort keys %data) { foreach my $what (split /\xac/,$w) { @@ -792,14 +802,15 @@ sub undefined_symbols { $what =~ s/sqrt(.*)/sqrt\(.*\)/; my $leave = get_leave($what); + my $added = 0; foreach my $l (split /\|/, $leave) { if (defined($leaf{$l})) { - next if ($leaf{$l} =~ m/\b$what\b/); - $leaf{$l} .= "\xac" . $what; + next if ($leaf{$l}->{what} =~ m/\b$what\b/); + $leaf{$l}->{what} .= "\xac" . $what; $added = 1; } else { - $leaf{$l} = $what; + $leaf{$l}->{what} = $what; $added = 1; } } @@ -809,6 +820,15 @@ sub undefined_symbols { } } + # Compile regexes + foreach my $l (keys %leaf) { + my @expr; + foreach my $w(split /\xac/, $leaf{$l}->{what}) { + push @expr, qr /^$w$/; + } + $leaf{$l}->{expr} = \@expr; + } + # Take links into account foreach my $link (keys %aliases) { my $abs_file = $aliases{$link}; From d4771993f2cf9e7e3f4d14bc1685b5346f6b218a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 23 Sep 2021 17:41:19 +0200 Subject: [PATCH 053/122] scripts: get_abi.pl: ensure that "others" regex will be parsed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The way the search algorithm works is that reduces the number of regex expressions that will be checked for a given file entry at sysfs. It does that by looking at the devnode name. For instance, when it checks for this file: /sys/bus/pci/drivers/iosf_mbi_pci/bind The logic will seek only the "What:" expressions that end with "bind". Currently, there are just a couple of What expressions that matches it: What: /sys/bus/fsl\-mc/drivers/.*/bind What: /sys/bus/pci/drivers/.*/bind It will then run an O(n²) algorithm to seek, which runs quickly when there are few regexs to seek. There are, however, some What: expressions that end with a wildcard. Those are harder to process. Right now, they're all grouped together at the "others" group. As those don't depend on the basename of the node, add an extra loop to ensure that those will be processed at the end, if not done yet. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9fe7ab46f67575def5db9e83034e9fab43846d84.1632411447.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index f2b5efef9c30..f25c98b1971e 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -723,6 +723,22 @@ sub check_undefined_symbols { } next if ($exact); + if ($leave ne "others") { + my @expr = @{$leaf{$leave}->{expr}}; + for (my $i = 0; $i < @names; $i++) { + foreach my $re (@expr) { + print "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); + if ($names[$i] =~ $re) { + $exact = 1; + last; + } + } + last if ($exact); + } + last if ($exact); + } + next if ($exact); + if ($hint && (!$search_string || $found_string)) { my $what = $leaf{$leave}->{what}; $what =~ s/\xac/\n\t/g; From ff3777d0d6617171e0baea271d8007defea61339 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:50 +0200 Subject: [PATCH 054/122] scripts: get_abi.pl: create a valid ReST with duplicated tags As warned, /sys/bus/iio/devices/iio:deviceX/fault_ovuv is defined 2 times: Warning: /sys/bus/iio/devices/iio:deviceX/fault_ovuv is defined 2 times: ./Documentation/ABI/testing/sysfs-bus-iio-temperature-max31856:14 ./Documentation/ABI/testing/sysfs-bus-iio-temperature-max31865:0 The logic with joins the two entries is just places the paragraph for the second entry after the previous one. That could cause more warnings, as the produced ReST may become invalid, as in the case of this specific symbol, which ends with a table: /new_devel/v4l/docs/Documentation/ABI/testing/sysfs-bus-iio-temperature-max31856:2: WARNING: Malformed table. No bottom table border found or no blank line after table bottom. === ======================================================= '1' The input voltage is negative or greater than VDD. '0' The input voltage is positive and less than VDD (normal state). === ======================================================= /new_devel/v4l/docs/Documentation/ABI/testing/sysfs-bus-iio-temperature-max31856:2: WARNING: Blank line required after table. Address it by adding two blank lines before joining duplicated symbols. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/4ad2e3a65f781f0f8d40bb75aa5a07aca80564d6.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index f25c98b1971e..c191c024f052 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -180,6 +180,7 @@ sub parse_abi { $data{$what}->{file} = $name; $data{$what}->{filepath} = $file; } else { + $data{$what}->{description} .= "\n\n" if (defined($data{$what}->{description})); if ($name ne $data{$what}->{file}) { $data{$what}->{file} .= " " . $name; $data{$what}->{filepath} .= " " . $file; From 26d98b9cc04238871ec24b015b280ebca050bf87 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:51 +0200 Subject: [PATCH 055/122] ABI: sysfs-platform-dell-privacy-wmi: correct ABI entries As described at Documentation/ABI/README doesn't contain an Attribute: field. The way sysfs ABI is supposed to work is that each different attribute would have a separate file. So, the right way to map this would be like: /sys/.../dell_privacy_supported_type/mic_mute /sys/.../dell_privacy_supported_type/camera_shutter /sys/.../dell_privacy_current_state/mic_mute /sys/.../dell_privacy_current_state/camera_shutter However, it seems to late to fix that, as this was merged already on Kernel 5.13, and a change right now would be a regression. So, instead, let's at least fix the entry to match the expected format. While here, fix the format of the contact, which is not a valid e-mail URL. This should also fix the current warnings produced when building the docs: Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi:35: WARNING: Unexpected indentation. Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi:2: WARNING: Unexpected indentation. Fixes: 8af9fa37b8a3 ("platform/x86: dell-privacy: Add support for Dell hardware privacy") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/42846621fdf2bf206feb114d06b14cbc47475fb5.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../testing/sysfs-platform-dell-privacy-wmi | 60 ++++++++++++------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi b/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi index 7f9e18705861..1f1f274a6979 100644 --- a/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi +++ b/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi @@ -1,55 +1,71 @@ What: /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type Date: Apr 2021 KernelVersion: 5.13 -Contact: "perry.yuan@dell.com>" +Contact: "" Description: Display which dell hardware level privacy devices are supported “Dell Privacy” is a set of HW, FW, and SW features to enhance Dell’s commitment to platform privacy for MIC, Camera, and ePrivacy screens. The supported hardware privacy devices are: -Attributes: - Microphone Mute: + + Attributes: + Microphone Mute: Identifies the local microphone can be muted by hardware, no applications is available to capture system mic sound - Camera Shutter: + Camera Shutter: Identifies camera shutter controlled by hardware, which is a micromechanical shutter assembly that is built onto the camera module to block capturing images from outside the laptop - supported: + Values: + + supported: The privacy device is supported by this system - unsupported: + unsupported: The privacy device is not supported on this system - For example to check which privacy devices are supported: + For example to check which privacy devices are supported:: - # cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type - [Microphone Mute] [supported] - [Camera Shutter] [supported] - [ePrivacy Screen] [unsupported] + # cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type + [Microphone Mute] [supported] + [Camera Shutter] [supported] + [ePrivacy Screen] [unsupported] What: /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state Date: Apr 2021 KernelVersion: 5.13 -Contact: "perry.yuan@dell.com>" +Contact: "" Description: Allow user space to check current dell privacy device state. Describes the Device State class exposed by BIOS which can be consumed by various applications interested in knowing the Privacy feature capabilities -Attributes: - muted: - Identifies the privacy device is turned off and cannot send stream to OS applications - unmuted: - Identifies the privacy device is turned on ,audio or camera driver can get - stream from mic and camera module to OS applications + Attributes: + Microphone: + Identifies the local microphone can be muted by hardware, no applications + is available to capture system mic sound - For example to check all supported current privacy device states: + Camera Shutter: + Identifies camera shutter controlled by hardware, which is a micromechanical + shutter assembly that is built onto the camera module to block capturing images + from outside the laptop - # cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state - [Microphone] [unmuted] - [Camera Shutter] [unmuted] + Values: + muted: + Identifies the privacy device is turned off + and cannot send stream to OS applications + + unmuted: + Identifies the privacy device is turned on, + audio or camera driver can get stream from mic + and camera module to OS applications + + For example to check all supported current privacy device states:: + + # cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state + [Microphone] [unmuted] + [Camera Shutter] [unmuted] From 6b59d8cac1ff4757577d53246c31eeb16e668068 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:52 +0200 Subject: [PATCH 056/122] ABI: sysfs-platform-dptf: Add tables markup to a table Solve those warnings: Documentation/ABI/testing/sysfs-platform-dptf:130: WARNING: Unexpected indentation. Documentation/ABI/testing/sysfs-platform-dptf:130: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/ABI/testing/sysfs-platform-dptf:130: WARNING: Definition list ends without a blank line; unexpected unindent. Fixes: 668ce99e4ed4 ("ACPI: DPTF: Additional sysfs attributes for power participant driver") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/41b5bbac8a67a8c5bc1d3f84de38824e705dea5d.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-platform-dptf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-platform-dptf b/Documentation/ABI/testing/sysfs-platform-dptf index 53c6b1000320..620fd20434a5 100644 --- a/Documentation/ABI/testing/sysfs-platform-dptf +++ b/Documentation/ABI/testing/sysfs-platform-dptf @@ -133,7 +133,10 @@ Contact: linux-acpi@vger.kernel.org Description: (RO) Presents SSC (spread spectrum clock) information for EMI (Electro magnetic interference) control. This is a bit mask. + + ======= ========================================== Bits Description + ======= ========================================== [7:0] Sets clock spectrum spread percentage: 0x00=0.2% , 0x3F=10% 1 LSB = 0.1% increase in spread (for @@ -151,3 +154,4 @@ Description: [10] 0: No white noise. 1: Add white noise to spread waveform [11] When 1, future writes are ignored. + ======= ========================================== From 1b8af67cae654c3c8d719563a2eabb88371d01c9 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:53 +0200 Subject: [PATCH 057/122] ABI: configfs-usb-gadget-uac1: fix a broken table Changeset 0356e6283c71 ("usb: gadget: f_uac1: add volume and mute support") added some new elements to the table but didn't care enough to actually adjust the columns, causing the output to be broken as warned by Sphinx when producing the documentation. Readjust it for it to be a valid ReST table. Fixes: 0356e6283c71 ("usb: gadget: f_uac1: add volume and mute support") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/044b0c14c35922bdcca50551fe2aa870baae9b06.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/configfs-usb-gadget-uac1 | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Documentation/ABI/testing/configfs-usb-gadget-uac1 b/Documentation/ABI/testing/configfs-usb-gadget-uac1 index dd647d44d975..b576b3d6ea6d 100644 --- a/Documentation/ABI/testing/configfs-usb-gadget-uac1 +++ b/Documentation/ABI/testing/configfs-usb-gadget-uac1 @@ -4,23 +4,29 @@ KernelVersion: 4.14 Description: The attributes: - ========== =================================== - c_chmask capture channel mask - c_srate capture sampling rate - c_ssize capture sample size (bytes) - c_mute_present capture mute control enable + ===================== ======================================= + c_chmask capture channel mask + c_srate capture sampling rate + c_ssize capture sample size (bytes) + c_mute_present capture mute control enable c_volume_present capture volume control enable - c_volume_min capture volume control min value (in 1/256 dB) - c_volume_max capture volume control max value (in 1/256 dB) - c_volume_res capture volume control resolution (in 1/256 dB) - p_chmask playback channel mask - p_srate playback sampling rate - p_ssize playback sample size (bytes) - p_mute_present playback mute control enable + c_volume_min capture volume control min value + (in 1/256 dB) + c_volume_max capture volume control max value + (in 1/256 dB) + c_volume_res capture volume control resolution + (in 1/256 dB) + p_chmask playback channel mask + p_srate playback sampling rate + p_ssize playback sample size (bytes) + p_mute_present playback mute control enable p_volume_present playback volume control enable - p_volume_min playback volume control min value (in 1/256 dB) - p_volume_max playback volume control max value (in 1/256 dB) - p_volume_res playback volume control resolution (in 1/256 dB) - req_number the number of pre-allocated request - for both capture and playback - ========== =================================== + p_volume_min playback volume control min value + (in 1/256 dB) + p_volume_max playback volume control max value + (in 1/256 dB) + p_volume_res playback volume control resolution + (in 1/256 dB) + req_number the number of pre-allocated request + for both capture and playback + ===================== ======================================= From 5ef803538bd2f2907b0a44e24f094cf9bbf8bc13 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:54 +0200 Subject: [PATCH 058/122] ABI: configfs-usb-gadget-uac2: fix a broken table Changeset af6cbe09920 ("usb: gadget: f_uac2: add volume and mute support") added some new elements to the table but didn't care enough to actually adjust the columns, causing the output to be broken as warned by Sphinx when producing the documentation. Readjust it for it to be a valid ReST table. Fixes: eaf6cbe09920 ("usb: gadget: f_uac2: add volume and mute support") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d253819a4c201b942d754682bb91dd278300fb79.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/configfs-usb-gadget-uac2 | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/Documentation/ABI/testing/configfs-usb-gadget-uac2 b/Documentation/ABI/testing/configfs-usb-gadget-uac2 index cfd160ff8b56..244d96650123 100644 --- a/Documentation/ABI/testing/configfs-usb-gadget-uac2 +++ b/Documentation/ABI/testing/configfs-usb-gadget-uac2 @@ -4,23 +4,30 @@ KernelVersion: 3.18 Description: The attributes: - ========= ============================ - c_chmask capture channel mask - c_srate capture sampling rate - c_ssize capture sample size (bytes) - c_sync capture synchronization type (async/adaptive) - c_mute_present capture mute control enable + ===================== ======================================= + c_chmask capture channel mask + c_srate capture sampling rate + c_ssize capture sample size (bytes) + c_sync capture synchronization type + (async/adaptive) + c_mute_present capture mute control enable c_volume_present capture volume control enable - c_volume_min capture volume control min value (in 1/256 dB) - c_volume_max capture volume control max value (in 1/256 dB) - c_volume_res capture volume control resolution (in 1/256 dB) - fb_max maximum extra bandwidth in async mode - p_chmask playback channel mask - p_srate playback sampling rate - p_ssize playback sample size (bytes) - p_mute_present playback mute control enable + c_volume_min capture volume control min value + (in 1/256 dB) + c_volume_max capture volume control max value + (in 1/256 dB) + c_volume_res capture volume control resolution + (in 1/256 dB) + fb_max maximum extra bandwidth in async mode + p_chmask playback channel mask + p_srate playback sampling rate + p_ssize playback sample size (bytes) + p_mute_present playback mute control enable p_volume_present playback volume control enable - p_volume_min playback volume control min value (in 1/256 dB) - p_volume_max playback volume control max value (in 1/256 dB) - p_volume_res playback volume control resolution (in 1/256 dB) - ========= ============================ + p_volume_min playback volume control min value + (in 1/256 dB) + p_volume_max playback volume control max value + (in 1/256 dB) + p_volume_res playback volume control resolution + (in 1/256 dB) + ===================== ======================================= From 1f223cdb38a73616eea9eeebd835d3381014ad86 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:55 +0200 Subject: [PATCH 059/122] ABI: sysfs-devices-removable: make a table valid as ReST markup Changeset 70f400d4d957 ("driver core: Move the "removable" attribute from USB to core") added a table to the file, but not using a valid ReST format. Change it to avoid build issues when producing documentation with "make htmldocs". Fixes: 70f400d4d957 ("driver core: Move the "removable" attribute from USB to core") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/bf83354747b8abaa486fe03af4be2826363469cb.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-devices-removable | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-devices-removable b/Documentation/ABI/testing/sysfs-devices-removable index bda6c320c8d3..754ecb4587ca 100644 --- a/Documentation/ABI/testing/sysfs-devices-removable +++ b/Documentation/ABI/testing/sysfs-devices-removable @@ -7,10 +7,12 @@ Description: bus / platform-specific way. This attribute is only present for devices that can support determining such information: - "removable": device can be removed from the platform by the user - "fixed": device is fixed to the platform / cannot be removed + =========== =================================================== + "removable" device can be removed from the platform by the user + "fixed" device is fixed to the platform / cannot be removed by the user. - "unknown": The information is unavailable / cannot be deduced. + "unknown" The information is unavailable / cannot be deduced. + =========== =================================================== Currently this is only supported by USB (which infers the information from a combination of hub descriptor bits and From 3cb1feadbffd536b58373312d93feae08c010193 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 13:10:56 +0200 Subject: [PATCH 060/122] ABI: sysfs-platform-intel-pmc: add blank lines to make it valid for ReST The ReST format requires blank lines before/after identation changes, for it to properly detect lists. Fixes: ee7abc105e2b ("platform/x86: intel_pmc_core: export platform global reset bits via etr3 sysfs file") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3673e1a255ad4100c933af215b60d68ba126f820.1632740376.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-platform-intel-pmc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-platform-intel-pmc b/Documentation/ABI/testing/sysfs-platform-intel-pmc index ef199af75ab0..f31d59b21f9b 100644 --- a/Documentation/ABI/testing/sysfs-platform-intel-pmc +++ b/Documentation/ABI/testing/sysfs-platform-intel-pmc @@ -11,8 +11,10 @@ Description: to take effect. Display global reset setting bits for PMC. + * bit 31 - global reset is locked * bit 20 - global reset is set + Writing bit 20 value to the etr3 will induce a platform "global reset" upon consequent platform reset, in case the register is not locked. From 3a1cc06c0e07065b06ba1af28eb48886e099e195 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:49:49 +0200 Subject: [PATCH 061/122] scripts: get_abi.pl: produce an error if the ref tree is broken The logic under graph_add_file should create, for every entry, a __name name array for all entries of the tree. If this fails, the symlink parsing will break. Add an error if this ever happens. While here, improve the output of data dumper to be more compact and to avoid displaying things like $VAR1=. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/e7dd4d70e206723455d50c851802c8bb6c34941d.1632750315.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index c191c024f052..26a3f8ff566a 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -27,6 +27,9 @@ my $dbg_what_open = 2; my $dbg_dump_abi_structs = 4; my $dbg_undefined = 8; +$Data::Dumper::Indent = 1; +$Data::Dumper::Terse = 1; + # # If true, assumes that the description is formatted with ReST # @@ -597,7 +600,6 @@ sub graph_add_link { my @queue; my %seen; - my $base_name; my $st; push @queue, $file_ref; @@ -611,6 +613,12 @@ sub graph_add_link { next if $seen{$$v{$c}}; next if ($c eq "__name"); + if (!defined($$v{$c}{"__name"})) { + printf STDERR "Error: Couldn't find a non-empty name on a children of $file/.*: "; + print STDERR Dumper(%{$v}); + exit; + } + # Add new name my $name = @{$$v{$c}{"__name"}}[0]; if ($name =~ s#^$file/#$link/#) { From 87b58c6fae17b2404f32dfbf793b1f1b14fa9c95 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:49:50 +0200 Subject: [PATCH 062/122] scripts: get_abi.pl: fix parse logic for DT firmware It doesn't make any sense to parse ABI entries under /sys/firmware, as those are either specified by ACPI specs or by Documentation/devicetree. The current logic to ignore firmware entries is incomplete, as it ignores just the relative name of the file, and not its absolute name. This cause errors while parsing the symlinks. So, rewrite the logic for it to do a better job. Tested with both x86 and arm64 (HiKey970) systems. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1c806eaec96f6706db4b041bbe6a0e2519e9637e.1632750315.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 26a3f8ff566a..d14f5cfc3138 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -635,20 +635,30 @@ my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\x sub parse_existing_sysfs { my $file = $File::Find::name; - # Ignore cgroup and firmware - return if ($file =~ m#^/sys/(fs/cgroup|firmware)/#); - - # Ignore some sysfs nodes - return if ($file =~ m#/(sections|notes)/#); - - # Would need to check at - # Documentation/admin-guide/kernel-parameters.txt, but this - # is not easily parseable. - return if ($file =~ m#/parameters/#); - my $mode = (lstat($file))[2]; my $abs_file = abs_path($file); + my @tmp; + push @tmp, $file; + push @tmp, $abs_file if ($abs_file ne $file); + + foreach my $f(@tmp) { + # Ignore cgroup, as this is big and has zero docs under ABI + return if ($f =~ m#^/sys/fs/cgroup/#); + + # Ignore firmware as it is documented elsewhere + # Either ACPI or under Documentation/devicetree/bindings/ + return if ($f =~ m#^/sys/firmware/#); + + # Ignore some sysfs nodes that aren't actually part of ABI + return if ($f =~ m#/sections|notes/#); + + # Would need to check at + # Documentation/admin-guide/kernel-parameters.txt, but this + # is not easily parseable. + return if ($f =~ m#/parameters/#); + } + if (S_ISLNK($mode)) { $aliases{$file} = $abs_file; return; From 42f09848cf3a8af1f9688487ccd81cb4b0fb7a8b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:49:51 +0200 Subject: [PATCH 063/122] scripts: get_abi.pl: update its documentation The current highlight schema is not working properly. So, use, instead, Pod::Text. While here, also update the copyright in order to reflect the latest changes and the e-mail I'm currently using. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/89fcd301e065ed86dfd8670725144b196266b6a4.1632750315.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index d14f5cfc3138..4978163f5b16 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -1,10 +1,12 @@ #!/usr/bin/env perl # SPDX-License-Identifier: GPL-2.0 +BEGIN { $Pod::Usage::Formatter = 'Pod::Text::Termcap'; } + use strict; use warnings; use utf8; -use Pod::Usage; +use Pod::Usage qw(pod2usage); use Getopt::Long; use File::Find; use Fcntl ':mode'; @@ -47,7 +49,7 @@ GetOptions( ) or pod2usage(2); pod2usage(1) if $help; -pod2usage(-exitstatus => 0, -verbose => 2) if $man; +pod2usage(-exitstatus => 0, -noperldoc, -verbose => 2) if $man; pod2usage(2) if (scalar @ARGV < 1 || @ARGV > 2); @@ -923,18 +925,18 @@ B [--debug ] [--enable-lineno] [--man] [--help] [--search-string ] [] -Where can be: +Where B can be: =over 8 -B [SEARCH_REGEX] - search for [SEARCH_REGEX] inside ABI +B I - search for I inside ABI -B - output the ABI in ReST markup language +B - output the ABI in ReST markup language -B - validate the ABI contents +B - validate the ABI contents -B - existing symbols at the system that aren't - defined at Documentation/ABI +B - existing symbols at the system that aren't + defined at Documentation/ABI =back @@ -950,9 +952,9 @@ the Documentation/ABI directory. =item B<--rst-source> and B<--no-rst-source> The input file may be using ReST syntax or not. Those two options allow -selecting between a rst-compliant source ABI (--rst-source), or a +selecting between a rst-compliant source ABI (B<--rst-source>), or a plain text that may be violating ReST spec, so it requres some escaping -logic (--no-rst-source). +logic (B<--no-rst-source>). =item B<--enable-lineno> @@ -972,7 +974,7 @@ following bitmask: Show hints about possible definitions for the missing ABI symbols. Used only when B. -=item B<--search-string> [regex string] +=item B<--search-string> I Show only occurences that match a search string. Used only when B. @@ -1021,11 +1023,11 @@ $ scripts/get_abi.pl rest --dir Documentation/ABI/obsolete =head1 BUGS -Report bugs to Mauro Carvalho Chehab +Report bugs to Mauro Carvalho Chehab =head1 COPYRIGHT -Copyright (c) 2016-2019 by Mauro Carvalho Chehab . +Copyright (c) 2016-2021 by Mauro Carvalho Chehab . License GPLv2: GNU GPL version 2 . From 2833e30aa04d4a025341b7071f9d469538367605 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Sep 2021 12:14:02 +0200 Subject: [PATCH 064/122] scripts: get_abi.pl: use STDERR for search-string and show-hints On undefined checks, use STDOUT only for the not found entries. All other data (search-string and show-hints) is printed at STDERR. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/51c6a39c82f73b441030c51bf905a1f382452a67.1632823172.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 4978163f5b16..a6c91f822363 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -728,9 +728,9 @@ sub check_undefined_symbols { for (my $i = 0; $i < @names; $i++) { if ($found_string && $hint) { if (!$i) { - print "--> $names[$i]\n"; + print STDERR "--> $names[$i]\n"; } else { - print " $names[$i]\n"; + print STDERR " $names[$i]\n"; } } foreach my $re (@expr) { @@ -760,17 +760,17 @@ sub check_undefined_symbols { } next if ($exact); + print "$file not found.\n" if (!$search_string || $found_string); + if ($hint && (!$search_string || $found_string)) { my $what = $leaf{$leave}->{what}; $what =~ s/\xac/\n\t/g; if ($leave ne "others") { - print " more likely regexes:\n\t$what\n"; + print STDERR " more likely regexes:\n\t$what\n"; } else { - print " tested regexes:\n\t$what\n"; + print STDERR " tested regexes:\n\t$what\n"; } - next; } - print "$file not found.\n" if (!$search_string || $found_string); } } @@ -852,7 +852,7 @@ sub undefined_symbols { } } if ($search_string && $added) { - print "What: $what\n" if ($what =~ m#$search_string#); + print STDERR "What: $what\n" if ($what =~ m#$search_string#); } } From 28331a011d1cab2e35be9d56b7aec2a203e7914e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Sep 2021 12:14:03 +0200 Subject: [PATCH 065/122] scripts: get_abi.pl: show progress As parsing the sysfs entries can take a long time, add progress information. The progress logic will update the stats on every second, or on 1% steps of the progress. When STDERR is a console, it will use a single line, using a VT-100 command to erase the line before rewriting it. Otherwise, it will put one message on a separate line. That would help to identify what parts of sysfs checking that it is taking more time to process. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/4e581dcbec21ad8a60fff883498018f96f13dd1c.1632823172.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 173 +++++++++++++++++++++++++++++---------------- 1 file changed, 113 insertions(+), 60 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index a6c91f822363..841d889747c0 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -9,6 +9,7 @@ use utf8; use Pod::Usage qw(pod2usage); use Getopt::Long; use File::Find; +use IO::Handle; use Fcntl ':mode'; use Cwd 'abs_path'; use Data::Dumper; @@ -702,87 +703,137 @@ sub get_leave($) return $leave; } -sub check_undefined_symbols { - foreach my $file_ref (sort @files) { - my @names = @{$$file_ref{"__name"}}; - my $file = $names[0]; +my @not_found; - my $exact = 0; - my $found_string; +sub check_file($$) +{ + my $file_ref = shift; + my $names_ref = shift; + my @names = @{$names_ref}; + my $file = $names[0]; - my $leave = get_leave($file); - if (!defined($leaf{$leave})) { - $leave = "others"; - } - my @expr = @{$leaf{$leave}->{expr}}; - die ("missing rules for $leave") if (!defined($leaf{$leave})); + my $found_string; - my $path = $file; - $path =~ s,(.*/).*,$1,; + my $leave = get_leave($file); + if (!defined($leaf{$leave})) { + $leave = "others"; + } + my @expr = @{$leaf{$leave}->{expr}}; + die ("\rmissing rules for $leave") if (!defined($leaf{$leave})); - if ($search_string) { - next if (!($file =~ m#$search_string#)); - $found_string = 1; - } + my $path = $file; + $path =~ s,(.*/).*,$1,; - for (my $i = 0; $i < @names; $i++) { - if ($found_string && $hint) { - if (!$i) { - print STDERR "--> $names[$i]\n"; - } else { - print STDERR " $names[$i]\n"; - } - } - foreach my $re (@expr) { - print "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); - if ($names[$i] =~ $re) { - $exact = 1; - last; - } - } - last if ($exact); - } - next if ($exact); + if ($search_string) { + return if (!($file =~ m#$search_string#)); + $found_string = 1; + } - if ($leave ne "others") { - my @expr = @{$leaf{$leave}->{expr}}; - for (my $i = 0; $i < @names; $i++) { - foreach my $re (@expr) { - print "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); - if ($names[$i] =~ $re) { - $exact = 1; - last; - } - } - last if ($exact); - } - last if ($exact); - } - next if ($exact); - - print "$file not found.\n" if (!$search_string || $found_string); - - if ($hint && (!$search_string || $found_string)) { - my $what = $leaf{$leave}->{what}; - $what =~ s/\xac/\n\t/g; - if ($leave ne "others") { - print STDERR " more likely regexes:\n\t$what\n"; + for (my $i = 0; $i < @names; $i++) { + if ($found_string && $hint) { + if (!$i) { + print STDERR "--> $names[$i]\n"; } else { - print STDERR " tested regexes:\n\t$what\n"; + print STDERR " $names[$i]\n"; } } + foreach my $re (@expr) { + print STDERR "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); + if ($names[$i] =~ $re) { + return; + } + } + } + + if ($leave ne "others") { + my @expr = @{$leaf{$leave}->{expr}}; + for (my $i = 0; $i < @names; $i++) { + foreach my $re (@expr) { + print STDERR "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); + if ($names[$i] =~ $re) { + return; + } + } + } + } + + push @not_found, $file if (!$search_string || $found_string); + + if ($hint && (!$search_string || $found_string)) { + my $what = $leaf{$leave}->{what}; + $what =~ s/\xac/\n\t/g; + if ($leave ne "others") { + print STDERR "\r more likely regexes:\n\t$what\n"; + } else { + print STDERR "\r tested regexes:\n\t$what\n"; + } + } +} + +sub check_undefined_symbols { + my $num_files = scalar @files; + my $next_i = 0; + my $start_time = times; + + my $last_time = $start_time; + + # When either debug or hint is enabled, there's no sense showing + # progress, as the progress will be overriden. + if ($hint || ($debug && $dbg_undefined)) { + $next_i = $num_files; + } + + my $is_console; + $is_console = 1 if (-t STDERR); + + for (my $i = 0; $i < $num_files; $i++) { + my $file_ref = $files[$i]; + my @names = @{$$file_ref{"__name"}}; + + check_file($file_ref, \@names); + + my $cur_time = times; + + if ($i == $next_i || $cur_time > $last_time + 1) { + my $percent = $i * 100 / $num_files; + + my $tm = $cur_time - $start_time; + my $time = sprintf "%d:%02d", int($tm), 60 * ($tm - int($tm)); + + printf STDERR "\33[2K\r", if ($is_console); + printf STDERR "%s: processing sysfs files... %i%%: $names[0]", $time, $percent; + printf STDERR "\n", if (!$is_console); + STDERR->flush(); + + $next_i = int (($percent + 1) * $num_files / 100); + $last_time = $cur_time; + } + } + + my $cur_time = times; + my $tm = $cur_time - $start_time; + my $time = sprintf "%d:%02d", int($tm), 60 * ($tm - int($tm)); + + printf STDERR "\33[2K\r", if ($is_console); + printf STDERR "%s: processing sysfs files... done\n", $time; + + foreach my $file (@not_found) { + print "$file not found.\n"; } } sub undefined_symbols { + print STDERR "Reading $sysfs_prefix directory contents..."; find({ wanted =>\&parse_existing_sysfs, preprocess =>\&dont_parse_special_attributes, no_chdir => 1 }, $sysfs_prefix); + print STDERR "done.\n"; $leaf{"others"}->{what} = ""; + print STDERR "Converting ABI What fields into regexes..."; foreach my $w (sort keys %data) { foreach my $what (split /\xac/,$w) { next if (!($what =~ m/^$sysfs_prefix/)); @@ -871,6 +922,8 @@ sub undefined_symbols { my $abs_file = $aliases{$link}; graph_add_link($abs_file, $link); } + print STDERR "done.\n"; + check_undefined_symbols; } From 483f7d699fd96d494dbd299f73d758073c73c147 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Sep 2021 12:14:04 +0200 Subject: [PATCH 066/122] ABI: evm: place a second what at the next line Originally, get_abi.pl was using spaces to separate What: parameters, but there are several references that declare things like: /sys/class/powercap/...//enabled So, the logic was changes in order to properly address it. That broke the second What added by Changeset 18e49b304633 ("ABI: security: fix location for evm and ima_policy"). As the only file that defines multiple What: at the same line is this file, let's move the second What: to a separate line. Fixes: 18e49b304633 ("ABI: security: fix location for evm and ima_policy") Fixes: ab9c14805b37 ("scripts: get_abi.pl: Better handle multiple What parameters") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/1f1e29ccdc0dd0ec089a67b8a4e9650517c6137a.1632823172.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/evm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/evm b/Documentation/ABI/testing/evm index 4b76a19b7bb4..44750a933db4 100644 --- a/Documentation/ABI/testing/evm +++ b/Documentation/ABI/testing/evm @@ -1,4 +1,5 @@ -What: /sys/kernel/security/evm /sys/kernel/security/*/evm +What: /sys/kernel/security/evm +What: /sys/kernel/security/*/evm Date: March 2011 Contact: Mimi Zohar Description: From 3b54fc5077dade7c400fbc08b02bd65e5edd5cc0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:34 +0200 Subject: [PATCH 067/122] ABI: stable/sysfs-module: better document modules Instead of placing almost everything there as a text, use the proper What: for each component of the ABI. This allows it to be better documented and parsed by get_abi.pl. While here, use wildcards for MODULENAME. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/35876c1eabbcd03170d658081030db980b403297.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/stable/sysfs-module | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/ABI/stable/sysfs-module b/Documentation/ABI/stable/sysfs-module index 6272ae5fb366..5c028af9921a 100644 --- a/Documentation/ABI/stable/sysfs-module +++ b/Documentation/ABI/stable/sysfs-module @@ -1,8 +1,7 @@ -What: /sys/module -Description: - The /sys/module tree consists of the following structure: +The /sys/module tree consists of the following structure: - /sys/module/MODULENAME +What: /sys/module/ +Description: The name of the module that is in the kernel. This module name will always show up if the module is loaded as a dynamic module. If it is built directly into the kernel, it @@ -12,7 +11,8 @@ Description: Note: The conditions of creation in the built-in case are not by design and may be removed in the future. - /sys/module/MODULENAME/parameters +What: /sys/module//parameters +Description: This directory contains individual files that are each individual parameters of the module that are able to be changed at runtime. See the individual module @@ -25,7 +25,8 @@ Description: individual driver documentation for details as to the stability of the different parameters. - /sys/module/MODULENAME/refcnt +What: /sys/module//refcnt +Description: If the module is able to be unloaded from the kernel, this file will contain the current reference count of the module. From 19aca231250f532b315ccbc22ff5125be292aed4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:35 +0200 Subject: [PATCH 068/122] ABI: stable/sysfs-module: document version and srcversion Changeset c988d2b28454 ("[PATCH] modules: add version and srcversion to sysfs") added version and srcversion ABI to modules. Document them. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/82bc7ebcc56c68c39b0e9de89cd0e023339d0597.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/stable/sysfs-module | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-module b/Documentation/ABI/stable/sysfs-module index 5c028af9921a..560b4a3278df 100644 --- a/Documentation/ABI/stable/sysfs-module +++ b/Documentation/ABI/stable/sysfs-module @@ -33,3 +33,15 @@ Description: Note: If the module is built into the kernel, or if the CONFIG_MODULE_UNLOAD kernel configuration value is not enabled, this file will not be present. + +What: /sys/module//srcversion +Date: Jun 2005 +Description: + If the module source has MODULE_VERSION, this file will contain + the checksum of the the source code. + +What: /sys/module//version +Date: Jun 2005 +Description: + If the module source has MODULE_VERSION, this file will contain + the version of the source code. From eeac9faf9645e2eeda0c7414700c41936667dbaa Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:36 +0200 Subject: [PATCH 069/122] ABI: testing/sysfs-module: document initstate Despite being an old ABI, present on all modules, its documentation is missing. Add it, based on the original commit. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/b9c72187abce2b0efd1c41646b1d0c66104d90e4.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-module | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-module b/Documentation/ABI/testing/sysfs-module index 88bddf192ceb..08886367d047 100644 --- a/Documentation/ABI/testing/sysfs-module +++ b/Documentation/ABI/testing/sysfs-module @@ -41,6 +41,13 @@ KernelVersion: 3.3 Contact: Kay Sievers Description: Module size in bytes. +What: /sys/module/*/initstate +Date: Nov 2006 +KernelVersion: 2.6.19 +Contact: Kay Sievers +Description: Show the initialization state(live, coming, going) of + the module. + What: /sys/module/*/taint Date: Jan 2012 KernelVersion: 3.3 From 405ea445781ac27c7bb68bb27eec6086db7922c1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:37 +0200 Subject: [PATCH 070/122] ABI: sysfs-devices-power: document some RPM statistics Changeset 8d4b9d1bfef1 ("PM / Runtime: Add runtime PM statistics (v3)") added runtime_active_time and runtime_suspended_time, in order to allow powertop to identify the amount of time a device is active/suspended. Add an ABI description for those. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d5524b966d081c650121c4c496c2f7ab3df524e9.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-devices-power | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power index 1763e64dd152..84694b8fec8e 100644 --- a/Documentation/ABI/testing/sysfs-devices-power +++ b/Documentation/ABI/testing/sysfs-devices-power @@ -269,3 +269,17 @@ Description: the current runtime PM status of the device, which may be "suspended", "suspending", "resuming", "active", "error" (fatal error), or "unsupported" (runtime PM is disabled). + +What: /sys/devices/.../power/runtime_active_time +Date: Jul 2010 +Contact: Arjan van de Ven +Description: + Reports the total time that the device has been active. + Used for runtime PM statistics. + +What: /sys/devices/.../power/runtime_suspended_time +Date: Jul 2010 +Contact: Arjan van de Ven +Description: + Reports total time that the device has been suspended. + Used for runtime PM statistics. From e95d6d8b0147229ee6a52f1dc0bef41d4017b2c2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:38 +0200 Subject: [PATCH 071/122] ABI: sysfs-devices: add /dev ABI Changeset 23681e479129 ("[PATCH] Driver core: allow struct device to have a dev_t") added a /dev ABI for /sys/devices. Document it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/bef678e68d1ac8ac504ed6e09f22105b787c877c.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/stable/sysfs-devices | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-devices b/Documentation/ABI/stable/sysfs-devices index 42bf1eab5677..98a8ef99ac5f 100644 --- a/Documentation/ABI/stable/sysfs-devices +++ b/Documentation/ABI/stable/sysfs-devices @@ -23,3 +23,10 @@ Contact: Device Tree mailing list Description: If CONFIG_OF is enabled, then this file is present. When read, it returns full name of the device node. + +What: /sys/devices/*/dev +Date: Jun 2006 +Contact: Greg Kroah-Hartman +Description: + Major and minor numbers of the character device corresponding + to the device (in : format). From 9919c339babf6b92ad79dd0db9eeef6a23971e7c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:39 +0200 Subject: [PATCH 072/122] ABI: sysfs-bus-pci: add documentation for modalias Even being available since 2005, there's no documentation for modalias. Acked-by: Bjorn Helgaas Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9ceb1fcdbef3c0d2d0368dcc2f19084a3e529ad1.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-pci | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci index 191cbe9ae5ed..1eeac7f59672 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci +++ b/Documentation/ABI/testing/sysfs-bus-pci @@ -187,6 +187,24 @@ Description: The symbolic link points to the PCI device sysfs entry of the Physical Function this device associates with. +What: /sys/bus/pci/devices/.../modalias +Date: May 2005 +Contact: Greg Kroah-Hartman +Description: + This attribute indicates the PCI ID of the device object. + + That is in the format: + pci:vXXXXXXXXdXXXXXXXXsvXXXXXXXXsdXXXXXXXXbcXXscXXiXX, + where: + + - vXXXXXXXX contains the vendor ID; + - dXXXXXXXX contains the device ID; + - svXXXXXXXX contains the sub-vendor ID; + - sdXXXXXXXX contains the subsystem device ID; + - bcXX contains the device class; + - scXX contains the device subclass; + - iXX contains the device class programming interface. + What: /sys/bus/pci/slots/.../module Date: June 2009 Contact: linux-pci@vger.kernel.org From 6abac1a8a68e7d2c15578a2c19c355afe910634d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:40 +0200 Subject: [PATCH 073/122] ABI: o2cb: add an obsolete file for /sys/o2cb This was renamed to /sys/fs/o2cb. Mark the old name as obsolete. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/25210a6af51b65808e3f102f9f08c3f90b763801.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/obsolete/o2cb | 11 +++++++++++ Documentation/ABI/stable/o2cb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/obsolete/o2cb diff --git a/Documentation/ABI/obsolete/o2cb b/Documentation/ABI/obsolete/o2cb new file mode 100644 index 000000000000..fe7e45e17bc7 --- /dev/null +++ b/Documentation/ABI/obsolete/o2cb @@ -0,0 +1,11 @@ +What: /sys/o2cb +Date: Dec 2005 +KernelVersion: 2.6.16 +Contact: ocfs2-devel@oss.oracle.com +Description: Ocfs2-tools looks at 'interface-revision' for versioning + information. Each logmask/ file controls a set of debug prints + and can be written into with the strings "allow", "deny", or + "off". Reading the file returns the current state. + Was renamed to /sys/fs/u2cb/ +Users: ocfs2-tools. It's sufficient to mail proposed changes to + ocfs2-devel@oss.oracle.com. diff --git a/Documentation/ABI/stable/o2cb b/Documentation/ABI/stable/o2cb index 5eb1545e0b8d..b62a967f01a0 100644 --- a/Documentation/ABI/stable/o2cb +++ b/Documentation/ABI/stable/o2cb @@ -1,4 +1,4 @@ -What: /sys/fs/o2cb/ (was /sys/o2cb) +What: /sys/fs/o2cb/ Date: Dec 2005 KernelVersion: 2.6.16 Contact: ocfs2-devel@oss.oracle.com From 773151dc41035657175eb7e5bc51721943039b31 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:41 +0200 Subject: [PATCH 074/122] ABI: sysfs-kernel-slab: Document some stats Document three slab stats that were added in 2011 and 2017. Fixes: 49e2258586b4 ("slub: per cpu cache for partial pages") Fixes: 8eb8284b4129 ("usercopy: Prepare for usercopy whitelisting") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/8960435734c5aa918568ce7891171448c4d68709.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-kernel-slab | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab index 77e5840b00a5..c440f4946e12 100644 --- a/Documentation/ABI/testing/sysfs-kernel-slab +++ b/Documentation/ABI/testing/sysfs-kernel-slab @@ -496,3 +496,24 @@ Contact: Pekka Enberg , Description: Writing to the validate file causes SLUB to traverse all of its cache's objects and check the validity of metadata. + +What: /sys/kernel/slab//usersize +Date: Jun 2017 +Contact: David Windsor +Description: + The usersize file is read-only and contains the usercopy + region size. + +What: /sys/kernel/slab//slabs_cpu_partial +Date: Aug 2011 +Contact: Christoph Lameter +Description: + This read-only file shows the number of partialli allocated + frozen slabs. + +What: /sys/kernel/slab//cpu_partial +Date: Aug 2011 +Contact: Christoph Lameter +Description: + This read-only file shows the number of per cpu partial + pages to keep around. From 5e58808871c1ed9a209bdd38be2b850941ee3aee Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:42 +0200 Subject: [PATCH 075/122] ABI: sysfs-devices-power: add some debug sysfs files Those files were added back in Apr 2010, but there's no documentation for them yet. Fixes: c92445fadb91 ("PM / Runtime: Add sysfs debug files") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/df6c3ae0ffc2dddf73d7a5baf696a4aa260fb576.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-devices-power | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power index 84694b8fec8e..1b2a2d41ff80 100644 --- a/Documentation/ABI/testing/sysfs-devices-power +++ b/Documentation/ABI/testing/sysfs-devices-power @@ -283,3 +283,25 @@ Contact: Arjan van de Ven Description: Reports total time that the device has been suspended. Used for runtime PM statistics. + +What: /sys/devices/.../power/runtime_usage +Date: Apr 2010 +Contact: Dominik Brodowski +Description: + Reports the runtime PM usage count of a device. + +What: /sys/devices/.../power/runtime_enabled +Date: Apr 2010 +Contact: Dominik Brodowski +Description: + Is runtime PM enabled for this device? + States are "enabled", "disabled", "forbidden" or a + combination of the latter two. + +What: /sys/devices/.../power/runtime_active_kids +Date: Apr 2010 +Contact: Dominik Brodowski +Description: + Reports the runtime PM children usage count of a device, or + 0 if the the children will be ignored. + From bab2f3c14e56c526c5b31ac3909fa5b47c21018d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:43 +0200 Subject: [PATCH 076/122] ABI: sysfs-bus-pci: add a alternative What fields There are some PCI ABI that aren't shown under: /sys/bus/pci/drivers/.../ Because they're registered with a different class. That's the case of, for instance: /sys/bus/i2c/drivers/CHT Whiskey Cove PMIC/unbind This one is not present under /sys/bus/pci: $ find /sys/bus/pci -name 'CHT Whiskey Cove PMIC' Although clearly this is provided by a PCI driver: /sys/devices/pci0000:00/0000:00:02.0/i2c-4/subsystem/drivers/CHT Whiskey Cove PMIC/unbind So, add an altertate What location in order to match bind/unbind to such devices. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/15ba8c07f1b0fd7359106920c8e34a7b9af7aea6.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-pci | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci index 1eeac7f59672..16afe3f59cbd 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci +++ b/Documentation/ABI/testing/sysfs-bus-pci @@ -1,4 +1,5 @@ What: /sys/bus/pci/drivers/.../bind +What: /sys/devices/pciX/.../bind Date: December 2003 Contact: linux-pci@vger.kernel.org Description: @@ -14,6 +15,7 @@ Description: (Note: kernels before 2.6.28 may require echo -n). What: /sys/bus/pci/drivers/.../unbind +What: /sys/devices/pciX/.../unbind Date: December 2003 Contact: linux-pci@vger.kernel.org Description: @@ -29,6 +31,7 @@ Description: (Note: kernels before 2.6.28 may require echo -n). What: /sys/bus/pci/drivers/.../new_id +What: /sys/devices/pciX/.../new_id Date: December 2003 Contact: linux-pci@vger.kernel.org Description: @@ -47,6 +50,7 @@ Description: # echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id What: /sys/bus/pci/drivers/.../remove_id +What: /sys/devices/pciX/.../remove_id Date: February 2009 Contact: Chris Wright Description: From 8a60958923e6cea34de024eb7e494de0bee3c7f2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:44 +0200 Subject: [PATCH 077/122] ABI: sysfs-class-bdi: use What: to describe each property Instead of listing all bdi entries inside the description, add one entry for each, just like the remaining ABI files. That allows get_abi.pl script to properly parse it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/77e5904dfd275ed2670cd13779e5ef1da96e355c.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-bdi | 30 ++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-bdi b/Documentation/ABI/testing/sysfs-class-bdi index 5402bd74ba43..6d2a2fc189dd 100644 --- a/Documentation/ABI/testing/sysfs-class-bdi +++ b/Documentation/ABI/testing/sysfs-class-bdi @@ -23,14 +23,17 @@ default The default backing dev, used for non-block device backed filesystems which do not provide their own BDI. -Files under /sys/class/bdi// - -read_ahead_kb (read-write) - +What: /sys/class/bdi//read_ahead_kb +Date: January 2008 +Contact: Peter Zijlstra +Description: Size of the read-ahead window in kilobytes -min_ratio (read-write) - + (read-write) +What: /sys/class/bdi//min_ratio +Date: January 2008 +Contact: Peter Zijlstra +Description: Under normal circumstances each device is given a part of the total write-back cache that relates to its current average writeout speed in relation to the other devices. @@ -39,8 +42,12 @@ min_ratio (read-write) percentage of the write-back cache to a particular device. For example, this is useful for providing a minimum QoS. -max_ratio (read-write) + (read-write) +What: /sys/class/bdi//max_ratio +Date: January 2008 +Contact: Peter Zijlstra +Description: Allows limiting a particular device to use not more than the given percentage of the write-back cache. This is useful in situations where we want to avoid one device taking all or @@ -48,7 +55,12 @@ max_ratio (read-write) mount that is prone to get stuck, or a FUSE mount which cannot be trusted to play fair. -stable_pages_required (read-only) - + (read-write) +What: /sys/class/bdi//stable_pages_required +Date: January 2008 +Contact: Peter Zijlstra +Description: If set, the backing device requires that all pages comprising a write request must not be changed until writeout is complete. + + (read-only) From 89ae45d72ae25f36872c046c804086579fdd3c5e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:45 +0200 Subject: [PATCH 078/122] ABI: sysfs-bus-mdio: add alternate What for mdio symbols Not all sysfs nodes are shown under: /sys/bus/mdio_bus/devices/... They can also be at: /sys/class/mdio_bus/.../ So, update the What: entries to allow both. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/aa51f6c2d482b28a349ba67e2a3904564e67496b.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-mdio | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-mdio b/Documentation/ABI/testing/sysfs-bus-mdio index da86efc7781b..38be04dfc05e 100644 --- a/Documentation/ABI/testing/sysfs-bus-mdio +++ b/Documentation/ABI/testing/sysfs-bus-mdio @@ -1,4 +1,5 @@ What: /sys/bus/mdio_bus/devices/.../statistics/ +What: /sys/class/mdio_bus/.../statistics/ Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -7,6 +8,7 @@ Description: MDIO bus address statistics. What: /sys/bus/mdio_bus/devices/.../statistics/transfers +What: /sys/class/mdio_bus/.../transfers Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -14,6 +16,7 @@ Description: Total number of transfers for this MDIO bus. What: /sys/bus/mdio_bus/devices/.../statistics/errors +What: /sys/class/mdio_bus/.../statistics/errors Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -21,6 +24,7 @@ Description: Total number of transfer errors for this MDIO bus. What: /sys/bus/mdio_bus/devices/.../statistics/writes +What: /sys/class/mdio_bus/.../statistics/writes Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -28,6 +32,7 @@ Description: Total number of write transactions for this MDIO bus. What: /sys/bus/mdio_bus/devices/.../statistics/reads +What: /sys/class/mdio_bus/.../statistics/reads Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -35,6 +40,7 @@ Description: Total number of read transactions for this MDIO bus. What: /sys/bus/mdio_bus/devices/.../statistics/transfers_ +What: /sys/class/mdio_bus/.../statistics/transfers_ Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -42,6 +48,7 @@ Description: Total number of transfers for this MDIO bus address. What: /sys/bus/mdio_bus/devices/.../statistics/errors_ +What: /sys/class/mdio_bus/.../statistics/errors_ Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -49,6 +56,7 @@ Description: Total number of transfer errors for this MDIO bus address. What: /sys/bus/mdio_bus/devices/.../statistics/writes_ +What: /sys/class/mdio_bus/.../statistics/writes_ Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org @@ -56,6 +64,7 @@ Description: Total number of write transactions for this MDIO bus address. What: /sys/bus/mdio_bus/devices/.../statistics/reads_ +What: /sys/class/mdio_bus/.../statistics/reads_ Date: January 2020 KernelVersion: 5.6 Contact: netdev@vger.kernel.org From e06ab8d57433086f8fafa71516564d15d6e3c430 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:46 +0200 Subject: [PATCH 079/122] ABI: sysfs-bus-usb: use a wildcard for interface name on What Use instead of INTERFACE, in order for the get_abi.pl script to be able to identify this as a wildcard. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/cec7048385b6a4779894e19af681226e60f4d8b9.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-usb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 42103f0f54d6..7269077ce505 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb @@ -1,4 +1,4 @@ -What: /sys/bus/usb/devices/INTERFACE/authorized +What: /sys/bus/usb/devices//authorized Date: August 2015 Description: This allows to authorize (1) or deauthorize (0) From 989eff9cdb799d1366c8cdd3456cec4083a9a6d6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:47 +0200 Subject: [PATCH 080/122] ABI: sysfs-bus-usb: add missing sysfs fields There are lots of interface, power and endpoint properties that are currently missing any documentation. Add a description for them. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/7f6f7b955032836546f78a9041b22c10b6f4bc5b.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-usb | 274 ++++++++++++++++++++++++ 1 file changed, 274 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 7269077ce505..2ebe5708b4bc 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb @@ -288,3 +288,277 @@ Description: USB 3.2 adds Dual-lane support, 2 rx and 2 tx -lanes over Type-C. Inter-Chip SSIC devices support asymmetric lanes up to 4 lanes per direction. Devices before USB 3.2 are single lane (tx_lanes = 1) + +What: /sys/bus/usb/devices/usbX/bAlternateSetting +Description: + The current interface alternate setting number, in decimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bcdDevice +Description: + The device's release number, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bConfigurationValue +Description: + While a USB device typically have just one configuration + setting, some devices support multiple configurations. + + This value shows the current configuration, in decimal. + + Changing its value will change the device's configuration + to another setting. + + The number of configurations supported by a device is at: + + /sys/bus/usb/devices/usbX/bNumConfigurations + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bDeviceClass +Description: + Class code of the device, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bDeviceProtocol +Description: + Protocol code of the device, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bDeviceSubClass +Description: + Subclass code of the device, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bInterfaceClass +Description: + Class code of the interface, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bInterfaceNumber +Description: + Interface number, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bInterfaceProtocol +Description: + Protocol code of the interface, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bInterfaceSubClass +Description: + Subclass code of the interface, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bmAttributes +Description: + Attributes of the current configuration, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bMaxPacketSize0 +Description: + Maximum endpoint 0 packet size, in decimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bMaxPower +Description: + Maximum power consumption of the active configuration of + the device, in miliamperes. + +What: /sys/bus/usb/devices/usbX/bNumConfigurations +Description: + Number of the possible configurations of the device, in + decimal. The current configuration is controlled via: + + /sys/bus/usb/devices/usbX/bConfigurationValue + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bNumEndpoints +Description: + Number of endpoints used on this interface, in hexadecimal. + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/bNumInterfaces +Description: + Number of interfaces on this device, in decimal. + +What: /sys/bus/usb/devices/usbX/busnum +Description: + Number of the bus. + +What: /sys/bus/usb/devices/usbX/configuration +Description: + Contents of the string descriptor associated with the + current configuration. It may include the firmware version + of a device and/or its serial number. + +What: /sys/bus/usb/devices/usbX/descriptors +Description: + Contains the interface descriptors, in binary. + +What: /sys/bus/usb/devices/usbX/idProduct +Description: + Product ID, in hexadecimal. + +What: /sys/bus/usb/devices/usbX/idVendor +Description: + Vendor ID, in hexadecimal. + +What: /sys/bus/usb/devices/usbX/devspec +Description: + Displays the Device Tree Open Firmware node of the interface. + +What: /sys/bus/usb/devices/usbX/avoid_reset_quirk +Description: + Most devices have this set to zero. + + If the value is 1, enable a USB quirk that prevents this + device to use reset. + + (read/write) + +What: /sys/bus/usb/devices/usbX/devnum +Description: + USB interface device number, in decimal. + +What: /sys/bus/usb/devices/usbX/devpath +Description: + String containing the USB interface device path. + +What: /sys/bus/usb/devices/usbX/manufacturer +Description: + Vendor specific string containing the name of the + manufacturer of the device. + +What: /sys/bus/usb/devices/usbX/maxchild +Description: + Number of ports of an USB hub + +What: /sys/bus/usb/devices/usbX/persist +Description: + Keeps the device even if it gets disconnected. + +What: /sys/bus/usb/devices/usbX/product +Description: + Vendor specific string containing the name of the + device's product. + +What: /sys/bus/usb/devices/usbX/speed +Description: + Shows the device's max speed, according to the USB version, + in Mbps. + Can be: + + ======= ==================== + Unknown speed unknown + 1.5 Low speed + 15 Full speed + 480 High Speed + 5000 Super Speed + 10000 Super Speed+ + 20000 Super Speed+ Gen 2x2 + ======= ==================== + +What: /sys/bus/usb/devices/usbX/supports_autosuspend +Description: + Returns 1 if the device doesn't support autosuspend. + Otherwise, returns 0. + +What: /sys/bus/usb/devices/usbX/urbnum +Description: + Number of URBs submitted for the whole device. + +What: /sys/bus/usb/devices/usbX/version +Description: + String containing the USB device version, as encoded + at the BCD descriptor. + +What: /sys/bus/usb/devices/usbX/power/autosuspend +Description: + Time in milliseconds for the device to autosuspend. If the + value is negative, then autosuspend is prevented. + + (read/write) + +What: /sys/bus/usb/devices/usbX/power/active_duration +Description: + The total time the device has not been suspended. + +What: /sys/bus/usb/devices/usbX/power/connected_duration +Description: + The total time (in msec) that the device has been connected. + +What: /sys/bus/usb/devices/usbX/power/level +Description: + +What: /sys/bus/usb/devices/usbX/ep_/bEndpointAddress +Description: + The address of the endpoint described by this descriptor, + in hexadecimal. The endpoint direction on this bitmapped field + is also shown at: + + /sys/bus/usb/devices/usbX/ep_/direction + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/ep_/bInterval +Description: + The interval of the endpoint as described on its descriptor, + in hexadecimal. The actual interval depends on the version + of the USB. Also shown in time units at + /sys/bus/usb/devices/usbX/ep_/interval. + +What: /sys/bus/usb/devices/usbX/ep_/bLength +Description: + Number of bytes of the endpoint descriptor, in hexadecimal. + +What: /sys/bus/usb/devices/usbX/ep_/bmAttributes +Description: + Attributes which apply to the endpoint as described on its + descriptor, in hexadecimal. The endpoint type on this + bitmapped field is also shown at: + + /sys/bus/usb/devices/usbX/ep_/type + + See USB specs for its meaning. + +What: /sys/bus/usb/devices/usbX/ep_/direction +Description: + Direction of the endpoint. Can be: + + - both (on control endpoints) + - in + - out + +What: /sys/bus/usb/devices/usbX/ep_/interval +Description: + Interval for polling endpoint for data transfers, in + milisseconds or microseconds. + +What: /sys/bus/usb/devices/usbX/ep_/type +Description: + Descriptor type. Can be: + + - Control + - Isoc + - Bulk + - Interrupt + - unknown + +What: /sys/bus/usb/devices/usbX/ep_/wMaxPacketSize +Description: + Maximum packet size this endpoint is capable of + sending or receiving, in hexadecimal. From 3a0d390bd52992cd238f55ee30a15fbd2223069e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:48 +0200 Subject: [PATCH 081/122] ABI: obsolete/sysfs-bus-iio: add some missing blank lines Avoid those warnings: Documentation/ABI/obsolete/sysfs-bus-iio:171: WARNING: Unexpected indentation. Documentation/ABI/obsolete/sysfs-bus-iio:12: WARNING: Unexpected indentation. Documentation/ABI/obsolete/sysfs-bus-iio:2: WARNING: Unexpected indentation. Documentation/ABI/obsolete/sysfs-bus-iio:149: WARNING: Unexpected indentation. Fixes: caf0fb3bb38a ("iio: Documentation: move incompatible ABI to obsolete") Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/602c52c3fb957b9d7d6b72292dc86d295b50c881.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/obsolete/sysfs-bus-iio | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/ABI/obsolete/sysfs-bus-iio b/Documentation/ABI/obsolete/sysfs-bus-iio index c9531bb64816..b64394b0b374 100644 --- a/Documentation/ABI/obsolete/sysfs-bus-iio +++ b/Documentation/ABI/obsolete/sysfs-bus-iio @@ -6,6 +6,7 @@ Description: Since Kernel 5.11, multiple buffers are supported. so, it is better to use, instead: + /sys/bus/iio/devices/iio:deviceX/bufferY/length What: /sys/bus/iio/devices/iio:deviceX/buffer/enable @@ -17,6 +18,7 @@ Description: Since Kernel 5.11, multiple buffers are supported. so, it is better to use, instead: + /sys/bus/iio/devices/iio:deviceX/bufferY/enable What: /sys/bus/iio/devices/iio:deviceX/scan_elements @@ -165,6 +167,7 @@ Description: Since Kernel 5.11, multiple buffers are supported. so, it is better to use, instead: + /sys/bus/iio/devices/iio:deviceX/bufferY/watermark What: /sys/bus/iio/devices/iio:deviceX/buffer/data_available @@ -179,4 +182,5 @@ Description: Since Kernel 5.11, multiple buffers are supported. so, it is better to use, instead: + /sys/bus/iio/devices/iio:deviceX/bufferY/data_available From e080f24795d03605dfec063820d92b3d848006da Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:49 +0200 Subject: [PATCH 082/122] ABI: sysfs-driver-ufs: Add another What for platform drivers The current what expressions: What: /sys/bus/platform/drivers/ufshcd/*/... Doesn't actually match what (some?) platform drivers actually export. For instance, drivers/scsi/ufs/ufs-hisi.c actually creates the sysfs struct for ufshcd inside this directory: /sys/devices/platform/soc/ff3c0000.ufs Which has those aliases: /sys/devices/virtual/devlink/platform:fff35000.crg_ctrl--platform:ff3c0000.ufs/consumer/ /sys/bus/platform/drivers/ufshcd-hisi/ff3c0000.ufs/ /sys/bus/platform/devices/soc/ff3c0000.ufs/ /sys/bus/platform/devices/ff3c0000.ufs/ So, add another What: for such files that will match the device ufs entries, e. g.: What: /sys/bus/platform/devices/*.ufs/ Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/bc61469964bbcabe38d12aa88f2734d38a8741e5.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-driver-ufs | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver-ufs index ec3a7149ced5..863cc4897277 100644 --- a/Documentation/ABI/testing/sysfs-driver-ufs +++ b/Documentation/ABI/testing/sysfs-driver-ufs @@ -13,6 +13,7 @@ Description: Interface specification for more details. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/device_type +What: /sys/bus/platform/devices/*.ufs/device_descriptor/device_type Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the device type. This is one of the UFS @@ -22,6 +23,7 @@ Description: This file shows the device type. This is one of the UFS The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/device_class +What: /sys/bus/platform/devices/*.ufs/device_descriptor/device_class Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the device class. This is one of the UFS @@ -31,6 +33,7 @@ Description: This file shows the device class. This is one of the UFS The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/device_sub_class +What: /sys/bus/platform/devices/*.ufs/device_descriptor/device_sub_class Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the UFS storage subclass. This is one of @@ -40,6 +43,7 @@ Description: This file shows the UFS storage subclass. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/protocol +What: /sys/bus/platform/devices/*.ufs/device_descriptor/protocol Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the protocol supported by an UFS device. @@ -50,6 +54,7 @@ Description: This file shows the protocol supported by an UFS device. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/number_of_luns +What: /sys/bus/platform/devices/*.ufs/device_descriptor/number_of_luns Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows number of logical units. This is one of @@ -59,6 +64,7 @@ Description: This file shows number of logical units. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/number_of_wluns +What: /sys/bus/platform/devices/*.ufs/device_descriptor/number_of_wluns Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows number of well known logical units. @@ -69,6 +75,7 @@ Description: This file shows number of well known logical units. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/boot_enable +What: /sys/bus/platform/devices/*.ufs/device_descriptor/boot_enable Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows value that indicates whether the device is @@ -79,6 +86,7 @@ Description: This file shows value that indicates whether the device is The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/descriptor_access_enable +What: /sys/bus/platform/devices/*.ufs/device_descriptor/descriptor_access_enable Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows value that indicates whether the device @@ -90,6 +98,7 @@ Description: This file shows value that indicates whether the device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/initial_power_mode +What: /sys/bus/platform/devices/*.ufs/device_descriptor/initial_power_mode Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows value that defines the power mode after @@ -100,6 +109,7 @@ Description: This file shows value that defines the power mode after The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/high_priority_lun +What: /sys/bus/platform/devices/*.ufs/device_descriptor/high_priority_lun Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the high priority lun. This is one of @@ -109,6 +119,7 @@ Description: This file shows the high priority lun. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/secure_removal_type +What: /sys/bus/platform/devices/*.ufs/device_descriptor/secure_removal_type Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the secure removal type. This is one of @@ -118,6 +129,7 @@ Description: This file shows the secure removal type. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/support_security_lun +What: /sys/bus/platform/devices/*.ufs/device_descriptor/support_security_lun Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether the security lun is supported. @@ -128,6 +140,7 @@ Description: This file shows whether the security lun is supported. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/bkops_termination_latency +What: /sys/bus/platform/devices/*.ufs/device_descriptor/bkops_termination_latency Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the background operations termination @@ -138,6 +151,7 @@ Description: This file shows the background operations termination The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/initial_active_icc_level +What: /sys/bus/platform/devices/*.ufs/device_descriptor/initial_active_icc_level Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the initial active ICC level. This is one @@ -147,6 +161,7 @@ Description: This file shows the initial active ICC level. This is one The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/specification_version +What: /sys/bus/platform/devices/*.ufs/device_descriptor/specification_version Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the specification version. This is one @@ -156,6 +171,7 @@ Description: This file shows the specification version. This is one The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/manufacturing_date +What: /sys/bus/platform/devices/*.ufs/device_descriptor/manufacturing_date Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the manufacturing date in BCD format. @@ -166,6 +182,7 @@ Description: This file shows the manufacturing date in BCD format. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/manufacturer_id +What: /sys/bus/platform/devices/*.ufs/device_descriptor/manufacturer_id Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the manufacturer ID. This is one of the @@ -175,6 +192,7 @@ Description: This file shows the manufacturer ID. This is one of the The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/rtt_capability +What: /sys/bus/platform/devices/*.ufs/device_descriptor/rtt_capability Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum number of outstanding RTTs @@ -185,6 +203,7 @@ Description: This file shows the maximum number of outstanding RTTs The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/rtc_update +What: /sys/bus/platform/devices/*.ufs/device_descriptor/rtc_update Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the frequency and method of the realtime @@ -195,6 +214,7 @@ Description: This file shows the frequency and method of the realtime The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/ufs_features +What: /sys/bus/platform/devices/*.ufs/device_descriptor/ufs_features Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows which features are supported by the device. @@ -205,6 +225,7 @@ Description: This file shows which features are supported by the device. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/ffu_timeout +What: /sys/bus/platform/devices/*.ufs/device_descriptor/ffu_timeout Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the FFU timeout. This is one of the @@ -214,6 +235,7 @@ Description: This file shows the FFU timeout. This is one of the The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/queue_depth +What: /sys/bus/platform/devices/*.ufs/device_descriptor/queue_depth Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the device queue depth. This is one of the @@ -223,6 +245,7 @@ Description: This file shows the device queue depth. This is one of the The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/device_version +What: /sys/bus/platform/devices/*.ufs/device_descriptor/device_version Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the device version. This is one of the @@ -232,6 +255,7 @@ Description: This file shows the device version. This is one of the The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/number_of_secure_wpa +What: /sys/bus/platform/devices/*.ufs/device_descriptor/number_of_secure_wpa Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows number of secure write protect areas @@ -242,6 +266,7 @@ Description: This file shows number of secure write protect areas The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/psa_max_data_size +What: /sys/bus/platform/devices/*.ufs/device_descriptor/psa_max_data_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum amount of data that may be @@ -253,6 +278,7 @@ Description: This file shows the maximum amount of data that may be The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/psa_state_timeout +What: /sys/bus/platform/devices/*.ufs/device_descriptor/psa_state_timeout Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the command maximum timeout for a change @@ -264,6 +290,7 @@ Description: This file shows the command maximum timeout for a change What: /sys/bus/platform/drivers/ufshcd/*/interconnect_descriptor/unipro_version +What: /sys/bus/platform/devices/*.ufs/interconnect_descriptor/unipro_version Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the MIPI UniPro version number in BCD format. @@ -274,6 +301,7 @@ Description: This file shows the MIPI UniPro version number in BCD format. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/interconnect_descriptor/mphy_version +What: /sys/bus/platform/devices/*.ufs/interconnect_descriptor/mphy_version Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the MIPI M-PHY version number in BCD format. @@ -285,6 +313,7 @@ Description: This file shows the MIPI M-PHY version number in BCD format. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/raw_device_capacity +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/raw_device_capacity Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the total memory quantity available to @@ -296,6 +325,7 @@ Description: This file shows the total memory quantity available to The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/max_number_of_luns +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/max_number_of_luns Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum number of logical units @@ -306,6 +336,7 @@ Description: This file shows the maximum number of logical units The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/segment_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/segment_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the segment size. This is one of the UFS @@ -315,6 +346,7 @@ Description: This file shows the segment size. This is one of the UFS The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/allocation_unit_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/allocation_unit_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the allocation unit size. This is one of @@ -324,6 +356,7 @@ Description: This file shows the allocation unit size. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/min_addressable_block_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/min_addressable_block_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the minimum addressable block size. This @@ -334,6 +367,7 @@ Description: This file shows the minimum addressable block size. This The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/optimal_read_block_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/optimal_read_block_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the optimal read block size. This is one @@ -344,6 +378,7 @@ Description: This file shows the optimal read block size. This is one The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/optimal_write_block_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/optimal_write_block_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the optimal write block size. This is one @@ -354,6 +389,7 @@ Description: This file shows the optimal write block size. This is one The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/max_in_buffer_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/max_in_buffer_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum data-in buffer size. This @@ -364,6 +400,7 @@ Description: This file shows the maximum data-in buffer size. This The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/max_out_buffer_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/max_out_buffer_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum data-out buffer size. This @@ -374,6 +411,7 @@ Description: This file shows the maximum data-out buffer size. This The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/rpmb_rw_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/rpmb_rw_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum number of RPMB frames allowed @@ -384,6 +422,7 @@ Description: This file shows the maximum number of RPMB frames allowed The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/dyn_capacity_resource_policy +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/dyn_capacity_resource_policy Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the dynamic capacity resource policy. This @@ -394,6 +433,7 @@ Description: This file shows the dynamic capacity resource policy. This The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/data_ordering +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/data_ordering Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows support for out-of-order data transfer. @@ -404,6 +444,7 @@ Description: This file shows support for out-of-order data transfer. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/max_number_of_contexts +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/max_number_of_contexts Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows maximum available number of contexts which @@ -414,6 +455,7 @@ Description: This file shows maximum available number of contexts which The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/sys_data_tag_unit_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/sys_data_tag_unit_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows system data tag unit size. This is one of @@ -423,6 +465,7 @@ Description: This file shows system data tag unit size. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/sys_data_tag_resource_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/sys_data_tag_resource_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows maximum storage area size allocated by @@ -434,6 +477,7 @@ Description: This file shows maximum storage area size allocated by The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/secure_removal_types +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/secure_removal_types Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows supported secure removal types. This is @@ -444,6 +488,7 @@ Description: This file shows supported secure removal types. This is The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/memory_types +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/memory_types Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows supported memory types. This is one of @@ -454,6 +499,7 @@ Description: This file shows supported memory types. This is one of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/*_memory_max_alloc_units +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/*_memory_max_alloc_units Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum number of allocation units for @@ -465,6 +511,7 @@ Description: This file shows the maximum number of allocation units for The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/*_memory_capacity_adjustment_factor +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/*_memory_capacity_adjustment_factor Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the memory capacity adjustment factor for @@ -477,6 +524,7 @@ Description: This file shows the memory capacity adjustment factor for What: /sys/bus/platform/drivers/ufshcd/*/health_descriptor/eol_info +What: /sys/bus/platform/devices/*.ufs/health_descriptor/eol_info Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows preend of life information. This is one @@ -487,6 +535,7 @@ Description: This file shows preend of life information. This is one The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/health_descriptor/life_time_estimation_a +What: /sys/bus/platform/devices/*.ufs/health_descriptor/life_time_estimation_a Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows indication of the device life time @@ -497,6 +546,7 @@ Description: This file shows indication of the device life time The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/health_descriptor/life_time_estimation_b +What: /sys/bus/platform/devices/*.ufs/health_descriptor/life_time_estimation_b Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows indication of the device life time @@ -508,6 +558,7 @@ Description: This file shows indication of the device life time What: /sys/bus/platform/drivers/ufshcd/*/power_descriptor/active_icc_levels_vcc* +What: /sys/bus/platform/devices/*.ufs/power_descriptor/active_icc_levels_vcc* Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows maximum VCC, VCCQ and VCCQ2 value for @@ -519,6 +570,7 @@ Description: This file shows maximum VCC, VCCQ and VCCQ2 value for What: /sys/bus/platform/drivers/ufshcd/*/string_descriptors/manufacturer_name +What: /sys/bus/platform/devices/*.ufs/string_descriptors/manufacturer_name Date: February 2018 Contact: Stanislav Nijnikov Description: This file contains a device manufacturer name string. @@ -528,6 +580,7 @@ Description: This file contains a device manufacturer name string. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/string_descriptors/product_name +What: /sys/bus/platform/devices/*.ufs/string_descriptors/product_name Date: February 2018 Contact: Stanislav Nijnikov Description: This file contains a product name string. The full information @@ -536,6 +589,7 @@ Description: This file contains a product name string. The full information The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/string_descriptors/oem_id +What: /sys/bus/platform/devices/*.ufs/string_descriptors/oem_id Date: February 2018 Contact: Stanislav Nijnikov Description: This file contains a OEM ID string. The full information @@ -544,6 +598,7 @@ Description: This file contains a OEM ID string. The full information The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/string_descriptors/serial_number +What: /sys/bus/platform/devices/*.ufs/string_descriptors/serial_number Date: February 2018 Contact: Stanislav Nijnikov Description: This file contains a device serial number string. The full @@ -553,6 +608,7 @@ Description: This file contains a device serial number string. The full The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/string_descriptors/product_revision +What: /sys/bus/platform/devices/*.ufs/string_descriptors/product_revision Date: February 2018 Contact: Stanislav Nijnikov Description: This file contains a product revision string. The full @@ -684,6 +740,7 @@ Description: This file shows the granularity of the LUN. This is one of What: /sys/bus/platform/drivers/ufshcd/*/flags/device_init +What: /sys/bus/platform/devices/*.ufs/flags/device_init Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the device init status. The full information @@ -692,6 +749,7 @@ Description: This file shows the device init status. The full information The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/permanent_wpe +What: /sys/bus/platform/devices/*.ufs/flags/permanent_wpe Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether permanent write protection is enabled. @@ -701,6 +759,7 @@ Description: This file shows whether permanent write protection is enabled. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/power_on_wpe +What: /sys/bus/platform/devices/*.ufs/flags/power_on_wpe Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether write protection is enabled on all @@ -711,6 +770,7 @@ Description: This file shows whether write protection is enabled on all The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/bkops_enable +What: /sys/bus/platform/devices/*.ufs/flags/bkops_enable Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether the device background operations are @@ -720,6 +780,7 @@ Description: This file shows whether the device background operations are The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/life_span_mode_enable +What: /sys/bus/platform/devices/*.ufs/flags/life_span_mode_enable Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether the device life span mode is enabled. @@ -729,6 +790,7 @@ Description: This file shows whether the device life span mode is enabled. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/phy_resource_removal +What: /sys/bus/platform/devices/*.ufs/flags/phy_resource_removal Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether physical resource removal is enable. @@ -738,6 +800,7 @@ Description: This file shows whether physical resource removal is enable. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/busy_rtc +What: /sys/bus/platform/devices/*.ufs/flags/busy_rtc Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether the device is executing internal @@ -747,6 +810,7 @@ Description: This file shows whether the device is executing internal The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/disable_fw_update +What: /sys/bus/platform/devices/*.ufs/flags/disable_fw_update Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether the device FW update is permanently @@ -757,6 +821,7 @@ Description: This file shows whether the device FW update is permanently What: /sys/bus/platform/drivers/ufshcd/*/attributes/boot_lun_enabled +What: /sys/bus/platform/devices/*.ufs/attributes/boot_lun_enabled Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the boot lun enabled UFS device attribute. @@ -766,6 +831,7 @@ Description: This file provides the boot lun enabled UFS device attribute. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/current_power_mode +What: /sys/bus/platform/devices/*.ufs/attributes/current_power_mode Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the current power mode UFS device attribute. @@ -775,6 +841,7 @@ Description: This file provides the current power mode UFS device attribute. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/active_icc_level +What: /sys/bus/platform/devices/*.ufs/attributes/active_icc_level Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the active icc level UFS device attribute. @@ -784,6 +851,7 @@ Description: This file provides the active icc level UFS device attribute. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/ooo_data_enabled +What: /sys/bus/platform/devices/*.ufs/attributes/ooo_data_enabled Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the out of order data transfer enabled UFS @@ -793,6 +861,7 @@ Description: This file provides the out of order data transfer enabled UFS The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/bkops_status +What: /sys/bus/platform/devices/*.ufs/attributes/bkops_status Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the background operations status UFS device @@ -802,6 +871,7 @@ Description: This file provides the background operations status UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/purge_status +What: /sys/bus/platform/devices/*.ufs/attributes/purge_status Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the purge operation status UFS device @@ -811,6 +881,7 @@ Description: This file provides the purge operation status UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_data_in_size +What: /sys/bus/platform/devices/*.ufs/attributes/max_data_in_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum data size in a DATA IN @@ -820,6 +891,7 @@ Description: This file shows the maximum data size in a DATA IN The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_data_out_size +What: /sys/bus/platform/devices/*.ufs/attributes/max_data_out_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the maximum number of bytes that can be @@ -829,6 +901,7 @@ Description: This file shows the maximum number of bytes that can be The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/reference_clock_frequency +What: /sys/bus/platform/devices/*.ufs/attributes/reference_clock_frequency Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the reference clock frequency UFS device @@ -838,6 +911,7 @@ Description: This file provides the reference clock frequency UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/configuration_descriptor_lock +What: /sys/bus/platform/devices/*.ufs/attributes/configuration_descriptor_lock Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows whether the configuration descriptor is locked. @@ -845,6 +919,7 @@ Description: This file shows whether the configuration descriptor is locked. UFS specifications 2.1. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_number_of_rtt +What: /sys/bus/platform/devices/*.ufs/attributes/max_number_of_rtt Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the maximum current number of @@ -855,6 +930,7 @@ Description: This file provides the maximum current number of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/exception_event_control +What: /sys/bus/platform/devices/*.ufs/attributes/exception_event_control Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the exception event control UFS device @@ -864,6 +940,7 @@ Description: This file provides the exception event control UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/exception_event_status +What: /sys/bus/platform/devices/*.ufs/attributes/exception_event_status Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the exception event status UFS device @@ -873,6 +950,7 @@ Description: This file provides the exception event status UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/ffu_status +What: /sys/bus/platform/devices/*.ufs/attributes/ffu_status Date: February 2018 Contact: Stanislav Nijnikov Description: This file provides the ffu status UFS device attribute. @@ -882,6 +960,7 @@ Description: This file provides the ffu status UFS device attribute. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/psa_state +What: /sys/bus/platform/devices/*.ufs/attributes/psa_state Date: February 2018 Contact: Stanislav Nijnikov Description: This file show the PSA feature status. The full information @@ -890,6 +969,7 @@ Description: This file show the PSA feature status. The full information The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/psa_data_size +What: /sys/bus/platform/devices/*.ufs/attributes/psa_data_size Date: February 2018 Contact: Stanislav Nijnikov Description: This file shows the amount of data that the host plans to @@ -912,6 +992,7 @@ Description: This file shows the The amount of physical memory needed What: /sys/bus/platform/drivers/ufshcd/*/rpm_lvl +What: /sys/bus/platform/devices/*.ufs/rpm_lvl Date: September 2014 Contact: Subhash Jadavani Description: This entry could be used to set or show the UFS device @@ -938,6 +1019,7 @@ Description: This entry could be used to set or show the UFS device == ==================================================== What: /sys/bus/platform/drivers/ufshcd/*/rpm_target_dev_state +What: /sys/bus/platform/devices/*.ufs/rpm_target_dev_state Date: February 2018 Contact: Subhash Jadavani Description: This entry shows the target power mode of an UFS device @@ -946,6 +1028,7 @@ Description: This entry shows the target power mode of an UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/rpm_target_link_state +What: /sys/bus/platform/devices/*.ufs/rpm_target_link_state Date: February 2018 Contact: Subhash Jadavani Description: This entry shows the target state of an UFS UIC link @@ -954,6 +1037,7 @@ Description: This entry shows the target state of an UFS UIC link The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/spm_lvl +What: /sys/bus/platform/devices/*.ufs/spm_lvl Date: September 2014 Contact: Subhash Jadavani Description: This entry could be used to set or show the UFS device @@ -980,6 +1064,7 @@ Description: This entry could be used to set or show the UFS device == ==================================================== What: /sys/bus/platform/drivers/ufshcd/*/spm_target_dev_state +What: /sys/bus/platform/devices/*.ufs/spm_target_dev_state Date: February 2018 Contact: Subhash Jadavani Description: This entry shows the target power mode of an UFS device @@ -988,6 +1073,7 @@ Description: This entry shows the target power mode of an UFS device The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/spm_target_link_state +What: /sys/bus/platform/devices/*.ufs/spm_target_link_state Date: February 2018 Contact: Subhash Jadavani Description: This entry shows the target state of an UFS UIC link @@ -996,6 +1082,7 @@ Description: This entry shows the target state of an UFS UIC link The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/monitor_enable +What: /sys/bus/platform/devices/*.ufs/monitor/monitor_enable Date: January 2021 Contact: Can Guo Description: This file shows the status of performance monitor enablement @@ -1003,6 +1090,7 @@ Description: This file shows the status of performance monitor enablement is stopped, the performance data collected is also cleared. What: /sys/bus/platform/drivers/ufshcd/*/monitor/monitor_chunk_size +What: /sys/bus/platform/devices/*.ufs/monitor/monitor_chunk_size Date: January 2021 Contact: Can Guo Description: This file tells the monitor to focus on requests transferring @@ -1010,6 +1098,7 @@ Description: This file tells the monitor to focus on requests transferring It can only be changed when monitor is disabled. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_total_sectors +What: /sys/bus/platform/devices/*.ufs/monitor/read_total_sectors Date: January 2021 Contact: Can Guo Description: This file shows how many sectors (in 512 Bytes) have been @@ -1018,6 +1107,7 @@ Description: This file shows how many sectors (in 512 Bytes) have been The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_total_busy +What: /sys/bus/platform/devices/*.ufs/monitor/read_total_busy Date: January 2021 Contact: Can Guo Description: This file shows how long (in micro seconds) has been spent @@ -1026,6 +1116,7 @@ Description: This file shows how long (in micro seconds) has been spent The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_nr_requests +What: /sys/bus/platform/devices/*.ufs/monitor/read_nr_requests Date: January 2021 Contact: Can Guo Description: This file shows how many read requests have been sent after @@ -1034,6 +1125,7 @@ Description: This file shows how many read requests have been sent after The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_max +What: /sys/bus/platform/devices/*.ufs/monitor/read_req_latency_max Date: January 2021 Contact: Can Guo Description: This file shows the maximum latency (in micro seconds) of @@ -1042,6 +1134,7 @@ Description: This file shows the maximum latency (in micro seconds) of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_min +What: /sys/bus/platform/devices/*.ufs/monitor/read_req_latency_min Date: January 2021 Contact: Can Guo Description: This file shows the minimum latency (in micro seconds) of @@ -1050,6 +1143,7 @@ Description: This file shows the minimum latency (in micro seconds) of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_avg +What: /sys/bus/platform/devices/*.ufs/monitor/read_req_latency_avg Date: January 2021 Contact: Can Guo Description: This file shows the average latency (in micro seconds) of @@ -1058,6 +1152,7 @@ Description: This file shows the average latency (in micro seconds) of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_sum +What: /sys/bus/platform/devices/*.ufs/monitor/read_req_latency_sum Date: January 2021 Contact: Can Guo Description: This file shows the total latency (in micro seconds) of @@ -1066,6 +1161,7 @@ Description: This file shows the total latency (in micro seconds) of The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_total_sectors +What: /sys/bus/platform/devices/*.ufs/monitor/write_total_sectors Date: January 2021 Contact: Can Guo Description: This file shows how many sectors (in 512 Bytes) have been sent @@ -1074,6 +1170,7 @@ Description: This file shows how many sectors (in 512 Bytes) have been sent The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_total_busy +What: /sys/bus/platform/devices/*.ufs/monitor/write_total_busy Date: January 2021 Contact: Can Guo Description: This file shows how long (in micro seconds) has been spent @@ -1082,6 +1179,7 @@ Description: This file shows how long (in micro seconds) has been spent The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_nr_requests +What: /sys/bus/platform/devices/*.ufs/monitor/write_nr_requests Date: January 2021 Contact: Can Guo Description: This file shows how many write requests have been sent after @@ -1090,6 +1188,7 @@ Description: This file shows how many write requests have been sent after The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_max +What: /sys/bus/platform/devices/*.ufs/monitor/write_req_latency_max Date: January 2021 Contact: Can Guo Description: This file shows the maximum latency (in micro seconds) of write @@ -1098,6 +1197,7 @@ Description: This file shows the maximum latency (in micro seconds) of write The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_min +What: /sys/bus/platform/devices/*.ufs/monitor/write_req_latency_min Date: January 2021 Contact: Can Guo Description: This file shows the minimum latency (in micro seconds) of write @@ -1106,6 +1206,7 @@ Description: This file shows the minimum latency (in micro seconds) of write The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_avg +What: /sys/bus/platform/devices/*.ufs/monitor/write_req_latency_avg Date: January 2021 Contact: Can Guo Description: This file shows the average latency (in micro seconds) of write @@ -1114,6 +1215,7 @@ Description: This file shows the average latency (in micro seconds) of write The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_sum +What: /sys/bus/platform/devices/*.ufs/monitor/write_req_latency_sum Date: January 2021 Contact: Can Guo Description: This file shows the total latency (in micro seconds) of write @@ -1122,6 +1224,7 @@ Description: This file shows the total latency (in micro seconds) of write The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_presv_us_en +What: /sys/bus/platform/devices/*.ufs/device_descriptor/wb_presv_us_en Date: June 2020 Contact: Asutosh Das Description: This entry shows if preserve user-space was configured @@ -1129,6 +1232,7 @@ Description: This entry shows if preserve user-space was configured The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_shared_alloc_units +What: /sys/bus/platform/devices/*.ufs/device_descriptor/wb_shared_alloc_units Date: June 2020 Contact: Asutosh Das Description: This entry shows the shared allocated units of WB buffer @@ -1136,6 +1240,7 @@ Description: This entry shows the shared allocated units of WB buffer The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_type +What: /sys/bus/platform/devices/*.ufs/device_descriptor/wb_type Date: June 2020 Contact: Asutosh Das Description: This entry shows the configured WB type. @@ -1144,6 +1249,7 @@ Description: This entry shows the configured WB type. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_buff_cap_adj +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/wb_buff_cap_adj Date: June 2020 Contact: Asutosh Das Description: This entry shows the total user-space decrease in shared @@ -1154,6 +1260,7 @@ Description: This entry shows the total user-space decrease in shared The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_max_alloc_units +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/wb_max_alloc_units Date: June 2020 Contact: Asutosh Das Description: This entry shows the Maximum total WriteBooster Buffer size @@ -1162,6 +1269,7 @@ Description: This entry shows the Maximum total WriteBooster Buffer size The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_max_wb_luns +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/wb_max_wb_luns Date: June 2020 Contact: Asutosh Das Description: This entry shows the maximum number of luns that can support @@ -1170,6 +1278,7 @@ Description: This entry shows the maximum number of luns that can support The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_sup_red_type +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/wb_sup_red_type Date: June 2020 Contact: Asutosh Das Description: The supportability of user space reduction mode @@ -1184,6 +1293,7 @@ Description: The supportability of user space reduction mode The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_sup_wb_type +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/wb_sup_wb_type Date: June 2020 Contact: Asutosh Das Description: The supportability of WriteBooster Buffer type. @@ -1198,6 +1308,7 @@ Description: The supportability of WriteBooster Buffer type. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_enable +What: /sys/bus/platform/devices/*.ufs/flags/wb_enable Date: June 2020 Contact: Asutosh Das Description: This entry shows the status of WriteBooster. @@ -1210,6 +1321,7 @@ Description: This entry shows the status of WriteBooster. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_flush_en +What: /sys/bus/platform/devices/*.ufs/flags/wb_flush_en Date: June 2020 Contact: Asutosh Das Description: This entry shows if flush is enabled. @@ -1222,6 +1334,7 @@ Description: This entry shows if flush is enabled. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_flush_during_h8 +What: /sys/bus/platform/devices/*.ufs/flags/wb_flush_during_h8 Date: June 2020 Contact: Asutosh Das Description: Flush WriteBooster Buffer during hibernate state. @@ -1236,6 +1349,7 @@ Description: Flush WriteBooster Buffer during hibernate state. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_avail_buf +What: /sys/bus/platform/devices/*.ufs/attributes/wb_avail_buf Date: June 2020 Contact: Asutosh Das Description: This entry shows the amount of unused WriteBooster buffer @@ -1244,6 +1358,7 @@ Description: This entry shows the amount of unused WriteBooster buffer The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_cur_buf +What: /sys/bus/platform/devices/*.ufs/attributes/wb_cur_buf Date: June 2020 Contact: Asutosh Das Description: This entry shows the amount of unused current buffer. @@ -1251,6 +1366,7 @@ Description: This entry shows the amount of unused current buffer. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_flush_status +What: /sys/bus/platform/devices/*.ufs/attributes/wb_flush_status Date: June 2020 Contact: Asutosh Das Description: This entry shows the flush operation status. @@ -1267,6 +1383,7 @@ Description: This entry shows the flush operation status. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_life_time_est +What: /sys/bus/platform/devices/*.ufs/attributes/wb_life_time_est Date: June 2020 Contact: Asutosh Das Description: This entry shows an indication of the WriteBooster Buffer @@ -1289,6 +1406,7 @@ Description: This entry shows the configured size of WriteBooster buffer. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/wb_on +What: /sys/bus/platform/devices/*.ufs/wb_on Date: January 2021 Contact: Bean Huo Description: This node is used to set or display whether UFS WriteBooster is @@ -1300,6 +1418,7 @@ Description: This node is used to set or display whether UFS WriteBooster is disable/enable WriteBooster through this sysfs node. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_version +What: /sys/bus/platform/devices/*.ufs/device_descriptor/hpb_version Date: June 2021 Contact: Daejun Park Description: This entry shows the HPB specification version. @@ -1310,6 +1429,7 @@ Description: This entry shows the HPB specification version. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/hpb_control +What: /sys/bus/platform/devices/*.ufs/device_descriptor/hpb_control Date: June 2021 Contact: Daejun Park Description: This entry shows an indication of the HPB control mode. @@ -1319,6 +1439,7 @@ Description: This entry shows an indication of the HPB control mode. The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_region_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/hpb_region_size Date: June 2021 Contact: Daejun Park Description: This entry shows the bHPBRegionSize which can be calculated @@ -1328,6 +1449,7 @@ Description: This entry shows the bHPBRegionSize which can be calculated The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_number_lu +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/hpb_number_lu Date: June 2021 Contact: Daejun Park Description: This entry shows the maximum number of HPB LU supported by @@ -1338,6 +1460,7 @@ Description: This entry shows the maximum number of HPB LU supported by The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_subregion_size +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/hpb_subregion_size Date: June 2021 Contact: Daejun Park Description: This entry shows the bHPBSubRegionSize, which can be @@ -1349,6 +1472,7 @@ Description: This entry shows the bHPBSubRegionSize, which can be The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/hpb_max_active_regions +What: /sys/bus/platform/devices/*.ufs/geometry_descriptor/hpb_max_active_regions Date: June 2021 Contact: Daejun Park Description: This entry shows the maximum number of active HPB regions that @@ -1434,6 +1558,7 @@ Description: This entry shows the requeue timeout threshold for write buffer this entry. What: /sys/bus/platform/drivers/ufshcd/*/attributes/max_data_size_hpb_single_cmd +What: /sys/bus/platform/devices/*.ufs/attributes/max_data_size_hpb_single_cmd Date: June 2021 Contact: Daejun Park Description: This entry shows the maximum HPB data size for using a single HPB @@ -1450,6 +1575,7 @@ Description: This entry shows the maximum HPB data size for using a single HPB The file is read only. What: /sys/bus/platform/drivers/ufshcd/*/flags/hpb_enable +What: /sys/bus/platform/devices/*.ufs/flags/hpb_enable Date: June 2021 Contact: Daejun Park Description: This entry shows the status of HPB. From 654e4d5d3d5b778a6d33fcab4028a3c89714c04e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 27 Sep 2021 15:59:50 +0200 Subject: [PATCH 083/122] ABI: sysfs-bus-platform: add modalias description Define the modalias parameter for platform devices, including the ones exposed via devicetree. Acked-by: Barry Song Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/9cdebbad008886b1d09f5f3ac5d88bee19f08d97.1632750608.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-bus-platform | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-platform b/Documentation/ABI/testing/sysfs-bus-platform index ff30728595ef..c4dfe7355c2d 100644 --- a/Documentation/ABI/testing/sysfs-bus-platform +++ b/Documentation/ABI/testing/sysfs-bus-platform @@ -42,3 +42,15 @@ Date: August 2021 Contact: Barry Song Description: This attribute will show "msi" if is a valid msi irq + +What: /sys/bus/platform/devices/.../modalias +Description: + Same as MODALIAS in the uevent at device creation. + + A platform device that it is exposed via devicetree uses: + + - of:N`of node name`T`type` + + Other platform devices use, instead: + + - platform:`driver name` From e5c044c8a9b65867369f8a4f3d5e3fee265d0487 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 28 Sep 2021 23:51:32 +0200 Subject: [PATCH 084/122] scripts: get_abi.pl: make undefined search more deterministic Sort keys on hashes during undefined search, in order to make the script more deterministic. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5dc55fd42e632a24a48f95212aa6c6bc4b2d11fd.1632865873.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 841d889747c0..d32dcd7cca5d 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -775,6 +775,8 @@ sub check_undefined_symbols { my $next_i = 0; my $start_time = times; + @files = sort @files; + my $last_time = $start_time; # When either debug or hint is enabled, there's no sense showing @@ -909,16 +911,16 @@ sub undefined_symbols { } } # Compile regexes - foreach my $l (keys %leaf) { + foreach my $l (sort keys %leaf) { my @expr; - foreach my $w(split /\xac/, $leaf{$l}->{what}) { + foreach my $w(sort split /\xac/, $leaf{$l}->{what}) { push @expr, qr /^$w$/; } $leaf{$l}->{expr} = \@expr; } # Take links into account - foreach my $link (keys %aliases) { + foreach my $link (sort keys %aliases) { my $abs_file = $aliases{$link}; graph_add_link($abs_file, $link); } From df0a18149474c7e6b21f6367fbc6bc8d0f192444 Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Thu, 30 Sep 2021 16:57:14 +0800 Subject: [PATCH 085/122] driver core: Fix possible memory leak in device_link_add() I got memory leak as follows: unreferenced object 0xffff88801f0b2200 (size 64): comm "i2c-lis2hh12-21", pid 5455, jiffies 4294944606 (age 15.224s) hex dump (first 32 bytes): 72 65 67 75 6c 61 74 6f 72 3a 72 65 67 75 6c 61 regulator:regula 74 6f 72 2e 30 2d 2d 69 32 63 3a 31 2d 30 30 31 tor.0--i2c:1-001 backtrace: [<00000000bf5b0c3b>] __kmalloc_track_caller+0x19f/0x3a0 [<0000000050da42d9>] kvasprintf+0xb5/0x150 [<000000004bbbed13>] kvasprintf_const+0x60/0x190 [<00000000cdac7480>] kobject_set_name_vargs+0x56/0x150 [<00000000bf83f8e8>] dev_set_name+0xc0/0x100 [<00000000cc1cf7e3>] device_link_add+0x6b4/0x17c0 [<000000009db9faed>] _regulator_get+0x297/0x680 [<00000000845e7f2b>] _devm_regulator_get+0x5b/0xe0 [<000000003958ee25>] st_sensors_power_enable+0x71/0x1b0 [st_sensors] [<000000005f450f52>] st_accel_i2c_probe+0xd9/0x150 [st_accel_i2c] [<00000000b5f2ab33>] i2c_device_probe+0x4d8/0xbe0 [<0000000070fb977b>] really_probe+0x299/0xc30 [<0000000088e226ce>] __driver_probe_device+0x357/0x500 [<00000000c21dda32>] driver_probe_device+0x4e/0x140 [<000000004e650441>] __device_attach_driver+0x257/0x340 [<00000000cf1891b8>] bus_for_each_drv+0x166/0x1e0 When device_register() returns an error, the name allocated in dev_set_name() will be leaked, the put_device() should be used instead of kfree() to give up the device reference, then the name will be freed in kobject_cleanup() and the references of consumer and supplier will be decreased in device_link_release_fn(). Fixes: 287905e68dd2 ("driver core: Expose device link details in sysfs") Reported-by: Hulk Robot Reviewed-by: Saravana Kannan Reviewed-by: Rafael J. Wysocki Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20210930085714.2057460-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 938cfcd1674e..5bbb63aa100d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -820,9 +820,7 @@ struct device_link *device_link_add(struct device *consumer, dev_bus_name(supplier), dev_name(supplier), dev_bus_name(consumer), dev_name(consumer)); if (device_register(&link->link_dev)) { - put_device(consumer); - put_device(supplier); - kfree(link); + put_device(&link->link_dev); link = NULL; goto out; } From d460d7f7bb43233e5e4c6c62955b3b26cf462062 Mon Sep 17 00:00:00 2001 From: Max Gurtovoy Date: Mon, 4 Oct 2021 16:34:52 +0300 Subject: [PATCH 086/122] driver core: use NUMA_NO_NODE during device_initialize Don't use (-1) constant for setting initial device node. Instead, use the generic NUMA_NO_NODE definition to indicate that "no node id specified". Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Gurtovoy Link: https://lore.kernel.org/r/20211004133453.18881-1-mgurtovoy@nvidia.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 5bbb63aa100d..d78331b763c8 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2872,7 +2872,7 @@ void device_initialize(struct device *dev) spin_lock_init(&dev->devres_lock); INIT_LIST_HEAD(&dev->devres_head); device_pm_init(dev); - set_dev_node(dev, -1); + set_dev_node(dev, NUMA_NO_NODE); #ifdef CONFIG_GENERIC_MSI_IRQ raw_spin_lock_init(&dev->msi_lock); INIT_LIST_HEAD(&dev->msi_list); From cee0ad4a212fde377926d93aa822395167564452 Mon Sep 17 00:00:00 2001 From: Max Gurtovoy Date: Mon, 4 Oct 2021 16:34:53 +0300 Subject: [PATCH 087/122] PCI/sysfs: use NUMA_NO_NODE macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the proper macro instead of hard-coded (-1) value. Suggested-by: Krzysztof Wilczyński Reviewed-by: Krzysztof Wilczyński Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Gurtovoy Link: https://lore.kernel.org/r/20211004133453.18881-2-mgurtovoy@nvidia.com Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pci-sysfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 7fb5cd17cc98..f807b92afa6c 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -81,8 +81,10 @@ static ssize_t pci_dev_show_local_cpu(struct device *dev, bool list, const struct cpumask *mask; #ifdef CONFIG_NUMA - mask = (dev_to_node(dev) == -1) ? cpu_online_mask : - cpumask_of_node(dev_to_node(dev)); + if (dev_to_node(dev) == NUMA_NO_NODE) + mask = cpu_online_mask; + else + mask = cpumask_of_node(dev_to_node(dev)); #else mask = cpumask_of_pcibus(to_pci_dev(dev)->bus); #endif From b39214911a548746e7375985c87cdaa8e1a0dfde Mon Sep 17 00:00:00 2001 From: Mianhan Liu Date: Wed, 29 Sep 2021 03:31:38 +0800 Subject: [PATCH 088/122] drivers/base/arch_topology.c: remove superfluous header arch_topology.c hasn't use any macro or function declared in linux/percpu.h, linux/smp.h and linux/string.h. Thus, these files can be removed from arch_topology.c safely without affecting the compilation of the drivers/base/ module Signed-off-by: Mianhan Liu Link: https://lore.kernel.org/r/20210928193138.24192-1-liumh1@shanghaitech.edu.cn Signed-off-by: Greg Kroah-Hartman --- drivers/base/arch_topology.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 43407665918f..92200873bd50 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -12,15 +12,12 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include static DEFINE_PER_CPU(struct scale_freq_data __rcu *, sft_data); static struct cpumask scale_freq_counters_mask; From 30b7ecf731ae800f4231fae8dbf3b47cf3d39142 Mon Sep 17 00:00:00 2001 From: Mianhan Liu Date: Wed, 29 Sep 2021 03:38:49 +0800 Subject: [PATCH 089/122] drivers/base/component.c: remove superfluous header files from component.c component.c hasn't use any macro or function declared in linux/kref.h. Thus, these files can be removed from component.c safely without affecting the compilation of the drivers/base/ module Signed-off-by: Mianhan Liu Link: https://lore.kernel.org/r/20210928193849.28717-1-liumh1@shanghaitech.edu.cn Signed-off-by: Greg Kroah-Hartman --- drivers/base/component.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index 5e79299f6c3f..6dc309913ccd 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -9,7 +9,6 @@ */ #include #include -#include #include #include #include From 8f5cfb3b5a1cb887d625b040e7260bd592ca57e0 Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Mon, 27 Sep 2021 09:38:00 -0700 Subject: [PATCH 090/122] fs/kernfs/symlink.c: replace S_IRWXUGO with 0777 on kernfs_create_link() If one ends up extending this line checkpatch will complain about the use of S_IRWXUGO suggesting it is not preferred and that 0777 should be used instead. Take the tip from checkpatch and do that change before we do our subsequent changes. This makes no functional changes. Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20210927163805.808907-8-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/kernfs/symlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c index c8f8e41b8411..19a6c71c6ff5 100644 --- a/fs/kernfs/symlink.c +++ b/fs/kernfs/symlink.c @@ -36,8 +36,7 @@ struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, gid = target->iattr->ia_gid; } - kn = kernfs_new_node(parent, name, S_IFLNK|S_IRWXUGO, uid, gid, - KERNFS_LINK); + kn = kernfs_new_node(parent, name, S_IFLNK|0777, uid, gid, KERNFS_LINK); if (!kn) return ERR_PTR(-ENOMEM); From 4dcce5b081555a33e97e06093910e6cfe6cb1023 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:39:59 +0200 Subject: [PATCH 091/122] scripts: get_abi.pl: fix fallback rule for undefined symbols The rule that falls back to the long regex list is wrong: it is just running again the same loop it did before. change it to look at the "others" table. That slows the processing speed, but provides a better list of undefined symbols. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a3ba919e9a9208a5f012a13c9674c362a9d73169.1632994565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index d32dcd7cca5d..2f3674bb3c9e 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -746,7 +746,7 @@ sub check_file($$) } if ($leave ne "others") { - my @expr = @{$leaf{$leave}->{expr}}; + my @expr = @{$leaf{"others"}->{expr}}; for (my $i = 0; $i < @names; $i++) { foreach my $re (@expr) { print STDERR "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); From df2205de92975bdaabb115dfef5c513b26b36263 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:40:00 +0200 Subject: [PATCH 092/122] scripts: get_abi.pl: better generate regex from what fields Using repeating sequencies of .* seem to slow down the processing speed on some cases. Also, currently, a "." character is not properly handled as such. Change the way regexes are created, in order to produce better search expressions. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c69c01c12b1b30466177dcb17e45f833fb47713d.1632994565.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- scripts/get_abi.pl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index 2f3674bb3c9e..6212f58b69c6 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -842,8 +842,8 @@ sub undefined_symbols { # Convert what into regular expressions - $what =~ s,/\.\.\./,/*/,g; - $what =~ s,\*,.*,g; + # Escape dot characters + $what =~ s/\./\xf6/g; # Temporarily change [0-9]+ type of patterns $what =~ s/\[0\-9\]\+/\xff/g; @@ -859,6 +859,8 @@ sub undefined_symbols { $what =~ s/[\{\<\[]([\w_]+)(?:[,|]+([\w_]+)){1,}[\}\>\]]/($1|$2)/g; # Handle wildcards + $what =~ s,\*,.*,g; + $what =~ s,/\xf6..,/.*,g; $what =~ s/\<[^\>]+\>/.*/g; $what =~ s/\{[^\}]+\}/.*/g; $what =~ s/\[[^\]]+\]/.*/g; @@ -891,6 +893,13 @@ sub undefined_symbols { # Special case: IIO ABI which a parenthesis. $what =~ s/sqrt(.*)/sqrt\(.*\)/; + # Simplify regexes with multiple .* + $what =~ s#(?:\.\*){2,}##g; +# $what =~ s#\.\*/\.\*#.*#g; + + # Recover dot characters + $what =~ s/\xf6/\./g; + my $leave = get_leave($what); my $added = 0; From edfc8730ba45eac3cca20dba3799d6ae6c584b56 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:44:51 +0200 Subject: [PATCH 093/122] ABI: sysfs-mce: add a new ABI file Reduce the gap of missing ABIs for Intel servers with MCE by adding a new ABI file. The contents of this file comes from: Documentation/x86/x86_64/machinecheck.rst Reviewed-by: Andi Kleen Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/801a26985e32589eb78ba4b728d3e19fdea18f04.1632994837.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-mce | 107 ++++++++++++++++++++++ Documentation/x86/x86_64/machinecheck.rst | 56 +---------- MAINTAINERS | 2 + 3 files changed, 111 insertions(+), 54 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-mce diff --git a/Documentation/ABI/testing/sysfs-mce b/Documentation/ABI/testing/sysfs-mce new file mode 100644 index 000000000000..686fbfa02cdc --- /dev/null +++ b/Documentation/ABI/testing/sysfs-mce @@ -0,0 +1,107 @@ +What: /sys/devices/system/machinecheck/machinecheckX/ +Contact: Andi Kleen +Date: Feb, 2007 +Description: + (X = CPU number) + + Machine checks report internal hardware error conditions + detected by the CPU. Uncorrected errors typically cause a + machine check (often with panic), corrected ones cause a + machine check log entry. + + For more details about the x86 machine check architecture + see the Intel and AMD architecture manuals from their + developer websites. + + For more details about the architecture + see http://one.firstfloor.org/~andi/mce.pdf + + Each CPU has its own directory. + +What: /sys/devices/system/machinecheck/machinecheckX/bank +Contact: Andi Kleen +Date: Feb, 2007 +Description: + (Y bank number) + + 64bit Hex bitmask enabling/disabling specific subevents for + bank Y. + + When a bit in the bitmask is zero then the respective + subevent will not be reported. + + By default all events are enabled. + + Note that BIOS maintain another mask to disable specific events + per bank. This is not visible here + +What: /sys/devices/system/machinecheck/machinecheckX/check_interval +Contact: Andi Kleen +Date: Feb, 2007 +Description: + The entries appear for each CPU, but they are truly shared + between all CPUs. + + How often to poll for corrected machine check errors, in + seconds (Note output is hexadecimal). Default 5 minutes. + When the poller finds MCEs it triggers an exponential speedup + (poll more often) on the polling interval. When the poller + stops finding MCEs, it triggers an exponential backoff + (poll less often) on the polling interval. The check_interval + variable is both the initial and maximum polling interval. + 0 means no polling for corrected machine check errors + (but some corrected errors might be still reported + in other ways) + +What: /sys/devices/system/machinecheck/machinecheckX/tolerant +Contact: Andi Kleen +Date: Feb, 2007 +Description: + The entries appear for each CPU, but they are truly shared + between all CPUs. + + Tolerance level. When a machine check exception occurs for a + non corrected machine check the kernel can take different + actions. + + Since machine check exceptions can happen any time it is + sometimes risky for the kernel to kill a process because it + defies normal kernel locking rules. The tolerance level + configures how hard the kernel tries to recover even at some + risk of deadlock. Higher tolerant values trade potentially + better uptime with the risk of a crash or even corruption + (for tolerant >= 3). + + == =========================================================== + 0 always panic on uncorrected errors, log corrected errors + 1 panic or SIGBUS on uncorrected errors, log corrected errors + 2 SIGBUS or log uncorrected errors, log corrected errors + 3 never panic or SIGBUS, log all errors (for testing only) + == =========================================================== + + Default: 1 + + Note this only makes a difference if the CPU allows recovery + from a machine check exception. Current x86 CPUs generally + do not. + +What: /sys/devices/system/machinecheck/machinecheckX/trigger +Contact: Andi Kleen +Date: Feb, 2007 +Description: + The entries appear for each CPU, but they are truly shared + between all CPUs. + + Program to run when a machine check event is detected. + This is an alternative to running mcelog regularly from cron + and allows to detect events faster. + +What: /sys/devices/system/machinecheck/machinecheckX/monarch_timeout +Contact: Andi Kleen +Date: Feb, 2007 +Description: + How long to wait for the other CPUs to machine check too on a + exception. 0 to disable waiting for other CPUs. + + Unit: us + diff --git a/Documentation/x86/x86_64/machinecheck.rst b/Documentation/x86/x86_64/machinecheck.rst index b402e04bee60..cea12ee97200 100644 --- a/Documentation/x86/x86_64/machinecheck.rst +++ b/Documentation/x86/x86_64/machinecheck.rst @@ -21,60 +21,8 @@ from /dev/mcelog. Normally mcelog should be run regularly from a cronjob. Each CPU has a directory in /sys/devices/system/machinecheck/machinecheckN (N = CPU number). -The directory contains some configurable entries: - -bankNctl - (N bank number) - - 64bit Hex bitmask enabling/disabling specific subevents for bank N - When a bit in the bitmask is zero then the respective - subevent will not be reported. - By default all events are enabled. - Note that BIOS maintain another mask to disable specific events - per bank. This is not visible here - -The following entries appear for each CPU, but they are truly shared -between all CPUs. - -check_interval - How often to poll for corrected machine check errors, in seconds - (Note output is hexadecimal). Default 5 minutes. When the poller - finds MCEs it triggers an exponential speedup (poll more often) on - the polling interval. When the poller stops finding MCEs, it - triggers an exponential backoff (poll less often) on the polling - interval. The check_interval variable is both the initial and - maximum polling interval. 0 means no polling for corrected machine - check errors (but some corrected errors might be still reported - in other ways) - -tolerant - Tolerance level. When a machine check exception occurs for a non - corrected machine check the kernel can take different actions. - Since machine check exceptions can happen any time it is sometimes - risky for the kernel to kill a process because it defies - normal kernel locking rules. The tolerance level configures - how hard the kernel tries to recover even at some risk of - deadlock. Higher tolerant values trade potentially better uptime - with the risk of a crash or even corruption (for tolerant >= 3). - - 0: always panic on uncorrected errors, log corrected errors - 1: panic or SIGBUS on uncorrected errors, log corrected errors - 2: SIGBUS or log uncorrected errors, log corrected errors - 3: never panic or SIGBUS, log all errors (for testing only) - - Default: 1 - - Note this only makes a difference if the CPU allows recovery - from a machine check exception. Current x86 CPUs generally do not. - -trigger - Program to run when a machine check event is detected. - This is an alternative to running mcelog regularly from cron - and allows to detect events faster. -monarch_timeout - How long to wait for the other CPUs to machine check too on a - exception. 0 to disable waiting for other CPUs. - Unit: us +The directory contains some configurable entries. See +Documentation/ABI/testing/sysfs-mce for more details. TBD document entries for AMD threshold interrupt configuration diff --git a/MAINTAINERS b/MAINTAINERS index abdcbcfef73d..8f49669e59c3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20353,6 +20353,8 @@ M: Tony Luck M: Borislav Petkov L: linux-edac@vger.kernel.org S: Maintained +F: Documentation/ABI/testing/sysfs-mce +F: Documentation/x86/x86_64/machinecheck.rst F: arch/x86/kernel/cpu/mce/* X86 MICROCODE UPDATE SUPPORT From bf0cf3219144e1acdf8582a084e498fcfe67b825 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:44:52 +0200 Subject: [PATCH 094/122] ABI: sysfs-mce: add 3 missing files Changeset 62fdac5913f7 ("x86, mce: Add boot options for corrected errors") added three more MCE files that are also exposed currently via sysfs. Document them. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/f9c13aff3f5a2cae0d4495eccd17f431f3a4c55a.1632994837.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-mce | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-mce b/Documentation/ABI/testing/sysfs-mce index 686fbfa02cdc..c8cd989034b4 100644 --- a/Documentation/ABI/testing/sysfs-mce +++ b/Documentation/ABI/testing/sysfs-mce @@ -105,3 +105,25 @@ Description: Unit: us +What: /sys/devices/system/machinecheck/machinecheckX/ignore_ce +Contact: Hidetoshi Seto +Date: Jun 2009 +Description: + Disables polling and CMCI for corrected errors. + All corrected events are not cleared and kept in bank MSRs. + +What: /sys/devices/system/machinecheck/machinecheckX/dont_log_ce +Contact: Hidetoshi Seto +Date: Jun 2009 +Description: + Disables logging for corrected errors. + All reported corrected errors will be cleared silently. + + This option will be useful if you never care about corrected + errors. + +What: /sys/devices/system/machinecheck/machinecheckX/cmci_disabled +Contact: Hidetoshi Seto +Date: Jun 2009 +Description: + Disables the CMCI feature. From 036d6a4e75c9e49e510b32c0b963e3f15f56f5ad Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:44:49 +0200 Subject: [PATCH 095/122] ABI: sysfs-class-hwmon: add ABI documentation for it Move the ABI attributes documentation from: Documentation/hwmon/sysfs-interface.rst in order for it to follow the usual ABI documentation. That allows script/get_abi.pl to properly handle it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5f47619ed882b0b8d1c84b56f7ea17bac0854b77.1632994837.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-hwmon | 918 ++++++++++++++++++++ Documentation/hwmon/sysfs-interface.rst | 596 +------------ MAINTAINERS | 1 + 3 files changed, 961 insertions(+), 554 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-hwmon diff --git a/Documentation/ABI/testing/sysfs-class-hwmon b/Documentation/ABI/testing/sysfs-class-hwmon new file mode 100644 index 000000000000..ea5a129ae082 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-hwmon @@ -0,0 +1,918 @@ +What: /sys/class/hwmon/hwmonX/name +Description: + The chip name. + This should be a short, lowercase string, not containing + whitespace, dashes, or the wildcard character '*'. + This attribute represents the chip name. It is the only + mandatory attribute. + I2C devices get this attribute created automatically. + + RO + +What: /sys/class/hwmon/hwmonX/update_interval +Description: + The interval at which the chip will update readings. + Unit: millisecond + + RW + + Some devices have a variable update rate or interval. + This attribute can be used to change it to the desired value. + +What: /sys/class/hwmon/hwmonX/inY_min +Description: + Voltage min value. + + Unit: millivolt + + RW + +What: /sys/class/hwmon/hwmonX/inY_lcrit +Description: + Voltage critical min value. + + Unit: millivolt + + RW + + If voltage drops to or below this limit, the system may + take drastic action such as power down or reset. At the very + least, it should report a fault. + +What: /sys/class/hwmon/hwmonX/inY_max +Description: + Voltage max value. + + Unit: millivolt + + RW + +What: /sys/class/hwmon/hwmonX/inY_crit +Description: + Voltage critical max value. + + Unit: millivolt + + RW + + If voltage reaches or exceeds this limit, the system may + take drastic action such as power down or reset. At the very + least, it should report a fault. + +What: /sys/class/hwmon/hwmonX/inY_input +Description: + Voltage input value. + + Unit: millivolt + + RO + + Voltage measured on the chip pin. + + Actual voltage depends on the scaling resistors on the + motherboard, as recommended in the chip datasheet. + + This varies by chip and by motherboard. + Because of this variation, values are generally NOT scaled + by the chip driver, and must be done by the application. + However, some drivers (notably lm87 and via686a) + do scale, because of internal resistors built into a chip. + These drivers will output the actual voltage. Rule of + thumb: drivers should report the voltage values at the + "pins" of the chip. + +What: /sys/class/hwmon/hwmonX/inY_average +Description: + Average voltage + + Unit: millivolt + + RO + +What: /sys/class/hwmon/hwmonX/inY_lowest +Description: + Historical minimum voltage + + Unit: millivolt + + RO + +What: /sys/class/hwmon/hwmonX/inY_highest +Description: + Historical maximum voltage + + Unit: millivolt + + RO + +What: /sys/class/hwmon/hwmonX/inY_reset_history +Description: + Reset inX_lowest and inX_highest + + WO + +What: /sys/class/hwmon/hwmonX/in_reset_history +Description: + Reset inX_lowest and inX_highest for all sensors + + WO + +What: /sys/class/hwmon/hwmonX/inY_label +Description: + Suggested voltage channel label. + + Text string + + Should only be created if the driver has hints about what + this voltage channel is being used for, and user-space + doesn't. In all other cases, the label is provided by + user-space. + + RO + +What: /sys/class/hwmon/hwmonX/inY_enable +Description: + Enable or disable the sensors. + + When disabled the sensor read will return -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/cpuY_vid +Description: + CPU core reference voltage. + + Unit: millivolt + + RO + + Not always correct. + +What: /sys/class/hwmon/hwmonX/vrm +Description: + Voltage Regulator Module version number. + + RW (but changing it should no more be necessary) + + Originally the VRM standard version multiplied by 10, but now + an arbitrary number, as not all standards have a version + number. + + Affects the way the driver calculates the CPU core reference + voltage from the vid pins. + +What: /sys/class/hwmon/hwmonX/inY_rated_min +Description: + Minimum rated voltage. + + Unit: millivolt + + RO + +What: /sys/class/hwmon/hwmonX/inY_rated_max +Description: + Maximum rated voltage. + + Unit: millivolt + + RO + +What: /sys/class/hwmon/hwmonX/fanY_min +Description: + Fan minimum value + + Unit: revolution/min (RPM) + + RW + +What: /sys/class/hwmon/hwmonX/fanY_max +Description: + Fan maximum value + + Unit: revolution/min (RPM) + + Only rarely supported by the hardware. + RW + +What: /sys/class/hwmon/hwmonX/fanY_input +Description: + Fan input value. + + Unit: revolution/min (RPM) + + RO + +What: /sys/class/hwmon/hwmonX/fanY_div +Description: + Fan divisor. + + Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128). + + RW + + Some chips only support values 1, 2, 4 and 8. + Note that this is actually an internal clock divisor, which + affects the measurable speed range, not the read value. + +What: /sys/class/hwmon/hwmonX/fanY_pulses +Description: + Number of tachometer pulses per fan revolution. + + Integer value, typically between 1 and 4. + + RW + + This value is a characteristic of the fan connected to the + device's input, so it has to be set in accordance with the fan + model. + + Should only be created if the chip has a register to configure + the number of pulses. In the absence of such a register (and + thus attribute) the value assumed by all devices is 2 pulses + per fan revolution. + +What: /sys/class/hwmon/hwmonX/fanY_target +Description: + Desired fan speed + + Unit: revolution/min (RPM) + + RW + + Only makes sense if the chip supports closed-loop fan speed + control based on the measured fan speed. + +What: /sys/class/hwmon/hwmonX/fanY_label +Description: + Suggested fan channel label. + + Text string + + Should only be created if the driver has hints about what + this fan channel is being used for, and user-space doesn't. + In all other cases, the label is provided by user-space. + + RO + +What: /sys/class/hwmon/hwmonX/fanY_enable +Description: + Enable or disable the sensors. + + When disabled the sensor read will return -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/pwmY +Description: + Pulse width modulation fan control. + + Integer value in the range 0 to 255 + + RW + + 255 is max or 100%. + +What: /sys/class/hwmon/hwmonX/pwmY_enable +Description: + Fan speed control method: + + - 0: no fan speed control (i.e. fan at full speed) + - 1: manual fan speed control enabled (using `pwmY`) + - 2+: automatic fan speed control enabled + + Check individual chip documentation files for automatic mode + details. + + RW + +What: /sys/class/hwmon/hwmonX/pwmY_mode +Description: + - 0: DC mode (direct current) + - 1: PWM mode (pulse-width modulation) + + RW + +What: /sys/class/hwmon/hwmonX/pwmY_freq +Description: + Base PWM frequency in Hz. + + Only possibly available when pwmN_mode is PWM, but not always + present even then. + + RW + +What: /sys/class/hwmon/hwmonX/pwmY_auto_channels_temp +Description: + Select which temperature channels affect this PWM output in + auto mode. + + Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc... + Which values are possible depend on the chip used. + + RW + +What: /sys/class/hwmon/hwmonX/pwmY_auto_pointZ_pwm +What: /sys/class/hwmon/hwmonX/pwmY_auto_pointZ_temp +What: /sys/class/hwmon/hwmonX/pwmY_auto_pointZ_temp_hyst +Description: + Define the PWM vs temperature curve. + + Number of trip points is chip-dependent. Use this for chips + which associate trip points to PWM output channels. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_auto_pointZ_pwm +What: /sys/class/hwmon/hwmonX/tempY_auto_pointZ_temp +What: /sys/class/hwmon/hwmonX/tempY_auto_pointZ_temp_hyst +Description: + Define the PWM vs temperature curve. + + Number of trip points is chip-dependent. Use this for chips + which associate trip points to temperature channels. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_type +Description: + Sensor type selection. + + Integers 1 to 6 + + RW + + - 1: CPU embedded diode + - 2: 3904 transistor + - 3: thermal diode + - 4: thermistor + - 5: AMD AMDSI + - 6: Intel PECI + + Not all types are supported by all chips + +What: /sys/class/hwmon/hwmonX/tempY_max +Description: + Temperature max value. + + Unit: millidegree Celsius (or millivolt, see below) + + RW + +What: /sys/class/hwmon/hwmonX/tempY_min +Description: + Temperature min value. + + Unit: millidegree Celsius + + RW + +What: /sys/class/hwmon/hwmonX/tempY_max_hyst +Description: + Temperature hysteresis value for max limit. + + Unit: millidegree Celsius + + Must be reported as an absolute temperature, NOT a delta + from the max value. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_min_hyst +Description: + Temperature hysteresis value for min limit. + Unit: millidegree Celsius + + Must be reported as an absolute temperature, NOT a delta + from the min value. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_input +Description: + Temperature input value. + + Unit: millidegree Celsius + + RO + +What: /sys/class/hwmon/hwmonX/tempY_crit +Description: + Temperature critical max value, typically greater than + corresponding temp_max values. + + Unit: millidegree Celsius + + RW + +What: /sys/class/hwmon/hwmonX/tempY_crit_hyst +Description: + Temperature hysteresis value for critical limit. + + Unit: millidegree Celsius + + Must be reported as an absolute temperature, NOT a delta + from the critical value. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_emergency +Description: + Temperature emergency max value, for chips supporting more than + two upper temperature limits. Must be equal or greater than + corresponding temp_crit values. + + Unit: millidegree Celsius + + RW + +What: /sys/class/hwmon/hwmonX/tempY_emergency_hyst +Description: + Temperature hysteresis value for emergency limit. + + Unit: millidegree Celsius + + Must be reported as an absolute temperature, NOT a delta + from the emergency value. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_lcrit +Description: + Temperature critical min value, typically lower than + corresponding temp_min values. + + Unit: millidegree Celsius + + RW + +What: /sys/class/hwmon/hwmonX/tempY_lcrit_hyst +Description: + Temperature hysteresis value for critical min limit. + + Unit: millidegree Celsius + + Must be reported as an absolute temperature, NOT a delta + from the critical min value. + + RW + +What: /sys/class/hwmon/hwmonX/tempY_offset +Description: + Temperature offset which is added to the temperature reading + by the chip. + + Unit: millidegree Celsius + + Read/Write value. + +What: /sys/class/hwmon/hwmonX/tempY_label +Description: + Suggested temperature channel label. + + Text string + + Should only be created if the driver has hints about what + this temperature channel is being used for, and user-space + doesn't. In all other cases, the label is provided by + user-space. + + RO + +What: /sys/class/hwmon/hwmonX/tempY_lowest +Description: + Historical minimum temperature + + Unit: millidegree Celsius + + RO + +What: /sys/class/hwmon/hwmonX/tempY_highest +Description: + Historical maximum temperature + + Unit: millidegree Celsius + + RO + +What: /sys/class/hwmon/hwmonX/tempY_reset_history +Description: + Reset temp_lowest and temp_highest + + WO + +What: /sys/class/hwmon/hwmonX/temp_reset_history +Description: + Reset temp_lowest and temp_highest for all sensors + + WO + +What: /sys/class/hwmon/hwmonX/tempY_enable +Description: + Enable or disable the sensors. + + When disabled the sensor read will return -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/tempY_rated_min +Description: + Minimum rated temperature. + + Unit: millidegree Celsius + + RO + +What: /sys/class/hwmon/hwmonX/tempY_rated_max +Description: + Maximum rated temperature. + + Unit: millidegree Celsius + + RO + +What: /sys/class/hwmon/hwmonX/currY_max +Description: + Current max value + + Unit: milliampere + + RW + +What: /sys/class/hwmon/hwmonX/currY_min +Description: + Current min value. + + Unit: milliampere + + RW + +What: /sys/class/hwmon/hwmonX/currY_lcrit +Description: + Current critical low value + + Unit: milliampere + + RW + +What: /sys/class/hwmon/hwmonX/currY_crit +Description: + Current critical high value. + + Unit: milliampere + + RW + +What: /sys/class/hwmon/hwmonX/currY_input +Description: + Current input value + + Unit: milliampere + + RO + +What: /sys/class/hwmon/hwmonX/currY_average +Description: + Average current use + + Unit: milliampere + + RO + +What: /sys/class/hwmon/hwmonX/currY_lowest +Description: + Historical minimum current + + Unit: milliampere + + RO + +What: /sys/class/hwmon/hwmonX/currY_highest +Description: + Historical maximum current + Unit: milliampere + RO + +What: /sys/class/hwmon/hwmonX/currY_reset_history +Description: + Reset currX_lowest and currX_highest + + WO + +What: /sys/class/hwmon/hwmonX/curr_reset_history +Description: + Reset currX_lowest and currX_highest for all sensors + + WO + +What: /sys/class/hwmon/hwmonX/currY_enable +Description: + Enable or disable the sensors. + + When disabled the sensor read will return -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/currY_rated_min +Description: + Minimum rated current. + + Unit: milliampere + + RO + +What: /sys/class/hwmon/hwmonX/currY_rated_max +Description: + Maximum rated current. + + Unit: milliampere + + RO + +What: /sys/class/hwmon/hwmonX/powerY_average +Description: + Average power use + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_average_interval +Description: + Power use averaging interval. A poll + notification is sent to this file if the + hardware changes the averaging interval. + + Unit: milliseconds + + RW + +What: /sys/class/hwmon/hwmonX/powerY_average_interval_max +Description: + Maximum power use averaging interval + + Unit: milliseconds + + RO + +What: /sys/class/hwmon/hwmonX/powerY_average_interval_min +Description: + Minimum power use averaging interval + + Unit: milliseconds + + RO + +What: /sys/class/hwmon/hwmonX/powerY_average_highest +Description: + Historical average maximum power use + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_average_lowest +Description: + Historical average minimum power use + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_average_max +Description: + A poll notification is sent to + `powerY_average` when power use + rises above this value. + + Unit: microWatt + + RW + +What: /sys/class/hwmon/hwmonX/powerY_average_min +Description: + A poll notification is sent to + `powerY_average` when power use + sinks below this value. + + Unit: microWatt + + RW + +What: /sys/class/hwmon/hwmonX/powerY_input +Description: + Instantaneous power use + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_input_highest +Description: + Historical maximum power use + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_input_lowest +Description: + Historical minimum power use + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_reset_history +Description: + Reset input_highest, input_lowest, + average_highest and average_lowest. + + WO + +What: /sys/class/hwmon/hwmonX/powerY_accuracy +Description: + Accuracy of the power meter. + + Unit: Percent + + RO + +What: /sys/class/hwmon/hwmonX/powerY_cap +Description: + If power use rises above this limit, the + system should take action to reduce power use. + A poll notification is sent to this file if the + cap is changed by the hardware. The `*_cap` + files only appear if the cap is known to be + enforced by hardware. + + Unit: microWatt + + RW + +What: /sys/class/hwmon/hwmonX/powerY_cap_hyst +Description: + Margin of hysteresis built around capping and + notification. + + Unit: microWatt + + RW + +What: /sys/class/hwmon/hwmonX/powerY_cap_max +Description: + Maximum cap that can be set. + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_cap_min +Description: + Minimum cap that can be set. + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_max +Description: + Maximum power. + + Unit: microWatt + + RW + +What: /sys/class/hwmon/hwmonX/powerY_crit +Description: + Critical maximum power. + + If power rises to or above this limit, the + system is expected take drastic action to reduce + power consumption, such as a system shutdown or + a forced powerdown of some devices. + + Unit: microWatt + + RW + +What: /sys/class/hwmon/hwmonX/powerY_enable +Description: + Enable or disable the sensors. + + When disabled the sensor read will return + -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/powerY_rated_min +Description: + Minimum rated power. + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/powerY_rated_max +Description: + Maximum rated power. + + Unit: microWatt + + RO + +What: /sys/class/hwmon/hwmonX/energyY_input +Description: + Cumulative energy use + + Unit: microJoule + + RO + +What: /sys/class/hwmon/hwmonX/energyY_enable +Description: + Enable or disable the sensors. + + When disabled the sensor read will return + -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/humidityY_input +Description: + Humidity + + Unit: milli-percent (per cent mille, pcm) + + RO + + +What: /sys/class/hwmon/hwmonX/humidityY_enable +Description: + Enable or disable the sensors + + When disabled the sensor read will return + -ENODATA. + + - 1: Enable + - 0: Disable + + RW + +What: /sys/class/hwmon/hwmonX/humidityY_rated_min +Description: + Minimum rated humidity. + + Unit: milli-percent (per cent mille, pcm) + + RO + +What: /sys/class/hwmon/hwmonX/humidityY_rated_max +Description: + Maximum rated humidity. + + Unit: milli-percent (per cent mille, pcm) + + RO + + +What: /sys/class/hwmon/hwmonX/intrusionY_alarm +Description: + Chassis intrusion detection + + - 0: OK + - 1: intrusion detected + + RW + + Contrary to regular alarm flags which clear themselves + automatically when read, this one sticks until cleared by + the user. This is done by writing 0 to the file. Writing + other values is unsupported. + +What: /sys/class/hwmon/hwmonX/intrusionY_beep +Description: + Chassis intrusion beep + + - 0: disable + - 1: enable + + RW diff --git a/Documentation/hwmon/sysfs-interface.rst b/Documentation/hwmon/sysfs-interface.rst index 13c5acb72d63..85652a6aaa3e 100644 --- a/Documentation/hwmon/sysfs-interface.rst +++ b/Documentation/hwmon/sysfs-interface.rst @@ -89,6 +89,8 @@ hardware implementation. All entries (except name) are optional, and should only be created in a given driver if the chip has the feature. +See Documentation/ABI/testing/sysfs-class-hwmon for a complete description +of the attributes. ***************** Global attributes @@ -96,22 +98,9 @@ Global attributes `name` The chip name. - This should be a short, lowercase string, not containing - whitespace, dashes, or the wildcard character '*'. - This attribute represents the chip name. It is the only - mandatory attribute. - I2C devices get this attribute created automatically. - - RO `update_interval` The interval at which the chip will update readings. - Unit: millisecond - - RW - - Some devices have a variable update rate or interval. - This attribute can be used to change it to the desired value. ******** @@ -121,148 +110,51 @@ Voltages `in[0-*]_min` Voltage min value. - Unit: millivolt - - RW - `in[0-*]_lcrit` Voltage critical min value. - Unit: millivolt - - RW - - If voltage drops to or below this limit, the system may - take drastic action such as power down or reset. At the very - least, it should report a fault. - `in[0-*]_max` Voltage max value. - Unit: millivolt - - RW - `in[0-*]_crit` Voltage critical max value. - Unit: millivolt - - RW - - If voltage reaches or exceeds this limit, the system may - take drastic action such as power down or reset. At the very - least, it should report a fault. - `in[0-*]_input` Voltage input value. - Unit: millivolt - - RO - - Voltage measured on the chip pin. - - Actual voltage depends on the scaling resistors on the - motherboard, as recommended in the chip datasheet. - - This varies by chip and by motherboard. - Because of this variation, values are generally NOT scaled - by the chip driver, and must be done by the application. - However, some drivers (notably lm87 and via686a) - do scale, because of internal resistors built into a chip. - These drivers will output the actual voltage. Rule of - thumb: drivers should report the voltage values at the - "pins" of the chip. - `in[0-*]_average` Average voltage - Unit: millivolt - - RO - `in[0-*]_lowest` Historical minimum voltage - Unit: millivolt - - RO - `in[0-*]_highest` Historical maximum voltage - Unit: millivolt - - RO - `in[0-*]_reset_history` Reset inX_lowest and inX_highest - WO - `in_reset_history` Reset inX_lowest and inX_highest for all sensors - WO - `in[0-*]_label` Suggested voltage channel label. - Text string - - Should only be created if the driver has hints about what - this voltage channel is being used for, and user-space - doesn't. In all other cases, the label is provided by - user-space. - - RO - `in[0-*]_enable` Enable or disable the sensors. - When disabled the sensor read will return -ENODATA. - - - 1: Enable - - 0: Disable - - RW - `cpu[0-*]_vid` CPU core reference voltage. - Unit: millivolt - - RO - - Not always correct. - `vrm` Voltage Regulator Module version number. - RW (but changing it should no more be necessary) - - Originally the VRM standard version multiplied by 10, but now - an arbitrary number, as not all standards have a version - number. - - Affects the way the driver calculates the CPU core reference - voltage from the vid pins. - `in[0-*]_rated_min` Minimum rated voltage. - Unit: millivolt - - RO - `in[0-*]_rated_max` Maximum rated voltage. - Unit: millivolt - - RO - Also see the Alarms section for status flags associated with voltages. @@ -273,83 +165,27 @@ Fans `fan[1-*]_min` Fan minimum value - Unit: revolution/min (RPM) - - RW - `fan[1-*]_max` Fan maximum value - Unit: revolution/min (RPM) - - Only rarely supported by the hardware. - RW - `fan[1-*]_input` Fan input value. - Unit: revolution/min (RPM) - - RO - `fan[1-*]_div` Fan divisor. - Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128). - - RW - - Some chips only support values 1, 2, 4 and 8. - Note that this is actually an internal clock divisor, which - affects the measurable speed range, not the read value. - `fan[1-*]_pulses` Number of tachometer pulses per fan revolution. - Integer value, typically between 1 and 4. - - RW - - This value is a characteristic of the fan connected to the - device's input, so it has to be set in accordance with the fan - model. - - Should only be created if the chip has a register to configure - the number of pulses. In the absence of such a register (and - thus attribute) the value assumed by all devices is 2 pulses - per fan revolution. - `fan[1-*]_target` Desired fan speed - Unit: revolution/min (RPM) - - RW - - Only makes sense if the chip supports closed-loop fan speed - control based on the measured fan speed. - `fan[1-*]_label` Suggested fan channel label. - Text string - - Should only be created if the driver has hints about what - this fan channel is being used for, and user-space doesn't. - In all other cases, the label is provided by user-space. - - RO - `fan[1-*]_enable` Enable or disable the sensors. - When disabled the sensor read will return -ENODATA. - - - 1: Enable - - 0: Disable - - RW - Also see the Alarms section for status flags associated with fans. @@ -360,63 +196,25 @@ PWM `pwm[1-*]` Pulse width modulation fan control. - Integer value in the range 0 to 255 - - RW - - 255 is max or 100%. - `pwm[1-*]_enable` Fan speed control method: - - 0: no fan speed control (i.e. fan at full speed) - - 1: manual fan speed control enabled (using `pwm[1-*]`) - - 2+: automatic fan speed control enabled - - Check individual chip documentation files for automatic mode - details. - - RW - `pwm[1-*]_mode` - - 0: DC mode (direct current) - - 1: PWM mode (pulse-width modulation) - - RW + direct current or pulse-width modulation. `pwm[1-*]_freq` Base PWM frequency in Hz. - Only possibly available when pwmN_mode is PWM, but not always - present even then. - - RW - `pwm[1-*]_auto_channels_temp` Select which temperature channels affect this PWM output in auto mode. - Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc... - Which values are possible depend on the chip used. - - RW - `pwm[1-*]_auto_point[1-*]_pwm` / `pwm[1-*]_auto_point[1-*]_temp` / `pwm[1-*]_auto_point[1-*]_temp_hyst` Define the PWM vs temperature curve. - Number of trip points is chip-dependent. Use this for chips - which associate trip points to PWM output channels. - - RW - `temp[1-*]_auto_point[1-*]_pwm` / `temp[1-*]_auto_point[1-*]_temp` / `temp[1-*]_auto_point[1-*]_temp_hyst` Define the PWM vs temperature curve. - Number of trip points is chip-dependent. Use this for chips - which associate trip points to temperature channels. - - RW - There is a third case where trip points are associated to both PWM output channels and temperature channels: the PWM values are associated to PWM output channels while the temperature values are associated to temperature @@ -434,182 +232,70 @@ Temperatures `temp[1-*]_type` Sensor type selection. - Integers 1 to 6 - - RW - - - 1: CPU embedded diode - - 2: 3904 transistor - - 3: thermal diode - - 4: thermistor - - 5: AMD AMDSI - - 6: Intel PECI - - Not all types are supported by all chips - `temp[1-*]_max` Temperature max value. - Unit: millidegree Celsius (or millivolt, see below) - - RW - `temp[1-*]_min` Temperature min value. - Unit: millidegree Celsius - - RW - `temp[1-*]_max_hyst` Temperature hysteresis value for max limit. - Unit: millidegree Celsius - - Must be reported as an absolute temperature, NOT a delta - from the max value. - - RW - `temp[1-*]_min_hyst` Temperature hysteresis value for min limit. - Unit: millidegree Celsius - - Must be reported as an absolute temperature, NOT a delta - from the min value. - - RW `temp[1-*]_input` - Temperature input value. - - Unit: millidegree Celsius - - RO + Temperature input value. `temp[1-*]_crit` Temperature critical max value, typically greater than corresponding temp_max values. - Unit: millidegree Celsius - - RW - `temp[1-*]_crit_hyst` Temperature hysteresis value for critical limit. - Unit: millidegree Celsius - - Must be reported as an absolute temperature, NOT a delta - from the critical value. - - RW - `temp[1-*]_emergency` Temperature emergency max value, for chips supporting more than - two upper temperature limits. Must be equal or greater than - corresponding temp_crit values. - - Unit: millidegree Celsius - - RW + two upper temperature limits. `temp[1-*]_emergency_hyst` Temperature hysteresis value for emergency limit. - Unit: millidegree Celsius - - Must be reported as an absolute temperature, NOT a delta - from the emergency value. - - RW - `temp[1-*]_lcrit` Temperature critical min value, typically lower than corresponding temp_min values. - Unit: millidegree Celsius - - RW - `temp[1-*]_lcrit_hyst` Temperature hysteresis value for critical min limit. - Unit: millidegree Celsius - - Must be reported as an absolute temperature, NOT a delta - from the critical min value. - - RW - `temp[1-*]_offset` Temperature offset which is added to the temperature reading by the chip. - Unit: millidegree Celsius - - Read/Write value. - `temp[1-*]_label` Suggested temperature channel label. - Text string - - Should only be created if the driver has hints about what - this temperature channel is being used for, and user-space - doesn't. In all other cases, the label is provided by - user-space. - - RO - `temp[1-*]_lowest` Historical minimum temperature - Unit: millidegree Celsius - - RO - `temp[1-*]_highest` Historical maximum temperature - Unit: millidegree Celsius - - RO - `temp[1-*]_reset_history` Reset temp_lowest and temp_highest - WO - `temp_reset_history` Reset temp_lowest and temp_highest for all sensors - WO - `temp[1-*]_enable` Enable or disable the sensors. - When disabled the sensor read will return -ENODATA. - - - 1: Enable - - 0: Disable - - RW - `temp[1-*]_rated_min` Minimum rated temperature. - Unit: millidegree Celsius - - RO - `temp[1-*]_rated_max` Maximum rated temperature. - Unit: millidegree Celsius - - RO - Some chips measure temperature using external thermistors and an ADC, and report the temperature measurement as a voltage. Converting this voltage back to a temperature (or the other way around for limits) requires @@ -627,58 +313,28 @@ Currents ******** `curr[1-*]_max` - Current max value - - Unit: milliampere - - RW + Current max value. `curr[1-*]_min` Current min value. - Unit: milliampere - - RW - `curr[1-*]_lcrit` Current critical low value - Unit: milliampere - - RW - `curr[1-*]_crit` Current critical high value. - Unit: milliampere - - RW - `curr[1-*]_input` - Current input value - - Unit: milliampere - - RO + Current input value. `curr[1-*]_average` - Average current use - - Unit: milliampere - - RO + Average current use. `curr[1-*]_lowest` - Historical minimum current - - Unit: milliampere - - RO + Historical minimum current. `curr[1-*]_highest` - Historical maximum current - Unit: milliampere - RO + Historical maximum current. `curr[1-*]_reset_history` Reset currX_lowest and currX_highest @@ -686,34 +342,17 @@ Currents WO `curr_reset_history` - Reset currX_lowest and currX_highest for all sensors - - WO + Reset currX_lowest and currX_highest for all sensors. `curr[1-*]_enable` Enable or disable the sensors. - When disabled the sensor read will return -ENODATA. - - - 1: Enable - - 0: Disable - - RW - `curr[1-*]_rated_min` Minimum rated current. - Unit: milliampere - - RO - `curr[1-*]_rated_max` Maximum rated current. - Unit: milliampere - - RO - Also see the Alarms section for status flags associated with currents. ***** @@ -721,141 +360,62 @@ Power ***** `power[1-*]_average` - Average power use - - Unit: microWatt - - RO + Average power use. `power[1-*]_average_interval` - Power use averaging interval. A poll - notification is sent to this file if the - hardware changes the averaging interval. - - Unit: milliseconds - - RW + Power use averaging interval. `power[1-*]_average_interval_max` - Maximum power use averaging interval - - Unit: milliseconds - - RO + Maximum power use averaging interval. `power[1-*]_average_interval_min` - Minimum power use averaging interval - - Unit: milliseconds - - RO + Minimum power use averaging interval. `power[1-*]_average_highest` - Historical average maximum power use - - Unit: microWatt - - RO + Historical average maximum power use `power[1-*]_average_lowest` - Historical average minimum power use - - Unit: microWatt - - RO + Historical average minimum power use `power[1-*]_average_max` - A poll notification is sent to - `power[1-*]_average` when power use - rises above this value. - - Unit: microWatt - - RW + A poll notification is sent to `power[1-*]_average` when + power use rises above this value. `power[1-*]_average_min` - A poll notification is sent to - `power[1-*]_average` when power use - sinks below this value. - - Unit: microWatt - - RW + A poll notification is sent to `power[1-*]_average` when + power use sinks below this value. `power[1-*]_input` - Instantaneous power use - - Unit: microWatt - - RO + Instantaneous power use. `power[1-*]_input_highest` - Historical maximum power use - - Unit: microWatt - - RO + Historical maximum power use `power[1-*]_input_lowest` - Historical minimum power use - - Unit: microWatt - - RO + Historical minimum power use. `power[1-*]_reset_history` - Reset input_highest, input_lowest, - average_highest and average_lowest. - - WO + Reset input_highest, input_lowest, average_highest and + average_lowest. `power[1-*]_accuracy` - Accuracy of the power meter. - - Unit: Percent - - RO + Accuracy of the power meter. `power[1-*]_cap` - If power use rises above this limit, the - system should take action to reduce power use. - A poll notification is sent to this file if the - cap is changed by the hardware. The `*_cap` - files only appear if the cap is known to be - enforced by hardware. - - Unit: microWatt - - RW + If power use rises above this limit, the + system should take action to reduce power use. `power[1-*]_cap_hyst` - Margin of hysteresis built around capping and - notification. - - Unit: microWatt - - RW + Margin of hysteresis built around capping and notification. `power[1-*]_cap_max` - Maximum cap that can be set. - - Unit: microWatt - - RO + Maximum cap that can be set. `power[1-*]_cap_min` - Minimum cap that can be set. - - Unit: microWatt - - RO + Minimum cap that can be set. `power[1-*]_max` - Maximum power. - - Unit: microWatt - - RW + Maximum power. `power[1-*]_crit` Critical maximum power. @@ -923,37 +483,16 @@ Humidity ******** `humidity[1-*]_input` - Humidity - - Unit: milli-percent (per cent mille, pcm) - - RO - + Humidity. `humidity[1-*]_enable` - Enable or disable the sensors - - When disabled the sensor read will return - -ENODATA. - - - 1: Enable - - 0: Disable - - RW + Enable or disable the sensors. `humidity[1-*]_rated_min` - Minimum rated humidity. - - Unit: milli-percent (per cent mille, pcm) - - RO + Minimum rated humidity. `humidity[1-*]_rated_max` - Maximum rated humidity. - - Unit: milli-percent (per cent mille, pcm) - - RO + Maximum rated humidity. ****** Alarms @@ -1004,30 +543,15 @@ supports it. When this boolean has value 1, the measurement for that channel should not be trusted. `fan[1-*]_fault` / `temp[1-*]_fault` - Input fault condition - - - 0: no fault occurred - - 1: fault condition - - RO + Input fault condition. Some chips also offer the possibility to get beeped when an alarm occurs: `beep_enable` - Master beep enable - - - 0: no beeps - - 1: beeps - - RW + Master beep enable. `in[0-*]_beep`, `curr[1-*]_beep`, `fan[1-*]_beep`, `temp[1-*]_beep`, - Channel beep - - - 0: disable - - 1: enable - - RW + Channel beep. In theory, a chip could provide per-limit beep masking, but no such chip was seen so far. @@ -1039,29 +563,8 @@ for compatibility reasons: `alarms` Alarm bitmask. - RO - - Integer representation of one to four bytes. - - A '1' bit means an alarm. - - Chips should be programmed for 'comparator' mode so that - the alarm will 'come back' after you read the register - if it is still valid. - - Generally a direct representation of a chip's internal - alarm registers; there is no standard for the position - of individual bits. For this reason, the use of this - interface file for new drivers is discouraged. Use - `individual *_alarm` and `*_fault` files instead. - Bits are defined in kernel/include/sensors.h. - `beep_mask` Bitmask for beep. - Same format as 'alarms' with the same bit locations, - use discouraged for the same reason. Use individual - `*_beep` files instead. - RW ******************* @@ -1069,25 +572,10 @@ Intrusion detection ******************* `intrusion[0-*]_alarm` - Chassis intrusion detection - - - 0: OK - - 1: intrusion detected - - RW - - Contrary to regular alarm flags which clear themselves - automatically when read, this one sticks until cleared by - the user. This is done by writing 0 to the file. Writing - other values is unsupported. + Chassis intrusion detection. `intrusion[0-*]_beep` - Chassis intrusion beep - - 0: disable - 1: enable - - RW + Chassis intrusion beep. **************************** Average sample configuration diff --git a/MAINTAINERS b/MAINTAINERS index 8f49669e59c3..14d5ef3c4336 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8215,6 +8215,7 @@ L: linux-hwmon@vger.kernel.org S: Maintained W: http://hwmon.wiki.kernel.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git +F: Documentation/ABI/testing/sysfs-class-hwmon F: Documentation/devicetree/bindings/hwmon/ F: Documentation/hwmon/ F: drivers/hwmon/ From 365b5d63a505a0756dbf5f729facd4877a423175 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:44:50 +0200 Subject: [PATCH 096/122] ABI: sysfs-class-hwmon: add a description for tempY_crit_alarm Such ABI symbol is currently not described. Document it. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/a14f98e1b23ea14cf14da3c3169955343ec28bbe.1632994837.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-hwmon | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-hwmon b/Documentation/ABI/testing/sysfs-class-hwmon index ea5a129ae082..1f20687def44 100644 --- a/Documentation/ABI/testing/sysfs-class-hwmon +++ b/Documentation/ABI/testing/sysfs-class-hwmon @@ -410,6 +410,20 @@ Description: RW +What: /sys/class/hwmon/hwmonX/tempY_crit_alarm +Description: + Critical high temperature alarm flag. + + - 0: OK + - 1: temperature has reached tempY_crit + + RW + + Contrary to regular alarm flags which clear themselves + automatically when read, this one sticks until cleared by + the user. This is done by writing 0 to the file. Writing + other values is unsupported. + What: /sys/class/hwmon/hwmonX/tempY_crit_hyst Description: Temperature hysteresis value for critical limit. From 4aa5216cac478a320c18183a7a990ff1543155d3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:44:53 +0200 Subject: [PATCH 097/122] ABI: sysfs-class-extcon: use uppercase X for wildcards Uppercase letters X, Y and Z are handled as wildcards by scripts/get_abi.pl. We can't do that with lowercase letters, as they're used everywhere. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/2dfd3f80cea2d0501f6451f2e66000b00fda3346.1632994837.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-class-extcon | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-extcon b/Documentation/ABI/testing/sysfs-class-extcon index fde0fecd5de9..f8e705375b24 100644 --- a/Documentation/ABI/testing/sysfs-class-extcon +++ b/Documentation/ABI/testing/sysfs-class-extcon @@ -65,19 +65,19 @@ Description: interface associated with each cable cannot update multiple cable states of an extcon device simultaneously. -What: /sys/class/extcon/.../cable.x/name +What: /sys/class/extcon/.../cable.X/name Date: February 2012 Contact: MyungJoo Ham Description: - The /sys/class/extcon/.../cable.x/name shows the name of cable - "x" (integer between 0 and 31) of an extcon device. + The /sys/class/extcon/.../cable.X/name shows the name of cable + "X" (integer between 0 and 31) of an extcon device. -What: /sys/class/extcon/.../cable.x/state +What: /sys/class/extcon/.../cable.X/state Date: February 2012 Contact: MyungJoo Ham Description: - The /sys/class/extcon/.../cable.x/state shows and stores the - state of cable "x" (integer between 0 and 31) of an extcon + The /sys/class/extcon/.../cable.X/state shows and stores the + state of cable "X" (integer between 0 and 31) of an extcon device. The state value is either 0 (detached) or 1 (attached). From abcb948db320abd39b64d058ee300226a4c252df Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Sep 2021 11:44:54 +0200 Subject: [PATCH 098/122] ABI: sysfs-devices-system-cpu: use cpuX instead of cpu# Some What entries here use cpu# as a wildcard, while others use, instead, cpuX. As scripts/get_abi.pl doesn't consider "#" as a wildcard, replace: cpu# -> cpuX inside the file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/60b1a79189d1a9d9f1c9c9c299770e69b18972fd.1632994837.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman --- .../ABI/testing/sysfs-devices-system-cpu | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu index 4ffc7e6ef403..69c65da16dff 100644 --- a/Documentation/ABI/testing/sysfs-devices-system-cpu +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu @@ -7,7 +7,7 @@ Description: Individual CPU attributes are contained in subdirectories named by the kernel's logical CPU number, e.g.: - /sys/devices/system/cpu/cpu#/ + /sys/devices/system/cpu/cpuX/ What: /sys/devices/system/cpu/kernel_max /sys/devices/system/cpu/offline @@ -53,7 +53,7 @@ Description: Dynamic addition and removal of CPU's. This is not hotplug the system. Information written to the file to remove CPU's is architecture specific. -What: /sys/devices/system/cpu/cpu#/node +What: /sys/devices/system/cpu/cpuX/node Date: October 2009 Contact: Linux memory management mailing list Description: Discover NUMA node a CPU belongs to @@ -67,41 +67,41 @@ Description: Discover NUMA node a CPU belongs to /sys/devices/system/cpu/cpu42/node2 -> ../../node/node2 -What: /sys/devices/system/cpu/cpu#/topology/core_id - /sys/devices/system/cpu/cpu#/topology/core_siblings - /sys/devices/system/cpu/cpu#/topology/core_siblings_list - /sys/devices/system/cpu/cpu#/topology/physical_package_id - /sys/devices/system/cpu/cpu#/topology/thread_siblings - /sys/devices/system/cpu/cpu#/topology/thread_siblings_list +What: /sys/devices/system/cpu/cpuX/topology/core_id + /sys/devices/system/cpu/cpuX/topology/core_siblings + /sys/devices/system/cpu/cpuX/topology/core_siblings_list + /sys/devices/system/cpu/cpuX/topology/physical_package_id + /sys/devices/system/cpu/cpuX/topology/thread_siblings + /sys/devices/system/cpu/cpuX/topology/thread_siblings_list Date: December 2008 Contact: Linux kernel mailing list Description: CPU topology files that describe a logical CPU's relationship to other cores and threads in the same physical package. - One cpu# directory is created per logical CPU in the system, + One cpuX directory is created per logical CPU in the system, e.g. /sys/devices/system/cpu/cpu42/. Briefly, the files above are: - core_id: the CPU core ID of cpu#. Typically it is the + core_id: the CPU core ID of cpuX. Typically it is the hardware platform's identifier (rather than the kernel's). The actual value is architecture and platform dependent. - core_siblings: internal kernel map of cpu#'s hardware threads + core_siblings: internal kernel map of cpuX's hardware threads within the same physical_package_id. core_siblings_list: human-readable list of the logical CPU - numbers within the same physical_package_id as cpu#. + numbers within the same physical_package_id as cpuX. - physical_package_id: physical package id of cpu#. Typically + physical_package_id: physical package id of cpuX. Typically corresponds to a physical socket number, but the actual value is architecture and platform dependent. - thread_siblings: internal kernel map of cpu#'s hardware - threads within the same core as cpu# + thread_siblings: internal kernel map of cpuX's hardware + threads within the same core as cpuX - thread_siblings_list: human-readable list of cpu#'s hardware - threads within the same core as cpu# + thread_siblings_list: human-readable list of cpuX's hardware + threads within the same core as cpuX See Documentation/admin-guide/cputopology.rst for more information. @@ -237,7 +237,7 @@ Description: Total number of times this state has been requested by the CPU while entering suspend-to-idle. -What: /sys/devices/system/cpu/cpu#/cpufreq/* +What: /sys/devices/system/cpu/cpuX/cpufreq/* Date: pre-git history Contact: linux-pm@vger.kernel.org Description: Discover and change clock speed of CPUs @@ -252,7 +252,7 @@ Description: Discover and change clock speed of CPUs See files in Documentation/cpu-freq/ for more information. -What: /sys/devices/system/cpu/cpu#/cpufreq/freqdomain_cpus +What: /sys/devices/system/cpu/cpuX/cpufreq/freqdomain_cpus Date: June 2013 Contact: linux-pm@vger.kernel.org Description: Discover CPUs in the same CPU frequency coordination domain @@ -301,16 +301,16 @@ Description: Processor frequency boosting control Documentation/admin-guide/pm/cpufreq.rst -What: /sys/devices/system/cpu/cpu#/crash_notes - /sys/devices/system/cpu/cpu#/crash_notes_size +What: /sys/devices/system/cpu/cpuX/crash_notes + /sys/devices/system/cpu/cpuX/crash_notes_size Date: April 2013 Contact: kexec@lists.infradead.org Description: address and size of the percpu note. crash_notes: the physical address of the memory that holds the - note of cpu#. + note of cpuX. - crash_notes_size: size of the note of cpu#. + crash_notes_size: size of the note of cpuX. What: /sys/devices/system/cpu/intel_pstate/max_perf_pct @@ -503,12 +503,12 @@ Description: Identifies the subset of CPUs in the system that can execute If absent, then all or none of the CPUs can execute AArch32 applications and execve() will behave accordingly. -What: /sys/devices/system/cpu/cpu#/cpu_capacity +What: /sys/devices/system/cpu/cpuX/cpu_capacity Date: December 2016 Contact: Linux kernel mailing list Description: information about CPUs heterogeneity. - cpu_capacity: capacity of cpu#. + cpu_capacity: capacity of cpuX. What: /sys/devices/system/cpu/vulnerabilities /sys/devices/system/cpu/vulnerabilities/meltdown @@ -560,7 +560,7 @@ Description: Control Symmetric Multi Threading (SMT) If control status is "forceoff" or "notsupported" writes are rejected. -What: /sys/devices/system/cpu/cpu#/power/energy_perf_bias +What: /sys/devices/system/cpu/cpuX/power/energy_perf_bias Date: March 2019 Contact: linux-pm@vger.kernel.org Description: Intel Energy and Performance Bias Hint (EPB) From f7a07f7b96033df7709042ff38e998720a3f7119 Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Fri, 17 Sep 2021 11:22:13 -0700 Subject: [PATCH 099/122] firmware_loader: fix pre-allocated buf built-in firmware use The firmware_loader can be used with a pre-allocated buffer through the use of the API calls: o request_firmware_into_buf() o request_partial_firmware_into_buf() If the firmware was built-in and present, our current check for if the built-in firmware fits into the pre-allocated buffer does not return any errors, and we proceed to tell the caller that everything worked fine. It's a lie and no firmware would end up being copied into the pre-allocated buffer. So if the caller trust the result it may end up writing a bunch of 0's to a device! Fix this by making the function that checks for the pre-allocated buffer return non-void. Since the typical use case is when no pre-allocated buffer is provided make this return successfully for that case. If the built-in firmware does *not* fit into the pre-allocated buffer size return a failure as we should have been doing before. I'm not aware of users of the built-in firmware using the API calls with a pre-allocated buffer, as such I doubt this fixes any real life issue. But you never know... perhaps some oddball private tree might use it. In so far as upstream is concerned this just fixes our code for correctness. Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20210917182226.3532898-2-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_loader/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index bdbedc6660a8..ef904b8b112e 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -100,12 +100,15 @@ static struct firmware_cache fw_cache; extern struct builtin_fw __start_builtin_fw[]; extern struct builtin_fw __end_builtin_fw[]; -static void fw_copy_to_prealloc_buf(struct firmware *fw, +static bool fw_copy_to_prealloc_buf(struct firmware *fw, void *buf, size_t size) { - if (!buf || size < fw->size) - return; + if (!buf) + return true; + if (size < fw->size) + return false; memcpy(buf, fw->data, fw->size); + return true; } static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, @@ -117,9 +120,7 @@ static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, if (strcmp(name, b_fw->name) == 0) { fw->size = b_fw->size; fw->data = b_fw->data; - fw_copy_to_prealloc_buf(fw, buf, size); - - return true; + return fw_copy_to_prealloc_buf(fw, buf, size); } } From 7c4fd90741b724b199089869262862542a8f026b Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Fri, 17 Sep 2021 11:22:14 -0700 Subject: [PATCH 100/122] firmware_loader: split built-in firmware call There are two ways the firmware_loader can use the built-in firmware: with or without the pre-allocated buffer. We already have one explicit use case for each of these, and so split them up so that it is clear what the intention is on the caller side. This also paves the way so that eventually other callers outside of the firmware loader can uses these if and when needed. While at it, adopt the firmware prefix for the routine names. Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20210917182226.3532898-3-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_loader/main.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index ef904b8b112e..eb4085b92ad4 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -111,8 +111,7 @@ static bool fw_copy_to_prealloc_buf(struct firmware *fw, return true; } -static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, - void *buf, size_t size) +static bool firmware_request_builtin(struct firmware *fw, const char *name) { struct builtin_fw *b_fw; @@ -120,13 +119,21 @@ static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, if (strcmp(name, b_fw->name) == 0) { fw->size = b_fw->size; fw->data = b_fw->data; - return fw_copy_to_prealloc_buf(fw, buf, size); + return true; } } return false; } +static bool firmware_request_builtin_buf(struct firmware *fw, const char *name, + void *buf, size_t size) +{ + if (!firmware_request_builtin(fw, name)) + return false; + return fw_copy_to_prealloc_buf(fw, buf, size); +} + static bool fw_is_builtin_firmware(const struct firmware *fw) { struct builtin_fw *b_fw; @@ -140,9 +147,15 @@ static bool fw_is_builtin_firmware(const struct firmware *fw) #else /* Module case - no builtin firmware support */ -static inline bool fw_get_builtin_firmware(struct firmware *fw, - const char *name, void *buf, - size_t size) +static inline bool firmware_request_builtin(struct firmware *fw, + const char *name) +{ + return false; +} + +static inline bool firmware_request_builtin_buf(struct firmware *fw, + const char *name, void *buf, + size_t size) { return false; } @@ -737,7 +750,7 @@ _request_firmware_prepare(struct firmware **firmware_p, const char *name, return -ENOMEM; } - if (fw_get_builtin_firmware(firmware, name, dbuf, size)) { + if (firmware_request_builtin_buf(firmware, name, dbuf, size)) { dev_dbg(device, "using built-in %s\n", name); return 0; /* assigned */ } @@ -1216,7 +1229,7 @@ static int uncache_firmware(const char *fw_name) pr_debug("%s: %s\n", __func__, fw_name); - if (fw_get_builtin_firmware(&fw, fw_name, NULL, 0)) + if (firmware_request_builtin(&fw, fw_name)) return 0; fw_priv = lookup_fw_priv(fw_name); From 0f8d7ccc2eab3e2ef39e49002e23e9677896715a Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Fri, 17 Sep 2021 11:22:15 -0700 Subject: [PATCH 101/122] firmware_loader: add a sanity check for firmware_request_builtin() Right now firmware_request_builtin() is used internally only and so we have control over the callers. But if we want to expose that API more broadly we should ensure the firmware pointer is valid. This doesn't fix any known issue, it just prepares us to later expose this API to other users. Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20210917182226.3532898-4-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_loader/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index eb4085b92ad4..d95b5fe5f700 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -115,6 +115,9 @@ static bool firmware_request_builtin(struct firmware *fw, const char *name) { struct builtin_fw *b_fw; + if (!fw) + return false; + for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) { if (strcmp(name, b_fw->name) == 0) { fw->size = b_fw->size; From d7c5bf94475b8b8fb960c7cf90682086076934df Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Mon, 27 Sep 2021 09:38:01 -0700 Subject: [PATCH 102/122] fs/sysfs/dir.c: replace S_IRWXU|S_IRUGO|S_IXUGO with 0755 sysfs_create_dir_ns() If one ends up expanding on this line checkpatch will complain that the combination S_IRWXU|S_IRUGO|S_IXUGO should just be replaced with the octal 0755. Do that. This makes no functional changes. Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20210927163805.808907-9-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 59dffd5ca517..b6b6796e1616 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -56,8 +56,7 @@ int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) kobject_get_ownership(kobj, &uid, &gid); - kn = kernfs_create_dir_ns(parent, kobject_name(kobj), - S_IRWXU | S_IRUGO | S_IXUGO, uid, gid, + kn = kernfs_create_dir_ns(parent, kobject_name(kobj), 0755, uid, gid, kobj, ns); if (IS_ERR(kn)) { if (PTR_ERR(kn) == -EEXIST) From 216a0fc40897d87b4a282bba10b01e96ea6a1c45 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Tue, 12 Oct 2021 12:33:06 -0600 Subject: [PATCH 103/122] dyndbg: show module in vpr-info in dd-exec-queries dynamic_debug_exec_queries() accepts a separate module arg (so it can support $module.dyndbg boot arg), display that in the vpr-info for a more useful user-debug context. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20211012183310.1016678-2-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index cb5abb42c16a..dfe1e6a857bc 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -529,7 +529,7 @@ static int ddebug_exec_queries(char *query, const char *modname) if (!query || !*query || *query == '#') continue; - vpr_info("query %d: \"%s\"\n", i, query); + v2pr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*"); rc = ddebug_exec_query(query, modname); if (rc < 0) { From 5ca173974888368fecfb17ae6fe455df5fd2a9d2 Mon Sep 17 00:00:00 2001 From: Andrew Halaney Date: Wed, 13 Oct 2021 11:40:20 -0400 Subject: [PATCH 104/122] dyndbg: make dyndbg a known cli param Right now dyndbg shows up as an unknown parameter if used on boot: Unknown command line parameters: dyndbg=+p That's because it is unknown, it doesn't sit in the __param section, so the processing done to warn users supplying an unknown parameter doesn't think it is legitimate. Install a dummy handler to register it. dynamic debug needs to search the whole command line for modules listed that are currently builtin, so there's no real work to be done in this callback. Fixes: 86d1919a4fb0 ("init: print out unknown kernel parameters") Tested-by: Jim Cromie Signed-off-by: Andrew Halaney Signed-off-by: Jason Baron Link: https://lore.kernel.org/r/1634139622-20667-2-git-send-email-jbaron@akamai.com Signed-off-by: Greg Kroah-Hartman --- lib/dynamic_debug.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index dfe1e6a857bc..cd222a1c1238 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -761,6 +761,18 @@ static __init int ddebug_setup_query(char *str) __setup("ddebug_query=", ddebug_setup_query); +/* + * Install a noop handler to make dyndbg look like a normal kernel cli param. + * This avoids warnings about dyndbg being an unknown cli param when supplied + * by a user. + */ +static __init int dyndbg_setup(char *str) +{ + return 1; +} + +__setup("dyndbg=", dyndbg_setup); + /* * File_ops->write method for /dynamic_debug/control. Gathers the * command text from userspace, parses and executes it. From 9c40e1aa84123750773a57c9cf39112459a952dd Mon Sep 17 00:00:00 2001 From: Andrew Halaney Date: Wed, 13 Oct 2021 11:40:21 -0400 Subject: [PATCH 105/122] dyndbg: Remove support for ddebug_query param This param has been deprecated for a very long time now, let's rip it out. Signed-off-by: Andrew Halaney Signed-off-by: Jason Baron Link: https://lore.kernel.org/r/1634139622-20667-3-git-send-email-jbaron@akamai.com Signed-off-by: Greg Kroah-Hartman --- .../admin-guide/dynamic-debug-howto.rst | 6 ++--- .../admin-guide/kernel-parameters.txt | 5 ---- lib/dynamic_debug.c | 25 ------------------- 3 files changed, 2 insertions(+), 34 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index b119b8277b3e..d0911e7cc271 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -249,8 +249,7 @@ Debug messages during Boot Process To activate debug messages for core code and built-in modules during the boot process, even before userspace and debugfs exists, use -``dyndbg="QUERY"``, ``module.dyndbg="QUERY"``, or ``ddebug_query="QUERY"`` -(``ddebug_query`` is obsoleted by ``dyndbg``, and deprecated). QUERY follows +``dyndbg="QUERY"`` or ``module.dyndbg="QUERY"``. QUERY follows the syntax described above, but must not exceed 1023 characters. Your bootloader may impose lower limits. @@ -270,8 +269,7 @@ this boot parameter for debugging purposes. If ``foo`` module is not built-in, ``foo.dyndbg`` will still be processed at boot time, without effect, but will be reprocessed when module is -loaded later. ``ddebug_query=`` and bare ``dyndbg=`` are only processed at -boot. +loaded later. Bare ``dyndbg=`` is only processed at boot. Debug Messages at Module Initialization Time diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 91ba391f9b32..9c0c57d1ca78 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -841,11 +841,6 @@ Format: , See also Documentation/input/devices/joystick-parport.rst - ddebug_query= [KNL,DYNAMIC_DEBUG] Enable debug messages at early boot - time. See - Documentation/admin-guide/dynamic-debug-howto.rst for - details. Deprecated, see dyndbg. - debug [KNL] Enable kernel debugging (events log level). debug_boot_weak_hash diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index cd222a1c1238..a44ae0b4b022 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -746,21 +746,6 @@ EXPORT_SYMBOL(__dynamic_ibdev_dbg); #endif -#define DDEBUG_STRING_SIZE 1024 -static __initdata char ddebug_setup_string[DDEBUG_STRING_SIZE]; - -static __init int ddebug_setup_query(char *str) -{ - if (strlen(str) >= DDEBUG_STRING_SIZE) { - pr_warn("ddebug boot param string too large\n"); - return 0; - } - strlcpy(ddebug_setup_string, str, DDEBUG_STRING_SIZE); - return 1; -} - -__setup("ddebug_query=", ddebug_setup_query); - /* * Install a noop handler to make dyndbg look like a normal kernel cli param. * This avoids warnings about dyndbg being an unknown cli param when supplied @@ -1133,16 +1118,6 @@ static int __init dynamic_debug_init(void) entries, modct, (int)((modct * sizeof(struct ddebug_table)) >> 10), (int)((entries * sizeof(struct _ddebug)) >> 10)); - /* apply ddebug_query boot param, dont unload tables on err */ - if (ddebug_setup_string[0] != '\0') { - pr_warn("ddebug_query param name is deprecated, change it to dyndbg\n"); - ret = ddebug_exec_queries(ddebug_setup_string, NULL); - if (ret < 0) - pr_warn("Invalid ddebug boot param %s\n", - ddebug_setup_string); - else - pr_info("%d changes by ddebug_query\n", ret); - } /* now that ddebug tables are loaded, process all boot args * again to find and activate queries given in dyndbg params. * While this has already been done for known boot params, it From 5879f1c94d67e05401cddd2043649548e38d65d3 Mon Sep 17 00:00:00 2001 From: Andrew Halaney Date: Wed, 13 Oct 2021 11:40:22 -0400 Subject: [PATCH 106/122] Documentation: dyndbg: Improve cli param examples Jim pointed out that using $module.dyndbg= is always a more flexible choice for using dynamic debug on the command line. The $module.dyndbg style is checked at boot and handles if $module is a builtin. If it is actually a loadable module, it is handled again later when the module is loaded. If you just use dyndbg="module $module +p" dynamic debug is only enabled when $module is a builtin. It was recommended to illustrate wildcard usage as well. Suggested-by: Jim Cromie Signed-off-by: Andrew Halaney Signed-off-by: Jason Baron Link: https://lore.kernel.org/r/1634139622-20667-4-git-send-email-jbaron@akamai.com Signed-off-by: Greg Kroah-Hartman --- Documentation/admin-guide/dynamic-debug-howto.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index d0911e7cc271..ae264aab42b6 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -357,7 +357,10 @@ Examples Kernel command line: ... // see whats going on in dyndbg=value processing dynamic_debug.verbose=1 - // enable pr_debugs in 2 builtins, #cmt is stripped - dyndbg="module params +p #cmt ; module sys +p" + // enable pr_debugs in the btrfs module (can be builtin or loadable) + btrfs.dyndbg="+p" + // enable pr_debugs in all files under init/ + // and the function parse_one, #cmt is stripped + dyndbg="file init/* +p #cmt ; func parse_one +p" // enable pr_debugs in 2 functions in a module loaded later pc87360.dyndbg="func pc87360_init_device +p; func pc87360_find +p" From f0ada6da3a0d69682e21f1783d02676e0fbf1bc1 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 13 Oct 2021 17:37:07 +0300 Subject: [PATCH 107/122] device property: Add missed header in fwnode.h When adding some stuff to the header file we must not rely on implicit dependencies that are happen by luck or bugs in other headers. Hence fwnode.h needs to use bits.h directly. Fixes: c2c724c868c4 ("driver core: Add fw_devlink_parse_fwtree()") Cc: Saravana Kannan Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211013143707.80222-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- include/linux/fwnode.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 9f4ad719bfe3..3a532ba66f6c 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h @@ -11,6 +11,7 @@ #include #include +#include #include struct fwnode_operations; From 7a5e202dfb8ab7572eba703e43f08dabdc8b7808 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Wed, 13 Oct 2021 16:07:25 -0600 Subject: [PATCH 108/122] dyndbg: vpr-info on remove-module complete, not starting On qemu --smp 3 runs, remove-module can get called 3 times. So don't print on entry; instead print "removed" after entry is found and removed, so just once. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20211013220726.1280565-3-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman --- lib/dynamic_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a44ae0b4b022..d706abba8dad 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1025,8 +1025,6 @@ int ddebug_remove_module(const char *mod_name) struct ddebug_table *dt, *nextdt; int ret = -ENOENT; - v2pr_info("removing module \"%s\"\n", mod_name); - mutex_lock(&ddebug_lock); list_for_each_entry_safe(dt, nextdt, &ddebug_tables, link) { if (dt->mod_name == mod_name) { @@ -1036,6 +1034,8 @@ int ddebug_remove_module(const char *mod_name) } } mutex_unlock(&ddebug_lock); + if (!ret) + v2pr_info("removed module \"%s\"\n", mod_name); return ret; } From 7edde0c807855a5bf149c6be3edfa11ecd919571 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Wed, 13 Oct 2021 16:07:26 -0600 Subject: [PATCH 109/122] dyndbg: no vpr-info on empty queries when `echo $cmd > control` contains multiple queries, extra query separators (;\n) can parse as empty statements. This is normal, and a vpr-info on an empty command is just noise. Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20211013220726.1280565-4-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman --- lib/dynamic_debug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d706abba8dad..ad80f1346c3f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -540,8 +540,10 @@ static int ddebug_exec_queries(char *query, const char *modname) } i++; } - vpr_info("processed %d queries, with %d matches, %d errs\n", - i, nfound, errs); + + if (i) + vpr_info("processed %d queries, with %d matches, %d errs\n", + i, nfound, errs); if (exitcode) return exitcode; From 1f8818e352f721c49ebea39025f6c98f25756eff Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Thu, 14 Oct 2021 16:36:14 -0600 Subject: [PATCH 110/122] dyndbg: fix spurious vNpr_info change The cited commit inadvertently altered the verbose level of a vpr_info, restore it to original. Fixes: 216a0fc40897 ("dyndbg: show module in vpr-info in dd-exec-queries") Signed-off-By: Jim Cromie Link: https://lore.kernel.org/r/20211014223614.1952171-1-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ad80f1346c3f..87b1b0121234 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -529,7 +529,7 @@ static int ddebug_exec_queries(char *query, const char *modname) if (!query || !*query || *query == '#') continue; - v2pr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*"); + vpr_info("query %d: \"%s\" mod:%s\n", i, query, modname ?: "*"); rc = ddebug_exec_query(query, modname); if (rc < 0) { From a164ff53cbd34479aeac3366840669b10845ce53 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 14 Oct 2021 16:47:54 +0300 Subject: [PATCH 111/122] driver core: Provide device_match_acpi_handle() helper We have a couple of users of this helper, make it available for them. The prototype for the helper is specifically crafted in order to be easily used with bus_find_device() call. That's why its location is in the driver core rather than ACPI. Reviewed-by: Rafael J. Wysocki Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211014134756.39092-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 6 ++++++ include/linux/device/bus.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index b67ebe6a323c..fd034d742447 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4838,6 +4838,12 @@ int device_match_acpi_dev(struct device *dev, const void *adev) } EXPORT_SYMBOL(device_match_acpi_dev); +int device_match_acpi_handle(struct device *dev, const void *handle) +{ + return ACPI_HANDLE(dev) == handle; +} +EXPORT_SYMBOL(device_match_acpi_handle); + int device_match_any(struct device *dev, const void *unused) { return 1; diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index 062777a45a74..a039ab809753 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -143,6 +143,7 @@ int device_match_of_node(struct device *dev, const void *np); int device_match_fwnode(struct device *dev, const void *fwnode); int device_match_devt(struct device *dev, const void *pdevt); int device_match_acpi_dev(struct device *dev, const void *adev); +int device_match_acpi_handle(struct device *dev, const void *handle); int device_match_any(struct device *dev, const void *unused); /* iterator helpers for buses */ From 0a2d47aa32f0e972a136ddea15bddfdd9957e292 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 14 Oct 2021 16:47:55 +0300 Subject: [PATCH 112/122] i2c: acpi: Replace custom function with device_match_acpi_handle() Since driver core provides a generic device_match_acpi_handle() we may replace the custom one with it. This unifies code to find an adapter with the similar one which finds a client. Acked-by: Wolfram Sang Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20211014134756.39092-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/i2c-core-acpi.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 546cc935e035..80631f93ad2f 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -398,24 +398,20 @@ u32 i2c_acpi_find_bus_speed(struct device *dev) } EXPORT_SYMBOL_GPL(i2c_acpi_find_bus_speed); -static int i2c_acpi_find_match_adapter(struct device *dev, const void *data) -{ - struct i2c_adapter *adapter = i2c_verify_adapter(dev); - - if (!adapter) - return 0; - - return ACPI_HANDLE(dev) == (acpi_handle)data; -} - struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle) { + struct i2c_adapter *adapter; struct device *dev; - dev = bus_find_device(&i2c_bus_type, NULL, handle, - i2c_acpi_find_match_adapter); + dev = bus_find_device(&i2c_bus_type, NULL, handle, device_match_acpi_handle); + if (!dev) + return NULL; - return dev ? i2c_verify_adapter(dev) : NULL; + adapter = i2c_verify_adapter(dev); + if (!adapter) + put_device(dev); + + return adapter; } EXPORT_SYMBOL_GPL(i2c_acpi_find_adapter_by_handle); From adb5151fa82ca8cc511c7d6bf80842281c09ea42 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 14 Oct 2021 16:47:56 +0300 Subject: [PATCH 113/122] gpiolib: acpi: Replace custom code with device_match_acpi_handle() Since driver core provides a generic device_match_acpi_handle() we may replace the custom code with it. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20211014134756.39092-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpiolib-acpi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 47712b6903b5..985e8589c58b 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -95,10 +95,7 @@ static bool acpi_gpio_deferred_req_irqs_done; static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) { - if (!gc->parent) - return false; - - return ACPI_HANDLE(gc->parent) == data; + return gc->parent && device_match_acpi_handle(gc->parent, data); } /** From 09ee10ff804ec4bc58eb9849226312ff1c4d7e7b Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Tue, 19 Oct 2021 15:07:46 -0600 Subject: [PATCH 114/122] dyndbg: refine verbosity 1-4 summary-detail adjust current v*pr_info() calls to fit an overview..detail scheme: 1- module level activity: add/remove, etc 2- command ingest, splitting, summary of effects. per >control write 3- command parsing: op, flags, search terms 4- per-site change msg can yield ~3k x 2 logs per echo "+p;-p" > command. Summarize these 4 levels in MODULE_PARM_DESC, and update verbose=3 in Doc. 2- is new, to isolate a problem where a stress-test script (which feeds ~4kb multi-command strings) would produce short writes, truncating last command and causing parsing errors, which confused test results. The script fix was to use syswrite, to deliver full proper commands. 4- gets per-callsite "changed:" pr-infos, which are very noisy during stress tests, and formerly obscured v1-3 messages, and overwhelmed the static-key workload being tested. The verbose parameter has previously seen adjustment: commit 481c0e33f1e7 ("dyndbg: refine debug verbosity; 1 is basic, 2 more chatty") The script driving these adjustments is: !/usr/bin/perl -w =for Doc 1st purpose was to benchmark the effect of wildcard queries on query performance; if wildcards are risk free cheap enough, we can deploy them in the (floating) format search. 1st finding: wildcards take 2x as long to process. 2nd purpose was to benchmark real static-key changes VS simple flag changes. Found ~100x decrease for the hard work. The script maximizes workload per >control by packing it a ~4kb string of "+p; -p;" commands; this uncovered some broken stuff. The 85th query failed, and appears to be truncated, so is gramatically incorrect. Its either an error here, or in the kernel. Its not happening atm, retest. Plot thickens: fail only happens doing +-p, not +-mf, likely load dependent. Error remains consistent. Looks like a short write, longer on writer than kernel-reader. Try syswrite on handle to control this. That fixed short write. =cut use Getopt::Std; getopts('vN:k:', \my %opts) or die <', $ctrl) or die "cant open $ctrl for writing: $!\n"; sub vx { my $arg = shift; my $cmd = "echo $arg > /sys/module/dynamic_debug/parameters/verbose"; system($cmd); warn("vx problem: rc:$? err:$! qry: $cmd\n") if ($?); } sub qryOK { my $qry = shift; print "syntax test: <\n$qry>\n" if $opts{v}; my $bytes = syswrite $CTL, $qry; printf "short read: $bytes / %d\n", length $qry if $bytes < length $qry; if ($?) { warn "rc:$? err:$! qry: $qry\n"; return 0; } return 1; } sub build_queries { my ($cmd, $flags, $ct) = @_; # build experiment and reference queries my $cycle = " $cmd +$flags # on ; $cmd -$flags # off \n"; my $ref = " +$flags ; -$flags \n"; my $len = length $cycle; my $max = int(4096 / $len); # break/fit to buffer size $ct |= $max; print "qry: ct:$max x << \n$cycle >>\n"; return unless qryOK($ref); return unless qryOK($cycle); my $wild = $cycle x $ct; my $empty = $ref x $ct; printf "len: %d, %d\n", length $wild, length $empty; return { trial => $wild, ref => $empty, probe => $cycle, zero => $ref, count => $ct, max => $max }; } my $query_set = build_queries(' file "*" module "*" func "*" ', "mf"); qryOK($query_set->{zero}); qryOK($query_set->{probe}); qryOK($query_set->{ref}); qryOK($query_set->{trial}); use Benchmark; sub dobatch { my ($cmd, $flags, $reps, $ct) = @_; $reps ||= $opts{N}; my $qs = build_queries($cmd, $flags, $ct); timethese($reps, { wildcards => sub { syswrite $CTL, $qs->{trial}; }, no_search => sub { syswrite $CTL, $qs->{ref}; } } ); } sub bench_static_key_toggle { vx 0; dobatch(' file "*" module "*" func "*" ', "mf"); dobatch(' file "*" module "*" func "*" ', "p"); } sub bench_verbose_levels { for my $i (0..4) { vx $i; dobatch(' file "*" module "*" func "*" ', "mf"); } } bench_static_key_toggle(); __END__ Heres how the test-script runs: :: verbose=3 parsing info [ 48.401646] dyndbg: query 95: "file "*" module "*" func "*" -mf # off " mod:* [ 48.402040] dyndbg: split into words: "file" "*" "module" "*" "func" "*" "-mf" [ 48.402456] dyndbg: op='-' [ 48.402615] dyndbg: flags=0x6 [ 48.402779] dyndbg: *flagsp=0x0 *maskp=0xfffffff9 [ 48.403033] dyndbg: parsed: func="*" file="*" module="*" format="" lineno=0-0 [ 48.403674] dyndbg: applied: func="*" file="*" module="*" format="" lineno=0-0 :: verbose=2 >control summary. ~300k site matches/changes per 4kb command [ 48.404063] dyndbg: processed 96 queries, with 296160 matches, 0 errs :: 2 queries against each other, no-search vs all-wildcard-search qry: ct:48 x << file "*" module "*" func "*" +mf # on ; file "*" module "*" func "*" -mf # off >> len: 4080, 576 Benchmark: timing 10 iterations of no_search, wildcards... no_search: 0 wallclock secs ( 0.00 usr + 0.03 sys = 0.03 CPU) @ 333.33/s (n=10) (warning: too few iterations for a reliable count) wildcards: 0 wallclock secs ( 0.00 usr + 0.09 sys = 0.09 CPU) @ 111.11/s (n=10) (warning: too few iterations for a reliable count) :: 2 queries, both doing real work / changing stati-key states. qry: ct:49 x << file "*" module "*" func "*" +p # on ; file "*" module "*" func "*" -p # off >> len: 4067, 490 Benchmark: timing 10 iterations of no_search, wildcards... no_search: 20 wallclock secs ( 0.00 usr + 20.36 sys = 20.36 CPU) @ 0.49/s (n=10) wildcards: 21 wallclock secs ( 0.00 usr + 21.08 sys = 21.08 CPU) @ 0.47/s (n=10) bash-5.1# Thats 150k static-key-toggles / sec ~600x slower than simple flags on qemu --smp 3 run Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20211019210746.185307-1-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../admin-guide/dynamic-debug-howto.rst | 2 +- lib/dynamic_debug.c | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index ae264aab42b6..a89cfa083155 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -356,7 +356,7 @@ Examples // boot-args example, with newlines and comments for readability Kernel command line: ... // see whats going on in dyndbg=value processing - dynamic_debug.verbose=1 + dynamic_debug.verbose=3 // enable pr_debugs in the btrfs module (can be builtin or loadable) btrfs.dyndbg="+p" // enable pr_debugs in all files under init/ diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 87b1b0121234..dd7f56af9aed 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -71,6 +71,8 @@ static DEFINE_MUTEX(ddebug_lock); static LIST_HEAD(ddebug_tables); static int verbose; module_param(verbose, int, 0644); +MODULE_PARM_DESC(verbose, " dynamic_debug/control processing " + "( 0 = off (default), 1 = module add/rm, 2 = >control summary, 3 = parsing, 4 = per-site changes)"); /* Return the path relative to source root */ static inline const char *trim_prefix(const char *path) @@ -118,6 +120,8 @@ do { \ #define vpr_info(fmt, ...) vnpr_info(1, fmt, ##__VA_ARGS__) #define v2pr_info(fmt, ...) vnpr_info(2, fmt, ##__VA_ARGS__) +#define v3pr_info(fmt, ...) vnpr_info(3, fmt, ##__VA_ARGS__) +#define v4pr_info(fmt, ...) vnpr_info(4, fmt, ##__VA_ARGS__) static void vpr_info_dq(const struct ddebug_query *query, const char *msg) { @@ -130,7 +134,7 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) fmtlen--; } - vpr_info("%s: func=\"%s\" file=\"%s\" module=\"%s\" format=\"%.*s\" lineno=%u-%u\n", + v3pr_info("%s: func=\"%s\" file=\"%s\" module=\"%s\" format=\"%.*s\" lineno=%u-%u\n", msg, query->function ?: "", query->filename ?: "", @@ -213,7 +217,7 @@ static int ddebug_change(const struct ddebug_query *query, static_branch_enable(&dp->key.dd_key_true); #endif dp->flags = newflags; - v2pr_info("changed %s:%d [%s]%s =%s\n", + v4pr_info("changed %s:%d [%s]%s =%s\n", trim_prefix(dp->filename), dp->lineno, dt->mod_name, dp->function, ddebug_describe_flags(dp->flags, &fbuf)); @@ -273,7 +277,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) buf = end; } - if (verbose) { + if (verbose >= 3) { int i; pr_info("split into words:"); for (i = 0; i < nwords; i++) @@ -333,7 +337,7 @@ static int parse_linerange(struct ddebug_query *query, const char *first) } else { query->last_lineno = query->first_lineno; } - vpr_info("parsed line %d-%d\n", query->first_lineno, + v3pr_info("parsed line %d-%d\n", query->first_lineno, query->last_lineno); return 0; } @@ -447,7 +451,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - vpr_info("op='%c'\n", op); + v3pr_info("op='%c'\n", op); for (; *str ; ++str) { for (i = ARRAY_SIZE(opt_array) - 1; i >= 0; i--) { @@ -461,7 +465,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) return -EINVAL; } } - vpr_info("flags=0x%x\n", modifiers->flags); + v3pr_info("flags=0x%x\n", modifiers->flags); /* calculate final flags, mask based upon op */ switch (op) { @@ -477,7 +481,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) modifiers->flags = 0; break; } - vpr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask); + v3pr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask); return 0; } @@ -540,9 +544,8 @@ static int ddebug_exec_queries(char *query, const char *modname) } i++; } - if (i) - vpr_info("processed %d queries, with %d matches, %d errs\n", + v2pr_info("processed %d queries, with %d matches, %d errs\n", i, nfound, errs); if (exitcode) @@ -780,7 +783,7 @@ static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf, tmpbuf = memdup_user_nul(ubuf, len); if (IS_ERR(tmpbuf)) return PTR_ERR(tmpbuf); - vpr_info("read %d bytes from userspace\n", (int)len); + v2pr_info("read %zu bytes from userspace\n", len); ret = ddebug_exec_queries(tmpbuf, NULL); kfree(tmpbuf); @@ -968,7 +971,7 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, list_add(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); - v2pr_info("%3u debug prints in module %s\n", n, dt->mod_name); + vpr_info("%3u debug prints in module %s\n", n, dt->mod_name); return 0; } From c87761db2100677a69be551365105125d872af5b Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 13 Oct 2021 19:13:45 +0300 Subject: [PATCH 115/122] component: do not leave master devres group open after bind In current code, the devres group for aggregate master is left open after call to component_master_add_*(). This leads to problems when the master does further managed allocations on its own. When any participating driver calls component_del(), this leads to immediate release of resources. This came up when investigating a page fault occurring with i915 DRM driver unbind with 5.15-rc1 kernel. The following sequence occurs: i915_pci_remove() -> intel_display_driver_unregister() -> i915_audio_component_cleanup() -> component_del() -> component.c:take_down_master() -> hdac_component_master_unbind() [via master->ops->unbind()] -> devres_release_group(master->parent, NULL) With older kernels this has not caused issues, but with audio driver moving to use managed interfaces for more of its allocations, this no longer works. Devres log shows following to occur: component_master_add_with_match() [ 126.886032] snd_hda_intel 0000:00:1f.3: DEVRES ADD 00000000323ccdc5 devm_component_match_release (24 bytes) [ 126.886045] snd_hda_intel 0000:00:1f.3: DEVRES ADD 00000000865cdb29 grp< (0 bytes) [ 126.886049] snd_hda_intel 0000:00:1f.3: DEVRES ADD 000000001b480725 grp< (0 bytes) audio driver completes its PCI probe() [ 126.892238] snd_hda_intel 0000:00:1f.3: DEVRES ADD 000000001b480725 pcim_iomap_release (48 bytes) component_del() called() at DRM/i915 unbind() [ 137.579422] i915 0000:00:02.0: DEVRES REL 00000000ef44c293 grp< (0 bytes) [ 137.579445] snd_hda_intel 0000:00:1f.3: DEVRES REL 00000000865cdb29 grp< (0 bytes) [ 137.579458] snd_hda_intel 0000:00:1f.3: DEVRES REL 000000001b480725 pcim_iomap_release (48 bytes) So the "devres_release_group(master->parent, NULL)" ends up freeing the pcim_iomap allocation. Upon next runtime resume, the audio driver will cause a page fault as the iomap alloc was released without the driver knowing about it. Fix this issue by using the "struct master" pointer as identifier for the devres group, and by closing the devres group after the master->ops->bind() call is done. This allows devres allocations done by the driver acting as master to be isolated from the binding state of the aggregate driver. This modifies the logic originally introduced in commit 9e1ccb4a7700 ("drivers/base: fix devres handling for master device") Fixes: 9e1ccb4a7700 ("drivers/base: fix devres handling for master device") Cc: stable@vger.kernel.org Acked-by: Imre Deak Acked-by: Russell King (Oracle) Signed-off-by: Kai Vehmanen BugLink: https://gitlab.freedesktop.org/drm/intel/-/issues/4136 Link: https://lore.kernel.org/r/20211013161345.3755341-1-kai.vehmanen@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/component.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index 6dc309913ccd..2d25a6416587 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -245,7 +245,7 @@ static int try_to_bring_up_master(struct master *master, return 0; } - if (!devres_open_group(master->parent, NULL, GFP_KERNEL)) + if (!devres_open_group(master->parent, master, GFP_KERNEL)) return -ENOMEM; /* Found all components */ @@ -257,6 +257,7 @@ static int try_to_bring_up_master(struct master *master, return ret; } + devres_close_group(master->parent, NULL); master->bound = true; return 1; } @@ -281,7 +282,7 @@ static void take_down_master(struct master *master) { if (master->bound) { master->ops->unbind(master->parent); - devres_release_group(master->parent, NULL); + devres_release_group(master->parent, master); master->bound = false; } } From 48d09e97876bed4bcc503d528bdba8c907e43cb3 Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Thu, 21 Oct 2021 08:58:34 -0700 Subject: [PATCH 116/122] firmware_loader: formalize built-in firmware API Formalize the built-in firmware with a proper API. This can later be used by other callers where all they need is built-in firmware. We export the firmware_request_builtin() call for now only under the TEST_FIRMWARE symbol namespace as there are no direct modular users for it. If they pop up they are free to export it generally. Built-in code always gets access to the callers and we'll demonstrate a hidden user which has been lurking in the kernel for a while and the reason why using a proper API was better long term. Reviewed-by: Borislav Petkov Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20211021155843.1969401-2-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_loader/builtin/Makefile | 6 +- drivers/base/firmware_loader/builtin/main.c | 100 ++++++++++++++++++ drivers/base/firmware_loader/firmware.h | 17 +++ drivers/base/firmware_loader/main.c | 78 +------------- include/linux/firmware.h | 15 +++ 5 files changed, 137 insertions(+), 79 deletions(-) create mode 100644 drivers/base/firmware_loader/builtin/main.c diff --git a/drivers/base/firmware_loader/builtin/Makefile b/drivers/base/firmware_loader/builtin/Makefile index 101754ad48d9..eb4be452062a 100644 --- a/drivers/base/firmware_loader/builtin/Makefile +++ b/drivers/base/firmware_loader/builtin/Makefile @@ -1,11 +1,13 @@ # SPDX-License-Identifier: GPL-2.0 +obj-y += main.o # Create $(fwdir) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a # leading /, it's relative to $(srctree). fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR)) fwdir := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir)) -obj-y := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE))) +firmware := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE))) +obj-y += $(firmware) FWNAME = $(patsubst $(obj)/%.gen.S,%,$@) FWSTR = $(subst $(comma),_,$(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME))))) @@ -34,7 +36,7 @@ $(obj)/%.gen.S: FORCE $(call filechk,fwbin) # The .o files depend on the binaries directly; the .S files don't. -$(addprefix $(obj)/, $(obj-y)): $(obj)/%.gen.o: $(fwdir)/% +$(addprefix $(obj)/, $(firmware)): $(obj)/%.gen.o: $(fwdir)/% targets := $(patsubst $(obj)/%,%, \ $(shell find $(obj) -name \*.gen.S 2>/dev/null)) diff --git a/drivers/base/firmware_loader/builtin/main.c b/drivers/base/firmware_loader/builtin/main.c new file mode 100644 index 000000000000..d85626b2fdf5 --- /dev/null +++ b/drivers/base/firmware_loader/builtin/main.c @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Builtin firmware support */ + +#include +#include "../firmware.h" + +/* Only if FW_LOADER=y */ +#ifdef CONFIG_FW_LOADER + +extern struct builtin_fw __start_builtin_fw[]; +extern struct builtin_fw __end_builtin_fw[]; + +static bool fw_copy_to_prealloc_buf(struct firmware *fw, + void *buf, size_t size) +{ + if (!buf) + return true; + if (size < fw->size) + return false; + memcpy(buf, fw->data, fw->size); + return true; +} + +/** + * firmware_request_builtin() - load builtin firmware + * @fw: pointer to firmware struct + * @name: name of firmware file + * + * Some use cases in the kernel have a requirement so that no memory allocator + * is involved as these calls take place early in boot process. An example is + * the x86 CPU microcode loader. In these cases all the caller wants is to see + * if the firmware was built-in and if so use it right away. This can be used + * for such cases. + * + * This looks for the firmware in the built-in kernel. Only if the kernel was + * built-in with the firmware you are looking for will this return successfully. + * + * Callers of this API do not need to use release_firmware() as the pointer to + * the firmware is expected to be provided locally on the stack of the caller. + **/ +bool firmware_request_builtin(struct firmware *fw, const char *name) +{ + struct builtin_fw *b_fw; + + if (!fw) + return false; + + for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) { + if (strcmp(name, b_fw->name) == 0) { + fw->size = b_fw->size; + fw->data = b_fw->data; + return true; + } + } + + return false; +} +EXPORT_SYMBOL_NS_GPL(firmware_request_builtin, TEST_FIRMWARE); + +/** + * firmware_request_builtin_buf() - load builtin firmware into optional buffer + * @fw: pointer to firmware struct + * @name: name of firmware file + * @buf: If set this lets you use a pre-allocated buffer so that the built-in + * firmware into is copied into. This field can be NULL. It is used by + * callers such as request_firmware_into_buf() and + * request_partial_firmware_into_buf() + * @size: if buf was provided, the max size of the allocated buffer available. + * If the built-in firmware does not fit into the pre-allocated @buf this + * call will fail. + * + * This looks for the firmware in the built-in kernel. Only if the kernel was + * built-in with the firmware you are looking for will this call possibly + * succeed. If you passed a @buf the firmware will be copied into it *iff* the + * built-in firmware fits into the pre-allocated buffer size specified in + * @size. + * + * This caller is to be used internally by the firmware_loader only. + **/ +bool firmware_request_builtin_buf(struct firmware *fw, const char *name, + void *buf, size_t size) +{ + if (!firmware_request_builtin(fw, name)) + return false; + + return fw_copy_to_prealloc_buf(fw, buf, size); +} + +bool firmware_is_builtin(const struct firmware *fw) +{ + struct builtin_fw *b_fw; + + for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) + if (fw->data == b_fw->data) + return true; + + return false; +} + +#endif diff --git a/drivers/base/firmware_loader/firmware.h b/drivers/base/firmware_loader/firmware.h index a3014e9e2c85..2889f446ad41 100644 --- a/drivers/base/firmware_loader/firmware.h +++ b/drivers/base/firmware_loader/firmware.h @@ -151,6 +151,23 @@ static inline void fw_state_done(struct fw_priv *fw_priv) int assign_fw(struct firmware *fw, struct device *device); +#ifdef CONFIG_FW_LOADER +bool firmware_is_builtin(const struct firmware *fw); +bool firmware_request_builtin_buf(struct firmware *fw, const char *name, + void *buf, size_t size); +#else /* module case */ +static inline bool firmware_is_builtin(const struct firmware *fw) +{ + return false; +} +static inline bool firmware_request_builtin_buf(struct firmware *fw, + const char *name, + void *buf, size_t size) +{ + return false; +} +#endif + #ifdef CONFIG_FW_LOADER_PAGED_BUF void fw_free_paged_buf(struct fw_priv *fw_priv); int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed); diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index d95b5fe5f700..94d1789a233e 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -93,82 +93,6 @@ DEFINE_MUTEX(fw_lock); static struct firmware_cache fw_cache; -/* Builtin firmware support */ - -#ifdef CONFIG_FW_LOADER - -extern struct builtin_fw __start_builtin_fw[]; -extern struct builtin_fw __end_builtin_fw[]; - -static bool fw_copy_to_prealloc_buf(struct firmware *fw, - void *buf, size_t size) -{ - if (!buf) - return true; - if (size < fw->size) - return false; - memcpy(buf, fw->data, fw->size); - return true; -} - -static bool firmware_request_builtin(struct firmware *fw, const char *name) -{ - struct builtin_fw *b_fw; - - if (!fw) - return false; - - for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) { - if (strcmp(name, b_fw->name) == 0) { - fw->size = b_fw->size; - fw->data = b_fw->data; - return true; - } - } - - return false; -} - -static bool firmware_request_builtin_buf(struct firmware *fw, const char *name, - void *buf, size_t size) -{ - if (!firmware_request_builtin(fw, name)) - return false; - return fw_copy_to_prealloc_buf(fw, buf, size); -} - -static bool fw_is_builtin_firmware(const struct firmware *fw) -{ - struct builtin_fw *b_fw; - - for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) - if (fw->data == b_fw->data) - return true; - - return false; -} - -#else /* Module case - no builtin firmware support */ - -static inline bool firmware_request_builtin(struct firmware *fw, - const char *name) -{ - return false; -} - -static inline bool firmware_request_builtin_buf(struct firmware *fw, - const char *name, void *buf, - size_t size) -{ - return false; -} - -static inline bool fw_is_builtin_firmware(const struct firmware *fw) -{ - return false; -} -#endif - static void fw_state_init(struct fw_priv *fw_priv) { struct fw_state *fw_st = &fw_priv->fw_st; @@ -1068,7 +992,7 @@ EXPORT_SYMBOL(request_partial_firmware_into_buf); void release_firmware(const struct firmware *fw) { if (fw) { - if (!fw_is_builtin_firmware(fw)) + if (!firmware_is_builtin(fw)) firmware_free_data(fw); kfree(fw); } diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 25109192cebe..d743a8d1c2fe 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -20,12 +20,19 @@ struct firmware { struct module; struct device; +/* + * Built-in firmware functionality is only available if FW_LOADER=y, but not + * FW_LOADER=m + */ +#ifdef CONFIG_FW_LOADER struct builtin_fw { char *name; void *data; unsigned long size; }; +bool firmware_request_builtin(struct firmware *fw, const char *name); + /* We have to play tricks here much like stringify() to get the __COUNTER__ macro to be expanded as we want it */ #define __fw_concat1(x, y) x##y @@ -38,6 +45,14 @@ struct builtin_fw { static const struct builtin_fw __fw_concat(__builtin_fw,__COUNTER__) \ __used __section(".builtin_fw") = { name, blob, size } +#else +static inline bool firmware_request_builtin(struct firmware *fw, + const char *name) +{ + return false; +} +#endif + #if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE)) int request_firmware(const struct firmware **fw, const char *name, struct device *device); From e520ecf4546fdaa7169ba75a35d24e2c53403a6e Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Thu, 21 Oct 2021 08:58:35 -0700 Subject: [PATCH 117/122] firmware_loader: remove old DECLARE_BUILTIN_FIRMWARE() This was never used upstream. Time to get rid of it. We don't carry around unused baggage. Reviewed-by: Borislav Petkov Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20211021155843.1969401-3-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- include/linux/firmware.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/include/linux/firmware.h b/include/linux/firmware.h index d743a8d1c2fe..34e8d5844fa0 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -32,19 +32,6 @@ struct builtin_fw { }; bool firmware_request_builtin(struct firmware *fw, const char *name); - -/* We have to play tricks here much like stringify() to get the - __COUNTER__ macro to be expanded as we want it */ -#define __fw_concat1(x, y) x##y -#define __fw_concat(x, y) __fw_concat1(x, y) - -#define DECLARE_BUILTIN_FIRMWARE(name, blob) \ - DECLARE_BUILTIN_FIRMWARE_SIZE(name, &(blob), sizeof(blob)) - -#define DECLARE_BUILTIN_FIRMWARE_SIZE(name, blob, size) \ - static const struct builtin_fw __fw_concat(__builtin_fw,__COUNTER__) \ - __used __section(".builtin_fw") = { name, blob, size } - #else static inline bool firmware_request_builtin(struct firmware *fw, const char *name) From 9d48960414c708f5d1327aa8b90664cf3467c480 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 21 Oct 2021 08:58:36 -0700 Subject: [PATCH 118/122] x86/microcode: Use the firmware_loader built-in API The microcode loader has been looping through __start_builtin_fw down to __end_builtin_fw to look for possibly built-in firmware for microcode updates. Now that the firmware loader code has exported an API for looping through the kernel's built-in firmware section, use it and drop the x86 implementation in favor. Signed-off-by: Borislav Petkov Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20211021155843.1969401-4-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/microcode.h | 3 --- arch/x86/kernel/cpu/microcode/amd.c | 14 ++++++++++---- arch/x86/kernel/cpu/microcode/core.c | 17 ----------------- arch/x86/kernel/cpu/microcode/intel.c | 9 ++++++++- 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h index ab45a220fac4..d6bfdfb0f0af 100644 --- a/arch/x86/include/asm/microcode.h +++ b/arch/x86/include/asm/microcode.h @@ -130,14 +130,11 @@ static inline unsigned int x86_cpuid_family(void) extern void __init load_ucode_bsp(void); extern void load_ucode_ap(void); void reload_early_microcode(void); -extern bool get_builtin_firmware(struct cpio_data *cd, const char *name); extern bool initrd_gone; #else static inline void __init load_ucode_bsp(void) { } static inline void load_ucode_ap(void) { } static inline void reload_early_microcode(void) { } -static inline bool -get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; } #endif #endif /* _ASM_X86_MICROCODE_H */ diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 3d4a48336084..8b2fcdfa6d31 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -456,17 +456,23 @@ apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_p static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family) { -#ifdef CONFIG_X86_64 char fw_name[36] = "amd-ucode/microcode_amd.bin"; + struct firmware fw; + + if (IS_ENABLED(CONFIG_X86_32)) + return false; if (family >= 0x15) snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin", family); - return get_builtin_firmware(cp, fw_name); -#else + if (firmware_request_builtin(&fw, fw_name)) { + cp->size = fw.size; + cp->data = (void *)fw.data; + return true; + } + return false; -#endif } static void __load_ucode_amd(unsigned int cpuid_1_eax, struct cpio_data *ret) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index efb69be41ab1..f955d25076ba 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -140,23 +140,6 @@ static bool __init check_loader_disabled_bsp(void) return *res; } -extern struct builtin_fw __start_builtin_fw[]; -extern struct builtin_fw __end_builtin_fw[]; - -bool get_builtin_firmware(struct cpio_data *cd, const char *name) -{ - struct builtin_fw *b_fw; - - for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) { - if (!strcmp(name, b_fw->name)) { - cd->size = b_fw->size; - cd->data = b_fw->data; - return true; - } - } - return false; -} - void __init load_ucode_bsp(void) { unsigned int cpuid_1_eax; diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 7e8e07bddd5f..d28a9f8f3fec 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -456,6 +456,7 @@ static void save_mc_for_early(struct ucode_cpu_info *uci, u8 *mc, unsigned int s static bool load_builtin_intel_microcode(struct cpio_data *cp) { unsigned int eax = 1, ebx, ecx = 0, edx; + struct firmware fw; char name[30]; if (IS_ENABLED(CONFIG_X86_32)) @@ -466,7 +467,13 @@ static bool load_builtin_intel_microcode(struct cpio_data *cp) sprintf(name, "intel-ucode/%02x-%02x-%02x", x86_family(eax), x86_model(eax), x86_stepping(eax)); - return get_builtin_firmware(cp, name); + if (firmware_request_builtin(&fw, name)) { + cp->size = fw.size; + cp->data = (void *)fw.data; + return true; + } + + return false; } /* From e2e2c0f20f321b0ec36e8bde467259c0adf1fecb Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Thu, 21 Oct 2021 08:58:37 -0700 Subject: [PATCH 119/122] firmware_loader: move struct builtin_fw to the only place used Now that x86 doesn't abuse picking at internals to the firmware loader move out the built-in firmware struct to its only user. Reviewed-by: Borislav Petkov Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20211021155843.1969401-5-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_loader/builtin/main.c | 6 ++++++ include/linux/firmware.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/base/firmware_loader/builtin/main.c b/drivers/base/firmware_loader/builtin/main.c index d85626b2fdf5..a065c3150897 100644 --- a/drivers/base/firmware_loader/builtin/main.c +++ b/drivers/base/firmware_loader/builtin/main.c @@ -7,6 +7,12 @@ /* Only if FW_LOADER=y */ #ifdef CONFIG_FW_LOADER +struct builtin_fw { + char *name; + void *data; + unsigned long size; +}; + extern struct builtin_fw __start_builtin_fw[]; extern struct builtin_fw __end_builtin_fw[]; diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 34e8d5844fa0..3b057dfc8284 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -25,12 +25,6 @@ struct device; * FW_LOADER=m */ #ifdef CONFIG_FW_LOADER -struct builtin_fw { - char *name; - void *data; - unsigned long size; -}; - bool firmware_request_builtin(struct firmware *fw, const char *name); #else static inline bool firmware_request_builtin(struct firmware *fw, From 771856caf518b477390afab3aa311d74144f148b Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Thu, 21 Oct 2021 08:58:38 -0700 Subject: [PATCH 120/122] vmlinux.lds.h: wrap built-in firmware support under FW_LOADER The firmware loader built-in firmware is only available when FW_LOADER is built-in, so tuck away the sections for built-in firmware under it. This ensures no oddball user tries to uses these sections without first enabling FW_LOADER=y. Reviewed-by: Borislav Petkov Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20211021155843.1969401-6-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- include/asm-generic/vmlinux.lds.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f2984af2b85b..ad792e2817a2 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -470,13 +470,7 @@ __end_pci_fixups_suspend_late = .; \ } \ \ - /* Built-in firmware blobs */ \ - .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) { \ - __start_builtin_fw = .; \ - KEEP(*(.builtin_fw)) \ - __end_builtin_fw = .; \ - } \ - \ + FW_LOADER_BUILT_IN_DATA \ TRACEDATA \ \ PRINTK_INDEX \ @@ -880,6 +874,18 @@ #define ORC_UNWIND_TABLE #endif +/* Built-in firmware blobs */ +#ifdef CONFIG_FW_LOADER +#define FW_LOADER_BUILT_IN_DATA \ + .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) { \ + __start_builtin_fw = .; \ + KEEP(*(.builtin_fw)) \ + __end_builtin_fw = .; \ + } +#else +#define FW_LOADER_BUILT_IN_DATA +#endif + #ifdef CONFIG_PM_TRACE #define TRACEDATA \ . = ALIGN(4); \ From c8dcf655ec81f94e19a41c54b74c907b57350360 Mon Sep 17 00:00:00 2001 From: Luis Chamberlain Date: Thu, 21 Oct 2021 08:58:39 -0700 Subject: [PATCH 121/122] x86/build: Tuck away built-in firmware under FW_LOADER When FW_LOADER is modular or disabled we don't use it. Update x86 relocs to reflect that. Reviewed-by: Borislav Petkov Signed-off-by: Luis Chamberlain Link: https://lore.kernel.org/r/20211021155843.1969401-7-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/tools/relocs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index 27c82207d387..ab3554d4aa06 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -63,7 +63,9 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { "(__parainstructions|__alt_instructions)(_end)?|" "(__iommu_table|__apicdrivers|__smp_locks)(_end)?|" "__(start|end)_pci_.*|" +#if CONFIG_FW_LOADER_BUILTIN "__(start|end)_builtin_fw|" +#endif "__(start|stop)___ksymtab(_gpl)?|" "__(start|stop)___kcrctab(_gpl)?|" "__(start|stop)___param|" From 27e0bcd02990f7291adb0f111e300f06c495d509 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 26 Oct 2021 19:29:54 +0300 Subject: [PATCH 122/122] device property: Drop redundant NULL checks In cases when functions are called via fwnode operations, we already know that this is software node we are dealing with, hence no need to check if it's NULL, it can't be, Reported-by: YE Chengfeng Reviewed-by: Rafael J. Wysocki Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211026162954.89811-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/swnode.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index c46f6a8e14d2..4debcea4fb12 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -413,9 +413,6 @@ software_node_get_name(const struct fwnode_handle *fwnode) { const struct swnode *swnode = to_swnode(fwnode); - if (!swnode) - return "(null)"; - return kobject_name(&swnode->kobj); } @@ -507,9 +504,6 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode, int error; int i; - if (!swnode) - return -ENOENT; - prop = property_entry_get(swnode->node->properties, propname); if (!prop) return -ENOENT;