OSDN Git Service

firewire: don't use PREPARE_DELAYED_WORK
authorTejun Heo <tj@kernel.org>
Fri, 7 Mar 2014 15:19:57 +0000 (10:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Mar 2014 04:38:16 +0000 (21:38 -0700)
commit9dfce5a3e2f985cca75c05dd714958b9d0ad8ab1
treefe4057fa9870fc22d9469a71f843fc982bece090
parentf5befc2c193dbe92826a382e16cb50e8640a4f62
firewire: don't use PREPARE_DELAYED_WORK

commit 70044d71d31d6973665ced5be04ef39ac1c09a48 upstream.

PREPARE_[DELAYED_]WORK() are being phased out.  They have few users
and a nasty surprise in terms of reentrancy guarantee as workqueue
considers work items to be different if they don't have the same work
function.

firewire core-device and sbp2 have been been multiplexing work items
with multiple work functions.  Introduce fw_device_workfn() and
sbp2_lu_workfn() which invoke fw_device->workfn and
sbp2_logical_unit->workfn respectively and always use the two
functions as the work functions and update the users to set the
->workfn fields instead of overriding work functions using
PREPARE_DELAYED_WORK().

This fixes a variety of possible regressions since a2c1c57be8d9
"workqueue: consider work function when searching for busy work items"
due to which fw_workqueue lost its required non-reentrancy property.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firewire/core-device.c
drivers/firewire/sbp2.c
include/linux/firewire.h