From: Senthil Balasubramanian Date: Wed, 13 Jan 2010 00:50:52 +0000 (-0800) Subject: Fix cfg80211 panic caused by backported pm-qos support X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7d2b68df6301937a8299bca8bef135ae951b569c;p=openwrt%2Fstaging%2Fblogic.git Fix cfg80211 panic caused by backported pm-qos support pm-qos needs to be deregistered upon module unload. Signed-off-by: Senthil Balasubramanian Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/main.c b/compat/main.c index 251ba43c16f1..76e571a700af 100644 --- a/compat/main.c +++ b/compat/main.c @@ -15,6 +15,8 @@ module_init(compat_init); static void __exit compat_exit(void) { + compat_pm_qos_power_deinit(); + return; } module_exit(compat_exit); diff --git a/compat/pm_qos_params.c b/compat/pm_qos_params.c index 30aeddf82177..833d98c5ddd1 100644 --- a/compat/pm_qos_params.c +++ b/compat/pm_qos_params.c @@ -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) */ diff --git a/include/linux/compat-2.6.25.h b/include/linux/compat-2.6.25.h index 4804977f5744..e0dfdf3a7daf 100644 --- a/include/linux/compat-2.6.25.h +++ b/include/linux/compat-2.6.25.h @@ -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 */