callout_drain either broken or man page needs updating

Matthew Macy mmacy at nextbsd.org
Fri Jul 15 03:45:31 UTC 2016


Upon updating my drm-next branch to the latest -CURRENT callout_drain returning no longer means that the function was in fact pending when it was called.


This little bit of code will panic because dwork->wq is NULL, because the callout was _not_ in fact enqueued. So either it's no longer possible to reliably query if a callout was pending while clearing it and we're ok with that or glebius last commit needs some further re-work.



#define	del_timer_sync(timer)	(callout_drain(&(timer)->timer_callout) == 1)

static inline bool
flush_delayed_work(struct delayed_work *dwork)
{

	if (del_timer_sync(&dwork->timer))
		linux_queue_work(dwork->cpu, dwork->wq, &dwork->work);
	return (flush_work(&dwork->work));
}



More information about the freebsd-current mailing list