Skip to content

Commit 115c841

Browse files
committed
Revert "timers: Rename del_timer_sync() to timer_delete_sync()"
This reverts commit 48a8a53 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>
1 parent ec0ad95 commit 115c841

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
690690
scan_request = cfg->scan_request;
691691
cfg->scan_request = NULL;
692692

693-
timer_delete_sync(&cfg->escan_timeout);
693+
del_timer_sync(&cfg->escan_timeout);
694694

695695
if (fw_abort) {
696696
/* Do a scan abort to stop the driver's scan engine */

include/linux/timer.h

+1-14
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,7 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);
175175
extern void add_timer(struct timer_list *timer);
176176

177177
extern int try_to_del_timer_sync(struct timer_list *timer);
178-
extern int timer_delete_sync(struct timer_list *timer);
179-
180-
/**
181-
* del_timer_sync - Delete a pending timer and wait for a running callback
182-
* @timer: The timer to be deleted
183-
*
184-
* See timer_delete_sync() for detailed explanation.
185-
*
186-
* Do not use in new code. Use timer_delete_sync() instead.
187-
*/
188-
static inline int del_timer_sync(struct timer_list *timer)
189-
{
190-
return timer_delete_sync(timer);
191-
}
178+
extern int del_timer_sync(struct timer_list *timer);
192179

193180
#define del_singleshot_timer_sync(t) del_timer_sync(t)
194181

kernel/time/timer.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option
10371037
/*
10381038
* We are trying to schedule the timer on the new base.
10391039
* However we can't change timer's base while it is running,
1040-
* otherwise timer_delete_sync() can't detect that the timer's
1040+
* otherwise del_timer_sync() can't detect that the timer's
10411041
* handler yet has not finished. This also guarantees that the
10421042
* timer is serialized wrt itself.
10431043
*/
@@ -1216,7 +1216,7 @@ EXPORT_SYMBOL_GPL(add_timer_on);
12161216
* @timer: The timer to be deactivated
12171217
*
12181218
* The function only deactivates a pending timer, but contrary to
1219-
* timer_delete_sync() it does not take into account whether the timer's
1219+
* del_timer_sync() it does not take into account whether the timer's
12201220
* callback function is concurrently executed on a different CPU or not.
12211221
* It neither prevents rearming of the timer. If @timer can be rearmed
12221222
* concurrently then the return value of this function is meaningless.
@@ -1350,7 +1350,7 @@ static inline void del_timer_wait_running(struct timer_list *timer) { }
13501350
#endif
13511351

13521352
/**
1353-
* timer_delete_sync - Deactivate a timer and wait for the handler to finish.
1353+
* del_timer_sync - Deactivate a timer and wait for the handler to finish.
13541354
* @timer: The timer to be deactivated
13551355
*
13561356
* Synchronization rules: Callers must prevent restarting of the timer,
@@ -1372,10 +1372,10 @@ static inline void del_timer_wait_running(struct timer_list *timer) { }
13721372
* spin_lock_irq(somelock);
13731373
* <IRQ>
13741374
* spin_lock(somelock);
1375-
* timer_delete_sync(mytimer);
1375+
* del_timer_sync(mytimer);
13761376
* while (base->running_timer == mytimer);
13771377
*
1378-
* Now timer_delete_sync() will never return and never release somelock.
1378+
* Now del_timer_sync() will never return and never release somelock.
13791379
* The interrupt on the other CPU is waiting to grab somelock but it has
13801380
* interrupted the softirq that CPU0 is waiting to finish.
13811381
*
@@ -1388,7 +1388,7 @@ static inline void del_timer_wait_running(struct timer_list *timer) { }
13881388
* * %0 - The timer was not pending
13891389
* * %1 - The timer was pending and deactivated
13901390
*/
1391-
int timer_delete_sync(struct timer_list *timer)
1391+
int del_timer_sync(struct timer_list *timer)
13921392
{
13931393
int ret;
13941394

@@ -1421,7 +1421,7 @@ int timer_delete_sync(struct timer_list *timer)
14211421

14221422
return ret;
14231423
}
1424-
EXPORT_SYMBOL(timer_delete_sync);
1424+
EXPORT_SYMBOL(del_timer_sync);
14251425

14261426
static void call_timer_fn(struct timer_list *timer,
14271427
void (*fn)(struct timer_list *),
@@ -1443,8 +1443,8 @@ static void call_timer_fn(struct timer_list *timer,
14431443
#endif
14441444
/*
14451445
* Couple the lock chain with the lock chain at
1446-
* timer_delete_sync() by acquiring the lock_map around the fn()
1447-
* call here and in timer_delete_sync().
1446+
* del_timer_sync() by acquiring the lock_map around the fn()
1447+
* call here and in del_timer_sync().
14481448
*/
14491449
lock_map_acquire(&lockdep_map);
14501450

0 commit comments

Comments
 (0)