Revert "timers: Rename del_timer_sync() to timer_delete_sync()"
This reverts commit 48a8a53939604aaab44c0699851f201f80db877d which is
commit 9b13df3fb64ee95e2397585404e442afee2c7d4f upstream.
It breaks the Android kernel abi by turning del_timer_sync() into an
inline function, which breaks the abi. Fix this by putting it back as
needed AND fix up the only use of this new function in
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c which is
what caused this commit to be backported to 4.19.y in the first place.
Bug: 161946584
Change-Id: Icd26c7c81e6172f36eeeb69827989bfab1d32afe
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index fe8f113..5a6912d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -690,7 +690,7 @@
scan_request = cfg->scan_request;
cfg->scan_request = NULL;
- timer_delete_sync(&cfg->escan_timeout);
+ del_timer_sync(&cfg->escan_timeout);
if (fw_abort) {
/* Do a scan abort to stop the driver's scan engine */
diff --git a/include/linux/timer.h b/include/linux/timer.h
index e595d83..a506fca 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -175,20 +175,7 @@
extern void add_timer(struct timer_list *timer);
extern int try_to_del_timer_sync(struct timer_list *timer);
-extern int timer_delete_sync(struct timer_list *timer);
-
-/**
- * del_timer_sync - Delete a pending timer and wait for a running callback
- * @timer: The timer to be deleted
- *
- * See timer_delete_sync() for detailed explanation.
- *
- * Do not use in new code. Use timer_delete_sync() instead.
- */
-static inline int del_timer_sync(struct timer_list *timer)
-{
- return timer_delete_sync(timer);
-}
+extern int del_timer_sync(struct timer_list *timer);
#define del_singleshot_timer_sync(t) del_timer_sync(t)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index e3120af..489bb01 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1037,7 +1037,7 @@
/*
* We are trying to schedule the timer on the new base.
* However we can't change timer's base while it is running,
- * otherwise timer_delete_sync() can't detect that the timer's
+ * otherwise del_timer_sync() can't detect that the timer's
* handler yet has not finished. This also guarantees that the
* timer is serialized wrt itself.
*/
@@ -1216,7 +1216,7 @@
* @timer: The timer to be deactivated
*
* The function only deactivates a pending timer, but contrary to
- * timer_delete_sync() it does not take into account whether the timer's
+ * del_timer_sync() it does not take into account whether the timer's
* callback function is concurrently executed on a different CPU or not.
* It neither prevents rearming of the timer. If @timer can be rearmed
* concurrently then the return value of this function is meaningless.
@@ -1350,7 +1350,7 @@
#endif
/**
- * timer_delete_sync - Deactivate a timer and wait for the handler to finish.
+ * del_timer_sync - Deactivate a timer and wait for the handler to finish.
* @timer: The timer to be deactivated
*
* Synchronization rules: Callers must prevent restarting of the timer,
@@ -1372,10 +1372,10 @@
* spin_lock_irq(somelock);
* <IRQ>
* spin_lock(somelock);
- * timer_delete_sync(mytimer);
+ * del_timer_sync(mytimer);
* while (base->running_timer == mytimer);
*
- * Now timer_delete_sync() will never return and never release somelock.
+ * Now del_timer_sync() will never return and never release somelock.
* The interrupt on the other CPU is waiting to grab somelock but it has
* interrupted the softirq that CPU0 is waiting to finish.
*
@@ -1388,7 +1388,7 @@
* * %0 - The timer was not pending
* * %1 - The timer was pending and deactivated
*/
-int timer_delete_sync(struct timer_list *timer)
+int del_timer_sync(struct timer_list *timer)
{
int ret;
@@ -1421,7 +1421,7 @@
return ret;
}
-EXPORT_SYMBOL(timer_delete_sync);
+EXPORT_SYMBOL(del_timer_sync);
static void call_timer_fn(struct timer_list *timer,
void (*fn)(struct timer_list *),
@@ -1443,8 +1443,8 @@
#endif
/*
* Couple the lock chain with the lock chain at
- * timer_delete_sync() by acquiring the lock_map around the fn()
- * call here and in timer_delete_sync().
+ * del_timer_sync() by acquiring the lock_map around the fn()
+ * call here and in del_timer_sync().
*/
lock_map_acquire(&lockdep_map);