diff options
Diffstat (limited to 'drivers/net/phy/dp83640.c')
| -rw-r--r-- | drivers/net/phy/dp83640.c | 13 | 
1 files changed, 10 insertions, 3 deletions
| diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index 482ea404a2d4..557f6510bad7 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -891,14 +891,14 @@ static void decode_txts(struct dp83640_private *dp83640,  			struct phy_txts *phy_txts)  {  	struct skb_shared_hwtstamps shhwtstamps; +	struct dp83640_skb_info *skb_info;  	struct sk_buff *skb; -	u64 ns;  	u8 overflow; +	u64 ns;  	/* We must already have the skb that triggered this. */ - +again:  	skb = skb_dequeue(&dp83640->tx_queue); -  	if (!skb) {  		pr_debug("have timestamp but tx_queue empty\n");  		return; @@ -913,6 +913,11 @@ static void decode_txts(struct dp83640_private *dp83640,  		}  		return;  	} +	skb_info = (struct dp83640_skb_info *)skb->cb; +	if (time_after(jiffies, skb_info->tmo)) { +		kfree_skb(skb); +		goto again; +	}  	ns = phy2txts(phy_txts);  	memset(&shhwtstamps, 0, sizeof(shhwtstamps)); @@ -1463,6 +1468,7 @@ static bool dp83640_rxtstamp(struct phy_device *phydev,  static void dp83640_txtstamp(struct phy_device *phydev,  			     struct sk_buff *skb, int type)  { +	struct dp83640_skb_info *skb_info = (struct dp83640_skb_info *)skb->cb;  	struct dp83640_private *dp83640 = phydev->priv;  	switch (dp83640->hwts_tx_en) { @@ -1475,6 +1481,7 @@ static void dp83640_txtstamp(struct phy_device *phydev,  		/* fall through */  	case HWTSTAMP_TX_ON:  		skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; +		skb_info->tmo = jiffies + SKB_TIMESTAMP_TIMEOUT;  		skb_queue_tail(&dp83640->tx_queue, skb);  		break; | 
