From 7473e7c8394e5eb7367b93fade9b4596076f0d26 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:48 +0100 Subject: [PATCH] Revert "hwspinlock: Introduce hwspin_lock_bust()" This reverts commit 5bfff48f58eac15b3fcc9faba55918890f8b4a4d. --- Documentation/locking/hwspinlock.rst | 11 ---------- drivers/hwspinlock/hwspinlock_core.c | 28 ------------------------ drivers/hwspinlock/hwspinlock_internal.h | 3 --- include/linux/hwspinlock.h | 6 ----- 4 files changed, 48 deletions(-) diff --git a/Documentation/locking/hwspinlock.rst b/Documentation/locking/hwspinlock.rst index 2ffaa3cbd..6f03713b7 100755 --- a/Documentation/locking/hwspinlock.rst +++ b/Documentation/locking/hwspinlock.rst @@ -85,17 +85,6 @@ is already free). Should be called from a process context (might sleep). -:: - - int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id); - -After verifying the owner of the hwspinlock, release a previously acquired -hwspinlock; returns 0 on success, or an appropriate error code on failure -(e.g. -EOPNOTSUPP if the bust operation is not defined for the specific -hwspinlock). - -Should be called from a process context (might sleep). - :: int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout); diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index 425597151..fd5f5c5a5 100755 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -302,34 +302,6 @@ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) } EXPORT_SYMBOL_GPL(__hwspin_unlock); -/** - * hwspin_lock_bust() - bust a specific hwspinlock - * @hwlock: a previously-acquired hwspinlock which we want to bust - * @id: identifier of the remote lock holder, if applicable - * - * This function will bust a hwspinlock that was previously acquired as - * long as the current owner of the lock matches the id given by the caller. - * - * Context: Process context. - * - * Returns: 0 on success, or -EINVAL if the hwspinlock does not exist, or - * the bust operation fails, and -EOPNOTSUPP if the bust operation is not - * defined for the hwspinlock. - */ -int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id) -{ - if (WARN_ON(!hwlock)) - return -EINVAL; - - if (!hwlock->bank->ops->bust) { - pr_err("bust operation not defined\n"); - return -EOPNOTSUPP; - } - - return hwlock->bank->ops->bust(hwlock, id); -} -EXPORT_SYMBOL_GPL(hwspin_lock_bust); - /** * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id * @bank: the hwspinlock device bank diff --git a/drivers/hwspinlock/hwspinlock_internal.h b/drivers/hwspinlock/hwspinlock_internal.h index f298fc0ee..29892767b 100755 --- a/drivers/hwspinlock/hwspinlock_internal.h +++ b/drivers/hwspinlock/hwspinlock_internal.h @@ -21,8 +21,6 @@ struct hwspinlock_device; * @trylock: make a single attempt to take the lock. returns 0 on * failure and true on success. may _not_ sleep. * @unlock: release the lock. always succeed. may _not_ sleep. - * @bust: optional, platform-specific bust handler, called by hwspinlock - * core to bust a specific lock. * @relax: optional, platform-specific relax handler, called by hwspinlock * core while spinning on a lock, between two successive * invocations of @trylock. may _not_ sleep. @@ -30,7 +28,6 @@ struct hwspinlock_device; struct hwspinlock_ops { int (*trylock)(struct hwspinlock *lock); void (*unlock)(struct hwspinlock *lock); - int (*bust)(struct hwspinlock *lock, unsigned int id); void (*relax)(struct hwspinlock *lock); }; diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h index f0231dbc4..bfe7c1f1a 100755 --- a/include/linux/hwspinlock.h +++ b/include/linux/hwspinlock.h @@ -68,7 +68,6 @@ int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int, int __hwspin_trylock(struct hwspinlock *, int, unsigned long *); void __hwspin_unlock(struct hwspinlock *, int, unsigned long *); int of_hwspin_lock_get_id_byname(struct device_node *np, const char *name); -int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id); int devm_hwspin_lock_free(struct device *dev, struct hwspinlock *hwlock); struct hwspinlock *devm_hwspin_lock_request(struct device *dev); struct hwspinlock *devm_hwspin_lock_request_specific(struct device *dev, @@ -128,11 +127,6 @@ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) { } -static inline int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id) -{ - return 0; -} - static inline int of_hwspin_lock_get_id(struct device_node *np, int index) { return 0;