Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2016 20:45:28 -0700
From:      Matthew Macy <mmacy@nextbsd.org>
To:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>,  "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   callout_drain either broken or man page needs updating
Message-ID:  <155eca8bae0.d811ff9b567670.7363072028299444677@nextbsd.org>

next in thread | raw e-mail | index | archive | help

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));
}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?155eca8bae0.d811ff9b567670.7363072028299444677>