diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-30 14:06:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-30 14:06:40 -0500 |
commit | 95c5e1f1e6e1788cc8b9acbe9379ae395ef64958 (patch) | |
tree | f6b41406a9eb3c6219d715efe00de7f43c232703 | |
parent | b31a0fecd1dd01f1db406014a7c8a73983e04cc9 (diff) | |
parent | 23d0a65cf229acd273b6f5a325c34d758a90d592 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
toshiba_acpi: close race in toshiba_acpi driver
ACPICA: disable _BIF warning
ACPI: delete OSI(Linux) DMI dmesg spam
ACPICA: Allow _WAK method to return an Integer
ACPI: thinkpad-acpi: fix fan sleep/resume path
sony-laptop: printk tweak
sony-laptop: brightness regression fix
Revert "ACPI: don't enable control method power button as wakeup device when Fixed Power button is used"
ACPI suspend: Blacklist boxes that require us to set SCI_EN directly on resume
ACPI: scheduling in atomic via acpi_evaluate_integer ()
ACPI: battery: Convert discharge energy rate to current properly
ACPI: EC: count interrupts only if called from interrupt handler.
-rw-r--r-- | drivers/acpi/battery.c | 9 | ||||
-rw-r--r-- | drivers/acpi/blacklist.c | 401 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 3 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 104 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 10 | ||||
-rw-r--r-- | drivers/acpi/sleep/main.c | 40 | ||||
-rw-r--r-- | drivers/acpi/toshiba_acpi.c | 2 | ||||
-rw-r--r-- | drivers/acpi/utils.c | 16 | ||||
-rw-r--r-- | drivers/misc/sony-laptop.c | 4 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 57 | ||||
-rw-r--r-- | include/acpi/acpredef.h | 4 |
11 files changed, 133 insertions, 517 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 1423b0c0cd2e..a0a178dd189c 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -174,6 +174,15 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
174 | break; | 174 | break; |
175 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 175 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
176 | val->intval = battery->current_now * 1000; | 176 | val->intval = battery->current_now * 1000; |
177 | /* if power units are mW, convert to mA by | ||
178 | dividing by current voltage (mV/1000) */ | ||
179 | if (!battery->power_unit) { | ||
180 | if (battery->voltage_now) { | ||
181 | val->intval /= battery->voltage_now; | ||
182 | val->intval *= 1000; | ||
183 | } else | ||
184 | val->intval = -1; | ||
185 | } | ||
177 | break; | 186 | break; |
178 | case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: | 187 | case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: |
179 | case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: | 188 | case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index ea92bac42c53..09c69806c1fc 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -176,16 +176,6 @@ static int __init dmi_enable_osi_linux(const struct dmi_system_id *d) | |||
176 | acpi_dmi_osi_linux(1, d); /* enable */ | 176 | acpi_dmi_osi_linux(1, d); /* enable */ |
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | static int __init dmi_disable_osi_linux(const struct dmi_system_id *d) | ||
180 | { | ||
181 | acpi_dmi_osi_linux(0, d); /* disable */ | ||
182 | return 0; | ||
183 | } | ||
184 | static int __init dmi_unknown_osi_linux(const struct dmi_system_id *d) | ||
185 | { | ||
186 | acpi_dmi_osi_linux(-1, d); /* unknown */ | ||
187 | return 0; | ||
188 | } | ||
189 | static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | 179 | static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) |
190 | { | 180 | { |
191 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | 181 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); |
@@ -193,295 +183,21 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | |||
193 | return 0; | 183 | return 0; |
194 | } | 184 | } |
195 | 185 | ||
196 | /* | ||
197 | * Most BIOS that invoke OSI(Linux) do nothing with it. | ||
198 | * But some cause Linux to break. | ||
199 | * Only a couple use it to make Linux run better. | ||
200 | * | ||
201 | * Thus, Linux should continue to disable OSI(Linux) by default, | ||
202 | * should continue to discourage BIOS writers from using it, and | ||
203 | * should whitelist the few existing systems that require it. | ||
204 | * | ||
205 | * If it appears clear a vendor isn't using OSI(Linux) | ||
206 | * for anything constructive, blacklist them by name to disable | ||
207 | * unnecessary dmesg warnings on all of their products. | ||
208 | */ | ||
209 | |||
210 | static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | 186 | static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { |
211 | /* | ||
212 | * Disable OSI(Linux) warnings on all "Acer, inc." | ||
213 | * | ||
214 | * _OSI(Linux) disables the latest Windows BIOS code: | ||
215 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3100"), | ||
216 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5050"), | ||
217 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), | ||
218 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5580"), | ||
219 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 3010"), | ||
220 | * _OSI(Linux) effect unknown: | ||
221 | * DMI_MATCH(DMI_PRODUCT_NAME, "Ferrari 5000"), | ||
222 | */ | ||
223 | /* | ||
224 | * note that dmi_check_system() uses strstr() | ||
225 | * to match sub-strings rather than !strcmp(), | ||
226 | * so "Acer" below matches "Acer, inc." above. | ||
227 | */ | ||
228 | /* | ||
229 | * Disable OSI(Linux) warnings on all "Acer" | ||
230 | * | ||
231 | * _OSI(Linux) effect unknown: | ||
232 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), | ||
233 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720Z"), | ||
234 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5520"), | ||
235 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 6460"), | ||
236 | * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 7510"), | ||
237 | * | ||
238 | * _OSI(Linux) is a NOP: | ||
239 | * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"), | ||
240 | * DMI_MATCH(DMI_PRODUCT_NAME, "Extensa 5220"), | ||
241 | */ | ||
242 | { | ||
243 | .callback = dmi_disable_osi_linux, | ||
244 | .ident = "Acer", | ||
245 | .matches = { | ||
246 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
247 | }, | ||
248 | }, | ||
249 | /* | ||
250 | * Disable OSI(Linux) warnings on all "Apple Computer, Inc." | ||
251 | * Disable OSI(Linux) warnings on all "Apple Inc." | ||
252 | * | ||
253 | * _OSI(Linux) confirmed to be a NOP: | ||
254 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), | ||
255 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"), | ||
256 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2"), | ||
257 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3,1"), | ||
258 | * _OSI(Linux) effect unknown: | ||
259 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacPro2,1"), | ||
260 | * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro1,1"), | ||
261 | */ | ||
262 | { | ||
263 | .callback = dmi_disable_osi_linux, | ||
264 | .ident = "Apple", | ||
265 | .matches = { | ||
266 | DMI_MATCH(DMI_SYS_VENDOR, "Apple"), | ||
267 | }, | ||
268 | }, | ||
269 | /* | ||
270 | * Disable OSI(Linux) warnings on all "BenQ" | ||
271 | * | ||
272 | * _OSI(Linux) confirmed to be a NOP: | ||
273 | * DMI_MATCH(DMI_PRODUCT_NAME, "Joybook S31"), | ||
274 | */ | ||
275 | { | ||
276 | .callback = dmi_disable_osi_linux, | ||
277 | .ident = "BenQ", | ||
278 | .matches = { | ||
279 | DMI_MATCH(DMI_SYS_VENDOR, "BenQ"), | ||
280 | }, | ||
281 | }, | ||
282 | /* | ||
283 | * Disable OSI(Linux) warnings on all "Clevo Co." | ||
284 | * | ||
285 | * _OSI(Linux) confirmed to be a NOP: | ||
286 | * DMI_MATCH(DMI_PRODUCT_NAME, "M570RU"), | ||
287 | */ | ||
288 | { | ||
289 | .callback = dmi_disable_osi_linux, | ||
290 | .ident = "Clevo", | ||
291 | .matches = { | ||
292 | DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."), | ||
293 | }, | ||
294 | }, | ||
295 | /* | ||
296 | * Disable OSI(Linux) warnings on all "COMPAL" | ||
297 | * | ||
298 | * _OSI(Linux) confirmed to be a NOP: | ||
299 | * DMI_MATCH(DMI_BOARD_NAME, "HEL8X"), | ||
300 | * _OSI(Linux) unknown effect: | ||
301 | * DMI_MATCH(DMI_BOARD_NAME, "IFL91"), | ||
302 | */ | ||
303 | { | ||
304 | .callback = dmi_disable_osi_linux, | ||
305 | .ident = "Compal", | ||
306 | .matches = { | ||
307 | DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), | ||
308 | }, | ||
309 | }, | ||
310 | { /* OSI(Linux) touches USB, unknown side-effect */ | ||
311 | .callback = dmi_disable_osi_linux, | ||
312 | .ident = "Dell Dimension 5150", | ||
313 | .matches = { | ||
314 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
315 | DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM051"), | ||
316 | }, | ||
317 | }, | ||
318 | { /* OSI(Linux) is a NOP */ | ||
319 | .callback = dmi_disable_osi_linux, | ||
320 | .ident = "Dell i1501", | ||
321 | .matches = { | ||
322 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
323 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1501"), | ||
324 | }, | ||
325 | }, | ||
326 | { /* OSI(Linux) effect unknown */ | ||
327 | .callback = dmi_unknown_osi_linux, | ||
328 | .ident = "Dell Latitude D830", | ||
329 | .matches = { | ||
330 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
331 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D830"), | ||
332 | }, | ||
333 | }, | ||
334 | { /* OSI(Linux) effect unknown */ | ||
335 | .callback = dmi_unknown_osi_linux, | ||
336 | .ident = "Dell OptiPlex GX620", | ||
337 | .matches = { | ||
338 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
339 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX620"), | ||
340 | }, | ||
341 | }, | ||
342 | { /* OSI(Linux) causes some USB initialization to not run */ | ||
343 | .callback = dmi_unknown_osi_linux, | ||
344 | .ident = "Dell OptiPlex 755", | ||
345 | .matches = { | ||
346 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
347 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 755"), | ||
348 | }, | ||
349 | }, | ||
350 | { /* OSI(Linux) effect unknown */ | ||
351 | .callback = dmi_unknown_osi_linux, | ||
352 | .ident = "Dell PE 1900", | ||
353 | .matches = { | ||
354 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
355 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1900"), | ||
356 | }, | ||
357 | }, | ||
358 | { /* OSI(Linux) is a NOP */ | ||
359 | .callback = dmi_unknown_osi_linux, | ||
360 | .ident = "Dell PE 1950", | ||
361 | .matches = { | ||
362 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
363 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"), | ||
364 | }, | ||
365 | }, | ||
366 | { /* OSI(Linux) is a NOP */ | ||
367 | .callback = dmi_disable_osi_linux, | ||
368 | .ident = "Dell PE R200", | ||
369 | .matches = { | ||
370 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
371 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R200"), | ||
372 | }, | ||
373 | }, | ||
374 | { /* OSI(Linux) touches USB */ | ||
375 | .callback = dmi_disable_osi_linux, | ||
376 | .ident = "Dell PR 390", | ||
377 | .matches = { | ||
378 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
379 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 390"), | ||
380 | }, | ||
381 | }, | ||
382 | { /* OSI(Linux) touches USB */ | ||
383 | .callback = dmi_unknown_osi_linux, | ||
384 | .ident = "Dell PR 390", | ||
385 | .matches = { | ||
386 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
387 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 690"), | ||
388 | }, | ||
389 | }, | ||
390 | { /* OSI(Linux) unknown - ASL looks benign, but may effect dock/SMM */ | ||
391 | .callback = dmi_unknown_osi_linux, | ||
392 | .ident = "Dell PR M4300", | ||
393 | .matches = { | ||
394 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
395 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision M4300"), | ||
396 | }, | ||
397 | }, | ||
398 | { /* OSI(Linux) is a NOP */ | ||
399 | .callback = dmi_disable_osi_linux, | ||
400 | .ident = "Dell Vostro 1000", | ||
401 | .matches = { | ||
402 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
403 | DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1000"), | ||
404 | }, | ||
405 | }, | ||
406 | { /* OSI(Linux) effect unknown */ | ||
407 | .callback = dmi_unknown_osi_linux, | ||
408 | .ident = "Dell PE SC440", | ||
409 | .matches = { | ||
410 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
411 | DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge SC440"), | ||
412 | }, | ||
413 | }, | ||
414 | { /* OSI(Linux) effect unknown */ | ||
415 | .callback = dmi_unknown_osi_linux, | ||
416 | .ident = "Dialogue Flybook V5", | ||
417 | .matches = { | ||
418 | DMI_MATCH(DMI_SYS_VENDOR, "Dialogue Technology Corporation"), | ||
419 | DMI_MATCH(DMI_PRODUCT_NAME, "Flybook V5"), | ||
420 | }, | ||
421 | }, | ||
422 | /* | ||
423 | * Disable OSI(Linux) warnings on all "FUJITSU SIEMENS" | ||
424 | * | ||
425 | * _OSI(Linux) disables latest Windows BIOS code: | ||
426 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 2510"), | ||
427 | * _OSI(Linux) confirmed to be a NOP: | ||
428 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1536"), | ||
429 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1556"), | ||
430 | * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 1546"), | ||
431 | * DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), | ||
432 | * _OSI(Linux) unknown effect: | ||
433 | * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo M1425"), | ||
434 | * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo Si 1520"), | ||
435 | */ | ||
436 | { | ||
437 | .callback = dmi_disable_osi_linux, | ||
438 | .ident = "Fujitsu Siemens", | ||
439 | .matches = { | ||
440 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
441 | }, | ||
442 | }, | ||
443 | { | 187 | { |
444 | .callback = dmi_disable_osi_vista, | 188 | .callback = dmi_disable_osi_vista, |
445 | .ident = "Fujitsu Siemens", | 189 | .ident = "Fujitsu Siemens", |
446 | .matches = { | 190 | .matches = { |
447 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | 191 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), |
448 | DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), | 192 | DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), |
449 | }, | 193 | }, |
450 | }, | 194 | }, |
195 | |||
451 | /* | 196 | /* |
452 | * Disable OSI(Linux) warnings on all "Hewlett-Packard" | 197 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
453 | * | 198 | * Linux ignores it, except for the machines enumerated below. |
454 | * _OSI(Linux) confirmed to be a NOP: | ||
455 | * .ident = "HP Pavilion tx 1000" | ||
456 | * DMI_MATCH(DMI_BOARD_NAME, "30BF"), | ||
457 | * .ident = "HP Pavilion dv2000" | ||
458 | * DMI_MATCH(DMI_BOARD_NAME, "30B5"), | ||
459 | * .ident = "HP Pavilion dv5000", | ||
460 | * DMI_MATCH(DMI_BOARD_NAME, "30A7"), | ||
461 | * .ident = "HP Pavilion dv6300 30BC", | ||
462 | * DMI_MATCH(DMI_BOARD_NAME, "30BC"), | ||
463 | * .ident = "HP Pavilion dv6000", | ||
464 | * DMI_MATCH(DMI_BOARD_NAME, "30B7"), | ||
465 | * DMI_MATCH(DMI_BOARD_NAME, "30B8"), | ||
466 | * .ident = "HP Pavilion dv9000", | ||
467 | * DMI_MATCH(DMI_BOARD_NAME, "30B9"), | ||
468 | * .ident = "HP Pavilion dv9500", | ||
469 | * DMI_MATCH(DMI_BOARD_NAME, "30CB"), | ||
470 | * .ident = "HP/Compaq Presario C500", | ||
471 | * DMI_MATCH(DMI_BOARD_NAME, "30C6"), | ||
472 | * .ident = "HP/Compaq Presario F500", | ||
473 | * DMI_MATCH(DMI_BOARD_NAME, "30D3"), | ||
474 | * _OSI(Linux) unknown effect: | ||
475 | * .ident = "HP Pavilion dv6500", | ||
476 | * DMI_MATCH(DMI_BOARD_NAME, "30D0"), | ||
477 | */ | 199 | */ |
478 | { | 200 | |
479 | .callback = dmi_disable_osi_linux, | ||
480 | .ident = "Hewlett-Packard", | ||
481 | .matches = { | ||
482 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
483 | }, | ||
484 | }, | ||
485 | /* | 201 | /* |
486 | * Lenovo has a mix of systems OSI(Linux) situations | 202 | * Lenovo has a mix of systems OSI(Linux) situations |
487 | * and thus we can not wildcard the vendor. | 203 | * and thus we can not wildcard the vendor. |
@@ -519,113 +235,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
519 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), | 235 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), |
520 | }, | 236 | }, |
521 | }, | 237 | }, |
522 | { | ||
523 | .callback = dmi_disable_osi_linux, | ||
524 | .ident = "Lenovo 3000 V100", | ||
525 | .matches = { | ||
526 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
527 | DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"), | ||
528 | }, | ||
529 | }, | ||
530 | { | ||
531 | .callback = dmi_disable_osi_linux, | ||
532 | .ident = "Lenovo 3000 N100", | ||
533 | .matches = { | ||
534 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
535 | DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), | ||
536 | }, | ||
537 | }, | ||
538 | /* | ||
539 | * Disable OSI(Linux) warnings on all "LG Electronics" | ||
540 | * | ||
541 | * _OSI(Linux) confirmed to be a NOP: | ||
542 | * DMI_MATCH(DMI_PRODUCT_NAME, "P1-J150B"), | ||
543 | * with DMI_MATCH(DMI_BOARD_NAME, "ROCKY"), | ||
544 | * | ||
545 | * unknown: | ||
546 | * DMI_MATCH(DMI_PRODUCT_NAME, "S1-MDGDG"), | ||
547 | * with DMI_MATCH(DMI_BOARD_NAME, "ROCKY"), | ||
548 | */ | ||
549 | { | ||
550 | .callback = dmi_disable_osi_linux, | ||
551 | .ident = "LG", | ||
552 | .matches = { | ||
553 | DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), | ||
554 | }, | ||
555 | }, | ||
556 | /* NEC - OSI(Linux) effect unknown */ | ||
557 | { | ||
558 | .callback = dmi_unknown_osi_linux, | ||
559 | .ident = "NEC VERSA M360", | ||
560 | .matches = { | ||
561 | DMI_MATCH(DMI_SYS_VENDOR, "NEC Computers SAS"), | ||
562 | DMI_MATCH(DMI_PRODUCT_NAME, "NEC VERSA M360"), | ||
563 | }, | ||
564 | }, | ||
565 | /* Panasonic */ | ||
566 | { | ||
567 | .callback = dmi_unknown_osi_linux, | ||
568 | .ident = "Panasonic", | ||
569 | .matches = { | ||
570 | DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), | ||
571 | /* Toughbook CF-52 */ | ||
572 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-52CCABVBG"), | ||
573 | }, | ||
574 | }, | ||
575 | /* | ||
576 | * Disable OSI(Linux) warnings on all "Samsung Electronics" | ||
577 | * | ||
578 | * OSI(Linux) disables PNP0C32 and other BIOS code for Windows: | ||
579 | * DMI_MATCH(DMI_PRODUCT_NAME, "R40P/R41P"), | ||
580 | * DMI_MATCH(DMI_PRODUCT_NAME, "R59P/R60P/R61P"), | ||
581 | */ | ||
582 | { | ||
583 | .callback = dmi_disable_osi_linux, | ||
584 | .ident = "Samsung", | ||
585 | .matches = { | ||
586 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
587 | }, | ||
588 | }, | ||
589 | /* | ||
590 | * Disable OSI(Linux) warnings on all "Sony Corporation" | ||
591 | * | ||
592 | * _OSI(Linux) is a NOP: | ||
593 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NR11S_S"), | ||
594 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ38GP_C"), | ||
595 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ650N"), | ||
596 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-TZ21MN_N"), | ||
597 | * _OSI(Linux) unknown effect: | ||
598 | * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ11M"), | ||
599 | */ | ||
600 | { | ||
601 | .callback = dmi_disable_osi_linux, | ||
602 | .ident = "Sony", | ||
603 | .matches = { | ||
604 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
605 | }, | ||
606 | }, | ||
607 | /* | ||
608 | * Disable OSI(Linux) warnings on all "TOSHIBA" | ||
609 | * | ||
610 | * _OSI(Linux) breaks sound (bugzilla 7787): | ||
611 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P100"), | ||
612 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P105"), | ||
613 | * _OSI(Linux) is a NOP: | ||
614 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A100"), | ||
615 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A210"), | ||
616 | * _OSI(Linux) unknown effect: | ||
617 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A135"), | ||
618 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A200"), | ||
619 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P205"), | ||
620 | * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U305"), | ||
621 | */ | ||
622 | { | ||
623 | .callback = dmi_disable_osi_linux, | ||
624 | .ident = "Toshiba", | ||
625 | .matches = { | ||
626 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
627 | }, | ||
628 | }, | ||
629 | {} | 238 | {} |
630 | }; | 239 | }; |
631 | 240 | ||
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index cf41f9fc24a7..30f3ef236ecb 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -219,7 +219,8 @@ static void gpe_transaction(struct acpi_ec *ec, u8 status) | |||
219 | goto unlock; | 219 | goto unlock; |
220 | err: | 220 | err: |
221 | /* false interrupt, state didn't change */ | 221 | /* false interrupt, state didn't change */ |
222 | ++ec->curr->irq_count; | 222 | if (in_interrupt()) |
223 | ++ec->curr->irq_count; | ||
223 | unlock: | 224 | unlock: |
224 | spin_unlock_irqrestore(&ec->curr_lock, flags); | 225 | spin_unlock_irqrestore(&ec->curr_lock, flags); |
225 | } | 226 | } |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 4be252145cb4..c8111424dcb8 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
36 | #include <linux/kmod.h> | 36 | #include <linux/kmod.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/dmi.h> | ||
39 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
40 | #include <linux/nmi.h> | 39 | #include <linux/nmi.h> |
41 | #include <linux/acpi.h> | 40 | #include <linux/acpi.h> |
@@ -97,54 +96,44 @@ static DEFINE_SPINLOCK(acpi_res_lock); | |||
97 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; | 96 | static char osi_additional_string[OSI_STRING_LENGTH_MAX]; |
98 | 97 | ||
99 | /* | 98 | /* |
100 | * "Ode to _OSI(Linux)" | 99 | * The story of _OSI(Linux) |
101 | * | 100 | * |
102 | * osi_linux -- Control response to BIOS _OSI(Linux) query. | 101 | * From pre-history through Linux-2.6.22, |
102 | * Linux responded TRUE upon a BIOS OSI(Linux) query. | ||
103 | * | 103 | * |
104 | * As Linux evolves, the features that it supports change. | 104 | * Unfortunately, reference BIOS writers got wind of this |
105 | * So an OSI string such as "Linux" is not specific enough | 105 | * and put OSI(Linux) in their example code, quickly exposing |
106 | * to be useful across multiple versions of Linux. It | 106 | * this string as ill-conceived and opening the door to |
107 | * doesn't identify any particular feature, interface, | 107 | * an un-bounded number of BIOS incompatibilities. |
108 | * or even any particular version of Linux... | ||
109 | * | 108 | * |
110 | * Unfortunately, Linux-2.6.22 and earlier responded "yes" | 109 | * For example, OSI(Linux) was used on resume to re-POST a |
111 | * to a BIOS _OSI(Linux) query. When | 110 | * video card on one system, because Linux at that time |
112 | * a reference mobile BIOS started using it, its use | 111 | * could not do a speedy restore in its native driver. |
113 | * started to spread to many vendor platforms. | 112 | * But then upon gaining quick native restore capability, |
114 | * As it is not supportable, we need to halt that spread. | 113 | * Linux has no way to tell the BIOS to skip the time-consuming |
114 | * POST -- putting Linux at a permanent performance disadvantage. | ||
115 | * On another system, the BIOS writer used OSI(Linux) | ||
116 | * to infer native OS support for IPMI! On other systems, | ||
117 | * OSI(Linux) simply got in the way of Linux claiming to | ||
118 | * be compatible with other operating systems, exposing | ||
119 | * BIOS issues such as skipped device initialization. | ||
115 | * | 120 | * |
116 | * Today, most BIOS references to _OSI(Linux) are noise -- | 121 | * So "Linux" turned out to be a really poor chose of |
117 | * they have no functional effect and are just dead code | 122 | * OSI string, and from Linux-2.6.23 onward we respond FALSE. |
118 | * carried over from the reference BIOS. | ||
119 | * | ||
120 | * The next most common case is that _OSI(Linux) harms Linux, | ||
121 | * usually by causing the BIOS to follow paths that are | ||
122 | * not tested during Windows validation. | ||
123 | * | ||
124 | * Finally, there is a short list of platforms | ||
125 | * where OSI(Linux) benefits Linux. | ||
126 | * | ||
127 | * In Linux-2.6.23, OSI(Linux) is first disabled by default. | ||
128 | * DMI is used to disable the dmesg warning about OSI(Linux) | ||
129 | * on platforms where it is known to have no effect. | ||
130 | * But a dmesg warning remains for systems where | ||
131 | * we do not know if OSI(Linux) is good or bad for the system. | ||
132 | * DMI is also used to enable OSI(Linux) for the machines | ||
133 | * that are known to need it. | ||
134 | * | 123 | * |
135 | * BIOS writers should NOT query _OSI(Linux) on future systems. | 124 | * BIOS writers should NOT query _OSI(Linux) on future systems. |
136 | * It will be ignored by default, and to get Linux to | 125 | * Linux will complain on the console when it sees it, and return FALSE. |
137 | * not ignore it will require a kernel source update to | 126 | * To get Linux to return TRUE for your system will require |
138 | * add a DMI entry, or a boot-time "acpi_osi=Linux" invocation. | 127 | * a kernel source update to add a DMI entry, |
128 | * or boot with "acpi_osi=Linux" | ||
139 | */ | 129 | */ |
140 | #define OSI_LINUX_ENABLE 0 | ||
141 | 130 | ||
142 | static struct osi_linux { | 131 | static struct osi_linux { |
143 | unsigned int enable:1; | 132 | unsigned int enable:1; |
144 | unsigned int dmi:1; | 133 | unsigned int dmi:1; |
145 | unsigned int cmdline:1; | 134 | unsigned int cmdline:1; |
146 | unsigned int known:1; | 135 | unsigned int known:1; |
147 | } osi_linux = { OSI_LINUX_ENABLE, 0, 0, 0}; | 136 | } osi_linux = { 0, 0, 0, 0}; |
148 | 137 | ||
149 | static void __init acpi_request_region (struct acpi_generic_address *addr, | 138 | static void __init acpi_request_region (struct acpi_generic_address *addr, |
150 | unsigned int length, char *desc) | 139 | unsigned int length, char *desc) |
@@ -1296,34 +1285,6 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) | |||
1296 | return (AE_OK); | 1285 | return (AE_OK); |
1297 | } | 1286 | } |
1298 | 1287 | ||
1299 | /** | ||
1300 | * acpi_dmi_dump - dump DMI slots needed for blacklist entry | ||
1301 | * | ||
1302 | * Returns 0 on success | ||
1303 | */ | ||
1304 | static int acpi_dmi_dump(void) | ||
1305 | { | ||
1306 | |||
1307 | if (!dmi_available) | ||
1308 | return -1; | ||
1309 | |||
1310 | printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n", | ||
1311 | dmi_get_system_info(DMI_SYS_VENDOR)); | ||
1312 | printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n", | ||
1313 | dmi_get_system_info(DMI_PRODUCT_NAME)); | ||
1314 | printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n", | ||
1315 | dmi_get_system_info(DMI_PRODUCT_VERSION)); | ||
1316 | printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n", | ||
1317 | dmi_get_system_info(DMI_BOARD_NAME)); | ||
1318 | printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n", | ||
1319 | dmi_get_system_info(DMI_BIOS_VENDOR)); | ||
1320 | printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n", | ||
1321 | dmi_get_system_info(DMI_BIOS_DATE)); | ||
1322 | |||
1323 | return 0; | ||
1324 | } | ||
1325 | |||
1326 | |||
1327 | /****************************************************************************** | 1288 | /****************************************************************************** |
1328 | * | 1289 | * |
1329 | * FUNCTION: acpi_os_validate_interface | 1290 | * FUNCTION: acpi_os_validate_interface |
@@ -1350,21 +1311,6 @@ acpi_os_validate_interface (char *interface) | |||
1350 | osi_linux.cmdline ? " via cmdline" : | 1311 | osi_linux.cmdline ? " via cmdline" : |
1351 | osi_linux.dmi ? " via DMI" : ""); | 1312 | osi_linux.dmi ? " via DMI" : ""); |
1352 | 1313 | ||
1353 | if (!osi_linux.dmi) { | ||
1354 | if (acpi_dmi_dump()) | ||
1355 | printk(KERN_NOTICE PREFIX | ||
1356 | "[please extract dmidecode output]\n"); | ||
1357 | printk(KERN_NOTICE PREFIX | ||
1358 | "Please send DMI info above to " | ||
1359 | "linux-acpi@vger.kernel.org\n"); | ||
1360 | } | ||
1361 | if (!osi_linux.known && !osi_linux.cmdline) { | ||
1362 | printk(KERN_NOTICE PREFIX | ||
1363 | "If \"acpi_osi=%sLinux\" works better, " | ||
1364 | "please notify linux-acpi@vger.kernel.org\n", | ||
1365 | osi_linux.enable ? "!" : ""); | ||
1366 | } | ||
1367 | |||
1368 | if (osi_linux.enable) | 1314 | if (osi_linux.enable) |
1369 | return AE_OK; | 1315 | return AE_OK; |
1370 | } | 1316 | } |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index bd5253ee5c85..39b7233c3485 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -751,16 +751,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
751 | if (!acpi_match_device_ids(device, button_device_ids)) | 751 | if (!acpi_match_device_ids(device, button_device_ids)) |
752 | device->wakeup.flags.run_wake = 1; | 752 | device->wakeup.flags.run_wake = 1; |
753 | 753 | ||
754 | /* | ||
755 | * Don't set Power button GPE as run_wake | ||
756 | * if Fixed Power button is used | ||
757 | */ | ||
758 | if (!strcmp(device->pnp.hardware_id, "PNP0C0C") && | ||
759 | !(acpi_gbl_FADT.flags & ACPI_FADT_POWER_BUTTON)) { | ||
760 | device->wakeup.flags.run_wake = 0; | ||
761 | device->wakeup.flags.valid = 0; | ||
762 | } | ||
763 | |||
764 | end: | 754 | end: |
765 | if (ACPI_FAILURE(status)) | 755 | if (ACPI_FAILURE(status)) |
766 | device->flags.wake_capable = 0; | 756 | device->flags.wake_capable = 0; |
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 80c0868d0480..28a691cc625e 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -90,6 +90,18 @@ void __init acpi_old_suspend_ordering(void) | |||
90 | old_suspend_ordering = true; | 90 | old_suspend_ordering = true; |
91 | } | 91 | } |
92 | 92 | ||
93 | /* | ||
94 | * According to the ACPI specification the BIOS should make sure that ACPI is | ||
95 | * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, | ||
96 | * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI | ||
97 | * on such systems during resume. Unfortunately that doesn't help in | ||
98 | * particularly pathological cases in which SCI_EN has to be set directly on | ||
99 | * resume, although the specification states very clearly that this flag is | ||
100 | * owned by the hardware. The set_sci_en_on_resume variable will be set in such | ||
101 | * cases. | ||
102 | */ | ||
103 | static bool set_sci_en_on_resume; | ||
104 | |||
93 | /** | 105 | /** |
94 | * acpi_pm_disable_gpes - Disable the GPEs. | 106 | * acpi_pm_disable_gpes - Disable the GPEs. |
95 | */ | 107 | */ |
@@ -235,7 +247,11 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
235 | } | 247 | } |
236 | 248 | ||
237 | /* If ACPI is not enabled by the BIOS, we need to enable it here. */ | 249 | /* If ACPI is not enabled by the BIOS, we need to enable it here. */ |
238 | acpi_enable(); | 250 | if (set_sci_en_on_resume) |
251 | acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1); | ||
252 | else | ||
253 | acpi_enable(); | ||
254 | |||
239 | /* Reprogram control registers and execute _BFS */ | 255 | /* Reprogram control registers and execute _BFS */ |
240 | acpi_leave_sleep_state_prep(acpi_state); | 256 | acpi_leave_sleep_state_prep(acpi_state); |
241 | 257 | ||
@@ -323,6 +339,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | |||
323 | return 0; | 339 | return 0; |
324 | } | 340 | } |
325 | 341 | ||
342 | static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d) | ||
343 | { | ||
344 | set_sci_en_on_resume = true; | ||
345 | return 0; | ||
346 | } | ||
347 | |||
326 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | 348 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { |
327 | { | 349 | { |
328 | .callback = init_old_suspend_ordering, | 350 | .callback = init_old_suspend_ordering, |
@@ -340,6 +362,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
340 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), | 362 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), |
341 | }, | 363 | }, |
342 | }, | 364 | }, |
365 | { | ||
366 | .callback = init_set_sci_en_on_resume, | ||
367 | .ident = "Apple MacBook 1,1", | ||
368 | .matches = { | ||
369 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), | ||
370 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), | ||
371 | }, | ||
372 | }, | ||
373 | { | ||
374 | .callback = init_set_sci_en_on_resume, | ||
375 | .ident = "Apple MacMini 1,1", | ||
376 | .matches = { | ||
377 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), | ||
378 | DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), | ||
379 | }, | ||
380 | }, | ||
343 | {}, | 381 | {}, |
344 | }; | 382 | }; |
345 | #endif /* CONFIG_SUSPEND */ | 383 | #endif /* CONFIG_SUSPEND */ |
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 66aac06f2ac5..25f531d892de 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c | |||
@@ -848,8 +848,6 @@ static int __init toshiba_acpi_init(void) | |||
848 | ret = input_register_polled_device(toshiba_acpi.poll_dev); | 848 | ret = input_register_polled_device(toshiba_acpi.poll_dev); |
849 | if (ret) { | 849 | if (ret) { |
850 | printk(MY_ERR "unable to register kill-switch input device\n"); | 850 | printk(MY_ERR "unable to register kill-switch input device\n"); |
851 | rfkill_free(toshiba_acpi.rfk_dev); | ||
852 | toshiba_acpi.rfk_dev = NULL; | ||
853 | toshiba_acpi_exit(); | 851 | toshiba_acpi_exit(); |
854 | return ret; | 852 | return ret; |
855 | } | 853 | } |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e827be36ee8d..f844941089bb 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -259,34 +259,26 @@ acpi_evaluate_integer(acpi_handle handle, | |||
259 | struct acpi_object_list *arguments, unsigned long long *data) | 259 | struct acpi_object_list *arguments, unsigned long long *data) |
260 | { | 260 | { |
261 | acpi_status status = AE_OK; | 261 | acpi_status status = AE_OK; |
262 | union acpi_object *element; | 262 | union acpi_object element; |
263 | struct acpi_buffer buffer = { 0, NULL }; | 263 | struct acpi_buffer buffer = { 0, NULL }; |
264 | 264 | ||
265 | |||
266 | if (!data) | 265 | if (!data) |
267 | return AE_BAD_PARAMETER; | 266 | return AE_BAD_PARAMETER; |
268 | 267 | ||
269 | element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); | ||
270 | if (!element) | ||
271 | return AE_NO_MEMORY; | ||
272 | |||
273 | buffer.length = sizeof(union acpi_object); | 268 | buffer.length = sizeof(union acpi_object); |
274 | buffer.pointer = element; | 269 | buffer.pointer = &element; |
275 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); | 270 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); |
276 | if (ACPI_FAILURE(status)) { | 271 | if (ACPI_FAILURE(status)) { |
277 | acpi_util_eval_error(handle, pathname, status); | 272 | acpi_util_eval_error(handle, pathname, status); |
278 | kfree(element); | ||
279 | return status; | 273 | return status; |
280 | } | 274 | } |
281 | 275 | ||
282 | if (element->type != ACPI_TYPE_INTEGER) { | 276 | if (element.type != ACPI_TYPE_INTEGER) { |
283 | acpi_util_eval_error(handle, pathname, AE_BAD_DATA); | 277 | acpi_util_eval_error(handle, pathname, AE_BAD_DATA); |
284 | kfree(element); | ||
285 | return AE_BAD_DATA; | 278 | return AE_BAD_DATA; |
286 | } | 279 | } |
287 | 280 | ||
288 | *data = element->integer.value; | 281 | *data = element.integer.value; |
289 | kfree(element); | ||
290 | 282 | ||
291 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); | 283 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); |
292 | 284 | ||
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 7bcb81002dcf..571b211608d1 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -1038,8 +1038,8 @@ static int sony_nc_add(struct acpi_device *device) | |||
1038 | goto outinput; | 1038 | goto outinput; |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | if (!acpi_video_backlight_support()) { | 1041 | if (acpi_video_backlight_support()) { |
1042 | printk(KERN_INFO DRV_PFX "Sony: Brightness ignored, must be " | 1042 | printk(KERN_INFO DRV_PFX "brightness ignored, must be " |
1043 | "controlled by ACPI video driver\n"); | 1043 | "controlled by ACPI video driver\n"); |
1044 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", | 1044 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", |
1045 | &handle))) { | 1045 | &handle))) { |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 7a4a26b0edd2..899766e16fa8 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -5318,6 +5318,7 @@ static enum fan_control_commands fan_control_commands; | |||
5318 | 5318 | ||
5319 | static u8 fan_control_initial_status; | 5319 | static u8 fan_control_initial_status; |
5320 | static u8 fan_control_desired_level; | 5320 | static u8 fan_control_desired_level; |
5321 | static u8 fan_control_resume_level; | ||
5321 | static int fan_watchdog_maxinterval; | 5322 | static int fan_watchdog_maxinterval; |
5322 | 5323 | ||
5323 | static struct mutex fan_mutex; | 5324 | static struct mutex fan_mutex; |
@@ -5440,8 +5441,8 @@ static int fan_set_level(int level) | |||
5440 | 5441 | ||
5441 | case TPACPI_FAN_WR_ACPI_FANS: | 5442 | case TPACPI_FAN_WR_ACPI_FANS: |
5442 | case TPACPI_FAN_WR_TPEC: | 5443 | case TPACPI_FAN_WR_TPEC: |
5443 | if ((level != TP_EC_FAN_AUTO) && | 5444 | if (!(level & TP_EC_FAN_AUTO) && |
5444 | (level != TP_EC_FAN_FULLSPEED) && | 5445 | !(level & TP_EC_FAN_FULLSPEED) && |
5445 | ((level < 0) || (level > 7))) | 5446 | ((level < 0) || (level > 7))) |
5446 | return -EINVAL; | 5447 | return -EINVAL; |
5447 | 5448 | ||
@@ -6005,38 +6006,67 @@ static void fan_exit(void) | |||
6005 | 6006 | ||
6006 | static void fan_suspend(pm_message_t state) | 6007 | static void fan_suspend(pm_message_t state) |
6007 | { | 6008 | { |
6009 | int rc; | ||
6010 | |||
6008 | if (!fan_control_allowed) | 6011 | if (!fan_control_allowed) |
6009 | return; | 6012 | return; |
6010 | 6013 | ||
6011 | /* Store fan status in cache */ | 6014 | /* Store fan status in cache */ |
6012 | fan_get_status_safe(NULL); | 6015 | fan_control_resume_level = 0; |
6016 | rc = fan_get_status_safe(&fan_control_resume_level); | ||
6017 | if (rc < 0) | ||
6018 | printk(TPACPI_NOTICE | ||
6019 | "failed to read fan level for later " | ||
6020 | "restore during resume: %d\n", rc); | ||
6021 | |||
6022 | /* if it is undefined, don't attempt to restore it. | ||
6023 | * KEEP THIS LAST */ | ||
6013 | if (tp_features.fan_ctrl_status_undef) | 6024 | if (tp_features.fan_ctrl_status_undef) |
6014 | fan_control_desired_level = TP_EC_FAN_AUTO; | 6025 | fan_control_resume_level = 0; |
6015 | } | 6026 | } |
6016 | 6027 | ||
6017 | static void fan_resume(void) | 6028 | static void fan_resume(void) |
6018 | { | 6029 | { |
6019 | u8 saved_fan_level; | ||
6020 | u8 current_level = 7; | 6030 | u8 current_level = 7; |
6021 | bool do_set = false; | 6031 | bool do_set = false; |
6032 | int rc; | ||
6022 | 6033 | ||
6023 | /* DSDT *always* updates status on resume */ | 6034 | /* DSDT *always* updates status on resume */ |
6024 | tp_features.fan_ctrl_status_undef = 0; | 6035 | tp_features.fan_ctrl_status_undef = 0; |
6025 | 6036 | ||
6026 | saved_fan_level = fan_control_desired_level; | ||
6027 | if (!fan_control_allowed || | 6037 | if (!fan_control_allowed || |
6038 | !fan_control_resume_level || | ||
6028 | (fan_get_status_safe(¤t_level) < 0)) | 6039 | (fan_get_status_safe(¤t_level) < 0)) |
6029 | return; | 6040 | return; |
6030 | 6041 | ||
6031 | switch (fan_control_access_mode) { | 6042 | switch (fan_control_access_mode) { |
6032 | case TPACPI_FAN_WR_ACPI_SFAN: | 6043 | case TPACPI_FAN_WR_ACPI_SFAN: |
6033 | do_set = (saved_fan_level > current_level); | 6044 | /* never decrease fan level */ |
6045 | do_set = (fan_control_resume_level > current_level); | ||
6034 | break; | 6046 | break; |
6035 | case TPACPI_FAN_WR_ACPI_FANS: | 6047 | case TPACPI_FAN_WR_ACPI_FANS: |
6036 | case TPACPI_FAN_WR_TPEC: | 6048 | case TPACPI_FAN_WR_TPEC: |
6037 | do_set = ((saved_fan_level & TP_EC_FAN_FULLSPEED) || | 6049 | /* never decrease fan level, scale is: |
6038 | (saved_fan_level == 7 && | 6050 | * TP_EC_FAN_FULLSPEED > 7 >= TP_EC_FAN_AUTO |
6039 | !(current_level & TP_EC_FAN_FULLSPEED))); | 6051 | * |
6052 | * We expect the firmware to set either 7 or AUTO, but we | ||
6053 | * handle FULLSPEED out of paranoia. | ||
6054 | * | ||
6055 | * So, we can safely only restore FULLSPEED or 7, anything | ||
6056 | * else could slow the fan. Restoring AUTO is useless, at | ||
6057 | * best that's exactly what the DSDT already set (it is the | ||
6058 | * slower it uses). | ||
6059 | * | ||
6060 | * Always keep in mind that the DSDT *will* have set the | ||
6061 | * fans to what the vendor supposes is the best level. We | ||
6062 | * muck with it only to speed the fan up. | ||
6063 | */ | ||
6064 | if (fan_control_resume_level != 7 && | ||
6065 | !(fan_control_resume_level & TP_EC_FAN_FULLSPEED)) | ||
6066 | return; | ||
6067 | else | ||
6068 | do_set = !(current_level & TP_EC_FAN_FULLSPEED) && | ||
6069 | (current_level != fan_control_resume_level); | ||
6040 | break; | 6070 | break; |
6041 | default: | 6071 | default: |
6042 | return; | 6072 | return; |
@@ -6044,8 +6074,11 @@ static void fan_resume(void) | |||
6044 | if (do_set) { | 6074 | if (do_set) { |
6045 | printk(TPACPI_NOTICE | 6075 | printk(TPACPI_NOTICE |
6046 | "restoring fan level to 0x%02x\n", | 6076 | "restoring fan level to 0x%02x\n", |
6047 | saved_fan_level); | 6077 | fan_control_resume_level); |
6048 | fan_set_level_safe(saved_fan_level); | 6078 | rc = fan_set_level_safe(fan_control_resume_level); |
6079 | if (rc < 0) | ||
6080 | printk(TPACPI_NOTICE | ||
6081 | "failed to restore fan level: %d\n", rc); | ||
6049 | } | 6082 | } |
6050 | } | 6083 | } |
6051 | 6084 | ||
diff --git a/include/acpi/acpredef.h b/include/acpi/acpredef.h index 619fb75f8861..16a9ca9a66e4 100644 --- a/include/acpi/acpredef.h +++ b/include/acpi/acpredef.h | |||
@@ -167,7 +167,7 @@ static const union acpi_predefined_info predefined_names[] = { | |||
167 | {.info = {"_BFS", 1, 0}}, | 167 | {.info = {"_BFS", 1, 0}}, |
168 | {.info = {"_BIF", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, | 168 | {.info = {"_BIF", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, |
169 | 9, | 169 | 9, |
170 | ACPI_RTYPE_STRING, 4, 0}}, /* fixed (9 Int),(4 Str) */ | 170 | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER, 4, 0}}, /* fixed (9 Int),(4 Str) */ |
171 | {.info = {"_BLT", 3, 0}}, | 171 | {.info = {"_BLT", 3, 0}}, |
172 | {.info = {"_BMC", 1, 0}}, | 172 | {.info = {"_BMC", 1, 0}}, |
173 | {.info = {"_BMD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5, 0, 0, 0}}, /* fixed (5 Int) */ | 173 | {.info = {"_BMD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5, 0, 0, 0}}, /* fixed (5 Int) */ |
@@ -346,7 +346,7 @@ static const union acpi_predefined_info predefined_names[] = { | |||
346 | 346 | ||
347 | /* Acpi 1.0 defined _WAK with no return value. Later, it was changed to return a package */ | 347 | /* Acpi 1.0 defined _WAK with no return value. Later, it was changed to return a package */ |
348 | 348 | ||
349 | {.info = {"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_PACKAGE}}, | 349 | {.info = {"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE}}, |
350 | {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, 0, 0, 0}}, /* fixed (2 Int), but is optional */ | 350 | {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, 0, 0, 0}}, /* fixed (2 Int), but is optional */ |
351 | {.ret_info = {0, 0, 0, 0, 0, 0}} /* Table terminator */ | 351 | {.ret_info = {0, 0, 0, 0, 0, 0}} /* Table terminator */ |
352 | }; | 352 | }; |