mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'timers-cleanups-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer cleanups from Thomas Gleixner:
"Another set of timer API cleanups:
- Convert init_timer*(), try_to_del_timer_sync() and
destroy_timer_on_stack() over to the canonical timer_*()
namespace convention.
There is another large conversion pending, which has not been included
because it would have caused a gazillion of merge conflicts in next.
The conversion scripts will be run towards the end of the merge window
and a pull request sent once all conflict dependencies have been
merged"
* tag 'timers-cleanups-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
treewide, timers: Rename destroy_timer_on_stack() as timer_destroy_on_stack()
treewide, timers: Rename try_to_del_timer_sync() as timer_delete_sync_try()
timers: Rename init_timers() as timers_init()
timers: Rename NEXT_TIMER_MAX_DELTA as TIMER_NEXT_MAX_DELTA
timers: Rename __init_timer_on_stack() as __timer_init_on_stack()
timers: Rename __init_timer() as __timer_init()
timers: Rename init_timer_on_stack_key() as timer_init_key_on_stack()
timers: Rename init_timer_key() as timer_init_key()
This commit is contained in:
@@ -572,7 +572,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
|
||||
|
||||
/*
|
||||
* Return the number of jiffies until the next timeout. If the timeout is
|
||||
* longer than the NEXT_TIMER_MAX_DELTA, then return NEXT_TIMER_MAX_DELTA
|
||||
* longer than the TIMER_NEXT_MAX_DELTA, then return TIMER_NEXT_MAX_DELTA
|
||||
* because the larger value can break the timer APIs.
|
||||
*/
|
||||
static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
|
||||
@@ -598,7 +598,7 @@ static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
|
||||
if (do_div(nr_jiffies, tb_ticks_per_jiffy))
|
||||
nr_jiffies++;
|
||||
|
||||
return min_t(unsigned long long, nr_jiffies, NEXT_TIMER_MAX_DELTA);
|
||||
return min_t(unsigned long long, nr_jiffies, TIMER_NEXT_MAX_DELTA);
|
||||
}
|
||||
|
||||
static void arm_next_watchdog(struct kvm_vcpu *vcpu)
|
||||
@@ -616,10 +616,10 @@ static void arm_next_watchdog(struct kvm_vcpu *vcpu)
|
||||
spin_lock_irqsave(&vcpu->arch.wdt_lock, flags);
|
||||
nr_jiffies = watchdog_next_timeout(vcpu);
|
||||
/*
|
||||
* If the number of jiffies of watchdog timer >= NEXT_TIMER_MAX_DELTA
|
||||
* If the number of jiffies of watchdog timer >= TIMER_NEXT_MAX_DELTA
|
||||
* then do not run the watchdog timer as this can break timer APIs.
|
||||
*/
|
||||
if (nr_jiffies < NEXT_TIMER_MAX_DELTA)
|
||||
if (nr_jiffies < TIMER_NEXT_MAX_DELTA)
|
||||
mod_timer(&vcpu->arch.wdt_timer, jiffies + nr_jiffies);
|
||||
else
|
||||
timer_delete(&vcpu->arch.wdt_timer);
|
||||
|
||||
@@ -864,7 +864,7 @@ void lapic_offline(void)
|
||||
__vector_cleanup(cl, false);
|
||||
|
||||
irq_matrix_offline(vector_matrix);
|
||||
WARN_ON_ONCE(try_to_del_timer_sync(&cl->timer) < 0);
|
||||
WARN_ON_ONCE(timer_delete_sync_try(&cl->timer) < 0);
|
||||
WARN_ON_ONCE(!hlist_empty(&cl->head));
|
||||
|
||||
unlock_vector_lock();
|
||||
|
||||
@@ -560,7 +560,7 @@ static void dpm_watchdog_clear(struct dpm_watchdog *wd)
|
||||
struct timer_list *timer = &wd->timer;
|
||||
|
||||
timer_delete_sync(timer);
|
||||
destroy_timer_on_stack(timer);
|
||||
timer_destroy_on_stack(timer);
|
||||
}
|
||||
#else
|
||||
#define DECLARE_DPM_WATCHDOG_ON_STACK(wd)
|
||||
|
||||
@@ -1312,9 +1312,9 @@ static void __cold try_to_generate_entropy(void)
|
||||
while (!crng_ready() && !signal_pending(current)) {
|
||||
/*
|
||||
* Check !timer_pending() and then ensure that any previous callback has finished
|
||||
* executing by checking try_to_del_timer_sync(), before queueing the next one.
|
||||
* executing by checking timer_delete_sync_try(), before queueing the next one.
|
||||
*/
|
||||
if (!timer_pending(&stack->timer) && try_to_del_timer_sync(&stack->timer) >= 0) {
|
||||
if (!timer_pending(&stack->timer) && timer_delete_sync_try(&stack->timer) >= 0) {
|
||||
struct cpumask timer_cpus;
|
||||
unsigned int num_cpus;
|
||||
|
||||
@@ -1354,7 +1354,7 @@ static void __cold try_to_generate_entropy(void)
|
||||
mix_pool_bytes(&stack->entropy, sizeof(stack->entropy));
|
||||
|
||||
timer_delete_sync(&stack->timer);
|
||||
destroy_timer_on_stack(&stack->timer);
|
||||
timer_destroy_on_stack(&stack->timer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ static int test_wait_timeout(void *arg)
|
||||
err = 0;
|
||||
err_free:
|
||||
timer_delete_sync(&wt.timer);
|
||||
destroy_timer_on_stack(&wt.timer);
|
||||
timer_destroy_on_stack(&wt.timer);
|
||||
dma_fence_signal(wt.f);
|
||||
dma_fence_put(wt.f);
|
||||
return err;
|
||||
|
||||
@@ -431,7 +431,7 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
|
||||
fw_send_request(card, &t, tcode, destination_id, generation, speed,
|
||||
offset, payload, length, transaction_callback, &d);
|
||||
wait_for_completion(&d.done);
|
||||
destroy_timer_on_stack(&t.split_timeout_timer);
|
||||
timer_destroy_on_stack(&t.split_timeout_timer);
|
||||
|
||||
return d.rcode;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ static int suspend_test_thread(void *arg)
|
||||
* later.
|
||||
*/
|
||||
timer_delete(&wakeup_timer);
|
||||
destroy_timer_on_stack(&wakeup_timer);
|
||||
timer_destroy_on_stack(&wakeup_timer);
|
||||
|
||||
if (atomic_dec_return_relaxed(&nb_active_threads) == 0)
|
||||
complete(&suspend_threads_done);
|
||||
|
||||
@@ -261,7 +261,7 @@ static int gud_usb_bulk(struct gud_device *gdrm, size_t len)
|
||||
else if (ctx.sgr.bytes != len)
|
||||
ret = -EIO;
|
||||
|
||||
destroy_timer_on_stack(&ctx.timer);
|
||||
timer_destroy_on_stack(&ctx.timer);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -661,7 +661,7 @@ static int live_emit_pte_full_ring(void *arg)
|
||||
out_rq:
|
||||
i915_request_add(rq); /* GEM_BUG_ON(rq->reserved_space > ring->space)? */
|
||||
timer_delete_sync(&st.timer);
|
||||
destroy_timer_on_stack(&st.timer);
|
||||
timer_destroy_on_stack(&st.timer);
|
||||
out_unpin:
|
||||
intel_context_unpin(ce);
|
||||
out_put:
|
||||
|
||||
@@ -77,7 +77,7 @@ void timed_fence_fini(struct timed_fence *tf)
|
||||
if (timer_delete_sync(&tf->timer))
|
||||
i915_sw_fence_commit(&tf->fence);
|
||||
|
||||
destroy_timer_on_stack(&tf->timer);
|
||||
timer_destroy_on_stack(&tf->timer);
|
||||
i915_sw_fence_fini(&tf->fence);
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ static int threaded_ttm_bo_reserve(void *arg)
|
||||
err = ttm_bo_reserve(bo, interruptible, no_wait, &ctx);
|
||||
|
||||
timer_delete_sync(&s_timer.timer);
|
||||
destroy_timer_on_stack(&s_timer.timer);
|
||||
timer_destroy_on_stack(&s_timer.timer);
|
||||
|
||||
ww_acquire_fini(&ctx);
|
||||
|
||||
|
||||
@@ -564,7 +564,7 @@ void imsic_state_offline(void)
|
||||
struct imsic_local_priv *lpriv = this_cpu_ptr(imsic->lpriv);
|
||||
|
||||
raw_spin_lock_irqsave(&lpriv->lock, flags);
|
||||
WARN_ON_ONCE(try_to_del_timer_sync(&lpriv->timer) < 0);
|
||||
WARN_ON_ONCE(timer_delete_sync_try(&lpriv->timer) < 0);
|
||||
raw_spin_unlock_irqrestore(&lpriv->lock, flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3806,7 +3806,7 @@ status);
|
||||
if ((status < 0) && (!probe_fl)) {
|
||||
pvr2_hdw_render_useless(hdw);
|
||||
}
|
||||
destroy_timer_on_stack(&timer.timer);
|
||||
timer_destroy_on_stack(&timer.timer);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -3952,7 +3952,7 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter)
|
||||
|
||||
|
||||
timer_delete_sync(&timeout.timer);
|
||||
destroy_timer_on_stack(&timeout.timer);
|
||||
timer_destroy_on_stack(&timeout.timer);
|
||||
|
||||
mutex_unlock(&raid_dev->sysfs_mtx);
|
||||
|
||||
|
||||
@@ -704,7 +704,7 @@ lld_ioctl(mraid_mmadp_t *adp, uioc_t *kioc)
|
||||
wait_event(wait_q, (kioc->status != -ENODATA));
|
||||
if (timeout.timer.function) {
|
||||
timer_delete_sync(&timeout.timer);
|
||||
destroy_timer_on_stack(&timeout.timer);
|
||||
timer_destroy_on_stack(&timeout.timer);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -611,7 +611,7 @@ static void start_wait_timer(struct wait_info *winfo)
|
||||
static void remove_wait_timer(struct wait_info *winfo)
|
||||
{
|
||||
timer_delete_sync(&winfo->timer);
|
||||
destroy_timer_on_stack(&winfo->timer);
|
||||
timer_destroy_on_stack(&winfo->timer);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -598,7 +598,7 @@ static int cxacru_start_wait_urb(struct urb *urb, struct completion *done,
|
||||
mod_timer(&timer.timer, jiffies + msecs_to_jiffies(CMD_TIMEOUT));
|
||||
wait_for_completion(done);
|
||||
timer_delete_sync(&timer.timer);
|
||||
destroy_timer_on_stack(&timer.timer);
|
||||
timer_destroy_on_stack(&timer.timer);
|
||||
|
||||
if (actual_length)
|
||||
*actual_length = urb->actual_length;
|
||||
|
||||
@@ -630,7 +630,7 @@ static int perform_sglist(
|
||||
retval = -ETIMEDOUT;
|
||||
else
|
||||
retval = req->status;
|
||||
destroy_timer_on_stack(&timeout.timer);
|
||||
timer_destroy_on_stack(&timeout.timer);
|
||||
|
||||
/* FIXME check resulting data pattern */
|
||||
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ void bch2_kthread_io_clock_wait(struct io_clock *clock,
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
timer_delete_sync(&wait.cpu_timer);
|
||||
destroy_timer_on_stack(&wait.cpu_timer);
|
||||
timer_destroy_on_stack(&wait.cpu_timer);
|
||||
bch2_io_timer_del(clock, &wait.io_timer);
|
||||
}
|
||||
|
||||
|
||||
+20
-20
@@ -67,44 +67,44 @@
|
||||
/*
|
||||
* LOCKDEP and DEBUG timer interfaces.
|
||||
*/
|
||||
void init_timer_key(struct timer_list *timer,
|
||||
void timer_init_key(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *), unsigned int flags,
|
||||
const char *name, struct lock_class_key *key);
|
||||
|
||||
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
|
||||
extern void init_timer_on_stack_key(struct timer_list *timer,
|
||||
extern void timer_init_key_on_stack(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *),
|
||||
unsigned int flags, const char *name,
|
||||
struct lock_class_key *key);
|
||||
#else
|
||||
static inline void init_timer_on_stack_key(struct timer_list *timer,
|
||||
static inline void timer_init_key_on_stack(struct timer_list *timer,
|
||||
void (*func)(struct timer_list *),
|
||||
unsigned int flags,
|
||||
const char *name,
|
||||
struct lock_class_key *key)
|
||||
{
|
||||
init_timer_key(timer, func, flags, name, key);
|
||||
timer_init_key(timer, func, flags, name, key);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
#define __init_timer(_timer, _fn, _flags) \
|
||||
#define __timer_init(_timer, _fn, _flags) \
|
||||
do { \
|
||||
static struct lock_class_key __key; \
|
||||
init_timer_key((_timer), (_fn), (_flags), #_timer, &__key);\
|
||||
timer_init_key((_timer), (_fn), (_flags), #_timer, &__key);\
|
||||
} while (0)
|
||||
|
||||
#define __init_timer_on_stack(_timer, _fn, _flags) \
|
||||
#define __timer_init_on_stack(_timer, _fn, _flags) \
|
||||
do { \
|
||||
static struct lock_class_key __key; \
|
||||
init_timer_on_stack_key((_timer), (_fn), (_flags), \
|
||||
timer_init_key_on_stack((_timer), (_fn), (_flags), \
|
||||
#_timer, &__key); \
|
||||
} while (0)
|
||||
#else
|
||||
#define __init_timer(_timer, _fn, _flags) \
|
||||
init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#define __init_timer_on_stack(_timer, _fn, _flags) \
|
||||
init_timer_on_stack_key((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#define __timer_init(_timer, _fn, _flags) \
|
||||
timer_init_key((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#define __timer_init_on_stack(_timer, _fn, _flags) \
|
||||
timer_init_key_on_stack((_timer), (_fn), (_flags), NULL, NULL)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -115,18 +115,18 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
|
||||
*
|
||||
* Regular timer initialization should use either DEFINE_TIMER() above,
|
||||
* or timer_setup(). For timers on the stack, timer_setup_on_stack() must
|
||||
* be used and must be balanced with a call to destroy_timer_on_stack().
|
||||
* be used and must be balanced with a call to timer_destroy_on_stack().
|
||||
*/
|
||||
#define timer_setup(timer, callback, flags) \
|
||||
__init_timer((timer), (callback), (flags))
|
||||
__timer_init((timer), (callback), (flags))
|
||||
|
||||
#define timer_setup_on_stack(timer, callback, flags) \
|
||||
__init_timer_on_stack((timer), (callback), (flags))
|
||||
__timer_init_on_stack((timer), (callback), (flags))
|
||||
|
||||
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
|
||||
extern void destroy_timer_on_stack(struct timer_list *timer);
|
||||
extern void timer_destroy_on_stack(struct timer_list *timer);
|
||||
#else
|
||||
static inline void destroy_timer_on_stack(struct timer_list *timer) { }
|
||||
static inline void timer_destroy_on_stack(struct timer_list *timer) { }
|
||||
#endif
|
||||
|
||||
#define from_timer(var, callback_timer, timer_fieldname) \
|
||||
@@ -156,19 +156,19 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);
|
||||
* The jiffies value which is added to now, when there is no timer
|
||||
* in the timer wheel:
|
||||
*/
|
||||
#define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1)
|
||||
#define TIMER_NEXT_MAX_DELTA ((1UL << 30) - 1)
|
||||
|
||||
extern void add_timer(struct timer_list *timer);
|
||||
extern void add_timer_local(struct timer_list *timer);
|
||||
extern void add_timer_global(struct timer_list *timer);
|
||||
|
||||
extern int try_to_del_timer_sync(struct timer_list *timer);
|
||||
extern int timer_delete_sync_try(struct timer_list *timer);
|
||||
extern int timer_delete_sync(struct timer_list *timer);
|
||||
extern int timer_delete(struct timer_list *timer);
|
||||
extern int timer_shutdown_sync(struct timer_list *timer);
|
||||
extern int timer_shutdown(struct timer_list *timer);
|
||||
|
||||
extern void init_timers(void);
|
||||
extern void timers_init(void);
|
||||
struct hrtimer;
|
||||
extern enum hrtimer_restart it_real_fn(struct hrtimer *);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user