diff options
author | Florian Mickler <florian@mickler.org> | 2010-08-02 10:27:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-03 00:20:20 -0400 |
commit | c128ec29208d410568469bd8bb373b4cdc10912a (patch) | |
tree | e53af9e53a700baddb147f961207fd88d44cd97b /drivers/net/e1000e/netdev.c | |
parent | c893b8066c7bf6156e4d760e5acaf4c148e37190 (diff) |
e1000e: register pm_qos request on hardware activation
The pm_qos_add_request call has to register the pm_qos request with the pm_qos
susbsystem before first use of the pm_qos request via
pm_qos_update_request.
As pm_qos changed to use plists there is no benefit in registering and
unregistering the pm_qos request on ifup/ifdown and thus we move the
registering into e1000_open and the unregistering in e1000_close.
This fixes the following warning:
[ 1.786060] WARNING: at kernel/pm_qos_params.c:264
pm_qos_update_request+0x28/0x54()
[ 1.786088] Hardware name: Latitude E6500
[ 1.787045] pm_qos_update_request() called for unknown object
[ 1.787966] Modules linked in:
[ 1.788940] Pid: 1, comm: swapper Not tainted 2.6.35-rc5-mmotm0719 #1
[ 1.790035] Call Trace:
[ 1.791121] [<ffffffff81037335>] warn_slowpath_common+0x80/0x98
[ 1.792205] [<ffffffff810373e1>] warn_slowpath_fmt+0x41/0x43
[ 1.793279] [<ffffffff81057c14>] pm_qos_update_request+0x28/0x54
[ 1.794347] [<ffffffff8134889e>] e1000_configure+0x421/0x459
[ 1.795393] [<ffffffff8134afbd>] e1000_open+0xbd/0x37c
[ 1.796436] [<ffffffff8105743a>] ? raw_notifier_call_chain+0xf/0x11
[ 1.797491] [<ffffffff8145f948>] __dev_open+0xae/0xe2
[ 1.798547] [<ffffffff8145f997>] dev_open+0x1b/0x49
[ 1.799612] [<ffffffff8146e36e>] netpoll_setup+0x84/0x259
[ 1.800685] [<ffffffff81b5037c>] init_netconsole+0xbc/0x21f
[ 1.801744] [<ffffffff81b5026c>] ? sir_wq_init+0x0/0x35
[ 1.802793] [<ffffffff81b502c0>] ? init_netconsole+0x0/0x21f
[ 1.803845] [<ffffffff810002ff>] do_one_initcall+0x7a/0x12f
[ 1.804885] [<ffffffff81b2ccae>] kernel_init+0x138/0x1c2
[ 1.805915] [<ffffffff81003554>] kernel_thread_helper+0x4/0x10
[ 1.806937] [<ffffffff81590e00>] ? restore_args+0x0/0x30
[ 1.807955] [<ffffffff81b2cb76>] ? kernel_init+0x0/0x1c2
[ 1.808958] [<ffffffff81003550>] ? kernel_thread_helper+0x0/0x10
[ 1.809958] ---[ end trace 84b562a00a60539e ]---
Signed-off-by: Florian Mickler <florian@mickler.org>
Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Tested-by: Jeff Pieper <jeffrey.e.pieper@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/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index afd01295fbec..464c9a28f1ba 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -3218,12 +3218,6 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
3218 | { | 3218 | { |
3219 | struct e1000_hw *hw = &adapter->hw; | 3219 | struct e1000_hw *hw = &adapter->hw; |
3220 | 3220 | ||
3221 | /* DMA latency requirement to workaround early-receive/jumbo issue */ | ||
3222 | if (adapter->flags & FLAG_HAS_ERT) | ||
3223 | adapter->netdev->pm_qos_req = | ||
3224 | pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, | ||
3225 | PM_QOS_DEFAULT_VALUE); | ||
3226 | |||
3227 | /* hardware has been reset, we need to reload some things */ | 3221 | /* hardware has been reset, we need to reload some things */ |
3228 | e1000_configure(adapter); | 3222 | e1000_configure(adapter); |
3229 | 3223 | ||
@@ -3287,12 +3281,6 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
3287 | e1000_clean_tx_ring(adapter); | 3281 | e1000_clean_tx_ring(adapter); |
3288 | e1000_clean_rx_ring(adapter); | 3282 | e1000_clean_rx_ring(adapter); |
3289 | 3283 | ||
3290 | if (adapter->flags & FLAG_HAS_ERT) { | ||
3291 | pm_qos_remove_request( | ||
3292 | adapter->netdev->pm_qos_req); | ||
3293 | adapter->netdev->pm_qos_req = NULL; | ||
3294 | } | ||
3295 | |||
3296 | /* | 3284 | /* |
3297 | * TODO: for power management, we could drop the link and | 3285 | * TODO: for power management, we could drop the link and |
3298 | * pci_disable_device here. | 3286 | * pci_disable_device here. |
@@ -3527,6 +3515,12 @@ static int e1000_open(struct net_device *netdev) | |||
3527 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN)) | 3515 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN)) |
3528 | e1000_update_mng_vlan(adapter); | 3516 | e1000_update_mng_vlan(adapter); |
3529 | 3517 | ||
3518 | /* DMA latency requirement to workaround early-receive/jumbo issue */ | ||
3519 | if (adapter->flags & FLAG_HAS_ERT) | ||
3520 | adapter->netdev->pm_qos_req = | ||
3521 | pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, | ||
3522 | PM_QOS_DEFAULT_VALUE); | ||
3523 | |||
3530 | /* | 3524 | /* |
3531 | * before we allocate an interrupt, we must be ready to handle it. | 3525 | * before we allocate an interrupt, we must be ready to handle it. |
3532 | * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt | 3526 | * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt |
@@ -3631,6 +3625,11 @@ static int e1000_close(struct net_device *netdev) | |||
3631 | if (adapter->flags & FLAG_HAS_AMT) | 3625 | if (adapter->flags & FLAG_HAS_AMT) |
3632 | e1000_release_hw_control(adapter); | 3626 | e1000_release_hw_control(adapter); |
3633 | 3627 | ||
3628 | if (adapter->flags & FLAG_HAS_ERT) { | ||
3629 | pm_qos_remove_request(adapter->netdev->pm_qos_req); | ||
3630 | adapter->netdev->pm_qos_req = NULL; | ||
3631 | } | ||
3632 | |||
3634 | pm_runtime_put_sync(&pdev->dev); | 3633 | pm_runtime_put_sync(&pdev->dev); |
3635 | 3634 | ||
3636 | return 0; | 3635 | return 0; |