aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/dp83640.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-02-08 14:21:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-02-08 14:21:54 -0500
commit27b4ad621e887ce8e5eb508a0103f13d30f6b38a (patch)
treee1fda67c6c119c2f6a00a22fe8ae9b7a2494e799 /drivers/net/phy/dp83640.c
parent680905431b9de8c7224b15b76b1826a1481cfeaf (diff)
parent39841cc1cbb69344539c98a1fa9d858ed124c7ba (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "This pull request is dedicated to the upcoming snowpocalypse parts 2 and 3 in the Pacific Northwest: 1) Drop profiles are broken because some drivers use dev_kfree_skb* instead of dev_consume_skb*, from Yang Wei. 2) Fix IWLWIFI kconfig deps, from Luca Coelho. 3) Fix percpu maps updating in bpftool, from Paolo Abeni. 4) Missing station release in batman-adv, from Felix Fietkau. 5) Fix some networking compat ioctl bugs, from Johannes Berg. 6) ucc_geth must reset the BQL queue state when stopping the device, from Mathias Thore. 7) Several XDP bug fixes in virtio_net from Toshiaki Makita. 8) TSO packets must be sent always on queue 0 in stmmac, from Jose Abreu. 9) Fix socket refcounting bug in RDS, from Eric Dumazet. 10) Handle sparse cpu allocations in bpf selftests, from Martynas Pumputis. 11) Make sure mgmt frames have enough tailroom in mac80211, from Felix Feitkau. 12) Use safe list walking in sctp_sendmsg() asoc list traversal, from Greg Kroah-Hartman. 13) Make DCCP's ccid_hc_[rt]x_parse_options always check for NULL ccid, from Eric Dumazet. 14) Need to reload WoL password into bcmsysport device after deep sleeps, from Florian Fainelli. 15) Remove filter from mask before freeing in cls_flower, from Petr Machata. 16) Missing release and use after free in error paths of s390 qeth code, from Julian Wiedmann. 17) Fix lockdep false positive in dsa code, from Marc Zyngier. 18) Fix counting of ATU violations in mv88e6xxx, from Andrew Lunn. 19) Fix EQ firmware assert in qed driver, from Manish Chopra. 20) Don't default Caivum PTP to Y in kconfig, from Bjorn Helgaas" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits) net: dsa: b53: Fix for failure when irq is not defined in dt sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach() geneve: should not call rt6_lookup() when ipv6 was disabled net: Don't default Cavium PTP driver to 'y' net: broadcom: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: via-velocity: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: tehuti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: sun: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: fsl_ucc_hdlc: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: fec_mpc52xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: smsc: epic100: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: dscc4: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: tulip: de2104x: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net: defxx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles net/mlx5e: Don't overwrite pedit action when multiple pedit used net/mlx5e: Update hw flows when encap source mac changed qed*: Advance drivers version to 8.37.0.20 qed: Change verbosity for coalescing message. qede: Fix system crash on configuring channels. qed: Consider TX tcs while deriving the max num_queues for PF. ...
Diffstat (limited to 'drivers/net/phy/dp83640.c')
-rw-r--r--drivers/net/phy/dp83640.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 18b41bc345ab..6e8807212aa3 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -898,14 +898,14 @@ static void decode_txts(struct dp83640_private *dp83640,
898 struct phy_txts *phy_txts) 898 struct phy_txts *phy_txts)
899{ 899{
900 struct skb_shared_hwtstamps shhwtstamps; 900 struct skb_shared_hwtstamps shhwtstamps;
901 struct dp83640_skb_info *skb_info;
901 struct sk_buff *skb; 902 struct sk_buff *skb;
902 u64 ns;
903 u8 overflow; 903 u8 overflow;
904 u64 ns;
904 905
905 /* We must already have the skb that triggered this. */ 906 /* We must already have the skb that triggered this. */
906 907again:
907 skb = skb_dequeue(&dp83640->tx_queue); 908 skb = skb_dequeue(&dp83640->tx_queue);
908
909 if (!skb) { 909 if (!skb) {
910 pr_debug("have timestamp but tx_queue empty\n"); 910 pr_debug("have timestamp but tx_queue empty\n");
911 return; 911 return;
@@ -920,6 +920,11 @@ static void decode_txts(struct dp83640_private *dp83640,
920 } 920 }
921 return; 921 return;
922 } 922 }
923 skb_info = (struct dp83640_skb_info *)skb->cb;
924 if (time_after(jiffies, skb_info->tmo)) {
925 kfree_skb(skb);
926 goto again;
927 }
923 928
924 ns = phy2txts(phy_txts); 929 ns = phy2txts(phy_txts);
925 memset(&shhwtstamps, 0, sizeof(shhwtstamps)); 930 memset(&shhwtstamps, 0, sizeof(shhwtstamps));
@@ -1472,6 +1477,7 @@ static bool dp83640_rxtstamp(struct phy_device *phydev,
1472static void dp83640_txtstamp(struct phy_device *phydev, 1477static void dp83640_txtstamp(struct phy_device *phydev,
1473 struct sk_buff *skb, int type) 1478 struct sk_buff *skb, int type)
1474{ 1479{
1480 struct dp83640_skb_info *skb_info = (struct dp83640_skb_info *)skb->cb;
1475 struct dp83640_private *dp83640 = phydev->priv; 1481 struct dp83640_private *dp83640 = phydev->priv;
1476 1482
1477 switch (dp83640->hwts_tx_en) { 1483 switch (dp83640->hwts_tx_en) {
@@ -1484,6 +1490,7 @@ static void dp83640_txtstamp(struct phy_device *phydev,
1484 /* fall through */ 1490 /* fall through */
1485 case HWTSTAMP_TX_ON: 1491 case HWTSTAMP_TX_ON:
1486 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; 1492 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
1493 skb_info->tmo = jiffies + SKB_TIMESTAMP_TIMEOUT;
1487 skb_queue_tail(&dp83640->tx_queue, skb); 1494 skb_queue_tail(&dp83640->tx_queue, skb);
1488 break; 1495 break;
1489 1496