summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_jmicron.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2017-05-03 20:28:53 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2017-06-14 02:11:47 +0300
commitaaebaf50b502648b1d4d8c93b4be133944c2bbd0 (patch)
tree786d784a10676f1d309531c3706cf45a93056438 /drivers/ata/pata_jmicron.c
parentb217566a525ff24334d17635a865f44b68c2c583 (diff)
downloadlinux-aaebaf50b502648b1d4d8c93b4be133944c2bbd0.tar.xz
ixgbe: fix race condition with PTP_TX_IN_PROGRESS bits
Hardware related to the ixgbe driver is limited to handling a single Tx timestamp request at a time. Thus, the driver ignores requests for Tx timestamp while waiting for the current request to finish. It uses a state bit lock which enforces that only one timestamp request is honored at a time. Unfortunately this suffers from a simple race condition. The bit lock is not cleared until after skb_tstamp_tx() is called notifying applications of a new Tx timestamp. Even a well behaved application sending only one packet at a time and waiting for a response can wake up and send a new packet before the bit lock is cleared. This results in needlessly dropping some Tx timestamp requests. We can fix this by unlocking the state bit as soon as we read the Timestamp register, as this is the first point at which it is safe to unlock. To avoid issues with the skb pointer, we'll use a copy of the pointer and set the global variable in the driver structure to NULL first. This ensures that the next timestamp request does not modify our local copy of the skb pointer. This ensures that well behaved applications do not accidentally race with the unlock bit. Obviously an application which sends multiple Tx timestamp requests at once will still only timestamp one packet at a time. Unfortunately there is nothing we can do about this. Reported-by: David Mirabito <davidm@metamako.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/ata/pata_jmicron.c')
0 files changed, 0 insertions, 0 deletions