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 251ba43..76e571a 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 30aeddf..833d98c 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 4804977..e0dfdf3 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 */