It was reverted later on, not needed at all.
+++ /dev/null
-From 4b1b4da283db21916e3ef99a286ae80f842ac56f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 24 Nov 2023 17:25:25 +0100
-Subject: debugfs: annotate debugfs handlers vs. removal with lockdep
-
-From: Johannes Berg <johannes.berg@intel.com>
-
-[ Upstream commit f4acfcd4deb158b96595250cc332901b282d15b0 ]
-
-When you take a lock in a debugfs handler but also try
-to remove the debugfs file under that lock, things can
-deadlock since the removal has to wait for all users
-to finish.
-
-Add lockdep annotations in debugfs_file_get()/_put()
-to catch such issues.
-
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/debugfs/file.c | 10 ++++++++++
- fs/debugfs/inode.c | 12 ++++++++++++
- fs/debugfs/internal.h | 6 ++++++
- 3 files changed, 28 insertions(+)
-
-diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
-index 9c0aadedfbff..6bc55a517446 100644
---- a/fs/debugfs/file.c
-+++ b/fs/debugfs/file.c
-@@ -108,6 +108,12 @@ int debugfs_file_get(struct dentry *dentry)
- kfree(fsd);
- fsd = READ_ONCE(dentry->d_fsdata);
- }
-+#ifdef CONFIG_LOCKDEP
-+ fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);
-+ lockdep_register_key(&fsd->key);
-+ lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",
-+ &fsd->key, 0);
-+#endif
- }
-
- /*
-@@ -124,6 +130,8 @@ int debugfs_file_get(struct dentry *dentry)
- if (!refcount_inc_not_zero(&fsd->active_users))
- return -EIO;
-
-+ lock_map_acquire_read(&fsd->lockdep_map);
-+
- return 0;
- }
- EXPORT_SYMBOL_GPL(debugfs_file_get);
-@@ -141,6 +149,8 @@ void debugfs_file_put(struct dentry *dentry)
- {
- struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);
-
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (refcount_dec_and_test(&fsd->active_users))
- complete(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
-index d04930c199cb..001d5e2513aa 100644
---- a/fs/debugfs/inode.c
-+++ b/fs/debugfs/inode.c
-@@ -215,6 +215,14 @@ static void debugfs_release_dentry(struct dentry *dentry)
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-
-+ /* check it wasn't a dir (no fsdata) or automount (no real_fops) */
-+ if (fsd && fsd->real_fops) {
-+#ifdef CONFIG_LOCKDEP
-+ lockdep_unregister_key(&fsd->key);
-+ kfree(fsd->lock_name);
-+#endif
-+ }
-+
- kfree(fsd);
- }
-
-@@ -708,6 +716,10 @@ static void __debugfs_file_removed(struct dentry *dentry)
- fsd = READ_ONCE(dentry->d_fsdata);
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-+
-+ lock_map_acquire(&fsd->lockdep_map);
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (!refcount_dec_and_test(&fsd->active_users))
- wait_for_completion(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/internal.h b/fs/debugfs/internal.h
-index f7c489b5a368..c7d61cfc97d2 100644
---- a/fs/debugfs/internal.h
-+++ b/fs/debugfs/internal.h
-@@ -7,6 +7,7 @@
-
- #ifndef _DEBUGFS_INTERNAL_H_
- #define _DEBUGFS_INTERNAL_H_
-+#include <linux/lockdep.h>
-
- struct file_operations;
-
-@@ -23,6 +24,11 @@ struct debugfs_fsdata {
- struct {
- refcount_t active_users;
- struct completion active_users_drained;
-+#ifdef CONFIG_LOCKDEP
-+ struct lockdep_map lockdep_map;
-+ struct lock_class_key key;
-+ char *lock_name;
-+#endif
- };
- };
- };
---
-2.43.0
-
alsa-hda-fix-speaker-and-headset-mic-pin-config-for-.patch
mptcp-fix-uninit-value-in-mptcp_incoming_options.patch
debugfs-fix-automount-d_fsdata-usage.patch
-debugfs-annotate-debugfs-handlers-vs.-removal-with-l.patch
drm-amdgpu-fix-cat-debugfs-amdgpu_regs_didt-causes-k.patch
nvme-core-check-for-too-small-lba-shift.patch
asoc-wm8974-correct-boost-mixer-inputs.patch
+++ /dev/null
-From 75cc707f2bb3de16987df5df49090b1f2d53421d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 24 Nov 2023 17:25:25 +0100
-Subject: debugfs: annotate debugfs handlers vs. removal with lockdep
-
-From: Johannes Berg <johannes.berg@intel.com>
-
-[ Upstream commit f4acfcd4deb158b96595250cc332901b282d15b0 ]
-
-When you take a lock in a debugfs handler but also try
-to remove the debugfs file under that lock, things can
-deadlock since the removal has to wait for all users
-to finish.
-
-Add lockdep annotations in debugfs_file_get()/_put()
-to catch such issues.
-
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/debugfs/file.c | 10 ++++++++++
- fs/debugfs/inode.c | 12 ++++++++++++
- fs/debugfs/internal.h | 6 ++++++
- 3 files changed, 28 insertions(+)
-
-diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
-index df5c2162e729..a1aea4d1637c 100644
---- a/fs/debugfs/file.c
-+++ b/fs/debugfs/file.c
-@@ -108,6 +108,12 @@ int debugfs_file_get(struct dentry *dentry)
- kfree(fsd);
- fsd = READ_ONCE(dentry->d_fsdata);
- }
-+#ifdef CONFIG_LOCKDEP
-+ fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);
-+ lockdep_register_key(&fsd->key);
-+ lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",
-+ &fsd->key, 0);
-+#endif
- }
-
- /*
-@@ -124,6 +130,8 @@ int debugfs_file_get(struct dentry *dentry)
- if (!refcount_inc_not_zero(&fsd->active_users))
- return -EIO;
-
-+ lock_map_acquire_read(&fsd->lockdep_map);
-+
- return 0;
- }
- EXPORT_SYMBOL_GPL(debugfs_file_get);
-@@ -141,6 +149,8 @@ void debugfs_file_put(struct dentry *dentry)
- {
- struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);
-
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (refcount_dec_and_test(&fsd->active_users))
- complete(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
-index 5290a721a703..014ff204548d 100644
---- a/fs/debugfs/inode.c
-+++ b/fs/debugfs/inode.c
-@@ -219,6 +219,14 @@ static void debugfs_release_dentry(struct dentry *dentry)
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-
-+ /* check it wasn't a dir (no fsdata) or automount (no real_fops) */
-+ if (fsd && fsd->real_fops) {
-+#ifdef CONFIG_LOCKDEP
-+ lockdep_unregister_key(&fsd->key);
-+ kfree(fsd->lock_name);
-+#endif
-+ }
-+
- kfree(fsd);
- }
-
-@@ -712,6 +720,10 @@ static void __debugfs_file_removed(struct dentry *dentry)
- fsd = READ_ONCE(dentry->d_fsdata);
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-+
-+ lock_map_acquire(&fsd->lockdep_map);
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (!refcount_dec_and_test(&fsd->active_users))
- wait_for_completion(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/internal.h b/fs/debugfs/internal.h
-index f7c489b5a368..c7d61cfc97d2 100644
---- a/fs/debugfs/internal.h
-+++ b/fs/debugfs/internal.h
-@@ -7,6 +7,7 @@
-
- #ifndef _DEBUGFS_INTERNAL_H_
- #define _DEBUGFS_INTERNAL_H_
-+#include <linux/lockdep.h>
-
- struct file_operations;
-
-@@ -23,6 +24,11 @@ struct debugfs_fsdata {
- struct {
- refcount_t active_users;
- struct completion active_users_drained;
-+#ifdef CONFIG_LOCKDEP
-+ struct lockdep_map lockdep_map;
-+ struct lock_class_key key;
-+ char *lock_name;
-+#endif
- };
- };
- };
---
-2.43.0
-
mptcp-fix-uninit-value-in-mptcp_incoming_options.patch
wifi-cfg80211-lock-wiphy-mutex-for-rfkill-poll.patch
debugfs-fix-automount-d_fsdata-usage.patch
-debugfs-annotate-debugfs-handlers-vs.-removal-with-l.patch
drm-amdgpu-fix-cat-debugfs-amdgpu_regs_didt-causes-k.patch
nvme-core-check-for-too-small-lba-shift.patch
asoc-wm8974-correct-boost-mixer-inputs.patch
+++ /dev/null
-From c480c858f191c09867b0dda2cb72301c4b4af22c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 24 Nov 2023 17:25:25 +0100
-Subject: debugfs: annotate debugfs handlers vs. removal with lockdep
-
-From: Johannes Berg <johannes.berg@intel.com>
-
-[ Upstream commit f4acfcd4deb158b96595250cc332901b282d15b0 ]
-
-When you take a lock in a debugfs handler but also try
-to remove the debugfs file under that lock, things can
-deadlock since the removal has to wait for all users
-to finish.
-
-Add lockdep annotations in debugfs_file_get()/_put()
-to catch such issues.
-
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/debugfs/file.c | 10 ++++++++++
- fs/debugfs/inode.c | 12 ++++++++++++
- fs/debugfs/internal.h | 6 ++++++
- 3 files changed, 28 insertions(+)
-
-diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
-index b38304b44476..375af381bf00 100644
---- a/fs/debugfs/file.c
-+++ b/fs/debugfs/file.c
-@@ -108,6 +108,12 @@ int debugfs_file_get(struct dentry *dentry)
- kfree(fsd);
- fsd = READ_ONCE(dentry->d_fsdata);
- }
-+#ifdef CONFIG_LOCKDEP
-+ fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);
-+ lockdep_register_key(&fsd->key);
-+ lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",
-+ &fsd->key, 0);
-+#endif
- }
-
- /*
-@@ -124,6 +130,8 @@ int debugfs_file_get(struct dentry *dentry)
- if (!refcount_inc_not_zero(&fsd->active_users))
- return -EIO;
-
-+ lock_map_acquire_read(&fsd->lockdep_map);
-+
- return 0;
- }
- EXPORT_SYMBOL_GPL(debugfs_file_get);
-@@ -141,6 +149,8 @@ void debugfs_file_put(struct dentry *dentry)
- {
- struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);
-
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (refcount_dec_and_test(&fsd->active_users))
- complete(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
-index 08ef685167ec..8fc470aa6782 100644
---- a/fs/debugfs/inode.c
-+++ b/fs/debugfs/inode.c
-@@ -242,6 +242,14 @@ static void debugfs_release_dentry(struct dentry *dentry)
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-
-+ /* check it wasn't a dir (no fsdata) or automount (no real_fops) */
-+ if (fsd && fsd->real_fops) {
-+#ifdef CONFIG_LOCKDEP
-+ lockdep_unregister_key(&fsd->key);
-+ kfree(fsd->lock_name);
-+#endif
-+ }
-+
- kfree(fsd);
- }
-
-@@ -745,6 +753,10 @@ static void __debugfs_file_removed(struct dentry *dentry)
- fsd = READ_ONCE(dentry->d_fsdata);
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-+
-+ lock_map_acquire(&fsd->lockdep_map);
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (!refcount_dec_and_test(&fsd->active_users))
- wait_for_completion(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/internal.h b/fs/debugfs/internal.h
-index f7c489b5a368..c7d61cfc97d2 100644
---- a/fs/debugfs/internal.h
-+++ b/fs/debugfs/internal.h
-@@ -7,6 +7,7 @@
-
- #ifndef _DEBUGFS_INTERNAL_H_
- #define _DEBUGFS_INTERNAL_H_
-+#include <linux/lockdep.h>
-
- struct file_operations;
-
-@@ -23,6 +24,11 @@ struct debugfs_fsdata {
- struct {
- refcount_t active_users;
- struct completion active_users_drained;
-+#ifdef CONFIG_LOCKDEP
-+ struct lockdep_map lockdep_map;
-+ struct lock_class_key key;
-+ char *lock_name;
-+#endif
- };
- };
- };
---
-2.43.0
-
wifi-avoid-offset-calculation-on-null-pointer.patch
wifi-mac80211-handle-320-mhz-in-ieee80211_ht_cap_ie_.patch
debugfs-fix-automount-d_fsdata-usage.patch
-debugfs-annotate-debugfs-handlers-vs.-removal-with-l.patch
alsa-hda-intel-nhlt-ignore-vbps-when-looking-for-dmi.patch
nvme-core-fix-a-memory-leak-in-nvme_ns_info_from_ide.patch
drm-amd-display-update-dcn315-lpddr-pstate-latency.patch
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- drivers/bus/moxtet.c | 7 +++++++
+ drivers/bus/moxtet.c | 7 +++++++
1 file changed, 7 insertions(+)
-diff --git a/drivers/bus/moxtet.c b/drivers/bus/moxtet.c
-index 48c18f95660a..e384fbc6c1d9 100644
--- a/drivers/bus/moxtet.c
+++ b/drivers/bus/moxtet.c
-@@ -830,6 +830,12 @@ static void moxtet_remove(struct spi_device *spi)
+@@ -830,6 +830,12 @@ static void moxtet_remove(struct spi_dev
mutex_destroy(&moxtet->lock);
}
static const struct of_device_id moxtet_dt_ids[] = {
{ .compatible = "cznic,moxtet" },
{},
-@@ -841,6 +847,7 @@ static struct spi_driver moxtet_spi_driver = {
+@@ -841,6 +847,7 @@ static struct spi_driver moxtet_spi_driv
.name = "moxtet",
.of_match_table = moxtet_dt_ids,
},
.probe = moxtet_probe,
.remove = moxtet_remove,
};
---
-2.43.0
-
+++ /dev/null
-From d8b036111f04e13f2096fa146212b20b9814a52e Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 24 Nov 2023 17:25:25 +0100
-Subject: debugfs: annotate debugfs handlers vs. removal with lockdep
-
-From: Johannes Berg <johannes.berg@intel.com>
-
-[ Upstream commit f4acfcd4deb158b96595250cc332901b282d15b0 ]
-
-When you take a lock in a debugfs handler but also try
-to remove the debugfs file under that lock, things can
-deadlock since the removal has to wait for all users
-to finish.
-
-Add lockdep annotations in debugfs_file_get()/_put()
-to catch such issues.
-
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/debugfs/file.c | 10 ++++++++++
- fs/debugfs/inode.c | 12 ++++++++++++
- fs/debugfs/internal.h | 6 ++++++
- 3 files changed, 28 insertions(+)
-
-diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
-index e40229c47fe5..bd9e6284d0a8 100644
---- a/fs/debugfs/file.c
-+++ b/fs/debugfs/file.c
-@@ -108,6 +108,12 @@ int debugfs_file_get(struct dentry *dentry)
- kfree(fsd);
- fsd = READ_ONCE(dentry->d_fsdata);
- }
-+#ifdef CONFIG_LOCKDEP
-+ fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);
-+ lockdep_register_key(&fsd->key);
-+ lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",
-+ &fsd->key, 0);
-+#endif
- }
-
- /*
-@@ -124,6 +130,8 @@ int debugfs_file_get(struct dentry *dentry)
- if (!refcount_inc_not_zero(&fsd->active_users))
- return -EIO;
-
-+ lock_map_acquire_read(&fsd->lockdep_map);
-+
- return 0;
- }
- EXPORT_SYMBOL_GPL(debugfs_file_get);
-@@ -141,6 +149,8 @@ void debugfs_file_put(struct dentry *dentry)
- {
- struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);
-
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (refcount_dec_and_test(&fsd->active_users))
- complete(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
-index dcde4199a625..80f4f000dcc1 100644
---- a/fs/debugfs/inode.c
-+++ b/fs/debugfs/inode.c
-@@ -241,6 +241,14 @@ static void debugfs_release_dentry(struct dentry *dentry)
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-
-+ /* check it wasn't a dir (no fsdata) or automount (no real_fops) */
-+ if (fsd && fsd->real_fops) {
-+#ifdef CONFIG_LOCKDEP
-+ lockdep_unregister_key(&fsd->key);
-+ kfree(fsd->lock_name);
-+#endif
-+ }
-+
- kfree(fsd);
- }
-
-@@ -744,6 +752,10 @@ static void __debugfs_file_removed(struct dentry *dentry)
- fsd = READ_ONCE(dentry->d_fsdata);
- if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)
- return;
-+
-+ lock_map_acquire(&fsd->lockdep_map);
-+ lock_map_release(&fsd->lockdep_map);
-+
- if (!refcount_dec_and_test(&fsd->active_users))
- wait_for_completion(&fsd->active_users_drained);
- }
-diff --git a/fs/debugfs/internal.h b/fs/debugfs/internal.h
-index f7c489b5a368..c7d61cfc97d2 100644
---- a/fs/debugfs/internal.h
-+++ b/fs/debugfs/internal.h
-@@ -7,6 +7,7 @@
-
- #ifndef _DEBUGFS_INTERNAL_H_
- #define _DEBUGFS_INTERNAL_H_
-+#include <linux/lockdep.h>
-
- struct file_operations;
-
-@@ -23,6 +24,11 @@ struct debugfs_fsdata {
- struct {
- refcount_t active_users;
- struct completion active_users_drained;
-+#ifdef CONFIG_LOCKDEP
-+ struct lockdep_map lockdep_map;
-+ struct lock_class_key key;
-+ char *lock_name;
-+#endif
- };
- };
- };
---
-2.43.0
-
wifi-avoid-offset-calculation-on-null-pointer.patch
wifi-mac80211-handle-320-mhz-in-ieee80211_ht_cap_ie_.patch
debugfs-fix-automount-d_fsdata-usage.patch
-debugfs-annotate-debugfs-handlers-vs.-removal-with-l.patch
alsa-hda-intel-nhlt-ignore-vbps-when-looking-for-dmi.patch
nvme-core-fix-a-memory-leak-in-nvme_ns_info_from_ide.patch
io_uring-use-fget-fput-consistently.patch