From owner-svn-src-head@freebsd.org Mon Dec 21 12:13:04 2015 Return-Path: Delivered-To: svn-src-head@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 C3D91A4E848; Mon, 21 Dec 2015 12:13:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9231A1578; Mon, 21 Dec 2015 12:13:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLCD3Ig037611; Mon, 21 Dec 2015 12:13:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLCD3Gl037610; Mon, 21 Dec 2015 12:13:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512211213.tBLCD3Gl037610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Dec 2015 12:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292543 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 12:13:04 -0000 Author: hselasky Date: Mon Dec 21 12:13:03 2015 New Revision: 292543 URL: https://svnweb.freebsd.org/changeset/base/292543 Log: In the zero delay case in queue_delayed_work() use the return value from taskqueue_enqueue() instead of reading "ta_pending" unlocked and also ensure the callout is stopped before proceeding. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 11:58:59 2015 (r292542) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 12:13:03 2015 (r292543) @@ -105,13 +105,15 @@ queue_delayed_work(struct workqueue_stru { int pending; - pending = work->work.work_task.ta_pending; work->work.taskqueue = wq->taskqueue; - if (delay != 0) + if (delay != 0) { + pending = work->work.work_task.ta_pending; callout_reset(&work->timer, delay, linux_delayed_work_fn, work); - else - linux_delayed_work_fn((void *)work); - + } else { + callout_stop(&work->timer); + pending = taskqueue_enqueue(work->work.taskqueue, + &work->work.work_task); + } return (!pending); }