From f608754f423288503daa4688f22e34b59ceaf531 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Thu, 8 Jul 2010 12:40:04 -0700 Subject: [PATCH] compat-wireless: update 28-pm-qos-params.patch This patch is required because now pm-qos has 3 different flavors: On kernels >= 2.6.36 the pm qos req is kzalloc()'d by pm-qos itself On kernel = 2.6.35 the pm qos req uses the stack On kernels < 2.6.35 the pm qos req is pegged to a unique name On newer kernels we don't use a name to tag a pm-qos requirement, and on older kernels we do. Although we can port over the struct pm_qos_request_list to older kernels it provides no variable with any unique name we can use for older kernels. Perhaps there's a way.. right now I just don't see it. We also should probably not bother updating pm-qos to newer versions unless we are willing to treat the oldest kernels as newer ones and that'd be a little wierd. Update the header of 28-pm-qos-params.patch while at it with a little explanation as to why this is all needed. Signed-off-by: Luis R. Rodriguez --- patches/28-pm-qos-params.patch | 65 ++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/patches/28-pm-qos-params.patch b/patches/28-pm-qos-params.patch index 204ade59732f..423fede74bf1 100644 --- a/patches/28-pm-qos-params.patch +++ b/patches/28-pm-qos-params.patch @@ -1,60 +1,89 @@ + +This patch is required because now pm-qos has 3 different flavors: + +On kernels >= 2.6.36 the pm qos req is kzalloc()'d by pm-qos itself +On kernel = 2.6.35 the pm qos req uses the stack +On kernels < 2.6.35 the pm qos req is pegged to a unique name + +On newer kernels we don't use a name to tag a pm-qos requirement, and on +older kernels we do. Although we can port over the struct pm_qos_request_list +to older kernels it provides no variable with any unique name we can use +for older kernels. Perhaps there's a way.. right now I just don't see it. + +We also should probably not bother updating pm-qos to newer versions unless +we are willing to treat the oldest kernels as newer ones and that'd be a +little wierd. + --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c -@@ -174,7 +174,9 @@ that only one external action is invoked +@@ -174,7 +174,11 @@ that only one external action is invoked #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - struct pm_qos_request_list *ipw2100_pm_qos_req; ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + struct pm_qos_request_list ipw2100_pm_qos_req; ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++struct pm_qos_request_list *ipw2100_pm_qos_req; +#endif /* Debugging stuff */ #ifdef CONFIG_IPW2100_DEBUG -@@ -1741,7 +1743,11 @@ static int ipw2100_up(struct ipw2100_pri +@@ -1741,7 +1745,13 @@ static int ipw2100_up(struct ipw2100_pri /* the ipw2100 hardware really doesn't want power management delays * longer than 175usec */ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - pm_qos_update_request(ipw2100_pm_qos_req, 175); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + pm_qos_update_request(&ipw2100_pm_qos_req, 175); ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++ pm_qos_update_request(ipw2100_pm_qos_req, 175); +#else + pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", 175); +#endif /* If the interrupt is enabled, turn it off... */ spin_lock_irqsave(&priv->low_lock, flags); -@@ -1889,7 +1895,12 @@ static void ipw2100_down(struct ipw2100_ +@@ -1889,7 +1899,14 @@ static void ipw2100_down(struct ipw2100_ ipw2100_disable_interrupts(priv); spin_unlock_irqrestore(&priv->low_lock, flags); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - pm_qos_update_request(ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) ++ pm_qos_update_request(ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE); ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + pm_qos_update_request(&ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE); +#else + pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", -+ PM_QOS_DEFAULT_VALUE); ++ PM_QOS_DEFAULT_VALUE); +#endif /* We have to signal any supplicant if we are disassociating */ if (associated) -@@ -6669,7 +6680,11 @@ static int __init ipw2100_init(void) +@@ -6665,8 +6686,16 @@ static int __init ipw2100_init(void) if (ret) goto out; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, + PM_QOS_DEFAULT_VALUE); ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++ ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, ++ PM_QOS_DEFAULT_VALUE); +#else + pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", ++ PM_QOS_DEFAULT_VALUE); +#endif - PM_QOS_DEFAULT_VALUE); #ifdef CONFIG_IPW2100_DEBUG ipw2100_debug_level = debug; -@@ -6692,7 +6707,11 @@ static void __exit ipw2100_exit(void) + ret = driver_create_file(&ipw2100_pci_driver.driver, +@@ -6688,7 +6717,13 @@ static void __exit ipw2100_exit(void) &driver_attr_debug_level); #endif pci_unregister_driver(&ipw2100_pci_driver); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) - pm_qos_remove_request(ipw2100_pm_qos_req); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + pm_qos_remove_request(&ipw2100_pm_qos_req); ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) ++ pm_qos_remove_request(ipw2100_pm_qos_req); +#else -+ pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100"); ++ pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100") +#endif } -- 2.30.2