Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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:
Revert "ACPI: Fan: Drop force_power_state acpi_device option"
ACPI: EC: "DEBUG" needs to be defined earlier
ACPI: EC: add leading zeros to debug messages
ACPI: EC: fix dmesg spam regression
ACPI: DMI blacklist to reduce console warnings on OSI(Linux) systems.
ACPI: Add ThinkPad R61, ThinkPad T61 to OSI(Linux) white-list
ACPI: make _OSI(Linux) console messages smarter
ACPI: Delete Intel Customer Reference Board (CRB) from OSI(Linux) DMI list
ACPI: on OSI(Linux), print needed DMI rather than requesting dmidecode output
ACPI: create acpi_dmi_dump()
DMI: create dmi_get_slot()
DMI: move dmi_available declaration to linux/dmi.h
ACPI: processor: Fix null pointer dereference in throttling

+591 -59
+381
drivers/acpi/blacklist.c
··· 3 3 * 4 4 * Check to see if the given machine has a known bad ACPI BIOS 5 5 * or if the BIOS is too old. 6 + * Check given machine against acpi_osi_dmi_table[]. 6 7 * 7 8 * Copyright (C) 2004 Len Brown <len.brown@intel.com> 8 9 * Copyright (C) 2002 Andy Grover <andrew.grover@intel.com> ··· 50 49 char *reason; 51 50 u32 is_critical_error; 52 51 }; 52 + 53 + static struct dmi_system_id acpi_osi_dmi_table[] __initdata; 53 54 54 55 /* 55 56 * POLICY: If *anything* doesn't work, put it on the blacklist. ··· 168 165 169 166 blacklisted += blacklist_by_year(); 170 167 168 + dmi_check_system(acpi_osi_dmi_table); 169 + 171 170 return blacklisted; 172 171 } 172 + #ifdef CONFIG_DMI 173 + static int __init dmi_enable_osi_linux(const struct dmi_system_id *d) 174 + { 175 + acpi_dmi_osi_linux(1, d); /* enable */ 176 + return 0; 177 + } 178 + static int __init dmi_disable_osi_linux(const struct dmi_system_id *d) 179 + { 180 + acpi_dmi_osi_linux(0, d); /* disable */ 181 + return 0; 182 + } 183 + static int __init dmi_unknown_osi_linux(const struct dmi_system_id *d) 184 + { 185 + acpi_dmi_osi_linux(-1, d); /* unknown */ 186 + return 0; 187 + } 188 + 189 + /* 190 + * Most BIOS that invoke OSI(Linux) do nothing with it. 191 + * But some cause Linux to break. 192 + * Only a couple use it to make Linux run better. 193 + * 194 + * Thus, Linux should continue to disable OSI(Linux) by default, 195 + * should continue to discourage BIOS writers from using it, and 196 + * should whitelist the few existing systems that require it. 197 + * 198 + * If it appears clear a vendor isn't using OSI(Linux) 199 + * for anything constructive, blacklist them by name to disable 200 + * unnecessary dmesg warnings on all of their products. 201 + */ 202 + 203 + static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { 204 + /* 205 + * Disable OSI(Linux) warnings on all "Acer, inc." 206 + * 207 + * _OSI(Linux) disables the latest Windows BIOS code: 208 + * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5050"), 209 + * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5580"), 210 + * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 3010"), 211 + * _OSI(Linux) effect unknown: 212 + * DMI_MATCH(DMI_PRODUCT_NAME, "Ferrari 5000"), 213 + */ 214 + { 215 + .callback = dmi_disable_osi_linux, 216 + .ident = "Acer, inc.", 217 + .matches = { 218 + DMI_MATCH(DMI_SYS_VENDOR, "Acer, inc."), 219 + }, 220 + }, 221 + /* 222 + * Disable OSI(Linux) warnings on all "Acer" 223 + * 224 + * _OSI(Linux) effect unknown: 225 + * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), 226 + * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), 227 + * DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720Z"), 228 + * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5520"), 229 + * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 6460"), 230 + * DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 7510"), 231 + * DMI_MATCH(DMI_PRODUCT_NAME, "Extensa 5220"), 232 + */ 233 + { 234 + .callback = dmi_unknown_osi_linux, 235 + .ident = "Acer", 236 + .matches = { 237 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 238 + }, 239 + }, 240 + /* 241 + * Disable OSI(Linux) warnings on all "Apple Computer, Inc." 242 + * 243 + * _OSI(Linux) confirmed to be a NOP: 244 + * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), 245 + * DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"), 246 + * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2"), 247 + * _OSI(Linux) effect unknown: 248 + * DMI_MATCH(DMI_PRODUCT_NAME, "MacPro2,1"), 249 + * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro1,1"), 250 + * DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3,1"), 251 + */ 252 + { 253 + .callback = dmi_disable_osi_linux, 254 + .ident = "Apple", 255 + .matches = { 256 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), 257 + }, 258 + }, 259 + /* 260 + * Disable OSI(Linux) warnings on all "BenQ" 261 + * 262 + * _OSI(Linux) confirmed to be a NOP: 263 + * DMI_MATCH(DMI_PRODUCT_NAME, "Joybook S31"), 264 + */ 265 + { 266 + .callback = dmi_disable_osi_linux, 267 + .ident = "BenQ", 268 + .matches = { 269 + DMI_MATCH(DMI_SYS_VENDOR, "BenQ"), 270 + }, 271 + }, 272 + /* 273 + * Disable OSI(Linux) warnings on all "Clevo Co." 274 + * 275 + * _OSI(Linux) confirmed to be a NOP: 276 + * DMI_MATCH(DMI_PRODUCT_NAME, "M570RU"), 277 + */ 278 + { 279 + .callback = dmi_disable_osi_linux, 280 + .ident = "Clevo", 281 + .matches = { 282 + DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."), 283 + }, 284 + }, 285 + /* 286 + * Disable OSI(Linux) warnings on all "COMPAL" 287 + * 288 + * _OSI(Linux) confirmed to be a NOP: 289 + * DMI_MATCH(DMI_BOARD_NAME, "HEL8X"), 290 + * _OSI(Linux) unknown effect: 291 + * DMI_MATCH(DMI_BOARD_NAME, "IFL91"), 292 + */ 293 + { 294 + .callback = dmi_unknown_osi_linux, 295 + .ident = "Compal", 296 + .matches = { 297 + DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), 298 + }, 299 + }, 300 + { /* OSI(Linux) touches USB, breaks suspend to disk */ 301 + .callback = dmi_disable_osi_linux, 302 + .ident = "Dell Dimension 5150", 303 + .matches = { 304 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 305 + DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM051"), 306 + }, 307 + }, 308 + { /* OSI(Linux) is a NOP */ 309 + .callback = dmi_disable_osi_linux, 310 + .ident = "Dell", 311 + .matches = { 312 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 313 + DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1501"), 314 + }, 315 + }, 316 + { /* OSI(Linux) effect unknown */ 317 + .callback = dmi_unknown_osi_linux, 318 + .ident = "Dell", 319 + .matches = { 320 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 321 + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude D830"), 322 + }, 323 + }, 324 + { /* OSI(Linux) effect unknown */ 325 + .callback = dmi_unknown_osi_linux, 326 + .ident = "Dell", 327 + .matches = { 328 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 329 + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX620"), 330 + }, 331 + }, 332 + { /* OSI(Linux) effect unknown */ 333 + .callback = dmi_unknown_osi_linux, 334 + .ident = "Dell", 335 + .matches = { 336 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 337 + DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1900"), 338 + }, 339 + }, 340 + { /* OSI(Linux) touches USB */ 341 + .callback = dmi_disable_osi_linux, 342 + .ident = "Dell", 343 + .matches = { 344 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 345 + DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 390"), 346 + }, 347 + }, 348 + { /* OSI(Linux) is a NOP */ 349 + .callback = dmi_disable_osi_linux, 350 + .ident = "Dell Vostro 1000", 351 + .matches = { 352 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 353 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1000"), 354 + }, 355 + }, 356 + { /* OSI(Linux) effect unknown */ 357 + .callback = dmi_unknown_osi_linux, 358 + .ident = "Dell", 359 + .matches = { 360 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 361 + DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge SC440"), 362 + }, 363 + }, 364 + { /* OSI(Linux) effect unknown */ 365 + .callback = dmi_unknown_osi_linux, 366 + .ident = "Dialogue Flybook V5", 367 + .matches = { 368 + DMI_MATCH(DMI_SYS_VENDOR, "Dialogue Technology Corporation"), 369 + DMI_MATCH(DMI_PRODUCT_NAME, "Flybook V5"), 370 + }, 371 + }, 372 + /* 373 + * Disable OSI(Linux) warnings on all "FUJITSU SIEMENS" 374 + * 375 + * _OSI(Linux) disables latest Windows BIOS code: 376 + * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 2510"), 377 + * _OSI(Linux) confirmed to be a NOP: 378 + * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1536"), 379 + * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1556"), 380 + * DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 1546"), 381 + * _OSI(Linux) unknown effect: 382 + * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo M1425"), 383 + * DMI_MATCH(DMI_PRODUCT_NAME, "Amilo Si 1520"), 384 + * DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"), 385 + */ 386 + { 387 + .callback = dmi_disable_osi_linux, 388 + .ident = "Fujitsu Siemens", 389 + .matches = { 390 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 391 + }, 392 + }, 393 + /* 394 + * Disable OSI(Linux) warnings on all "Hewlett-Packard" 395 + * 396 + * _OSI(Linux) confirmed to be a NOP: 397 + * .ident = "HP Pavilion tx 1000" 398 + * DMI_MATCH(DMI_BOARD_NAME, "30BF"), 399 + * .ident = "HP Pavilion dv2000" 400 + * DMI_MATCH(DMI_BOARD_NAME, "30B5"), 401 + * .ident = "HP Pavilion dv5000", 402 + * DMI_MATCH(DMI_BOARD_NAME, "30A7"), 403 + * .ident = "HP Pavilion dv6300 30BC", 404 + * DMI_MATCH(DMI_BOARD_NAME, "30BC"), 405 + * .ident = "HP Pavilion dv6000", 406 + * DMI_MATCH(DMI_BOARD_NAME, "30B7"), 407 + * DMI_MATCH(DMI_BOARD_NAME, "30B8"), 408 + * .ident = "HP Pavilion dv9000", 409 + * DMI_MATCH(DMI_BOARD_NAME, "30B9"), 410 + * .ident = "HP Pavilion dv9500", 411 + * DMI_MATCH(DMI_BOARD_NAME, "30CB"), 412 + * .ident = "HP/Compaq Presario C500", 413 + * DMI_MATCH(DMI_BOARD_NAME, "30C6"), 414 + * .ident = "HP/Compaq Presario F500", 415 + * DMI_MATCH(DMI_BOARD_NAME, "30D3"), 416 + * _OSI(Linux) unknown effect: 417 + * .ident = "HP Pavilion dv6500", 418 + * DMI_MATCH(DMI_BOARD_NAME, "30D0"), 419 + */ 420 + { 421 + .callback = dmi_disable_osi_linux, 422 + .ident = "Hewlett-Packard", 423 + .matches = { 424 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 425 + }, 426 + }, 427 + /* 428 + * Lenovo has a mix of systems OSI(Linux) situations 429 + * and thus we can not wildcard the vendor. 430 + * 431 + * _OSI(Linux) helps sound 432 + * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"), 433 + * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"), 434 + * _OSI(Linux) is a NOP: 435 + * DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), 436 + */ 437 + { 438 + .callback = dmi_enable_osi_linux, 439 + .ident = "Lenovo ThinkPad R61", 440 + .matches = { 441 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 442 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"), 443 + }, 444 + }, 445 + { 446 + .callback = dmi_enable_osi_linux, 447 + .ident = "Lenovo ThinkPad T61", 448 + .matches = { 449 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 450 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"), 451 + }, 452 + }, 453 + { 454 + .callback = dmi_unknown_osi_linux, 455 + .ident = "Lenovo 3000 V100", 456 + .matches = { 457 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 458 + DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"), 459 + }, 460 + }, 461 + { 462 + .callback = dmi_disable_osi_linux, 463 + .ident = "Lenovo 3000 N100", 464 + .matches = { 465 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 466 + DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), 467 + }, 468 + }, 469 + /* 470 + * Disable OSI(Linux) warnings on all "LG Electronics" 471 + * 472 + * _OSI(Linux) confirmed to be a NOP: 473 + * DMI_MATCH(DMI_PRODUCT_NAME, "P1-J150B"), 474 + */ 475 + { 476 + .callback = dmi_disable_osi_linux, 477 + .ident = "LG", 478 + .matches = { 479 + DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"), 480 + }, 481 + }, 482 + /* NEC - OSI(Linux) effect unknown */ 483 + { 484 + .callback = dmi_unknown_osi_linux, 485 + .ident = "NEC VERSA M360", 486 + .matches = { 487 + DMI_MATCH(DMI_SYS_VENDOR, "NEC Computers SAS"), 488 + DMI_MATCH(DMI_PRODUCT_NAME, "NEC VERSA M360"), 489 + }, 490 + }, 491 + /* 492 + * Disable OSI(Linux) warnings on all "Samsung Electronics" 493 + * 494 + * OSI(Linux) disables PNP0C32 and other BIOS code for Windows: 495 + * DMI_MATCH(DMI_PRODUCT_NAME, "R40P/R41P"), 496 + * DMI_MATCH(DMI_PRODUCT_NAME, "R59P/R60P/R61P"), 497 + */ 498 + { 499 + .callback = dmi_disable_osi_linux, 500 + .ident = "Samsung", 501 + .matches = { 502 + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), 503 + }, 504 + }, 505 + /* 506 + * Disable OSI(Linux) warnings on all "Sony Corporation" 507 + * 508 + * _OSI(Linux) is a NOP: 509 + * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ650N"), 510 + * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ38GP_C"), 511 + * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-TZ21MN_N"), 512 + * _OSI(Linux) unknown effect: 513 + * DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ11M"), 514 + */ 515 + { 516 + .callback = dmi_unknown_osi_linux, 517 + .ident = "Sony", 518 + .matches = { 519 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 520 + }, 521 + }, 522 + /* 523 + * Disable OSI(Linux) warnings on all "TOSHIBA" 524 + * 525 + * _OSI(Linux) breaks sound (bugzilla 7787): 526 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P100"), 527 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P105"), 528 + * _OSI(Linux) is a NOP: 529 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A100"), 530 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A210"), 531 + * _OSI(Linux) unknown effect: 532 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A135"), 533 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A200"), 534 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P205"), 535 + * DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U305"), 536 + */ 537 + { 538 + .callback = dmi_disable_osi_linux, 539 + .ident = "Toshiba", 540 + .matches = { 541 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 542 + }, 543 + }, 544 + {} 545 + }; 546 + 547 + #endif /* CONFIG_DMI */
+1 -1
drivers/acpi/bus.c
··· 200 200 * Get device's current power state 201 201 */ 202 202 acpi_bus_get_power(device->handle, &device->power.state); 203 - if (state == device->power.state) { 203 + if ((state == device->power.state) && !device->flags.force_power_state) { 204 204 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", 205 205 state)); 206 206 return 0;
+18 -8
drivers/acpi/ec.c
··· 26 26 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 27 */ 28 28 29 + /* Uncomment next line to get verbose print outs*/ 30 + /* #define DEBUG */ 31 + 29 32 #include <linux/kernel.h> 30 33 #include <linux/module.h> 31 34 #include <linux/init.h> ··· 49 46 50 47 #undef PREFIX 51 48 #define PREFIX "ACPI: EC: " 52 - 53 - /* Uncomment next line to get verbose print outs*/ 54 - /* #define DEBUG */ 55 49 56 50 /* EC status register */ 57 51 #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ ··· 82 82 EC_FLAGS_ADDRESS, /* Address is being written */ 83 83 EC_FLAGS_NO_WDATA_GPE, /* Don't expect WDATA GPE event */ 84 84 EC_FLAGS_WDATA, /* Data is being written */ 85 + EC_FLAGS_NO_OBF1_GPE, /* Don't expect GPE before read */ 85 86 }; 86 87 87 88 static int acpi_ec_remove(struct acpi_device *device, int type); ··· 139 138 static inline u8 acpi_ec_read_status(struct acpi_ec *ec) 140 139 { 141 140 u8 x = inb(ec->command_addr); 142 - pr_debug(PREFIX "---> status = 0x%2x\n", x); 141 + pr_debug(PREFIX "---> status = 0x%2.2x\n", x); 143 142 return x; 144 143 } 145 144 146 145 static inline u8 acpi_ec_read_data(struct acpi_ec *ec) 147 146 { 148 147 u8 x = inb(ec->data_addr); 149 - pr_debug(PREFIX "---> data = 0x%2x\n", x); 148 + pr_debug(PREFIX "---> data = 0x%2.2x\n", x); 150 149 return inb(ec->data_addr); 151 150 } 152 151 153 152 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command) 154 153 { 155 - pr_debug(PREFIX "<--- command = 0x%2x\n", command); 154 + pr_debug(PREFIX "<--- command = 0x%2.2x\n", command); 156 155 outb(command, ec->command_addr); 157 156 } 158 157 159 158 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) 160 159 { 161 - pr_debug(PREFIX "<--- data = 0x%2x\n", data); 160 + pr_debug(PREFIX "<--- data = 0x%2.2x\n", data); 162 161 outb(data, ec->data_addr); 163 162 } 164 163 ··· 180 179 static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll) 181 180 { 182 181 int ret = 0; 182 + 183 + if (unlikely(event == ACPI_EC_EVENT_OBF_1 && 184 + test_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags))) 185 + force_poll = 1; 183 186 if (unlikely(test_bit(EC_FLAGS_ADDRESS, &ec->flags) && 184 187 test_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags))) 185 188 force_poll = 1; ··· 197 192 goto end; 198 193 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags); 199 194 if (acpi_ec_check_status(ec, event)) { 200 - if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) { 195 + if (event == ACPI_EC_EVENT_OBF_1) { 196 + /* miss OBF_1 GPE, don't expect it */ 197 + pr_info(PREFIX "missing OBF confirmation, " 198 + "don't expect it any longer.\n"); 199 + set_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags); 200 + } else if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) { 201 201 /* miss address GPE, don't expect it anymore */ 202 202 pr_info(PREFIX "missing address confirmation, " 203 203 "don't expect it any longer.\n");
+40
drivers/acpi/fan.c
··· 47 47 48 48 static int acpi_fan_add(struct acpi_device *device); 49 49 static int acpi_fan_remove(struct acpi_device *device, int type); 50 + static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); 51 + static int acpi_fan_resume(struct acpi_device *device); 50 52 51 53 static const struct acpi_device_id fan_device_ids[] = { 52 54 {"PNP0C0B", 0}, ··· 63 61 .ops = { 64 62 .add = acpi_fan_add, 65 63 .remove = acpi_fan_remove, 64 + .suspend = acpi_fan_suspend, 65 + .resume = acpi_fan_resume, 66 66 }, 67 67 }; 68 68 ··· 195 191 goto end; 196 192 } 197 193 194 + device->flags.force_power_state = 1; 195 + acpi_bus_set_power(device->handle, state); 196 + device->flags.force_power_state = 0; 197 + 198 198 result = acpi_fan_add_fs(device); 199 199 if (result) 200 200 goto end; ··· 222 214 acpi_fan_remove_fs(device); 223 215 224 216 return 0; 217 + } 218 + 219 + static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state) 220 + { 221 + if (!device) 222 + return -EINVAL; 223 + 224 + acpi_bus_set_power(device->handle, ACPI_STATE_D0); 225 + 226 + return AE_OK; 227 + } 228 + 229 + static int acpi_fan_resume(struct acpi_device *device) 230 + { 231 + int result = 0; 232 + int power_state = 0; 233 + 234 + if (!device) 235 + return -EINVAL; 236 + 237 + result = acpi_bus_get_power(device->handle, &power_state); 238 + if (result) { 239 + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 240 + "Error reading fan power state\n")); 241 + return result; 242 + } 243 + 244 + device->flags.force_power_state = 1; 245 + acpi_bus_set_power(device->handle, power_state); 246 + device->flags.force_power_state = 0; 247 + 248 + return result; 225 249 } 226 250 227 251 static int __init acpi_fan_init(void)
+130 -43
drivers/acpi/osl.c
··· 77 77 #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ 78 78 static char osi_additional_string[OSI_STRING_LENGTH_MAX]; 79 79 80 - static int osi_linux; /* disable _OSI(Linux) by default */ 80 + /* 81 + * "Ode to _OSI(Linux)" 82 + * 83 + * osi_linux -- Control response to BIOS _OSI(Linux) query. 84 + * 85 + * As Linux evolves, the features that it supports change. 86 + * So an OSI string such as "Linux" is not specific enough 87 + * to be useful across multiple versions of Linux. It 88 + * doesn't identify any particular feature, interface, 89 + * or even any particular version of Linux... 90 + * 91 + * Unfortunately, Linux-2.6.22 and earlier responded "yes" 92 + * to a BIOS _OSI(Linux) query. When 93 + * a reference mobile BIOS started using it, its use 94 + * started to spread to many vendor platforms. 95 + * As it is not supportable, we need to halt that spread. 96 + * 97 + * Today, most BIOS references to _OSI(Linux) are noise -- 98 + * they have no functional effect and are just dead code 99 + * carried over from the reference BIOS. 100 + * 101 + * The next most common case is that _OSI(Linux) harms Linux, 102 + * usually by causing the BIOS to follow paths that are 103 + * not tested during Windows validation. 104 + * 105 + * Finally, there is a short list of platforms 106 + * where OSI(Linux) benefits Linux. 107 + * 108 + * In Linux-2.6.23, OSI(Linux) is first disabled by default. 109 + * DMI is used to disable the dmesg warning about OSI(Linux) 110 + * on platforms where it is known to have no effect. 111 + * But a dmesg warning remains for systems where 112 + * we do not know if OSI(Linux) is good or bad for the system. 113 + * DMI is also used to enable OSI(Linux) for the machines 114 + * that are known to need it. 115 + * 116 + * BIOS writers should NOT query _OSI(Linux) on future systems. 117 + * It will be ignored by default, and to get Linux to 118 + * not ignore it will require a kernel source update to 119 + * add a DMI entry, or a boot-time "acpi_osi=Linux" invocation. 120 + */ 121 + #define OSI_LINUX_ENABLE 0 81 122 82 - #ifdef CONFIG_DMI 83 - static struct __initdata dmi_system_id acpi_osl_dmi_table[]; 84 - #endif 123 + struct osi_linux { 124 + unsigned int enable:1; 125 + unsigned int dmi:1; 126 + unsigned int cmdline:1; 127 + unsigned int known:1; 128 + } osi_linux = { OSI_LINUX_ENABLE, 0, 0, 0}; 85 129 86 130 static void __init acpi_request_region (struct acpi_generic_address *addr, 87 131 unsigned int length, char *desc) ··· 177 133 178 134 acpi_status __init acpi_os_initialize(void) 179 135 { 180 - dmi_check_system(acpi_osl_dmi_table); 181 136 return AE_OK; 182 137 } 183 138 ··· 1007 964 1008 965 __setup("acpi_os_name=", acpi_os_name_setup); 1009 966 1010 - static void enable_osi_linux(int enable) { 967 + static void __init set_osi_linux(unsigned int enable) 968 + { 969 + if (osi_linux.enable != enable) { 970 + osi_linux.enable = enable; 971 + printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n", 972 + enable ? "Add": "Delet"); 973 + } 974 + return; 975 + } 1011 976 1012 - if (osi_linux != enable) 1013 - printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n", 1014 - enable ? "En": "Dis"); 977 + static void __init acpi_cmdline_osi_linux(unsigned int enable) 978 + { 979 + osi_linux.cmdline = 1; /* cmdline set the default */ 980 + set_osi_linux(enable); 1015 981 1016 - osi_linux = enable; 982 + return; 983 + } 984 + 985 + void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) 986 + { 987 + osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */ 988 + 989 + printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); 990 + 991 + if (enable == -1) 992 + return; 993 + 994 + osi_linux.known = 1; /* DMI knows which OSI(Linux) default needed */ 995 + 996 + set_osi_linux(enable); 997 + 1017 998 return; 1018 999 } 1019 1000 ··· 1054 987 printk(KERN_INFO PREFIX "_OSI method disabled\n"); 1055 988 acpi_gbl_create_osi_method = FALSE; 1056 989 } else if (!strcmp("!Linux", str)) { 1057 - enable_osi_linux(0); 990 + acpi_cmdline_osi_linux(0); /* !enable */ 1058 991 } else if (*str == '!') { 1059 992 if (acpi_osi_invalidate(++str) == AE_OK) 1060 993 printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); 1061 994 } else if (!strcmp("Linux", str)) { 1062 - enable_osi_linux(1); 995 + acpi_cmdline_osi_linux(1); /* enable */ 1063 996 } else if (*osi_additional_string == '\0') { 1064 997 strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); 1065 998 printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); ··· 1208 1141 return (AE_OK); 1209 1142 } 1210 1143 1144 + /** 1145 + * acpi_dmi_dump - dump DMI slots needed for blacklist entry 1146 + * 1147 + * Returns 0 on success 1148 + */ 1149 + int acpi_dmi_dump(void) 1150 + { 1151 + 1152 + if (!dmi_available) 1153 + return -1; 1154 + 1155 + printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n", 1156 + dmi_get_slot(DMI_SYS_VENDOR)); 1157 + printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n", 1158 + dmi_get_slot(DMI_PRODUCT_NAME)); 1159 + printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n", 1160 + dmi_get_slot(DMI_PRODUCT_VERSION)); 1161 + printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n", 1162 + dmi_get_slot(DMI_BOARD_NAME)); 1163 + printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n", 1164 + dmi_get_slot(DMI_BIOS_VENDOR)); 1165 + printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n", 1166 + dmi_get_slot(DMI_BIOS_DATE)); 1167 + 1168 + return 0; 1169 + } 1170 + 1171 + 1211 1172 /****************************************************************************** 1212 1173 * 1213 1174 * FUNCTION: acpi_os_validate_interface ··· 1255 1160 if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) 1256 1161 return AE_OK; 1257 1162 if (!strcmp("Linux", interface)) { 1258 - printk(KERN_WARNING PREFIX 1259 - "System BIOS is requesting _OSI(Linux)\n"); 1260 - printk(KERN_WARNING PREFIX 1261 - "If \"acpi_osi=Linux\" works better,\n" 1262 - "Please send dmidecode " 1263 - "to linux-acpi@vger.kernel.org\n"); 1264 - if(osi_linux) 1163 + 1164 + printk(KERN_NOTICE PREFIX 1165 + "BIOS _OSI(Linux) query %s%s\n", 1166 + osi_linux.enable ? "honored" : "ignored", 1167 + osi_linux.cmdline ? " via cmdline" : 1168 + osi_linux.dmi ? " via DMI" : ""); 1169 + 1170 + if (!osi_linux.dmi) { 1171 + if (acpi_dmi_dump()) 1172 + printk(KERN_NOTICE PREFIX 1173 + "[please extract dmidecode output]\n"); 1174 + printk(KERN_NOTICE PREFIX 1175 + "Please send DMI info above to " 1176 + "linux-acpi@vger.kernel.org\n"); 1177 + } 1178 + if (!osi_linux.known && !osi_linux.cmdline) { 1179 + printk(KERN_NOTICE PREFIX 1180 + "If \"acpi_osi=%sLinux\" works better, " 1181 + "please notify linux-acpi@vger.kernel.org\n", 1182 + osi_linux.enable ? "!" : ""); 1183 + } 1184 + 1185 + if (osi_linux.enable) 1265 1186 return AE_OK; 1266 1187 } 1267 1188 return AE_SUPPORT; ··· 1308 1197 1309 1198 return AE_OK; 1310 1199 } 1311 - 1312 - #ifdef CONFIG_DMI 1313 - static int dmi_osi_linux(const struct dmi_system_id *d) 1314 - { 1315 - printk(KERN_NOTICE "%s detected: enabling _OSI(Linux)\n", d->ident); 1316 - enable_osi_linux(1); 1317 - return 0; 1318 - } 1319 - 1320 - static struct dmi_system_id acpi_osl_dmi_table[] __initdata = { 1321 - /* 1322 - * Boxes that need _OSI(Linux) 1323 - */ 1324 - { 1325 - .callback = dmi_osi_linux, 1326 - .ident = "Intel Napa CRB", 1327 - .matches = { 1328 - DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 1329 - DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"), 1330 - }, 1331 - }, 1332 - {} 1333 - }; 1334 - #endif /* CONFIG_DMI */ 1335 1200 1336 1201 #endif
+2 -2
drivers/acpi/processor_throttling.c
··· 775 775 acpi_processor_get_throttling_states(pr) || 776 776 acpi_processor_get_platform_limit(pr)) 777 777 { 778 - if (acpi_processor_get_fadt_info(pr)) 779 - return 0; 780 778 pr->throttling.acpi_processor_get_throttling = 781 779 &acpi_processor_get_throttling_fadt; 782 780 pr->throttling.acpi_processor_set_throttling = 783 781 &acpi_processor_set_throttling_fadt; 782 + if (acpi_processor_get_fadt_info(pr)) 783 + return 0; 784 784 } else { 785 785 pr->throttling.acpi_processor_get_throttling = 786 786 &acpi_processor_get_throttling_ptc;
-2
drivers/firmware/dmi-id.c
··· 173 173 if (dmi_get_system_info(_field)) \ 174 174 sys_dmi_attributes[i++] = &sys_dmi_##_name##_attr.dev_attr.attr; 175 175 176 - extern int dmi_available; 177 - 178 176 /* In a separate function to keep gcc 3.2 happy - do NOT merge this in 179 177 dmi_id_init! */ 180 178 static void __init dmi_id_init_attr_table(void)
+8
drivers/firmware/dmi_scan.c
··· 470 470 return year; 471 471 } 472 472 473 + /** 474 + * dmi_get_slot - return dmi_ident[slot] 475 + * @slot: index into dmi_ident[] 476 + */ 477 + char *dmi_get_slot(int slot) 478 + { 479 + return(dmi_ident[slot]); 480 + }
+2 -1
include/acpi/acpi_bus.h
··· 168 168 u32 power_manageable:1; 169 169 u32 performance_manageable:1; 170 170 u32 wake_capable:1; /* Wakeup(_PRW) supported? */ 171 - u32 reserved:20; 171 + u32 force_power_state:1; 172 + u32 reserved:19; 172 173 }; 173 174 174 175 /* File System */
+5 -2
include/linux/acpi.h
··· 40 40 #include <acpi/acpi_drivers.h> 41 41 #include <acpi/acpi_numa.h> 42 42 #include <asm/acpi.h> 43 + #include <linux/dmi.h> 43 44 44 45 45 46 #ifdef CONFIG_ACPI ··· 193 192 #endif /*CONFIG_ACPI_EC*/ 194 193 195 194 extern int acpi_blacklisted(void); 196 - extern void acpi_bios_year(char *s); 195 + #ifdef CONFIG_DMI 196 + extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); 197 + #endif 197 198 198 199 #ifdef CONFIG_ACPI_NUMA 199 200 int acpi_get_pxm(acpi_handle handle); ··· 229 226 return 0; 230 227 } 231 228 232 - #endif /* CONFIG_ACPI */ 229 + #endif /* !CONFIG_ACPI */ 233 230 #endif /*_LINUX_ACPI_H*/
+4
include/linux/dmi.h
··· 78 78 extern void dmi_scan_machine(void); 79 79 extern int dmi_get_year(int field); 80 80 extern int dmi_name_in_vendors(const char *str); 81 + extern int dmi_available; 82 + extern char *dmi_get_slot(int slot); 81 83 82 84 #else 83 85 ··· 89 87 const struct dmi_device *from) { return NULL; } 90 88 static inline int dmi_get_year(int year) { return 0; } 91 89 static inline int dmi_name_in_vendors(const char *s) { return 0; } 90 + #define dmi_available 0 91 + static inline char *dmi_get_slot(int slot) { return NULL; } 92 92 93 93 #endif 94 94