diff options
author | James Bottomley <James.Bottomley@suse.de> | 2010-07-05 16:53:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-07-18 20:00:34 -0400 |
commit | 82f682514a5df89ffb3890627eebf0897b7a84ec (patch) | |
tree | 27a3dba7a179102ac5bfdd5935679bd2abd3f70f /drivers/net | |
parent | 5f279845f9d684661563894d44729a0c706375b4 (diff) |
pm_qos: Get rid of the allocation in pm_qos_add_request()
All current users of pm_qos_add_request() have the ability to supply
the memory required by the pm_qos routines, so make them do this and
eliminate the kmalloc() with pm_qos_add_request(). This has the
double benefit of making the call never fail and allowing it to be
called from atomic context.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: mark gross <markgross@thegnar.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 17 | ||||
-rw-r--r-- | drivers/net/igbvf/netdev.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2100.c | 12 |
3 files changed, 17 insertions, 21 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 57a7e41da69e..9f13b660b801 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -2901,10 +2901,10 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) | |||
2901 | * dropped transactions. | 2901 | * dropped transactions. |
2902 | */ | 2902 | */ |
2903 | pm_qos_update_request( | 2903 | pm_qos_update_request( |
2904 | adapter->netdev->pm_qos_req, 55); | 2904 | &adapter->netdev->pm_qos_req, 55); |
2905 | } else { | 2905 | } else { |
2906 | pm_qos_update_request( | 2906 | pm_qos_update_request( |
2907 | adapter->netdev->pm_qos_req, | 2907 | &adapter->netdev->pm_qos_req, |
2908 | PM_QOS_DEFAULT_VALUE); | 2908 | PM_QOS_DEFAULT_VALUE); |
2909 | } | 2909 | } |
2910 | } | 2910 | } |
@@ -3196,9 +3196,9 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
3196 | 3196 | ||
3197 | /* DMA latency requirement to workaround early-receive/jumbo issue */ | 3197 | /* DMA latency requirement to workaround early-receive/jumbo issue */ |
3198 | if (adapter->flags & FLAG_HAS_ERT) | 3198 | if (adapter->flags & FLAG_HAS_ERT) |
3199 | adapter->netdev->pm_qos_req = | 3199 | pm_qos_add_request(&adapter->netdev->pm_qos_req, |
3200 | pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, | 3200 | PM_QOS_CPU_DMA_LATENCY, |
3201 | PM_QOS_DEFAULT_VALUE); | 3201 | PM_QOS_DEFAULT_VALUE); |
3202 | 3202 | ||
3203 | /* hardware has been reset, we need to reload some things */ | 3203 | /* hardware has been reset, we need to reload some things */ |
3204 | e1000_configure(adapter); | 3204 | e1000_configure(adapter); |
@@ -3263,11 +3263,8 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
3263 | e1000_clean_tx_ring(adapter); | 3263 | e1000_clean_tx_ring(adapter); |
3264 | e1000_clean_rx_ring(adapter); | 3264 | e1000_clean_rx_ring(adapter); |
3265 | 3265 | ||
3266 | if (adapter->flags & FLAG_HAS_ERT) { | 3266 | if (adapter->flags & FLAG_HAS_ERT) |
3267 | pm_qos_remove_request( | 3267 | pm_qos_remove_request(&adapter->netdev->pm_qos_req); |
3268 | adapter->netdev->pm_qos_req); | ||
3269 | adapter->netdev->pm_qos_req = NULL; | ||
3270 | } | ||
3271 | 3268 | ||
3272 | /* | 3269 | /* |
3273 | * TODO: for power management, we could drop the link and | 3270 | * TODO: for power management, we could drop the link and |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index 5e2b2a8c56c6..add6197d3bcb 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -48,7 +48,7 @@ | |||
48 | #define DRV_VERSION "1.0.0-k0" | 48 | #define DRV_VERSION "1.0.0-k0" |
49 | char igbvf_driver_name[] = "igbvf"; | 49 | char igbvf_driver_name[] = "igbvf"; |
50 | const char igbvf_driver_version[] = DRV_VERSION; | 50 | const char igbvf_driver_version[] = DRV_VERSION; |
51 | struct pm_qos_request_list *igbvf_driver_pm_qos_req; | 51 | static struct pm_qos_request_list igbvf_driver_pm_qos_req; |
52 | static const char igbvf_driver_string[] = | 52 | static const char igbvf_driver_string[] = |
53 | "Intel(R) Virtual Function Network Driver"; | 53 | "Intel(R) Virtual Function Network Driver"; |
54 | static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation."; | 54 | static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation."; |
@@ -2902,8 +2902,8 @@ static int __init igbvf_init_module(void) | |||
2902 | printk(KERN_INFO "%s\n", igbvf_copyright); | 2902 | printk(KERN_INFO "%s\n", igbvf_copyright); |
2903 | 2903 | ||
2904 | ret = pci_register_driver(&igbvf_driver); | 2904 | ret = pci_register_driver(&igbvf_driver); |
2905 | igbvf_driver_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, | 2905 | pm_qos_add_request(&igbvf_driver_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, |
2906 | PM_QOS_DEFAULT_VALUE); | 2906 | PM_QOS_DEFAULT_VALUE); |
2907 | 2907 | ||
2908 | return ret; | 2908 | return ret; |
2909 | } | 2909 | } |
@@ -2918,8 +2918,7 @@ module_init(igbvf_init_module); | |||
2918 | static void __exit igbvf_exit_module(void) | 2918 | static void __exit igbvf_exit_module(void) |
2919 | { | 2919 | { |
2920 | pci_unregister_driver(&igbvf_driver); | 2920 | pci_unregister_driver(&igbvf_driver); |
2921 | pm_qos_remove_request(igbvf_driver_pm_qos_req); | 2921 | pm_qos_remove_request(&igbvf_driver_pm_qos_req); |
2922 | igbvf_driver_pm_qos_req = NULL; | ||
2923 | } | 2922 | } |
2924 | module_exit(igbvf_exit_module); | 2923 | module_exit(igbvf_exit_module); |
2925 | 2924 | ||
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 0bd4dfa59a8a..7f0d98b885bc 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -174,7 +174,7 @@ that only one external action is invoked at a time. | |||
174 | #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" | 174 | #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" |
175 | #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" | 175 | #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" |
176 | 176 | ||
177 | struct pm_qos_request_list *ipw2100_pm_qos_req; | 177 | struct pm_qos_request_list ipw2100_pm_qos_req; |
178 | 178 | ||
179 | /* Debugging stuff */ | 179 | /* Debugging stuff */ |
180 | #ifdef CONFIG_IPW2100_DEBUG | 180 | #ifdef CONFIG_IPW2100_DEBUG |
@@ -1741,7 +1741,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred) | |||
1741 | /* the ipw2100 hardware really doesn't want power management delays | 1741 | /* the ipw2100 hardware really doesn't want power management delays |
1742 | * longer than 175usec | 1742 | * longer than 175usec |
1743 | */ | 1743 | */ |
1744 | pm_qos_update_request(ipw2100_pm_qos_req, 175); | 1744 | pm_qos_update_request(&ipw2100_pm_qos_req, 175); |
1745 | 1745 | ||
1746 | /* If the interrupt is enabled, turn it off... */ | 1746 | /* If the interrupt is enabled, turn it off... */ |
1747 | spin_lock_irqsave(&priv->low_lock, flags); | 1747 | spin_lock_irqsave(&priv->low_lock, flags); |
@@ -1889,7 +1889,7 @@ static void ipw2100_down(struct ipw2100_priv *priv) | |||
1889 | ipw2100_disable_interrupts(priv); | 1889 | ipw2100_disable_interrupts(priv); |
1890 | spin_unlock_irqrestore(&priv->low_lock, flags); | 1890 | spin_unlock_irqrestore(&priv->low_lock, flags); |
1891 | 1891 | ||
1892 | pm_qos_update_request(ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE); | 1892 | pm_qos_update_request(&ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE); |
1893 | 1893 | ||
1894 | /* We have to signal any supplicant if we are disassociating */ | 1894 | /* We have to signal any supplicant if we are disassociating */ |
1895 | if (associated) | 1895 | if (associated) |
@@ -6669,8 +6669,8 @@ static int __init ipw2100_init(void) | |||
6669 | if (ret) | 6669 | if (ret) |
6670 | goto out; | 6670 | goto out; |
6671 | 6671 | ||
6672 | ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, | 6672 | pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, |
6673 | PM_QOS_DEFAULT_VALUE); | 6673 | PM_QOS_DEFAULT_VALUE); |
6674 | #ifdef CONFIG_IPW2100_DEBUG | 6674 | #ifdef CONFIG_IPW2100_DEBUG |
6675 | ipw2100_debug_level = debug; | 6675 | ipw2100_debug_level = debug; |
6676 | ret = driver_create_file(&ipw2100_pci_driver.driver, | 6676 | ret = driver_create_file(&ipw2100_pci_driver.driver, |
@@ -6692,7 +6692,7 @@ static void __exit ipw2100_exit(void) | |||
6692 | &driver_attr_debug_level); | 6692 | &driver_attr_debug_level); |
6693 | #endif | 6693 | #endif |
6694 | pci_unregister_driver(&ipw2100_pci_driver); | 6694 | pci_unregister_driver(&ipw2100_pci_driver); |
6695 | pm_qos_remove_request(ipw2100_pm_qos_req); | 6695 | pm_qos_remove_request(&ipw2100_pm_qos_req); |
6696 | } | 6696 | } |
6697 | 6697 | ||
6698 | module_init(ipw2100_init); | 6698 | module_init(ipw2100_init); |