History

Merge tag 'pm+acpi-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki: - ACPI-based memory hotplug stopped working after a recent change, because it's not possible to associate sufficiently many "physical" devices with one ACPI device object due to an artificial limit. Fix from Rafael J Wysocki removes that limit and makes memory hotplug work again. - A change made in 3.9 uncovered a bug in the ACPI processor driver preventing NUMA nodes from being put offline due to an ordering issue. Fix from Yasuaki Ishimatsu changes the ordering to make things work again. - One of the recent ACPI video commits (that hasn't been reverted so far) uncovered a bug in the code handling quirky BIOSes that caused some Asus machines to boot with backlight completely off which made it quite difficult to use them afterward. Fix from Felipe Contreras improves the quirk to cover this particular case correctly. - A cpufreq user space interface change made in 3.10 inadvertently renamed the ignore_nice_load sysfs attribute to ignore_nice which resulted in some confusion. Fix from Viresh Kumar changes the name back to ignore_nice_load. - An initialization ordering change made in 3.9 broke cpufreq on loongson2 boards. Fix from Aaro Koskinen restores the correct initialization ordering there. - Fix breakage resulting from a mistake made in 3.9 and causing the detection of some graphics adapters (that were detected correctly before) to fail. There are two objects representing the same PCIe port in the affected systems' ACPI tables and both appear as "enabled" and we are expected to guess which one to use. We used to choose the right one before by pure luck, but when we tried to address another similar corner case, the luck went away. This time we try to make our guessing a bit more educated which is reported to work on those systems. - The /proc/acpi/wakeup interface code is missing some locking which may lead to breakage if that file is written or read during hotplug of wakeup devices. That should be rare but still possible, so it's better to start using the appropriate locking there. * tag 'pm+acpi-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: Try harder to resolve _ADR collisions for bridges cpufreq: rename ignore_nice as ignore_nice_load cpufreq: loongson2: fix regression related to clock management ACPI / processor: move try_offline_node() after acpi_unmap_lsapic() ACPI: Drop physical_node_id_bitmap from struct acpi_device ACPI / PM: Walk physical_node_list under physical_node_lock ACPI / video: improve quirk check in acpi_video_bqc_quirk()

Linus Torvalds committed 13 years ago

Commit 14e94192 parents fdafa7c 69fdadf11 files · +162 −76Browse files

Unified · Split

11 files
  1. drivers/acpi/acpi_processor.c +2 −1
  2. drivers/acpi/glue.c +101 −32
  3. drivers/acpi/proc.c +8 −0
  4. drivers/acpi/video.c +1 −1
  5. drivers/cpufreq/cpufreq_conservative.c +10 −10
  6. drivers/cpufreq/cpufreq_governor.c +4 −4
  7. drivers/cpufreq/cpufreq_governor.h +2 −2
  8. drivers/cpufreq/cpufreq_ondemand.c +10 −10
  9. drivers/cpufreq/loongson2_cpufreq.c +6 −5
  10. drivers/pci/pci-acpi.c +11 −4
  11. include/acpi/acpi_bus.h +7 −7
drivers/acpi/acpi_processor.c+2−1
@@ -451,7 +451,6 @@ static void acpi_processor_remove(struct acpi_device *device) · 450 unmodified lines
451451 /* Clean up. */
452452 per_cpu(processor_device_array, pr->id) = NULL;
453453 per_cpu(processors, pr->id) = NULL;
454− try_offline_node(cpu_to_node(pr->id));
455454
456455 /* Remove the CPU. */
457456 get_online_cpus();
@@ -459,6 +458,8 @@ static void acpi_processor_remove(struct acpi_device *device) · 1 unmodified line
459458 acpi_unmap_lsapic(pr->id);
460459 put_online_cpus();
461460
461+ try_offline_node(cpu_to_node(pr->id));
462+
462463 out:
463464 free_cpumask_var(pr->throttling.shared_cpu_map);
464465 kfree(pr);
drivers/acpi/glue.c+101−32
@@ -31,6 +31,7 @@ static LIST_HEAD(bus_type_list); · 30 unmodified lines
3131 static DECLARE_RWSEM(bus_type_sem);
3232
3333 #define PHYSICAL_NODE_STRING "physical_node"
34+#define PHYSICAL_NODE_NAME_SIZE (sizeof(PHYSICAL_NODE_STRING) + 10)
3435
3536 int register_acpi_bus_type(struct acpi_bus_type *type)
3637 {
@@ -78,41 +79,108 @@ static struct acpi_bus_type *acpi_get_bus_type(struct device *dev) · 41 unmodified lines
7879 return ret;
7980 }
8081
81−static acpi_status do_acpi_find_child(acpi_handle handle, u32 lvl_not_used,
82− void *addr_p, void **ret_p)
82+static acpi_status acpi_dev_present(acpi_handle handle, u32 lvl_not_used,
83+ void *not_used, void **ret_p)
8384 {
84− unsigned long long addr, sta;
85− acpi_status status;
85+ struct acpi_device *adev = NULL;
8686
87− status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &addr);
88− if (ACPI_SUCCESS(status) && addr == *((u64 *)addr_p)) {
87+ acpi_bus_get_device(handle, &adev);
88+ if (adev) {
8989 *ret_p = handle;
90− status = acpi_bus_get_status_handle(handle, &sta);
91− if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_ENABLED))
92− return AE_CTRL_TERMINATE;
90+ return AE_CTRL_TERMINATE;
9391 }
9492 return AE_OK;
9593 }
9694
97−acpi_handle acpi_get_child(acpi_handle parent, u64 address)
95+static bool acpi_extra_checks_passed(acpi_handle handle, bool is_bridge)
9896 {
99− void *ret = NULL;
97+ unsigned long long sta;
98+ acpi_status status;
99+
100+ status = acpi_bus_get_status_handle(handle, &sta);
101+ if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_ENABLED))
102+ return false;
103+
104+ if (is_bridge) {
105+ void *test = NULL;
106+
107+ /* Check if this object has at least one child device. */
108+ acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
109+ acpi_dev_present, NULL, NULL, &test);
110+ return !!test;
111+ }
112+ return true;
113+}
114+
115+struct find_child_context {
116+ u64 addr;
117+ bool is_bridge;
118+ acpi_handle ret;
119+ bool ret_checked;
120+};
121+
122+static acpi_status do_find_child(acpi_handle handle, u32 lvl_not_used,
123+ void *data, void **not_used)
124+{
125+ struct find_child_context *context = data;
126+ unsigned long long addr;
127+ acpi_status status;
100128
101− if (!parent)
102− return NULL;
129+ status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &addr);
130+ if (ACPI_FAILURE(status) || addr != context->addr)
131+ return AE_OK;
103132
104− acpi_walk_namespace(ACPI_TYPE_DEVICE, parent, 1, NULL,
105− do_acpi_find_child, &address, &ret);
106− return (acpi_handle)ret;
133+ if (!context->ret) {
134+ /* This is the first matching object. Save its handle. */
135+ context->ret = handle;
136+ return AE_OK;
137+ }
138+ /*
139+ * There is more than one matching object with the same _ADR value.
140+ * That really is unexpected, so we are kind of beyond the scope of the
141+ * spec here. We have to choose which one to return, though.
142+ *
143+ * First, check if the previously found object is good enough and return
144+ * its handle if so. Second, check the same for the object that we've
145+ * just found.
146+ */
147+ if (!context->ret_checked) {
148+ if (acpi_extra_checks_passed(context->ret, context->is_bridge))
149+ return AE_CTRL_TERMINATE;
150+ else
151+ context->ret_checked = true;
152+ }
153+ if (acpi_extra_checks_passed(handle, context->is_bridge)) {
154+ context->ret = handle;
155+ return AE_CTRL_TERMINATE;
156+ }
157+ return AE_OK;
107158 }
108−EXPORT_SYMBOL(acpi_get_child);
159+
160+acpi_handle acpi_find_child(acpi_handle parent, u64 addr, bool is_bridge)
161+{
162+ if (parent) {
163+ struct find_child_context context = {
164+ .addr = addr,
165+ .is_bridge = is_bridge,
166+ };
167+
168+ acpi_walk_namespace(ACPI_TYPE_DEVICE, parent, 1, do_find_child,
169+ NULL, &context, NULL);
170+ return context.ret;
171+ }
172+ return NULL;
173+}
174+EXPORT_SYMBOL_GPL(acpi_find_child);
109175
110176 int acpi_bind_one(struct device *dev, acpi_handle handle)
111177 {
112178 struct acpi_device *acpi_dev;
113179 acpi_status status;
114180 struct acpi_device_physical_node *physical_node, *pn;
115− char physical_node_name[sizeof(PHYSICAL_NODE_STRING) + 2];
181+ char physical_node_name[PHYSICAL_NODE_NAME_SIZE];
182+ struct list_head *physnode_list;
183+ unsigned int node_id;
116184 int retval = -EINVAL;
117185
118186 if (ACPI_HANDLE(dev)) {
@@ -139,25 +207,27 @@ int acpi_bind_one(struct device *dev, acpi_handle handle) · 20 unmodified lines
139207
140208 mutex_lock(&acpi_dev->physical_node_lock);
141209
142− /* Sanity check. */
143− list_for_each_entry(pn, &acpi_dev->physical_node_list, node)
210+ /*
211+ * Keep the list sorted by node_id so that the IDs of removed nodes can
212+ * be recycled easily.
213+ */
214+ physnode_list = &acpi_dev->physical_node_list;
215+ node_id = 0;
216+ list_for_each_entry(pn, &acpi_dev->physical_node_list, node) {
217+ /* Sanity check. */
144218 if (pn->dev == dev) {
145219 dev_warn(dev, "Already associated with ACPI node\n");
146220 goto err_free;
147221 }
148−
149− /* allocate physical node id according to physical_node_id_bitmap */
150− physical_node->node_id =
151− find_first_zero_bit(acpi_dev->physical_node_id_bitmap,
152− ACPI_MAX_PHYSICAL_NODE);
153− if (physical_node->node_id >= ACPI_MAX_PHYSICAL_NODE) {
154− retval = -ENOSPC;
155− goto err_free;
222+ if (pn->node_id == node_id) {
223+ physnode_list = &pn->node;
224+ node_id++;
225+ }
156226 }
157227
158− set_bit(physical_node->node_id, acpi_dev->physical_node_id_bitmap);
228+ physical_node->node_id = node_id;
159229 physical_node->dev = dev;
160− list_add_tail(&physical_node->node, &acpi_dev->physical_node_list);
230+ list_add(&physical_node->node, physnode_list);
161231 acpi_dev->physical_node_count++;
162232
163233 mutex_unlock(&acpi_dev->physical_node_lock);
@@ -208,7 +278,7 @@ int acpi_unbind_one(struct device *dev) · 44 unmodified lines
208278
209279 mutex_lock(&acpi_dev->physical_node_lock);
210280 list_for_each_safe(node, next, &acpi_dev->physical_node_list) {
211− char physical_node_name[sizeof(PHYSICAL_NODE_STRING) + 2];
281+ char physical_node_name[PHYSICAL_NODE_NAME_SIZE];
212282
213283 entry = list_entry(node, struct acpi_device_physical_node,
214284 node);
@@ -216,7 +286,6 @@ int acpi_unbind_one(struct device *dev) · 1 unmodified line
216286 continue;
217287
218288 list_del(node);
219− clear_bit(entry->node_id, acpi_dev->physical_node_id_bitmap);
220289
221290 acpi_dev->physical_node_count--;
222291
drivers/acpi/proc.c+8−0
@@ -311,6 +311,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) · 310 unmodified lines
311311 dev->pnp.bus_id,
312312 (u32) dev->wakeup.sleep_state);
313313
314+ mutex_lock(&dev->physical_node_lock);
315+
314316 if (!dev->physical_node_count) {
315317 seq_printf(seq, "%c%-8s\n",
316318 dev->wakeup.flags.run_wake ? '*' : ' ',
@@ -338,6 +340,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) · 21 unmodified lines
338340 put_device(ldev);
339341 }
340342 }
343+
344+ mutex_unlock(&dev->physical_node_lock);
341345 }
342346 mutex_unlock(&acpi_device_lock);
343347 return 0;
@@ -347,12 +351,16 @@ static void physical_device_enable_wakeup(struct acpi_device *adev) · 3 unmodified lines
347351 {
348352 struct acpi_device_physical_node *entry;
349353
354+ mutex_lock(&adev->physical_node_lock);
355+
350356 list_for_each_entry(entry,
351357 &adev->physical_node_list, node)
352358 if (entry->dev && device_can_wakeup(entry->dev)) {
353359 bool enable = !device_may_wakeup(entry->dev);
354360 device_set_wakeup_enable(entry->dev, enable);
355361 }
362+
363+ mutex_unlock(&adev->physical_node_lock);
356364 }
357365
358366 static ssize_t
drivers/acpi/video.c+1−1
@@ -689,7 +689,7 @@ static int acpi_video_bqc_quirk(struct acpi_video_device *device, · 688 unmodified lines
689689 * Some systems always report current brightness level as maximum
690690 * through _BQC, we need to test another value for them.
691691 */
692− test_level = current_level == max_level ? br->levels[2] : max_level;
692+ test_level = current_level == max_level ? br->levels[3] : max_level;
693693
694694 result = acpi_video_device_lcd_set_level(device, test_level);
695695 if (result)
drivers/cpufreq/cpufreq_conservative.c+10−10
@@ -221,8 +221,8 @@ static ssize_t store_down_threshold(struct dbs_data *dbs_data, const char *buf, · 220 unmodified lines
221221 return count;
222222 }
223223
224−static ssize_t store_ignore_nice(struct dbs_data *dbs_data, const char *buf,
225− size_t count)
224+static ssize_t store_ignore_nice_load(struct dbs_data *dbs_data,
225+ const char *buf, size_t count)
226226 {
227227 struct cs_dbs_tuners *cs_tuners = dbs_data->tuners;
228228 unsigned int input, j;
@@ -235,10 +235,10 @@ static ssize_t store_ignore_nice(struct dbs_data *dbs_data, const char *buf, · 6 unmodified lines
235235 if (input > 1)
236236 input = 1;
237237
238− if (input == cs_tuners->ignore_nice) /* nothing to do */
238+ if (input == cs_tuners->ignore_nice_load) /* nothing to do */
239239 return count;
240240
241− cs_tuners->ignore_nice = input;
241+ cs_tuners->ignore_nice_load = input;
242242
243243 /* we need to re-evaluate prev_cpu_idle */
244244 for_each_online_cpu(j) {
@@ -246,7 +246,7 @@ static ssize_t store_ignore_nice(struct dbs_data *dbs_data, const char *buf, · 1 unmodified line
246246 dbs_info = &per_cpu(cs_cpu_dbs_info, j);
247247 dbs_info->cdbs.prev_cpu_idle = get_cpu_idle_time(j,
248248 &dbs_info->cdbs.prev_cpu_wall, 0);
249− if (cs_tuners->ignore_nice)
249+ if (cs_tuners->ignore_nice_load)
250250 dbs_info->cdbs.prev_cpu_nice =
251251 kcpustat_cpu(j).cpustat[CPUTIME_NICE];
252252 }
@@ -279,7 +279,7 @@ show_store_one(cs, sampling_rate); · 26 unmodified lines
279279 show_store_one(cs, sampling_down_factor);
280280 show_store_one(cs, up_threshold);
281281 show_store_one(cs, down_threshold);
282−show_store_one(cs, ignore_nice);
282+show_store_one(cs, ignore_nice_load);
283283 show_store_one(cs, freq_step);
284284 declare_show_sampling_rate_min(cs);
285285
@@ -287,7 +287,7 @@ gov_sys_pol_attr_rw(sampling_rate); · 1 unmodified line
287287 gov_sys_pol_attr_rw(sampling_down_factor);
288288 gov_sys_pol_attr_rw(up_threshold);
289289 gov_sys_pol_attr_rw(down_threshold);
290−gov_sys_pol_attr_rw(ignore_nice);
290+gov_sys_pol_attr_rw(ignore_nice_load);
291291 gov_sys_pol_attr_rw(freq_step);
292292 gov_sys_pol_attr_ro(sampling_rate_min);
293293
@@ -297,7 +297,7 @@ static struct attribute *dbs_attributes_gov_sys[] = { · 3 unmodified lines
297297 &sampling_down_factor_gov_sys.attr,
298298 &up_threshold_gov_sys.attr,
299299 &down_threshold_gov_sys.attr,
300− &ignore_nice_gov_sys.attr,
300+ &ignore_nice_load_gov_sys.attr,
301301 &freq_step_gov_sys.attr,
302302 NULL
303303 };
@@ -313,7 +313,7 @@ static struct attribute *dbs_attributes_gov_pol[] = { · 9 unmodified lines
313313 &sampling_down_factor_gov_pol.attr,
314314 &up_threshold_gov_pol.attr,
315315 &down_threshold_gov_pol.attr,
316− &ignore_nice_gov_pol.attr,
316+ &ignore_nice_load_gov_pol.attr,
317317 &freq_step_gov_pol.attr,
318318 NULL
319319 };
@@ -338,7 +338,7 @@ static int cs_init(struct dbs_data *dbs_data) · 18 unmodified lines
338338 tuners->up_threshold = DEF_FREQUENCY_UP_THRESHOLD;
339339 tuners->down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD;
340340 tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR;
341− tuners->ignore_nice = 0;
341+ tuners->ignore_nice_load = 0;
342342 tuners->freq_step = DEF_FREQUENCY_STEP;
343343
344344 dbs_data->tuners = tuners;
drivers/cpufreq/cpufreq_governor.c+4−4
@@ -47,9 +47,9 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu) · 46 unmodified lines
4747 unsigned int j;
4848
4949 if (dbs_data->cdata->governor == GOV_ONDEMAND)
50− ignore_nice = od_tuners->ignore_nice;
50+ ignore_nice = od_tuners->ignore_nice_load;
5151 else
52− ignore_nice = cs_tuners->ignore_nice;
52+ ignore_nice = cs_tuners->ignore_nice_load;
5353
5454 policy = cdbs->cur_policy;
5555
@@ -298,12 +298,12 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, · 242 unmodified lines
298298 cs_tuners = dbs_data->tuners;
299299 cs_dbs_info = dbs_data->cdata->get_cpu_dbs_info_s(cpu);
300300 sampling_rate = cs_tuners->sampling_rate;
301− ignore_nice = cs_tuners->ignore_nice;
301+ ignore_nice = cs_tuners->ignore_nice_load;
302302 } else {
303303 od_tuners = dbs_data->tuners;
304304 od_dbs_info = dbs_data->cdata->get_cpu_dbs_info_s(cpu);
305305 sampling_rate = od_tuners->sampling_rate;
306− ignore_nice = od_tuners->ignore_nice;
306+ ignore_nice = od_tuners->ignore_nice_load;
307307 od_ops = dbs_data->cdata->gov_ops;
308308 io_busy = od_tuners->io_is_busy;
309309 }
drivers/cpufreq/cpufreq_governor.h+2−2
@@ -165,7 +165,7 @@ struct cs_cpu_dbs_info_s { · 164 unmodified lines
165165
166166 /* Per policy Governers sysfs tunables */
167167 struct od_dbs_tuners {
168− unsigned int ignore_nice;
168+ unsigned int ignore_nice_load;
169169 unsigned int sampling_rate;
170170 unsigned int sampling_down_factor;
171171 unsigned int up_threshold;
@@ -175,7 +175,7 @@ struct od_dbs_tuners { · 3 unmodified lines
175175 };
176176
177177 struct cs_dbs_tuners {
178− unsigned int ignore_nice;
178+ unsigned int ignore_nice_load;
179179 unsigned int sampling_rate;
180180 unsigned int sampling_down_factor;
181181 unsigned int up_threshold;
drivers/cpufreq/cpufreq_ondemand.c+10−10
@@ -403,8 +403,8 @@ static ssize_t store_sampling_down_factor(struct dbs_data *dbs_data, · 402 unmodified lines
403403 return count;
404404 }
405405
406−static ssize_t store_ignore_nice(struct dbs_data *dbs_data, const char *buf,
407− size_t count)
406+static ssize_t store_ignore_nice_load(struct dbs_data *dbs_data,
407+ const char *buf, size_t count)
408408 {
409409 struct od_dbs_tuners *od_tuners = dbs_data->tuners;
410410 unsigned int input;
@@ -419,10 +419,10 @@ static ssize_t store_ignore_nice(struct dbs_data *dbs_data, const char *buf, · 8 unmodified lines
419419 if (input > 1)
420420 input = 1;
421421
422− if (input == od_tuners->ignore_nice) { /* nothing to do */
422+ if (input == od_tuners->ignore_nice_load) { /* nothing to do */
423423 return count;
424424 }
425− od_tuners->ignore_nice = input;
425+ od_tuners->ignore_nice_load = input;
426426
427427 /* we need to re-evaluate prev_cpu_idle */
428428 for_each_online_cpu(j) {
@@ -430,7 +430,7 @@ static ssize_t store_ignore_nice(struct dbs_data *dbs_data, const char *buf, · 1 unmodified line
430430 dbs_info = &per_cpu(od_cpu_dbs_info, j);
431431 dbs_info->cdbs.prev_cpu_idle = get_cpu_idle_time(j,
432432 &dbs_info->cdbs.prev_cpu_wall, od_tuners->io_is_busy);
433− if (od_tuners->ignore_nice)
433+ if (od_tuners->ignore_nice_load)
434434 dbs_info->cdbs.prev_cpu_nice =
435435 kcpustat_cpu(j).cpustat[CPUTIME_NICE];
436436
@@ -461,7 +461,7 @@ show_store_one(od, sampling_rate); · 24 unmodified lines
461461 show_store_one(od, io_is_busy);
462462 show_store_one(od, up_threshold);
463463 show_store_one(od, sampling_down_factor);
464−show_store_one(od, ignore_nice);
464+show_store_one(od, ignore_nice_load);
465465 show_store_one(od, powersave_bias);
466466 declare_show_sampling_rate_min(od);
467467
@@ -469,7 +469,7 @@ gov_sys_pol_attr_rw(sampling_rate); · 1 unmodified line
469469 gov_sys_pol_attr_rw(io_is_busy);
470470 gov_sys_pol_attr_rw(up_threshold);
471471 gov_sys_pol_attr_rw(sampling_down_factor);
472−gov_sys_pol_attr_rw(ignore_nice);
472+gov_sys_pol_attr_rw(ignore_nice_load);
473473 gov_sys_pol_attr_rw(powersave_bias);
474474 gov_sys_pol_attr_ro(sampling_rate_min);
475475
@@ -478,7 +478,7 @@ static struct attribute *dbs_attributes_gov_sys[] = { · 2 unmodified lines
478478 &sampling_rate_gov_sys.attr,
479479 &up_threshold_gov_sys.attr,
480480 &sampling_down_factor_gov_sys.attr,
481− &ignore_nice_gov_sys.attr,
481+ &ignore_nice_load_gov_sys.attr,
482482 &powersave_bias_gov_sys.attr,
483483 &io_is_busy_gov_sys.attr,
484484 NULL
@@ -494,7 +494,7 @@ static struct attribute *dbs_attributes_gov_pol[] = { · 9 unmodified lines
494494 &sampling_rate_gov_pol.attr,
495495 &up_threshold_gov_pol.attr,
496496 &sampling_down_factor_gov_pol.attr,
497− &ignore_nice_gov_pol.attr,
497+ &ignore_nice_load_gov_pol.attr,
498498 &powersave_bias_gov_pol.attr,
499499 &io_is_busy_gov_pol.attr,
500500 NULL
@@ -544,7 +544,7 @@ static int od_init(struct dbs_data *dbs_data) · 43 unmodified lines
544544 }
545545
546546 tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR;
547− tuners->ignore_nice = 0;
547+ tuners->ignore_nice_load = 0;
548548 tuners->powersave_bias = default_powersave_bias;
549549 tuners->io_is_busy = should_io_be_busy();
550550
drivers/cpufreq/loongson2_cpufreq.c+6−5
@@ -118,11 +118,6 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy) · 117 unmodified lines
118118 clk_put(cpuclk);
119119 return -EINVAL;
120120 }
121− ret = clk_set_rate(cpuclk, rate);
122− if (ret) {
123− clk_put(cpuclk);
124− return ret;
125− }
126121
127122 /* clock table init */
128123 for (i = 2;
@@ -130,6 +125,12 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy) · 1 unmodified line
130125 i++)
131126 loongson2_clockmod_table[i].frequency = (rate * i) / 8;
132127
128+ ret = clk_set_rate(cpuclk, rate);
129+ if (ret) {
130+ clk_put(cpuclk);
131+ return ret;
132+ }
133+
133134 policy->cur = loongson2_cpufreq_get(policy->cpu);
134135
135136 cpufreq_frequency_table_get_attr(&loongson2_clockmod_table[0],
drivers/pci/pci-acpi.c+11−4
@@ -317,13 +317,20 @@ void acpi_pci_remove_bus(struct pci_bus *bus) · 316 unmodified lines
317317 /* ACPI bus type */
318318 static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
319319 {
320− struct pci_dev * pci_dev;
321− u64 addr;
320+ struct pci_dev *pci_dev = to_pci_dev(dev);
321+ bool is_bridge;
322+ u64 addr;
322323
323− pci_dev = to_pci_dev(dev);
324+ /*
325+ * pci_is_bridge() is not suitable here, because pci_dev->subordinate
326+ * is set only after acpi_pci_find_device() has been called for the
327+ * given device.
328+ */
329+ is_bridge = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
330+ || pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
324331 /* Please ref to ACPI spec for the syntax of _ADR */
325332 addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
326− *handle = acpi_get_child(DEVICE_ACPI_HANDLE(dev->parent), addr);
333+ *handle = acpi_find_child(ACPI_HANDLE(dev->parent), addr, is_bridge);
327334 if (!*handle)
328335 return -ENODEV;
329336 return 0;
include/acpi/acpi_bus.h+7−7
@@ -274,15 +274,12 @@ struct acpi_device_wakeup { · 273 unmodified lines
274274 };
275275
276276 struct acpi_device_physical_node {
277− u8 node_id;
277+ unsigned int node_id;
278278 struct list_head node;
279279 struct device *dev;
280280 bool put_online:1;
281281 };
282282
283−/* set maximum of physical nodes to 32 for expansibility */
284−#define ACPI_MAX_PHYSICAL_NODE 32
285−
286283 /* Device */
287284 struct acpi_device {
288285 int device_type;
@@ -302,10 +299,9 @@ struct acpi_device { · 13 unmodified lines
302299 struct acpi_driver *driver;
303300 void *driver_data;
304301 struct device dev;
305− u8 physical_node_count;
302+ unsigned int physical_node_count;
306303 struct list_head physical_node_list;
307304 struct mutex physical_node_lock;
308− DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE);
309305 struct list_head power_dependent;
310306 void (*remove)(struct acpi_device *);
311307 };
@@ -445,7 +441,11 @@ struct acpi_pci_root { · 133 unmodified lines
445441 };
446442
447443 /* helper */
448−acpi_handle acpi_get_child(acpi_handle, u64);
444+acpi_handle acpi_find_child(acpi_handle, u64, bool);
445+static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr)
446+{
447+ return acpi_find_child(handle, addr, false);
448+}
449449 int acpi_is_root_bridge(acpi_handle);
450450 struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
451451 #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t