From owner-freebsd-net@freebsd.org Fri Jul 15 03:45:31 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA40DB982BA; Fri, 15 Jul 2016 03:45:31 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC4651306; Fri, 15 Jul 2016 03:45:31 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1468554328859242.3635984150202; Thu, 14 Jul 2016 20:45:28 -0700 (PDT) Date: Thu, 14 Jul 2016 20:45:28 -0700 From: Matthew Macy To: "freebsd-current@freebsd.org" , "freebsd-net@freebsd.org" Message-ID: <155eca8bae0.d811ff9b567670.7363072028299444677@nextbsd.org> Subject: callout_drain either broken or man page needs updating MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2016 03:45:31 -0000 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)); }