]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
net: macb: Check for SKBTX_HW_TSTAMP in macb driver
authorPaul Thomas <pthomas8589@gmail.com>
Thu, 14 Mar 2019 10:11:33 +0000 (15:41 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 15 Mar 2019 10:23:54 +0000 (11:23 +0100)
Make sure SKBTX_HW_TSTAMP (i.e. SOF_TIMESTAMPING_TX_HARDWARE) has
been enabled for this skb. This is a common practice in handling TX
timestamp. It fixes the issue where normal socks that aren't
expecting a timestamp will not wake up on select.

Fixed if statement, modified commit description and tested.
- Harini

Signed-off-by: Paul Thomas <pthomas8589@gmail.com>
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/cadence/macb_main.c

index eb0503b79e40b2df3f23f56f2d63f9d27991680e..13d6409b8d822479a36e90d8c215c2a6f34a25a9 100644 (file)
@@ -930,7 +930,9 @@ static void macb_tx_interrupt(struct macb_queue *queue)
 
                        /* First, update TX stats if needed */
                        if (skb) {
-                               if (gem_ptp_do_txstamp(queue, skb, desc) == 0) {
+                               if (unlikely(skb_shinfo(skb)->tx_flags &
+                                            SKBTX_HW_TSTAMP) &&
+                                 (gem_ptp_do_txstamp(queue, skb, desc) == 0)) {
                                        /* skb now belongs to timestamp buffer
                                         * and will be removed later
                                         */