From: Luis R. Rodriguez Date: Tue, 12 Jan 2010 00:40:14 +0000 (-0800) Subject: Add the new system bus frequency pm-qos object for older kernels X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5e4b4b6ae384d543c2067aad5fe5c58ed9106c63;p=openwrt%2Fstaging%2Fblogic.git Add the new system bus frequency pm-qos object for older kernels This adds the new system_bus_freq_pm_qos for older kernels. This also fixes a compile warning on possible array out of bounds access on pm-qos, this was due to the fact that the pm-qos implementation we had on code was out of synch with the header we were copying over. This synchs up the array to what is in linux-next as of linux-next tag next-20100111 Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat-2.6.25.c b/compat/compat-2.6.25.c index 328457255630..e1a81aeb4729 100644 --- a/compat/compat-2.6.25.c +++ b/compat/compat-2.6.25.c @@ -94,12 +94,24 @@ static struct pm_qos_object network_throughput_pm_qos = { .comparitor = max_compare }; +static BLOCKING_NOTIFIER_HEAD(system_bus_freq_notifier); +static struct pm_qos_object system_bus_freq_pm_qos = { + .requirements = + {LIST_HEAD_INIT(system_bus_freq_pm_qos.requirements.list)}, + .notifiers = &system_bus_freq_notifier, + .name = "system_bus_freq", + .default_value = 0, + .target_value = 0, + .comparitor = max_compare +}; + static struct pm_qos_object *pm_qos_array[] = { &null_pm_qos, &cpu_dma_pm_qos, &network_lat_pm_qos, - &network_throughput_pm_qos + &network_throughput_pm_qos, + &system_bus_freq_pm_qos, }; static DEFINE_SPINLOCK(pm_qos_lock); @@ -408,9 +420,17 @@ int compat_pm_qos_power_init(void) return ret; } ret = register_pm_qos_misc(&network_throughput_pm_qos); - if (ret < 0) + if (ret < 0) { printk(KERN_ERR "pm_qos_param: network_throughput setup failed\n"); + return ret; + } + ret = register_pm_qos_misc(&system_bus_freq_pm_qos); + if (ret < 0) { + printk(KERN_ERR + "pm_qos_param: network_throughput setup failed\n"); + return ret; + } return ret; }