From: Sasha Levin Date: Tue, 15 Jul 2025 19:01:58 +0000 (-0400) Subject: Drop platform-x86-think-lmi-fix-sysfs-group-cleanup.patch X-Git-Tag: v5.4.296~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=424b1eac49c83f5c047d6e848cc3c9d0b82b45e9;p=thirdparty%2Fkernel%2Fstable-queue.git Drop platform-x86-think-lmi-fix-sysfs-group-cleanup.patch Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/platform-x86-think-lmi-fix-sysfs-group-cleanup.patch b/queue-5.15/platform-x86-think-lmi-fix-sysfs-group-cleanup.patch deleted file mode 100644 index a490bcb337..0000000000 --- a/queue-5.15/platform-x86-think-lmi-fix-sysfs-group-cleanup.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 357c8f1ceab8d83276cdda4f32b6380846fb4f9a Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sat, 12 Jul 2025 04:49:29 -0400 -Subject: platform/x86: think-lmi: Fix sysfs group cleanup -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Kurt Borja - -[ Upstream commit 4f30f946f27b7f044cf8f3f1f353dee1dcd3517a ] - -Many error paths in tlmi_sysfs_init() lead to sysfs groups being removed -when they were not even created. - -Fix this by letting the kobject core manage these groups through their -kobj_type's defult_groups. - -Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms") -Cc: stable@vger.kernel.org -Reviewed-by: Mark Pearson -Reviewed-by: Ilpo Järvinen -Signed-off-by: Kurt Borja -Link: https://lore.kernel.org/r/20250630-lmi-fix-v3-3-ce4f81c9c481@gmail.com -Signed-off-by: Ilpo Järvinen -Signed-off-by: Sasha Levin ---- - drivers/platform/x86/think-lmi.c | 35 +++++++++----------------------- - 1 file changed, 10 insertions(+), 25 deletions(-) - -diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c -index 36ff64a7b6847..cc46aa5f1da2c 100644 ---- a/drivers/platform/x86/think-lmi.c -+++ b/drivers/platform/x86/think-lmi.c -@@ -491,6 +491,7 @@ static struct attribute *auth_attrs[] = { - static const struct attribute_group auth_attr_group = { - .attrs = auth_attrs, - }; -+__ATTRIBUTE_GROUPS(auth_attr); - - /* ---- Attributes sysfs --------------------------------------------------------- */ - static ssize_t display_name_show(struct kobject *kobj, struct kobj_attribute *attr, -@@ -643,6 +644,7 @@ static const struct attribute_group tlmi_attr_group = { - .is_visible = attr_is_visible, - .attrs = tlmi_attrs, - }; -+__ATTRIBUTE_GROUPS(tlmi_attr); - - static ssize_t tlmi_attr_show(struct kobject *kobj, struct attribute *attr, - char *buf) -@@ -688,12 +690,14 @@ static void tlmi_pwd_setting_release(struct kobject *kobj) - - static struct kobj_type tlmi_attr_setting_ktype = { - .release = &tlmi_attr_setting_release, -- .sysfs_ops = &tlmi_kobj_sysfs_ops, -+ .sysfs_ops = &kobj_sysfs_ops, -+ .default_groups = tlmi_attr_groups, - }; - - static struct kobj_type tlmi_pwd_setting_ktype = { - .release = &tlmi_pwd_setting_release, -- .sysfs_ops = &tlmi_kobj_sysfs_ops, -+ .sysfs_ops = &kobj_sysfs_ops, -+ .default_groups = auth_attr_groups, - }; - - static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *attr, -@@ -765,25 +769,18 @@ static struct kobj_attribute debug_cmd = __ATTR_WO(debug_cmd); - /* ---- Initialisation --------------------------------------------------------- */ - static void tlmi_release_attr(void) - { -- int i; -+ struct kobject *pos, *n; - - /* Attribute structures */ -- for (i = 0; i < TLMI_SETTINGS_COUNT; i++) { -- if (tlmi_priv.setting[i]) { -- sysfs_remove_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group); -- kobject_put(&tlmi_priv.setting[i]->kobj); -- } -- } - sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr); - if (tlmi_priv.can_debug_cmd && debug_support) - sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &debug_cmd.attr); - kset_unregister(tlmi_priv.attribute_kset); - - /* Authentication structures */ -- sysfs_remove_group(&tlmi_priv.pwd_admin->kobj, &auth_attr_group); -- kobject_put(&tlmi_priv.pwd_admin->kobj); -- sysfs_remove_group(&tlmi_priv.pwd_power->kobj, &auth_attr_group); -- kobject_put(&tlmi_priv.pwd_power->kobj); -+ list_for_each_entry_safe(pos, n, &tlmi_priv.authentication_kset->list, entry) -+ kobject_put(pos); -+ - kset_unregister(tlmi_priv.authentication_kset); - } - -@@ -855,10 +852,6 @@ static int tlmi_sysfs_init(void) - "%s", tlmi_priv.setting[i]->display_name); - if (ret) - goto fail_create_attr; -- -- ret = sysfs_create_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group); -- if (ret) -- goto fail_create_attr; - } - - ret = sysfs_create_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr); -@@ -876,19 +869,11 @@ static int tlmi_sysfs_init(void) - if (ret) - goto fail_create_attr; - -- ret = sysfs_create_group(&tlmi_priv.pwd_admin->kobj, &auth_attr_group); -- if (ret) -- goto fail_create_attr; -- - tlmi_priv.pwd_power->kobj.kset = tlmi_priv.authentication_kset; - ret = kobject_add(&tlmi_priv.pwd_power->kobj, NULL, "%s", "System"); - if (ret) - goto fail_create_attr; - -- ret = sysfs_create_group(&tlmi_priv.pwd_power->kobj, &auth_attr_group); -- if (ret) -- goto fail_create_attr; -- - return ret; - - fail_create_attr: --- -2.39.5 - diff --git a/queue-5.15/series b/queue-5.15/series index b57c48a75c..ec4a233f71 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -50,7 +50,6 @@ usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch dma-buf-add-dma_resv_for_each_fence_unlocked-v8.patch dma-buf-use-new-iterator-in-dma_resv_wait_timeout.patch dma-buf-fix-timeout-handling-in-dma_resv_wait_timeou.patch -platform-x86-think-lmi-fix-sysfs-group-cleanup.patch wifi-zd1211rw-fix-potential-null-pointer-dereference.patch md-raid1-fix-stack-memory-use-after-return-in-raid1_.patch raid10-cleanup-memleak-at-raid10_make_request.patch diff --git a/queue-6.1/platform-x86-think-lmi-fix-sysfs-group-cleanup.patch b/queue-6.1/platform-x86-think-lmi-fix-sysfs-group-cleanup.patch deleted file mode 100644 index a788686392..0000000000 --- a/queue-6.1/platform-x86-think-lmi-fix-sysfs-group-cleanup.patch +++ /dev/null @@ -1,82 +0,0 @@ -From b0e2afd8b3bee745e8e375df02f976f9f8ffd690 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sat, 12 Jul 2025 03:36:43 -0400 -Subject: platform/x86: think-lmi: Fix sysfs group cleanup -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Zhang Rui - -[ Upstream commit 4f30f946f27b7f044cf8f3f1f353dee1dcd3517a ] - -Many error paths in tlmi_sysfs_init() lead to sysfs groups being removed -when they were not even created. - -Fix this by letting the kobject core manage these groups through their -kobj_type's defult_groups. - -Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms") -Cc: stable@vger.kernel.org -Reviewed-by: Mark Pearson -Reviewed-by: Ilpo Järvinen -Signed-off-by: Kurt Borja -Link: https://lore.kernel.org/r/20250630-lmi-fix-v3-3-ce4f81c9c481@gmail.com -Signed-off-by: Ilpo Järvinen -Signed-off-by: Sasha Levin ---- - drivers/powercap/intel_rapl_common.c | 22 ++++++++++++++++++++-- - 1 file changed, 20 insertions(+), 2 deletions(-) - -diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c -index 26d00b1853b42..02787682b395e 100644 ---- a/drivers/powercap/intel_rapl_common.c -+++ b/drivers/powercap/intel_rapl_common.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -227,17 +228,34 @@ static int find_nr_power_limit(struct rapl_domain *rd) - static int set_domain_enable(struct powercap_zone *power_zone, bool mode) - { - struct rapl_domain *rd = power_zone_to_rapl_domain(power_zone); -+ u64 val; -+ int ret; - - if (rd->state & DOMAIN_STATE_BIOS_LOCKED) - return -EACCES; - - cpus_read_lock(); -- rapl_write_data_raw(rd, PL1_ENABLE, mode); -+ ret = rapl_write_data_raw(rd, PL1_ENABLE, mode); -+ if (ret) -+ goto end; -+ -+ ret = rapl_read_data_raw(rd, PL1_ENABLE, true, &val); -+ if (ret) -+ goto end; -+ -+ if (mode != val) { -+ pr_debug("%s cannot be %s\n", power_zone->name, -+ str_enabled_disabled(mode)); -+ goto end; -+ } -+ - if (rapl_defaults->set_floor_freq) - rapl_defaults->set_floor_freq(rd, mode); -+ -+end: - cpus_read_unlock(); - -- return 0; -+ return ret; - } - - static int get_domain_enable(struct powercap_zone *power_zone, bool *mode) --- -2.39.5 - diff --git a/queue-6.1/series b/queue-6.1/series index edcb84401f..9117ddd785 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -50,7 +50,6 @@ usb-cdnsp-remove-trb_flush_endpoint-command.patch usb-cdnsp-replace-snprintf-with-the-safer-scnprintf-.patch usb-cdnsp-fix-issue-with-cv-bad-descriptor-test.patch usb-dwc3-abort-suspend-on-soft-disconnect-failure.patch -platform-x86-think-lmi-fix-sysfs-group-cleanup.patch wifi-zd1211rw-fix-potential-null-pointer-dereference.patch drm-tegra-nvdec-fix-dma_alloc_coherent-error-check.patch md-raid1-fix-stack-memory-use-after-return-in-raid1_.patch