Fix cfg80211 panic caused by backported pm-qos support
authorSenthil Balasubramanian <senthilkumar@atheros.com>
Wed, 13 Jan 2010 00:50:52 +0000 (16:50 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 13 Jan 2010 00:50:52 +0000 (16:50 -0800)
pm-qos needs to be deregistered upon module unload.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
compat/main.c
compat/pm_qos_params.c
include/linux/compat-2.6.25.h

index 251ba43c16f12344abb2aa82369f0aa8cd262df6..76e571a700af51b15e0636556319aa7693560934 100644 (file)
@@ -15,6 +15,8 @@ module_init(compat_init);
 
 static void __exit compat_exit(void)
 {
+       compat_pm_qos_power_deinit();
+
         return;
 }
 module_exit(compat_exit);
index 30aeddf8217736bfccdeb8dfb3300689011a0f17..833d98c5ddd1caef39ba41e044bb64d73a776311 100644 (file)
@@ -441,4 +441,37 @@ int compat_pm_qos_power_init(void)
 
        return ret;
 }
+
+int compat_pm_qos_power_deinit(void)
+{
+       int ret = 0;
+
+       ret = misc_deregister(&cpu_dma_pm_qos.pm_qos_power_miscdev);
+       if (ret < 0) {
+               printk(KERN_ERR "pm_qos_param: cpu_dma_latency deinit failed\n");
+               return ret;
+       }
+
+       ret = misc_deregister(&network_lat_pm_qos.pm_qos_power_miscdev);
+       if (ret < 0) {
+               printk(KERN_ERR "pm_qos_param: network_latency deinit failed\n");
+               return ret;
+       }
+
+       ret = misc_deregister(&network_throughput_pm_qos.pm_qos_power_miscdev);
+       if (ret < 0) {
+               printk(KERN_ERR
+                       "pm_qos_param: network_throughput deinit failed\n");
+               return ret;
+       }
+
+       ret = misc_deregister(&system_bus_freq_pm_qos.pm_qos_power_miscdev);
+       if (ret < 0) {
+               printk(KERN_ERR
+                       "pm_qos_param: system_bus_freq deinit failed\n");
+               return ret;
+       }
+
+       return ret;
+}
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) */
index 4804977f5744d048d7c4a81860ac0a9c9668c83d..e0dfdf3a7daf8a8c1fd260c0e70f6752231b285e 100644 (file)
@@ -53,6 +53,7 @@
  * defned below is used by the compat module to initialize pm-qos.
  */
 int compat_pm_qos_power_init(void);
+int compat_pm_qos_power_deinit(void);
 
 /*
  * 2.6.25 adds PM_EVENT_HIBERNATE as well here but
@@ -167,6 +168,11 @@ static inline int compat_pm_qos_power_init(void)
 {
        return 0;
 }
+
+static inline int int compat_pm_qos_power_deinit(void)
+{
+       return 0;
+}
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
 
 #endif /* LINUX_26_25_COMPAT_H */