summaryrefslogtreecommitdiff
path: root/include/linux/reset-controller.h
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-03-06 18:22:53 +0100
committerPhilipp Zabel <p.zabel@pengutronix.de>2026-03-09 10:20:04 +0100
commit44a0acb2caca3bfd0ca459fbf0b19be75f1819c0 (patch)
tree46ab5af644048f3e40f575fec3c9e9d75d00a7c9 /include/linux/reset-controller.h
parent78ebbff6d1a05ffc2062d90231b4720618a57147 (diff)
reset: protect struct reset_controller_dev with its own mutex
Currently we use a single, global mutex - misleadingly names reset_list_mutex - to protect the global list of reset devices, per-controller list of reset control handles and also internal fields of struct reset_control. Locking can be made a lot more fine-grained if we use a separate mutex for serializing operations on the list AND accessing the reset controller device. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'include/linux/reset-controller.h')
-rw-r--r--include/linux/reset-controller.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index aa95b460fdf8..185d2a9bd7cd 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -3,6 +3,7 @@
#define _LINUX_RESET_CONTROLLER_H_
#include <linux/list.h>
+#include <linux/mutex.h>
struct reset_controller_dev;
@@ -40,6 +41,7 @@ struct of_phandle_args;
* device tree to id as given to the reset control ops, defaults
* to :c:func:`of_reset_simple_xlate`.
* @nr_resets: number of reset controls in this reset controller device
+ * @lock: protects the reset control list from concurrent access
*/
struct reset_controller_dev {
const struct reset_control_ops *ops;
@@ -52,6 +54,7 @@ struct reset_controller_dev {
int (*of_xlate)(struct reset_controller_dev *rcdev,
const struct of_phandle_args *reset_spec);
unsigned int nr_resets;
+ struct mutex lock;
};
#if IS_ENABLED(CONFIG_RESET_CONTROLLER)