diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:11:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:11:59 -0400 |
commit | 283dbd82055eb70ff3b469f812d9c695f18c9641 (patch) | |
tree | 0a97e7b60b79bc48de9276c4da0f9472a202b130 /drivers | |
parent | 11126c611e10abb18b6f1ed0300c0548c3906b54 (diff) | |
parent | 6825a26c2dc21eb4f8df9c06d3786ddec97cf53b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking changes from David Miller:
"The most important bit in here is the fix for input route caching from
Eric Dumazet, it's a shame we couldn't fully analyze this in time for
3.6 as it's a 3.6 regression introduced by the routing cache removal.
Anyways, will send quickly to -stable after you pull this in.
Other changes of note:
1) Fix lockdep splats in team and bonding, from Eric Dumazet.
2) IPV6 adds link local route even when there is no link local
address, from Nicolas Dichtel.
3) Fix ixgbe PTP implementation, from Jacob Keller.
4) Fix excessive stack usage in cxgb4 driver, from Vipul Pandya.
5) MAC length computed improperly in VLAN demux, from Antonio
Quartulli."
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits)
ipv6: release reference of ip6_null_entry's dst entry in __ip6_del_rt
Remove noisy printks from llcp_sock_connect
tipc: prevent dropped connections due to rcvbuf overflow
silence some noisy printks in irda
team: set qdisc_tx_busylock to avoid LOCKDEP splat
bonding: set qdisc_tx_busylock to avoid LOCKDEP splat
sctp: check src addr when processing SACK to update transport state
sctp: fix a typo in prototype of __sctp_rcv_lookup()
ipv4: add a fib_type to fib_info
can: mpc5xxx_can: fix section type conflict
can: peak_pcmcia: fix error return code
can: peak_pci: fix error return code
cxgb4: Fix build error due to missing linux/vmalloc.h include.
bnx2x: fix ring size for 10G functions
cxgb4: Dynamically allocate memory in t4_memory_rw() and get_vpd_params()
ixgbe: add support for X540-AT1
ixgbe: fix poll loop for FDIRCTRL.INIT_DONE bit
ixgbe: fix PTP ethtool timestamping function
ixgbe: (PTP) Fix PPS interrupt code
ixgbe: Fix PTP X540 SDP alignment code for PPS signal
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 | ||||
-rw-r--r-- | drivers/net/can/mscan/mpc5xxx_can.c | 8 | ||||
-rw-r--r-- | drivers/net/can/sja1000/peak_pci.c | 2 | ||||
-rw-r--r-- | drivers/net/can/sja1000/peak_pcmcia.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 17 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 43 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 15 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 202 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/ti/davinci_cpdma.c | 1 | ||||
-rw-r--r-- | drivers/net/team/team.c | 2 |
18 files changed, 176 insertions, 148 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 7858c58df4a3..b721902bb6b4 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4826,6 +4826,7 @@ static int bond_check_params(struct bond_params *params) | |||
4826 | 4826 | ||
4827 | static struct lock_class_key bonding_netdev_xmit_lock_key; | 4827 | static struct lock_class_key bonding_netdev_xmit_lock_key; |
4828 | static struct lock_class_key bonding_netdev_addr_lock_key; | 4828 | static struct lock_class_key bonding_netdev_addr_lock_key; |
4829 | static struct lock_class_key bonding_tx_busylock_key; | ||
4829 | 4830 | ||
4830 | static void bond_set_lockdep_class_one(struct net_device *dev, | 4831 | static void bond_set_lockdep_class_one(struct net_device *dev, |
4831 | struct netdev_queue *txq, | 4832 | struct netdev_queue *txq, |
@@ -4840,6 +4841,7 @@ static void bond_set_lockdep_class(struct net_device *dev) | |||
4840 | lockdep_set_class(&dev->addr_list_lock, | 4841 | lockdep_set_class(&dev->addr_list_lock, |
4841 | &bonding_netdev_addr_lock_key); | 4842 | &bonding_netdev_addr_lock_key); |
4842 | netdev_for_each_tx_queue(dev, bond_set_lockdep_class_one, NULL); | 4843 | netdev_for_each_tx_queue(dev, bond_set_lockdep_class_one, NULL); |
4844 | dev->qdisc_tx_busylock = &bonding_tx_busylock_key; | ||
4843 | } | 4845 | } |
4844 | 4846 | ||
4845 | /* | 4847 | /* |
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index c975999bb055..799c354083c4 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c | |||
@@ -247,7 +247,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev, | |||
247 | } | 247 | } |
248 | #endif /* CONFIG_PPC_MPC512x */ | 248 | #endif /* CONFIG_PPC_MPC512x */ |
249 | 249 | ||
250 | static struct of_device_id mpc5xxx_can_table[]; | 250 | static const struct of_device_id mpc5xxx_can_table[]; |
251 | static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) | 251 | static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) |
252 | { | 252 | { |
253 | const struct of_device_id *match; | 253 | const struct of_device_id *match; |
@@ -380,17 +380,17 @@ static int mpc5xxx_can_resume(struct platform_device *ofdev) | |||
380 | } | 380 | } |
381 | #endif | 381 | #endif |
382 | 382 | ||
383 | static const struct mpc5xxx_can_data __devinitdata mpc5200_can_data = { | 383 | static const struct mpc5xxx_can_data __devinitconst mpc5200_can_data = { |
384 | .type = MSCAN_TYPE_MPC5200, | 384 | .type = MSCAN_TYPE_MPC5200, |
385 | .get_clock = mpc52xx_can_get_clock, | 385 | .get_clock = mpc52xx_can_get_clock, |
386 | }; | 386 | }; |
387 | 387 | ||
388 | static const struct mpc5xxx_can_data __devinitdata mpc5121_can_data = { | 388 | static const struct mpc5xxx_can_data __devinitconst mpc5121_can_data = { |
389 | .type = MSCAN_TYPE_MPC5121, | 389 | .type = MSCAN_TYPE_MPC5121, |
390 | .get_clock = mpc512x_can_get_clock, | 390 | .get_clock = mpc512x_can_get_clock, |
391 | }; | 391 | }; |
392 | 392 | ||
393 | static struct of_device_id __devinitdata mpc5xxx_can_table[] = { | 393 | static const struct of_device_id __devinitconst mpc5xxx_can_table[] = { |
394 | { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, }, | 394 | { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, }, |
395 | /* Note that only MPC5121 Rev. 2 (and later) is supported */ | 395 | /* Note that only MPC5121 Rev. 2 (and later) is supported */ |
396 | { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, }, | 396 | { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, }, |
diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c index f0a12962f7b6..f5b82aeb2540 100644 --- a/drivers/net/can/sja1000/peak_pci.c +++ b/drivers/net/can/sja1000/peak_pci.c | |||
@@ -583,12 +583,14 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev, | |||
583 | cfg_base = pci_iomap(pdev, 0, PEAK_PCI_CFG_SIZE); | 583 | cfg_base = pci_iomap(pdev, 0, PEAK_PCI_CFG_SIZE); |
584 | if (!cfg_base) { | 584 | if (!cfg_base) { |
585 | dev_err(&pdev->dev, "failed to map PCI resource #0\n"); | 585 | dev_err(&pdev->dev, "failed to map PCI resource #0\n"); |
586 | err = -ENOMEM; | ||
586 | goto failure_release_regions; | 587 | goto failure_release_regions; |
587 | } | 588 | } |
588 | 589 | ||
589 | reg_base = pci_iomap(pdev, 1, PEAK_PCI_CHAN_SIZE * channels); | 590 | reg_base = pci_iomap(pdev, 1, PEAK_PCI_CHAN_SIZE * channels); |
590 | if (!reg_base) { | 591 | if (!reg_base) { |
591 | dev_err(&pdev->dev, "failed to map PCI resource #1\n"); | 592 | dev_err(&pdev->dev, "failed to map PCI resource #1\n"); |
593 | err = -ENOMEM; | ||
592 | goto failure_unmap_cfg_base; | 594 | goto failure_unmap_cfg_base; |
593 | } | 595 | } |
594 | 596 | ||
diff --git a/drivers/net/can/sja1000/peak_pcmcia.c b/drivers/net/can/sja1000/peak_pcmcia.c index ec6bd9d1b2af..272a85f32b14 100644 --- a/drivers/net/can/sja1000/peak_pcmcia.c +++ b/drivers/net/can/sja1000/peak_pcmcia.c | |||
@@ -686,8 +686,10 @@ static int __devinit pcan_probe(struct pcmcia_device *pdev) | |||
686 | 686 | ||
687 | /* detect available channels */ | 687 | /* detect available channels */ |
688 | pcan_add_channels(card); | 688 | pcan_add_channels(card); |
689 | if (!card->chan_count) | 689 | if (!card->chan_count) { |
690 | err = -ENOMEM; | ||
690 | goto probe_err_4; | 691 | goto probe_err_4; |
692 | } | ||
691 | 693 | ||
692 | /* init the timer which controls the leds */ | 694 | /* init the timer which controls the leds */ |
693 | init_timer(&card->led_timer); | 695 | init_timer(&card->led_timer); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 30f04a389227..24220992413f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -3523,15 +3523,18 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) | |||
3523 | } else | 3523 | } else |
3524 | #endif | 3524 | #endif |
3525 | if (!bp->rx_ring_size) { | 3525 | if (!bp->rx_ring_size) { |
3526 | u32 cfg = SHMEM_RD(bp, | ||
3527 | dev_info.port_hw_config[BP_PORT(bp)].default_cfg); | ||
3528 | |||
3529 | rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp); | 3526 | rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp); |
3530 | 3527 | ||
3531 | /* Dercease ring size for 1G functions */ | 3528 | if (CHIP_IS_E3(bp)) { |
3532 | if ((cfg & PORT_HW_CFG_NET_SERDES_IF_MASK) == | 3529 | u32 cfg = SHMEM_RD(bp, |
3533 | PORT_HW_CFG_NET_SERDES_IF_SGMII) | 3530 | dev_info.port_hw_config[BP_PORT(bp)]. |
3534 | rx_ring_size /= 10; | 3531 | default_cfg); |
3532 | |||
3533 | /* Decrease ring size for 1G functions */ | ||
3534 | if ((cfg & PORT_HW_CFG_NET_SERDES_IF_MASK) == | ||
3535 | PORT_HW_CFG_NET_SERDES_IF_SGMII) | ||
3536 | rx_ring_size /= 10; | ||
3537 | } | ||
3535 | 3538 | ||
3536 | /* allocate at least number of buffers required by FW */ | 3539 | /* allocate at least number of buffers required by FW */ |
3537 | rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA : | 3540 | rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA : |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index f7ed122f4071..d5648fc666bd 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -3052,9 +3052,8 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x *bp) | |||
3052 | struct eth_stats_info *ether_stat = | 3052 | struct eth_stats_info *ether_stat = |
3053 | &bp->slowpath->drv_info_to_mcp.ether_stat; | 3053 | &bp->slowpath->drv_info_to_mcp.ether_stat; |
3054 | 3054 | ||
3055 | /* leave last char as NULL */ | 3055 | strlcpy(ether_stat->version, DRV_MODULE_VERSION, |
3056 | memcpy(ether_stat->version, DRV_MODULE_VERSION, | 3056 | ETH_STAT_INFO_VERSION_LEN); |
3057 | ETH_STAT_INFO_VERSION_LEN - 1); | ||
3058 | 3057 | ||
3059 | bp->sp_objs[0].mac_obj.get_n_elements(bp, &bp->sp_objs[0].mac_obj, | 3058 | bp->sp_objs[0].mac_obj.get_n_elements(bp, &bp->sp_objs[0].mac_obj, |
3060 | DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED, | 3059 | DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED, |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 46280ba4c5d4..a8800ac10df9 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -782,7 +782,8 @@ static int tg3_ape_wait_for_event(struct tg3 *tp, u32 timeout_us) | |||
782 | return i == timeout_us / 10; | 782 | return i == timeout_us / 10; |
783 | } | 783 | } |
784 | 784 | ||
785 | int tg3_ape_scratchpad_read(struct tg3 *tp, u32 *data, u32 base_off, u32 len) | 785 | static int tg3_ape_scratchpad_read(struct tg3 *tp, u32 *data, u32 base_off, |
786 | u32 len) | ||
786 | { | 787 | { |
787 | int err; | 788 | int err; |
788 | u32 i, bufoff, msgoff, maxlen, apedata; | 789 | u32 i, bufoff, msgoff, maxlen, apedata; |
@@ -7763,7 +7764,7 @@ static int tg3_alloc_consistent(struct tg3 *tp) | |||
7763 | sblk = tnapi->hw_status; | 7764 | sblk = tnapi->hw_status; |
7764 | 7765 | ||
7765 | if (tg3_flag(tp, ENABLE_RSS)) { | 7766 | if (tg3_flag(tp, ENABLE_RSS)) { |
7766 | u16 *prodptr = 0; | 7767 | u16 *prodptr = NULL; |
7767 | 7768 | ||
7768 | /* | 7769 | /* |
7769 | * When RSS is enabled, the status block format changes | 7770 | * When RSS is enabled, the status block format changes |
@@ -8103,11 +8104,11 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
8103 | u16 val16; | 8104 | u16 val16; |
8104 | 8105 | ||
8105 | if (tp->pci_chip_rev_id == CHIPREV_ID_5750_A0) { | 8106 | if (tp->pci_chip_rev_id == CHIPREV_ID_5750_A0) { |
8106 | int i; | 8107 | int j; |
8107 | u32 cfg_val; | 8108 | u32 cfg_val; |
8108 | 8109 | ||
8109 | /* Wait for link training to complete. */ | 8110 | /* Wait for link training to complete. */ |
8110 | for (i = 0; i < 5000; i++) | 8111 | for (j = 0; j < 5000; j++) |
8111 | udelay(100); | 8112 | udelay(100); |
8112 | 8113 | ||
8113 | pci_read_config_dword(tp->pdev, 0xc4, &cfg_val); | 8114 | pci_read_config_dword(tp->pdev, 0xc4, &cfg_val); |
@@ -10206,7 +10207,7 @@ static u32 tg3_irq_count(struct tg3 *tp) | |||
10206 | static bool tg3_enable_msix(struct tg3 *tp) | 10207 | static bool tg3_enable_msix(struct tg3 *tp) |
10207 | { | 10208 | { |
10208 | int i, rc; | 10209 | int i, rc; |
10209 | struct msix_entry msix_ent[tp->irq_max]; | 10210 | struct msix_entry msix_ent[TG3_IRQ_MAX_VECS]; |
10210 | 10211 | ||
10211 | tp->txq_cnt = tp->txq_req; | 10212 | tp->txq_cnt = tp->txq_req; |
10212 | tp->rxq_cnt = tp->rxq_req; | 10213 | tp->rxq_cnt = tp->rxq_req; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 745a1f53361f..31752b24434e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/pci.h> | 43 | #include <linux/pci.h> |
44 | #include <linux/spinlock.h> | 44 | #include <linux/spinlock.h> |
45 | #include <linux/timer.h> | 45 | #include <linux/timer.h> |
46 | #include <linux/vmalloc.h> | ||
46 | #include <asm/io.h> | 47 | #include <asm/io.h> |
47 | #include "cxgb4_uld.h" | 48 | #include "cxgb4_uld.h" |
48 | #include "t4_hw.h" | 49 | #include "t4_hw.h" |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index 35b81d8b59e9..137a24438d9c 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | |||
@@ -408,7 +408,8 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, | |||
408 | __be32 *buf, int dir) | 408 | __be32 *buf, int dir) |
409 | { | 409 | { |
410 | u32 pos, start, end, offset, memoffset; | 410 | u32 pos, start, end, offset, memoffset; |
411 | int ret; | 411 | int ret = 0; |
412 | __be32 *data; | ||
412 | 413 | ||
413 | /* | 414 | /* |
414 | * Argument sanity checks ... | 415 | * Argument sanity checks ... |
@@ -416,6 +417,10 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, | |||
416 | if ((addr & 0x3) || (len & 0x3)) | 417 | if ((addr & 0x3) || (len & 0x3)) |
417 | return -EINVAL; | 418 | return -EINVAL; |
418 | 419 | ||
420 | data = vmalloc(MEMWIN0_APERTURE/sizeof(__be32)); | ||
421 | if (!data) | ||
422 | return -ENOMEM; | ||
423 | |||
419 | /* | 424 | /* |
420 | * Offset into the region of memory which is being accessed | 425 | * Offset into the region of memory which is being accessed |
421 | * MEM_EDC0 = 0 | 426 | * MEM_EDC0 = 0 |
@@ -438,7 +443,6 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, | |||
438 | offset = (addr - start)/sizeof(__be32); | 443 | offset = (addr - start)/sizeof(__be32); |
439 | 444 | ||
440 | for (pos = start; pos < end; pos += MEMWIN0_APERTURE, offset = 0) { | 445 | for (pos = start; pos < end; pos += MEMWIN0_APERTURE, offset = 0) { |
441 | __be32 data[MEMWIN0_APERTURE/sizeof(__be32)]; | ||
442 | 446 | ||
443 | /* | 447 | /* |
444 | * If we're writing, copy the data from the caller's memory | 448 | * If we're writing, copy the data from the caller's memory |
@@ -452,7 +456,7 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, | |||
452 | if (offset || len < MEMWIN0_APERTURE) { | 456 | if (offset || len < MEMWIN0_APERTURE) { |
453 | ret = t4_mem_win_rw(adap, pos, data, 1); | 457 | ret = t4_mem_win_rw(adap, pos, data, 1); |
454 | if (ret) | 458 | if (ret) |
455 | return ret; | 459 | break; |
456 | } | 460 | } |
457 | while (offset < (MEMWIN0_APERTURE/sizeof(__be32)) && | 461 | while (offset < (MEMWIN0_APERTURE/sizeof(__be32)) && |
458 | len > 0) { | 462 | len > 0) { |
@@ -466,7 +470,7 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, | |||
466 | */ | 470 | */ |
467 | ret = t4_mem_win_rw(adap, pos, data, dir); | 471 | ret = t4_mem_win_rw(adap, pos, data, dir); |
468 | if (ret) | 472 | if (ret) |
469 | return ret; | 473 | break; |
470 | 474 | ||
471 | /* | 475 | /* |
472 | * If we're reading, copy the data into the caller's memory | 476 | * If we're reading, copy the data into the caller's memory |
@@ -480,7 +484,8 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, | |||
480 | } | 484 | } |
481 | } | 485 | } |
482 | 486 | ||
483 | return 0; | 487 | vfree(data); |
488 | return ret; | ||
484 | } | 489 | } |
485 | 490 | ||
486 | int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len, | 491 | int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len, |
@@ -519,16 +524,21 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) | |||
519 | u32 cclk_param, cclk_val; | 524 | u32 cclk_param, cclk_val; |
520 | int i, ret; | 525 | int i, ret; |
521 | int ec, sn; | 526 | int ec, sn; |
522 | u8 vpd[VPD_LEN], csum; | 527 | u8 *vpd, csum; |
523 | unsigned int vpdr_len, kw_offset, id_len; | 528 | unsigned int vpdr_len, kw_offset, id_len; |
524 | 529 | ||
525 | ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(vpd), vpd); | 530 | vpd = vmalloc(VPD_LEN); |
531 | if (!vpd) | ||
532 | return -ENOMEM; | ||
533 | |||
534 | ret = pci_read_vpd(adapter->pdev, VPD_BASE, VPD_LEN, vpd); | ||
526 | if (ret < 0) | 535 | if (ret < 0) |
527 | return ret; | 536 | goto out; |
528 | 537 | ||
529 | if (vpd[0] != PCI_VPD_LRDT_ID_STRING) { | 538 | if (vpd[0] != PCI_VPD_LRDT_ID_STRING) { |
530 | dev_err(adapter->pdev_dev, "missing VPD ID string\n"); | 539 | dev_err(adapter->pdev_dev, "missing VPD ID string\n"); |
531 | return -EINVAL; | 540 | ret = -EINVAL; |
541 | goto out; | ||
532 | } | 542 | } |
533 | 543 | ||
534 | id_len = pci_vpd_lrdt_size(vpd); | 544 | id_len = pci_vpd_lrdt_size(vpd); |
@@ -538,21 +548,24 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) | |||
538 | i = pci_vpd_find_tag(vpd, 0, VPD_LEN, PCI_VPD_LRDT_RO_DATA); | 548 | i = pci_vpd_find_tag(vpd, 0, VPD_LEN, PCI_VPD_LRDT_RO_DATA); |
539 | if (i < 0) { | 549 | if (i < 0) { |
540 | dev_err(adapter->pdev_dev, "missing VPD-R section\n"); | 550 | dev_err(adapter->pdev_dev, "missing VPD-R section\n"); |
541 | return -EINVAL; | 551 | ret = -EINVAL; |
552 | goto out; | ||
542 | } | 553 | } |
543 | 554 | ||
544 | vpdr_len = pci_vpd_lrdt_size(&vpd[i]); | 555 | vpdr_len = pci_vpd_lrdt_size(&vpd[i]); |
545 | kw_offset = i + PCI_VPD_LRDT_TAG_SIZE; | 556 | kw_offset = i + PCI_VPD_LRDT_TAG_SIZE; |
546 | if (vpdr_len + kw_offset > VPD_LEN) { | 557 | if (vpdr_len + kw_offset > VPD_LEN) { |
547 | dev_err(adapter->pdev_dev, "bad VPD-R length %u\n", vpdr_len); | 558 | dev_err(adapter->pdev_dev, "bad VPD-R length %u\n", vpdr_len); |
548 | return -EINVAL; | 559 | ret = -EINVAL; |
560 | goto out; | ||
549 | } | 561 | } |
550 | 562 | ||
551 | #define FIND_VPD_KW(var, name) do { \ | 563 | #define FIND_VPD_KW(var, name) do { \ |
552 | var = pci_vpd_find_info_keyword(vpd, kw_offset, vpdr_len, name); \ | 564 | var = pci_vpd_find_info_keyword(vpd, kw_offset, vpdr_len, name); \ |
553 | if (var < 0) { \ | 565 | if (var < 0) { \ |
554 | dev_err(adapter->pdev_dev, "missing VPD keyword " name "\n"); \ | 566 | dev_err(adapter->pdev_dev, "missing VPD keyword " name "\n"); \ |
555 | return -EINVAL; \ | 567 | ret = -EINVAL; \ |
568 | goto out; \ | ||
556 | } \ | 569 | } \ |
557 | var += PCI_VPD_INFO_FLD_HDR_SIZE; \ | 570 | var += PCI_VPD_INFO_FLD_HDR_SIZE; \ |
558 | } while (0) | 571 | } while (0) |
@@ -564,7 +577,8 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) | |||
564 | if (csum) { | 577 | if (csum) { |
565 | dev_err(adapter->pdev_dev, | 578 | dev_err(adapter->pdev_dev, |
566 | "corrupted VPD EEPROM, actual csum %u\n", csum); | 579 | "corrupted VPD EEPROM, actual csum %u\n", csum); |
567 | return -EINVAL; | 580 | ret = -EINVAL; |
581 | goto out; | ||
568 | } | 582 | } |
569 | 583 | ||
570 | FIND_VPD_KW(ec, "EC"); | 584 | FIND_VPD_KW(ec, "EC"); |
@@ -587,6 +601,9 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) | |||
587 | FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CCLK)); | 601 | FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CCLK)); |
588 | ret = t4_query_params(adapter, adapter->mbox, 0, 0, | 602 | ret = t4_query_params(adapter, adapter->mbox, 0, 0, |
589 | 1, &cclk_param, &cclk_val); | 603 | 1, &cclk_param, &cclk_val); |
604 | |||
605 | out: | ||
606 | vfree(vpd); | ||
590 | if (ret) | 607 | if (ret) |
591 | return ret; | 608 | return ret; |
592 | p->cclk = cclk_val; | 609 | p->cclk = cclk_val; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c index 18bf08c9d7a4..1077cb2b38db 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | |||
@@ -1099,7 +1099,7 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) | |||
1099 | if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) & | 1099 | if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) & |
1100 | IXGBE_FDIRCTRL_INIT_DONE) | 1100 | IXGBE_FDIRCTRL_INIT_DONE) |
1101 | break; | 1101 | break; |
1102 | udelay(10); | 1102 | usleep_range(1000, 2000); |
1103 | } | 1103 | } |
1104 | if (i >= IXGBE_FDIR_INIT_DONE_POLL) { | 1104 | if (i >= IXGBE_FDIR_INIT_DONE_POLL) { |
1105 | hw_dbg(hw, "Flow Director Signature poll time exceeded!\n"); | 1105 | hw_dbg(hw, "Flow Director Signature poll time exceeded!\n"); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index 90e41db3cb69..dbf37e4a45fd 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | |||
@@ -70,6 +70,7 @@ static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw) | |||
70 | 70 | ||
71 | switch (hw->device_id) { | 71 | switch (hw->device_id) { |
72 | case IXGBE_DEV_ID_X540T: | 72 | case IXGBE_DEV_ID_X540T: |
73 | case IXGBE_DEV_ID_X540T1: | ||
73 | return 0; | 74 | return 0; |
74 | case IXGBE_DEV_ID_82599_T3_LOM: | 75 | case IXGBE_DEV_ID_82599_T3_LOM: |
75 | return 0; | 76 | return 0; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 4104ea25d818..56b20d17d0e4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -2690,10 +2690,7 @@ static int ixgbe_get_ts_info(struct net_device *dev, | |||
2690 | (1 << HWTSTAMP_FILTER_NONE) | | 2690 | (1 << HWTSTAMP_FILTER_NONE) | |
2691 | (1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) | | 2691 | (1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) | |
2692 | (1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) | | 2692 | (1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) | |
2693 | (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) | | 2693 | (1 << HWTSTAMP_FILTER_PTP_V2_EVENT); |
2694 | (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) | | ||
2695 | (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) | | ||
2696 | (1 << HWTSTAMP_FILTER_SOME); | ||
2697 | break; | 2694 | break; |
2698 | #endif /* CONFIG_IXGBE_PTP */ | 2695 | #endif /* CONFIG_IXGBE_PTP */ |
2699 | default: | 2696 | default: |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 868af6938219..fa3d552e1f4a 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -114,6 +114,7 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbe_pci_tbl) = { | |||
114 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), board_82599 }, | 114 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), board_82599 }, |
115 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), board_82599 }, | 115 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), board_82599 }, |
116 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), board_82599 }, | 116 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), board_82599 }, |
117 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T1), board_X540 }, | ||
117 | /* required last entry */ | 118 | /* required last entry */ |
118 | {0, } | 119 | {0, } |
119 | }; | 120 | }; |
@@ -2322,6 +2323,12 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues, | |||
2322 | default: | 2323 | default: |
2323 | break; | 2324 | break; |
2324 | } | 2325 | } |
2326 | |||
2327 | #ifdef CONFIG_IXGBE_PTP | ||
2328 | if (adapter->hw.mac.type == ixgbe_mac_X540) | ||
2329 | mask |= IXGBE_EIMS_TIMESYNC; | ||
2330 | #endif | ||
2331 | |||
2325 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) && | 2332 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) && |
2326 | !(adapter->flags2 & IXGBE_FLAG2_FDIR_REQUIRES_REINIT)) | 2333 | !(adapter->flags2 & IXGBE_FLAG2_FDIR_REQUIRES_REINIT)) |
2327 | mask |= IXGBE_EIMS_FLOW_DIR; | 2334 | mask |= IXGBE_EIMS_FLOW_DIR; |
@@ -2385,8 +2392,10 @@ static irqreturn_t ixgbe_msix_other(int irq, void *data) | |||
2385 | } | 2392 | } |
2386 | 2393 | ||
2387 | ixgbe_check_fan_failure(adapter, eicr); | 2394 | ixgbe_check_fan_failure(adapter, eicr); |
2395 | |||
2388 | #ifdef CONFIG_IXGBE_PTP | 2396 | #ifdef CONFIG_IXGBE_PTP |
2389 | ixgbe_ptp_check_pps_event(adapter, eicr); | 2397 | if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) |
2398 | ixgbe_ptp_check_pps_event(adapter, eicr); | ||
2390 | #endif | 2399 | #endif |
2391 | 2400 | ||
2392 | /* re-enable the original interrupt state, no lsc, no queues */ | 2401 | /* re-enable the original interrupt state, no lsc, no queues */ |
@@ -2580,7 +2589,8 @@ static irqreturn_t ixgbe_intr(int irq, void *data) | |||
2580 | 2589 | ||
2581 | ixgbe_check_fan_failure(adapter, eicr); | 2590 | ixgbe_check_fan_failure(adapter, eicr); |
2582 | #ifdef CONFIG_IXGBE_PTP | 2591 | #ifdef CONFIG_IXGBE_PTP |
2583 | ixgbe_ptp_check_pps_event(adapter, eicr); | 2592 | if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) |
2593 | ixgbe_ptp_check_pps_event(adapter, eicr); | ||
2584 | #endif | 2594 | #endif |
2585 | 2595 | ||
2586 | /* would disable interrupts here but EIAM disabled it */ | 2596 | /* would disable interrupts here but EIAM disabled it */ |
@@ -7045,6 +7055,7 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id, | |||
7045 | is_wol_supported = 1; | 7055 | is_wol_supported = 1; |
7046 | break; | 7056 | break; |
7047 | case IXGBE_DEV_ID_X540T: | 7057 | case IXGBE_DEV_ID_X540T: |
7058 | case IXGBE_DEV_ID_X540T1: | ||
7048 | /* check eeprom to see if enabled wol */ | 7059 | /* check eeprom to see if enabled wol */ |
7049 | if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) || | 7060 | if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) || |
7050 | ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) && | 7061 | ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) && |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c index 39881cb17a4b..d9291316ee9f 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | |||
@@ -106,6 +106,83 @@ static struct sock_filter ptp_filter[] = { | |||
106 | }; | 106 | }; |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * ixgbe_ptp_setup_sdp | ||
110 | * @hw: the hardware private structure | ||
111 | * | ||
112 | * this function enables or disables the clock out feature on SDP0 for | ||
113 | * the X540 device. It will create a 1second periodic output that can | ||
114 | * be used as the PPS (via an interrupt). | ||
115 | * | ||
116 | * It calculates when the systime will be on an exact second, and then | ||
117 | * aligns the start of the PPS signal to that value. The shift is | ||
118 | * necessary because it can change based on the link speed. | ||
119 | */ | ||
120 | static void ixgbe_ptp_setup_sdp(struct ixgbe_adapter *adapter) | ||
121 | { | ||
122 | struct ixgbe_hw *hw = &adapter->hw; | ||
123 | int shift = adapter->cc.shift; | ||
124 | u32 esdp, tsauxc, clktiml, clktimh, trgttiml, trgttimh, rem; | ||
125 | u64 ns = 0, clock_edge = 0; | ||
126 | |||
127 | if ((adapter->flags2 & IXGBE_FLAG2_PTP_PPS_ENABLED) && | ||
128 | (hw->mac.type == ixgbe_mac_X540)) { | ||
129 | |||
130 | /* disable the pin first */ | ||
131 | IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, 0x0); | ||
132 | IXGBE_WRITE_FLUSH(hw); | ||
133 | |||
134 | esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); | ||
135 | |||
136 | /* | ||
137 | * enable the SDP0 pin as output, and connected to the | ||
138 | * native function for Timesync (ClockOut) | ||
139 | */ | ||
140 | esdp |= (IXGBE_ESDP_SDP0_DIR | | ||
141 | IXGBE_ESDP_SDP0_NATIVE); | ||
142 | |||
143 | /* | ||
144 | * enable the Clock Out feature on SDP0, and allow | ||
145 | * interrupts to occur when the pin changes | ||
146 | */ | ||
147 | tsauxc = (IXGBE_TSAUXC_EN_CLK | | ||
148 | IXGBE_TSAUXC_SYNCLK | | ||
149 | IXGBE_TSAUXC_SDP0_INT); | ||
150 | |||
151 | /* clock period (or pulse length) */ | ||
152 | clktiml = (u32)(NSECS_PER_SEC << shift); | ||
153 | clktimh = (u32)((NSECS_PER_SEC << shift) >> 32); | ||
154 | |||
155 | /* | ||
156 | * Account for the cyclecounter wrap-around value by | ||
157 | * using the converted ns value of the current time to | ||
158 | * check for when the next aligned second would occur. | ||
159 | */ | ||
160 | clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIML); | ||
161 | clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIMH) << 32; | ||
162 | ns = timecounter_cyc2time(&adapter->tc, clock_edge); | ||
163 | |||
164 | div_u64_rem(ns, NSECS_PER_SEC, &rem); | ||
165 | clock_edge += ((NSECS_PER_SEC - (u64)rem) << shift); | ||
166 | |||
167 | /* specify the initial clock start time */ | ||
168 | trgttiml = (u32)clock_edge; | ||
169 | trgttimh = (u32)(clock_edge >> 32); | ||
170 | |||
171 | IXGBE_WRITE_REG(hw, IXGBE_CLKTIML, clktiml); | ||
172 | IXGBE_WRITE_REG(hw, IXGBE_CLKTIMH, clktimh); | ||
173 | IXGBE_WRITE_REG(hw, IXGBE_TRGTTIML0, trgttiml); | ||
174 | IXGBE_WRITE_REG(hw, IXGBE_TRGTTIMH0, trgttimh); | ||
175 | |||
176 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); | ||
177 | IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc); | ||
178 | } else { | ||
179 | IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, 0x0); | ||
180 | } | ||
181 | |||
182 | IXGBE_WRITE_FLUSH(hw); | ||
183 | } | ||
184 | |||
185 | /** | ||
109 | * ixgbe_ptp_read - read raw cycle counter (to be used by time counter) | 186 | * ixgbe_ptp_read - read raw cycle counter (to be used by time counter) |
110 | * @cc: the cyclecounter structure | 187 | * @cc: the cyclecounter structure |
111 | * | 188 | * |
@@ -198,6 +275,9 @@ static int ixgbe_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) | |||
198 | now); | 275 | now); |
199 | 276 | ||
200 | spin_unlock_irqrestore(&adapter->tmreg_lock, flags); | 277 | spin_unlock_irqrestore(&adapter->tmreg_lock, flags); |
278 | |||
279 | ixgbe_ptp_setup_sdp(adapter); | ||
280 | |||
201 | return 0; | 281 | return 0; |
202 | } | 282 | } |
203 | 283 | ||
@@ -251,6 +331,7 @@ static int ixgbe_ptp_settime(struct ptp_clock_info *ptp, | |||
251 | timecounter_init(&adapter->tc, &adapter->cc, ns); | 331 | timecounter_init(&adapter->tc, &adapter->cc, ns); |
252 | spin_unlock_irqrestore(&adapter->tmreg_lock, flags); | 332 | spin_unlock_irqrestore(&adapter->tmreg_lock, flags); |
253 | 333 | ||
334 | ixgbe_ptp_setup_sdp(adapter); | ||
254 | return 0; | 335 | return 0; |
255 | } | 336 | } |
256 | 337 | ||
@@ -281,8 +362,9 @@ static int ixgbe_ptp_enable(struct ptp_clock_info *ptp, | |||
281 | if (on) | 362 | if (on) |
282 | adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED; | 363 | adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED; |
283 | else | 364 | else |
284 | adapter->flags2 &= | 365 | adapter->flags2 &= ~IXGBE_FLAG2_PTP_PPS_ENABLED; |
285 | ~IXGBE_FLAG2_PTP_PPS_ENABLED; | 366 | |
367 | ixgbe_ptp_setup_sdp(adapter); | ||
286 | return 0; | 368 | return 0; |
287 | default: | 369 | default: |
288 | break; | 370 | break; |
@@ -305,109 +387,15 @@ void ixgbe_ptp_check_pps_event(struct ixgbe_adapter *adapter, u32 eicr) | |||
305 | struct ixgbe_hw *hw = &adapter->hw; | 387 | struct ixgbe_hw *hw = &adapter->hw; |
306 | struct ptp_clock_event event; | 388 | struct ptp_clock_event event; |
307 | 389 | ||
308 | event.type = PTP_CLOCK_PPS; | ||
309 | |||
310 | /* Make sure ptp clock is valid, and PPS event enabled */ | ||
311 | if (!adapter->ptp_clock || | ||
312 | !(adapter->flags2 & IXGBE_FLAG2_PTP_PPS_ENABLED)) | ||
313 | return; | ||
314 | |||
315 | if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) { | ||
316 | switch (hw->mac.type) { | ||
317 | case ixgbe_mac_X540: | ||
318 | ptp_clock_event(adapter->ptp_clock, &event); | ||
319 | break; | ||
320 | default: | ||
321 | break; | ||
322 | } | ||
323 | } | ||
324 | } | ||
325 | |||
326 | /** | ||
327 | * ixgbe_ptp_enable_sdp | ||
328 | * @hw: the hardware private structure | ||
329 | * @shift: the clock shift for calculating nanoseconds | ||
330 | * | ||
331 | * this function enables the clock out feature on the sdp0 for the | ||
332 | * X540 device. It will create a 1second periodic output that can be | ||
333 | * used as the PPS (via an interrupt). | ||
334 | * | ||
335 | * It calculates when the systime will be on an exact second, and then | ||
336 | * aligns the start of the PPS signal to that value. The shift is | ||
337 | * necessary because it can change based on the link speed. | ||
338 | */ | ||
339 | static void ixgbe_ptp_enable_sdp(struct ixgbe_hw *hw, int shift) | ||
340 | { | ||
341 | u32 esdp, tsauxc, clktiml, clktimh, trgttiml, trgttimh; | ||
342 | u64 clock_edge = 0; | ||
343 | u32 rem; | ||
344 | |||
345 | switch (hw->mac.type) { | 390 | switch (hw->mac.type) { |
346 | case ixgbe_mac_X540: | 391 | case ixgbe_mac_X540: |
347 | esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); | 392 | ptp_clock_event(adapter->ptp_clock, &event); |
348 | |||
349 | /* | ||
350 | * enable the SDP0 pin as output, and connected to the native | ||
351 | * function for Timesync (ClockOut) | ||
352 | */ | ||
353 | esdp |= (IXGBE_ESDP_SDP0_DIR | | ||
354 | IXGBE_ESDP_SDP0_NATIVE); | ||
355 | |||
356 | /* | ||
357 | * enable the Clock Out feature on SDP0, and allow interrupts | ||
358 | * to occur when the pin changes | ||
359 | */ | ||
360 | tsauxc = (IXGBE_TSAUXC_EN_CLK | | ||
361 | IXGBE_TSAUXC_SYNCLK | | ||
362 | IXGBE_TSAUXC_SDP0_INT); | ||
363 | |||
364 | /* clock period (or pulse length) */ | ||
365 | clktiml = (u32)(NSECS_PER_SEC << shift); | ||
366 | clktimh = (u32)((NSECS_PER_SEC << shift) >> 32); | ||
367 | |||
368 | clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIML); | ||
369 | clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIMH) << 32; | ||
370 | |||
371 | /* | ||
372 | * account for the fact that we can't do u64 division | ||
373 | * with remainder, by converting the clock values into | ||
374 | * nanoseconds first | ||
375 | */ | ||
376 | clock_edge >>= shift; | ||
377 | div_u64_rem(clock_edge, NSECS_PER_SEC, &rem); | ||
378 | clock_edge += (NSECS_PER_SEC - rem); | ||
379 | clock_edge <<= shift; | ||
380 | |||
381 | /* specify the initial clock start time */ | ||
382 | trgttiml = (u32)clock_edge; | ||
383 | trgttimh = (u32)(clock_edge >> 32); | ||
384 | |||
385 | IXGBE_WRITE_REG(hw, IXGBE_CLKTIML, clktiml); | ||
386 | IXGBE_WRITE_REG(hw, IXGBE_CLKTIMH, clktimh); | ||
387 | IXGBE_WRITE_REG(hw, IXGBE_TRGTTIML0, trgttiml); | ||
388 | IXGBE_WRITE_REG(hw, IXGBE_TRGTTIMH0, trgttimh); | ||
389 | |||
390 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); | ||
391 | IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc); | ||
392 | |||
393 | IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_TIMESYNC); | ||
394 | break; | 393 | break; |
395 | default: | 394 | default: |
396 | break; | 395 | break; |
397 | } | 396 | } |
398 | } | 397 | } |
399 | 398 | ||
400 | /** | ||
401 | * ixgbe_ptp_disable_sdp | ||
402 | * @hw: the private hardware structure | ||
403 | * | ||
404 | * this function disables the auxiliary SDP clock out feature | ||
405 | */ | ||
406 | static void ixgbe_ptp_disable_sdp(struct ixgbe_hw *hw) | ||
407 | { | ||
408 | IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_TIMESYNC); | ||
409 | IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, 0); | ||
410 | } | ||
411 | 399 | ||
412 | /** | 400 | /** |
413 | * ixgbe_ptp_overflow_check - delayed work to detect SYSTIME overflow | 401 | * ixgbe_ptp_overflow_check - delayed work to detect SYSTIME overflow |
@@ -822,9 +810,6 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter) | |||
822 | if (adapter->cycle_speed == cycle_speed && timinca) | 810 | if (adapter->cycle_speed == cycle_speed && timinca) |
823 | return; | 811 | return; |
824 | 812 | ||
825 | /* disable the SDP clock out */ | ||
826 | ixgbe_ptp_disable_sdp(hw); | ||
827 | |||
828 | /** | 813 | /** |
829 | * Scale the NIC cycle counter by a large factor so that | 814 | * Scale the NIC cycle counter by a large factor so that |
830 | * relatively small corrections to the frequency can be added | 815 | * relatively small corrections to the frequency can be added |
@@ -877,10 +862,6 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter) | |||
877 | IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0x00000000); | 862 | IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0x00000000); |
878 | IXGBE_WRITE_FLUSH(hw); | 863 | IXGBE_WRITE_FLUSH(hw); |
879 | 864 | ||
880 | /* now that the shift has been calculated and the systime | ||
881 | * registers reset, (re-)enable the Clock out feature*/ | ||
882 | ixgbe_ptp_enable_sdp(hw, shift); | ||
883 | |||
884 | /* store the new cycle speed */ | 865 | /* store the new cycle speed */ |
885 | adapter->cycle_speed = cycle_speed; | 866 | adapter->cycle_speed = cycle_speed; |
886 | 867 | ||
@@ -901,6 +882,12 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter) | |||
901 | ktime_to_ns(ktime_get_real())); | 882 | ktime_to_ns(ktime_get_real())); |
902 | 883 | ||
903 | spin_unlock_irqrestore(&adapter->tmreg_lock, flags); | 884 | spin_unlock_irqrestore(&adapter->tmreg_lock, flags); |
885 | |||
886 | /* | ||
887 | * Now that the shift has been calculated and the systime | ||
888 | * registers reset, (re-)enable the Clock out feature | ||
889 | */ | ||
890 | ixgbe_ptp_setup_sdp(adapter); | ||
904 | } | 891 | } |
905 | 892 | ||
906 | /** | 893 | /** |
@@ -979,10 +966,11 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter) | |||
979 | */ | 966 | */ |
980 | void ixgbe_ptp_stop(struct ixgbe_adapter *adapter) | 967 | void ixgbe_ptp_stop(struct ixgbe_adapter *adapter) |
981 | { | 968 | { |
982 | ixgbe_ptp_disable_sdp(&adapter->hw); | ||
983 | |||
984 | /* stop the overflow check task */ | 969 | /* stop the overflow check task */ |
985 | adapter->flags2 &= ~IXGBE_FLAG2_OVERFLOW_CHECK_ENABLED; | 970 | adapter->flags2 &= ~(IXGBE_FLAG2_OVERFLOW_CHECK_ENABLED | |
971 | IXGBE_FLAG2_PTP_PPS_ENABLED); | ||
972 | |||
973 | ixgbe_ptp_setup_sdp(adapter); | ||
986 | 974 | ||
987 | if (adapter->ptp_clock) { | 975 | if (adapter->ptp_clock) { |
988 | ptp_clock_unregister(adapter->ptp_clock); | 976 | ptp_clock_unregister(adapter->ptp_clock); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h index 400f86a31174..0722f3368092 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | |||
@@ -65,6 +65,7 @@ | |||
65 | #define IXGBE_DEV_ID_82599_LS 0x154F | 65 | #define IXGBE_DEV_ID_82599_LS 0x154F |
66 | #define IXGBE_DEV_ID_X540T 0x1528 | 66 | #define IXGBE_DEV_ID_X540T 0x1528 |
67 | #define IXGBE_DEV_ID_82599_SFP_SF_QP 0x154A | 67 | #define IXGBE_DEV_ID_82599_SFP_SF_QP 0x154A |
68 | #define IXGBE_DEV_ID_X540T1 0x1560 | ||
68 | 69 | ||
69 | /* VF Device IDs */ | 70 | /* VF Device IDs */ |
70 | #define IXGBE_DEV_ID_82599_VF 0x10ED | 71 | #define IXGBE_DEV_ID_82599_VF 0x10ED |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig index bce01641ee6b..97302419a377 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | |||
@@ -26,7 +26,7 @@ if PCH_GBE | |||
26 | config PCH_PTP | 26 | config PCH_PTP |
27 | bool "PCH PTP clock support" | 27 | bool "PCH PTP clock support" |
28 | default n | 28 | default n |
29 | depends on PTP_1588_CLOCK_PCH | 29 | select PTP_1588_CLOCK_PCH |
30 | ---help--- | 30 | ---help--- |
31 | Say Y here if you want to use Precision Time Protocol (PTP) in the | 31 | Say Y here if you want to use Precision Time Protocol (PTP) in the |
32 | driver. PTP is a method to precisely synchronize distributed clocks | 32 | driver. PTP is a method to precisely synchronize distributed clocks |
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index d15c888e9df8..49956730cd8d 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c | |||
@@ -863,6 +863,7 @@ int cpdma_chan_stop(struct cpdma_chan *chan) | |||
863 | 863 | ||
864 | next_dma = desc_read(desc, hw_next); | 864 | next_dma = desc_read(desc, hw_next); |
865 | chan->head = desc_from_phys(pool, next_dma); | 865 | chan->head = desc_from_phys(pool, next_dma); |
866 | chan->count--; | ||
866 | chan->stats.teardown_dequeue++; | 867 | chan->stats.teardown_dequeue++; |
867 | 868 | ||
868 | /* issue callback without locks held */ | 869 | /* issue callback without locks held */ |
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 5c7547c4f802..d44cca327588 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -1315,6 +1315,7 @@ static const struct team_option team_options[] = { | |||
1315 | 1315 | ||
1316 | static struct lock_class_key team_netdev_xmit_lock_key; | 1316 | static struct lock_class_key team_netdev_xmit_lock_key; |
1317 | static struct lock_class_key team_netdev_addr_lock_key; | 1317 | static struct lock_class_key team_netdev_addr_lock_key; |
1318 | static struct lock_class_key team_tx_busylock_key; | ||
1318 | 1319 | ||
1319 | static void team_set_lockdep_class_one(struct net_device *dev, | 1320 | static void team_set_lockdep_class_one(struct net_device *dev, |
1320 | struct netdev_queue *txq, | 1321 | struct netdev_queue *txq, |
@@ -1327,6 +1328,7 @@ static void team_set_lockdep_class(struct net_device *dev) | |||
1327 | { | 1328 | { |
1328 | lockdep_set_class(&dev->addr_list_lock, &team_netdev_addr_lock_key); | 1329 | lockdep_set_class(&dev->addr_list_lock, &team_netdev_addr_lock_key); |
1329 | netdev_for_each_tx_queue(dev, team_set_lockdep_class_one, NULL); | 1330 | netdev_for_each_tx_queue(dev, team_set_lockdep_class_one, NULL); |
1331 | dev->qdisc_tx_busylock = &team_tx_busylock_key; | ||
1330 | } | 1332 | } |
1331 | 1333 | ||
1332 | static int team_init(struct net_device *dev) | 1334 | static int team_init(struct net_device *dev) |