i40e: fix Timesync Tx interrupt handler code
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 25 Apr 2014 01:05:03 +0000 (18:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Apr 2014 16:55:39 +0000 (12:55 -0400)
commitcafa1fca9de584dcd920629cf075091a7df64bb0
tree433b2952a832031fa71e51b614783b8b8bd4962d
parent69d268b7725d1478cc084d9397b9d045c7f14b0a
i40e: fix Timesync Tx interrupt handler code

This patch fixes the PTP Tx timestamp interrupt handler. The original
code misinterpreted the interrupt handler design. We were clearing the
ena_mask bit for the Timesync interrupts. This is done to indicate that
the interrupt will be handled in a scheduled work item (instead of
immediately) and that work item is responsible for re-enabling the
interrupts. However, the Tx timestamp was being handled immediately and
nothing was ever re-enabling it. This resulted in a single interrupt
working for the life of the driver.

This patch fixes the issue by instead clearing the bit from icr0 which
is used to indicate that the interrupt was immediately handled and can
be re-enabled right away. This patch also clears up a related issue due
to writing the PRTTSYN_STAT_0 register, which was unintentionally
clearing the cause bits for Timesync interrupts.

Change-ID: I057bd70d53c302f60fab78246989cbdfa469d83b
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/i40e/i40e_main.c