ixgbe: fix lockdep annotation issue for ptp's work item
commit8fecf67c7eafad28bb6725e326aef8a34ee1c045
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 21 Jun 2013 08:14:32 +0000 (21 08:14 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 31 Jul 2013 08:00:57 +0000 (31 01:00 -0700)
tree6ea4a9fad5904441ef5772154d66d93c11b410ad
parente027d1aec4bb49030646d2c186a721f94372d7f2
ixgbe: fix lockdep annotation issue for ptp's work item

This patch fixes a lockdep issue created due to ixgbe_ptp_stop always running
cancel_work_sync even if the work item had not been created properly with
INIT_WORK. This is caused because ixgbe_ptp_stop did not check to actually
ensure PTP was running first. The new implementation introduces a state in the
&adapter->state field which is used to indicate that PTP is running. (This
replaces the IXGBE_FLAG2_PTP_ENABLED field). This state will use the atomic
set_bit, test_bit, and test_and_clear_bit functions. ixgbe_ptp_stop will check
to ensure that PTP was enabled, (and if not, it will not attempt to do any
cleanup work from ixgbe_ptp_init). This resolves the lockdep annotation warning
found by Stephen Hemminger

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe.h
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c