aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2009-11-20 18:27:40 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-21 14:34:24 -0500
commit53ec5498d107a61b84944351d32324ce52788b74 (patch)
tree663fdeb193134471c22eaffca76796dcfb70b1d7 /drivers/net/e1000e
parent99673d9b5d48c81f2e9fe094c0d9e42815c60b3f (diff)
e1000e: set pm_qos DMA latency requirement per interface when needed
It was pointed out a pm_qos DMA latency requirement set when the driver is loaded when parts that support early receive of jumbo frames are probed could have that requirement overidden if another part supported by the driver (one that does not support early receive of jumbo frames) is probed later. Change the DMA latency requirement to be per-interface if needed instead of per driver. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/netdev.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 25b0ef8dc86a..39f01d998b4d 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2472,21 +2472,23 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
2472 * packet size is equal or larger than the specified value (in 8 byte 2472 * packet size is equal or larger than the specified value (in 8 byte
2473 * units), e.g. using jumbo frames when setting to E1000_ERT_2048 2473 * units), e.g. using jumbo frames when setting to E1000_ERT_2048
2474 */ 2474 */
2475 if ((adapter->flags & FLAG_HAS_ERT) && 2475 if (adapter->flags & FLAG_HAS_ERT) {
2476 (adapter->netdev->mtu > ETH_DATA_LEN)) { 2476 if (adapter->netdev->mtu > ETH_DATA_LEN) {
2477 u32 rxdctl = er32(RXDCTL(0)); 2477 u32 rxdctl = er32(RXDCTL(0));
2478 ew32(RXDCTL(0), rxdctl | 0x3); 2478 ew32(RXDCTL(0), rxdctl | 0x3);
2479 ew32(ERT, E1000_ERT_2048 | (1 << 13)); 2479 ew32(ERT, E1000_ERT_2048 | (1 << 13));
2480 /* 2480 /*
2481 * With jumbo frames and early-receive enabled, excessive 2481 * With jumbo frames and early-receive enabled,
2482 * C4->C2 latencies result in dropped transactions. 2482 * excessive C-state transition latencies result in
2483 */ 2483 * dropped transactions.
2484 pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, 2484 */
2485 e1000e_driver_name, 55); 2485 pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
2486 } else { 2486 adapter->netdev->name, 55);
2487 pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, 2487 } else {
2488 e1000e_driver_name, 2488 pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
2489 PM_QOS_DEFAULT_VALUE); 2489 adapter->netdev->name,
2490 PM_QOS_DEFAULT_VALUE);
2491 }
2490 } 2492 }
2491 2493
2492 /* Enable Receives */ 2494 /* Enable Receives */
@@ -2804,6 +2806,12 @@ int e1000e_up(struct e1000_adapter *adapter)
2804{ 2806{
2805 struct e1000_hw *hw = &adapter->hw; 2807 struct e1000_hw *hw = &adapter->hw;
2806 2808
2809 /* DMA latency requirement to workaround early-receive/jumbo issue */
2810 if (adapter->flags & FLAG_HAS_ERT)
2811 pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
2812 adapter->netdev->name,
2813 PM_QOS_DEFAULT_VALUE);
2814
2807 /* hardware has been reset, we need to reload some things */ 2815 /* hardware has been reset, we need to reload some things */
2808 e1000_configure(adapter); 2816 e1000_configure(adapter);
2809 2817
@@ -2864,6 +2872,10 @@ void e1000e_down(struct e1000_adapter *adapter)
2864 e1000_clean_tx_ring(adapter); 2872 e1000_clean_tx_ring(adapter);
2865 e1000_clean_rx_ring(adapter); 2873 e1000_clean_rx_ring(adapter);
2866 2874
2875 if (adapter->flags & FLAG_HAS_ERT)
2876 pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
2877 adapter->netdev->name);
2878
2867 /* 2879 /*
2868 * TODO: for power management, we could drop the link and 2880 * TODO: for power management, we could drop the link and
2869 * pci_disable_device here. 2881 * pci_disable_device here.
@@ -5363,9 +5375,7 @@ static int __init e1000_init_module(void)
5363 printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n", 5375 printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n",
5364 e1000e_driver_name); 5376 e1000e_driver_name);
5365 ret = pci_register_driver(&e1000_driver); 5377 ret = pci_register_driver(&e1000_driver);
5366 pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name, 5378
5367 PM_QOS_DEFAULT_VALUE);
5368
5369 return ret; 5379 return ret;
5370} 5380}
5371module_init(e1000_init_module); 5381module_init(e1000_init_module);
@@ -5379,7 +5389,6 @@ module_init(e1000_init_module);
5379static void __exit e1000_exit_module(void) 5389static void __exit e1000_exit_module(void)
5380{ 5390{
5381 pci_unregister_driver(&e1000_driver); 5391 pci_unregister_driver(&e1000_driver);
5382 pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name);
5383} 5392}
5384module_exit(e1000_exit_module); 5393module_exit(e1000_exit_module);
5385 5394