History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock: hwspinlock: add MAINTAINERS entries hwspinlock/omap: omap_hwspinlock_remove should be __devexit hwspinlock/u8500: add hwspinlock driver hwspinlock/core: register a bank of hwspinlocks in a single API call hwspinlock/core: remove stubs for register/unregister hwspinlock/core: use a mutex to protect the radix tree hwspinlock/core/omap: fix id issues on multiple hwspinlock devices hwspinlock/omap: simplify allocation scheme hwspinlock/core: simplify 'owner' handling hwspinlock/core: simplify Kconfig Fix up trivial conflicts (addition of omap_hwspinlock_pdata, removal of omap_spinlock_latency) in arch/arm/mach-omap2/hwspinlock.c Also, do an "evil merge" to fix a compile error in omap_hsmmc.c which for some reason was reported in the same email thread as the "please pull hwspinlock changes".

Linus Torvalds committed 15 years ago

Commit 3f8ddb02 parents 30307c6 8b37fcf11 files · +516 −226Browse files

Showing the changes to include/linux (1 of 11 files). Show all

Unified · Split

include/linux/hwspinlock.h+34−12
@@ -20,17 +20,49 @@ · 19 unmodified lines
2020
2121 #include <linux/err.h>
2222 #include <linux/sched.h>
23+#include <linux/device.h>
2324
2425 /* hwspinlock mode argument */
2526 #define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
2627 #define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
2728
2829 struct hwspinlock;
30+struct hwspinlock_device;
31+struct hwspinlock_ops;
32+
33+/**
34+ * struct hwspinlock_pdata - platform data for hwspinlock drivers
35+ * @base_id: base id for this hwspinlock device
36+ *
37+ * hwspinlock devices provide system-wide hardware locks that are used
38+ * by remote processors that have no other way to achieve synchronization.
39+ *
40+ * To achieve that, each physical lock must have a system-wide id number
41+ * that is agreed upon, otherwise remote processors can't possibly assume
42+ * they're using the same hardware lock.
43+ *
44+ * Usually boards have a single hwspinlock device, which provides several
45+ * hwspinlocks, and in this case, they can be trivially numbered 0 to
46+ * (num-of-locks - 1).
47+ *
48+ * In case boards have several hwspinlocks devices, a different base id
49+ * should be used for each hwspinlock device (they can't all use 0 as
50+ * a starting id!).
51+ *
52+ * This platform data structure should be used to provide the base id
53+ * for each device (which is trivially 0 when only a single hwspinlock
54+ * device exists). It can be shared between different platforms, hence
55+ * its location.
56+ */
57+struct hwspinlock_pdata {
58+ int base_id;
59+};
2960
3061 #if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE)
3162
32−int hwspin_lock_register(struct hwspinlock *lock);
33−struct hwspinlock *hwspin_lock_unregister(unsigned int id);
63+int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
64+ const struct hwspinlock_ops *ops, int base_id, int num_locks);
65+int hwspin_lock_unregister(struct hwspinlock_device *bank);
3466 struct hwspinlock *hwspin_lock_request(void);
3567 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
3668 int hwspin_lock_free(struct hwspinlock *hwlock);
@@ -94,16 +126,6 @@ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock) · 57 unmodified lines
94126 return 0;
95127 }
96128
97−static inline int hwspin_lock_register(struct hwspinlock *hwlock)
98−{
99− return -ENODEV;
100−}
101−
102−static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id)
103−{
104− return NULL;
105−}
106−
107129 #endif /* !CONFIG_HWSPINLOCK */
108130
109131 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t