File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,34 @@ static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
64
64
pr_err ("%s: failed to unlock spinlock\n" , __func__ );
65
65
}
66
66
67
+ static int qcom_hwspinlock_bust (struct hwspinlock * lock , unsigned int id )
68
+ {
69
+ struct regmap_field * field = lock -> priv ;
70
+ u32 owner ;
71
+ int ret ;
72
+
73
+ ret = regmap_field_read (field , & owner );
74
+ if (ret ) {
75
+ dev_err (lock -> bank -> dev , "unable to query spinlock owner\n" );
76
+ return ret ;
77
+ }
78
+
79
+ if (owner != id )
80
+ return 0 ;
81
+
82
+ ret = regmap_field_write (field , 0 );
83
+ if (ret ) {
84
+ dev_err (lock -> bank -> dev , "failed to bust spinlock\n" );
85
+ return ret ;
86
+ }
87
+
88
+ return 0 ;
89
+ }
90
+
67
91
static const struct hwspinlock_ops qcom_hwspinlock_ops = {
68
92
.trylock = qcom_hwspinlock_trylock ,
69
93
.unlock = qcom_hwspinlock_unlock ,
94
+ .bust = qcom_hwspinlock_bust ,
70
95
};
71
96
72
97
static const struct regmap_config sfpb_mutex_config = {
You can’t perform that action at this time.
0 commit comments