From: Stefan Sørensen Date: Tue, 22 Jul 2014 13:20:45 +0000 (+0200) Subject: dp83640: Fix receive timestamp race condition X-Git-Tag: omap-for-v3.17/fixes-against-rc2~149^2~101 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63502b8d01631bd41778a64c9f6b72ea409bf97b;p=pandora-kernel.git dp83640: Fix receive timestamp race condition When timestamping received packets, rx_timestamp_work may be scheduled before the timestamps is received from the hardware resulting in the packet beeing delivered without the timestamp. This is fixed by changing the receive timestamp path: On receiving a packet that need timestamping, the rxts list is traversed. If a match is found, packet+timestamp are delivered, otherwise the packet is added to a rx_queue. When a timestamp arrives rx_queue is traversed and if a matching packet is found, it is delivered with the timestamp. Otherwise the timestamp is added to the rxts list for matching with packets arriving later. In case the hardware drops a timestamp, a workqueue regularly checks the queue for old packets and delivers them without a timestamp. Signed-off-by: Stefan Sørensen Signed-off-by: David S. Miller --- Reading git-diff-tree failed