diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-21 13:01:17 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-21 13:01:17 -0500 |
| commit | 795233bfd65916a7d1d3b086f056bd7af03c50fe (patch) | |
| tree | 32eee4ddc3d1bf56b3c466b7ff17c6b2f75188a3 | |
| parent | 7777d9348996dbe25c73fe23ebde26b6d71e2cb4 (diff) | |
| parent | fee5ae96e0bc48b13f97512aef91d5aea60240a5 (diff) | |
Merge tag 'pm+acpi-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management fixes from Rafael Wysocki:
"These include two fixes for recent regressions related to ACPI, a
cpufreq fix for breakage overlooked by a previous fix commit, two
intel_pstate fixes for stuff added during the 3.13 cycle that need to
go into -stable, three fixes for older bugs that also are -stable
candidates, ACPI video blacklist changes related to BIOSes that behave
in a special way on Windows 8, several build fixes for CONFIG_PM_SLEEP
unset in ACPI drivers and an ACPI driver cleanup.
Specifics:
- Fix for a recent probing regression in the nouveau driver
introduced by an ACPI change related to the handling of _DSM from
Jiang Liu.
- Fix for a dock station sysfs attribute that stopped working
correctly after recent changes in the ACPI core.
- cpufreq fix taking care of broken code related to CPU removal and
overlooked by a previous recent fix in that area. From Viresh
Kumar.
- Two intel_pstate fixes related to Baytrail support added during the
3.13 cycle (candidates for -stable) from Dirk Brandewie.
- ACPI video fix removing duplicate brightness values from the _BCL
table which makes its user space interface behave sanely. From
Hans de Goede.
- Fix for the powernow-k8 cpufreq driver making it initialize its
per-CPU data structures correctly from Srivatsa S Bhat.
- Fix for an obscure memory leak in the ACPI PCI interrupt allocation
code (related to ISA) from Tomasz Nowicki.
- ACPI video blacklist changes moving several systems that should use
the native backlight interface instead of the ACPI one from the
general ACPI _OSI blacklist the the ACPI video driver's blacklist
where they belong. This consists of an ACPI video driver update
from Aaron Lu and a revert of a previous commit adding systems to
the ACPI _OSI blacklist requested by Takashi Iwai.
- Several fixes for build issues in ACPI drivers occuring when
CONFIG_PM_SLEEP is unset from Shuah Khan.
- Fix for an sscanf() format string in the ACPI Smart Battery
Subsystem (SBS) driver from Luis G.F"
* tag 'pm+acpi-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
intel_pstate: Add support for Baytrail turbo P states
intel_pstate: Use LFM bus ratio as min ratio/P state
ACPI / nouveau: fix probing regression related to _DSM
Revert "ACPI: Blacklist Win8 OSI for some HP laptop 2013 models"
ACPI / video: Add systems that should favour native backlight interface
ACPI / video: Filter the _BCL table for duplicate brightness values
cpufreq: powernow-k8: Initialize per-cpu data-structures properly
cpufreq: remove sysfs link when a cpu != policy->cpu, is removed
ACPI / PCI: Fix memory leak in acpi_pci_irq_enable()
ACPI / dock: Make 'docked' sysfs attribute work as documented
ACPI / SBS: Fix incorrect sscanf() string
ACPI / thermal: fix thermal driver compile error when CONFIG_PM_SLEEP is undefined
ACPI / SBS: fix SBS driver compile error when CONFIG_PM_SLEEP is undefined
ACPI / fan: fix fan driver compile error when CONFIG_PM_SLEEP is undefined
ACPI / button: fix button driver compile error when CONFIG_PM_SLEEP is undefined
ACPI / battery: fix battery driver compile error when CONFIG_PM_SLEEP is undefined
ACPI / AC: fix AC driver compile error when CONFIG_PM_SLEEP is undefined
| -rw-r--r-- | drivers/acpi/ac.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/battery.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/blacklist.c | 58 | ||||
| -rw-r--r-- | drivers/acpi/button.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/dock.c | 8 | ||||
| -rw-r--r-- | drivers/acpi/fan.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/pci_irq.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/sbs.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/thermal.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/video.c | 147 | ||||
| -rw-r--r-- | drivers/acpi/video_detect.c | 16 | ||||
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 3 | ||||
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 17 | ||||
| -rw-r--r-- | drivers/cpufreq/powernow-k8.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_acpi.c | 26 |
15 files changed, 204 insertions, 97 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index e7515aa43d6b..6f190bc2b8b7 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
| @@ -243,6 +243,8 @@ static int acpi_ac_resume(struct device *dev) | |||
| 243 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); | 243 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
| 244 | return 0; | 244 | return 0; |
| 245 | } | 245 | } |
| 246 | #else | ||
| 247 | #define acpi_ac_resume NULL | ||
| 246 | #endif | 248 | #endif |
| 247 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm_ops, NULL, acpi_ac_resume); | 249 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm_ops, NULL, acpi_ac_resume); |
| 248 | 250 | ||
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 018a42883706..797a6938d051 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -841,6 +841,8 @@ static int acpi_battery_resume(struct device *dev) | |||
| 841 | acpi_battery_update(battery); | 841 | acpi_battery_update(battery); |
| 842 | return 0; | 842 | return 0; |
| 843 | } | 843 | } |
| 844 | #else | ||
| 845 | #define acpi_battery_resume NULL | ||
| 844 | #endif | 846 | #endif |
| 845 | 847 | ||
| 846 | static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); | 848 | static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 10e4964d051a..afec4526c48a 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
| @@ -260,14 +260,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 260 | }, | 260 | }, |
| 261 | { | 261 | { |
| 262 | .callback = dmi_disable_osi_win8, | 262 | .callback = dmi_disable_osi_win8, |
| 263 | .ident = "Dell Inspiron 15R SE", | ||
| 264 | .matches = { | ||
| 265 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 266 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7520"), | ||
| 267 | }, | ||
| 268 | }, | ||
| 269 | { | ||
| 270 | .callback = dmi_disable_osi_win8, | ||
| 271 | .ident = "ThinkPad Edge E530", | 263 | .ident = "ThinkPad Edge E530", |
| 272 | .matches = { | 264 | .matches = { |
| 273 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | 265 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), |
| @@ -322,56 +314,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 322 | DMI_MATCH(DMI_PRODUCT_VERSION, "2349D15"), | 314 | DMI_MATCH(DMI_PRODUCT_VERSION, "2349D15"), |
| 323 | }, | 315 | }, |
| 324 | }, | 316 | }, |
| 325 | { | ||
| 326 | .callback = dmi_disable_osi_win8, | ||
| 327 | .ident = "HP ProBook 2013 models", | ||
| 328 | .matches = { | ||
| 329 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 330 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook "), | ||
| 331 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
| 332 | }, | ||
| 333 | }, | ||
| 334 | { | ||
| 335 | .callback = dmi_disable_osi_win8, | ||
| 336 | .ident = "HP EliteBook 2013 models", | ||
| 337 | .matches = { | ||
| 338 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 339 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook "), | ||
| 340 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
| 341 | }, | ||
| 342 | }, | ||
| 343 | { | ||
| 344 | .callback = dmi_disable_osi_win8, | ||
| 345 | .ident = "HP ZBook 14", | ||
| 346 | .matches = { | ||
| 347 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 348 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 14"), | ||
| 349 | }, | ||
| 350 | }, | ||
| 351 | { | ||
| 352 | .callback = dmi_disable_osi_win8, | ||
| 353 | .ident = "HP ZBook 15", | ||
| 354 | .matches = { | ||
| 355 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 356 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15"), | ||
| 357 | }, | ||
| 358 | }, | ||
| 359 | { | ||
| 360 | .callback = dmi_disable_osi_win8, | ||
| 361 | .ident = "HP ZBook 17", | ||
| 362 | .matches = { | ||
| 363 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 364 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17"), | ||
| 365 | }, | ||
| 366 | }, | ||
| 367 | { | ||
| 368 | .callback = dmi_disable_osi_win8, | ||
| 369 | .ident = "HP EliteBook 8780w", | ||
| 370 | .matches = { | ||
| 371 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 372 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), | ||
| 373 | }, | ||
| 374 | }, | ||
| 375 | 317 | ||
| 376 | /* | 318 | /* |
| 377 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. | 319 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 11c11f6b8fa1..714e957a871a 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
| @@ -80,6 +80,8 @@ static void acpi_button_notify(struct acpi_device *device, u32 event); | |||
| 80 | 80 | ||
| 81 | #ifdef CONFIG_PM_SLEEP | 81 | #ifdef CONFIG_PM_SLEEP |
| 82 | static int acpi_button_resume(struct device *dev); | 82 | static int acpi_button_resume(struct device *dev); |
| 83 | #else | ||
| 84 | #define acpi_button_resume NULL | ||
| 83 | #endif | 85 | #endif |
| 84 | static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); | 86 | static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); |
| 85 | 87 | ||
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index e9b3081c4fe9..5bfd769fc91f 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
| @@ -713,13 +713,11 @@ static acpi_status __init find_dock_devices(acpi_handle handle, u32 lvl, | |||
| 713 | static ssize_t show_docked(struct device *dev, | 713 | static ssize_t show_docked(struct device *dev, |
| 714 | struct device_attribute *attr, char *buf) | 714 | struct device_attribute *attr, char *buf) |
| 715 | { | 715 | { |
| 716 | struct acpi_device *tmp; | ||
| 717 | |||
| 718 | struct dock_station *dock_station = dev->platform_data; | 716 | struct dock_station *dock_station = dev->platform_data; |
| 717 | struct acpi_device *adev = NULL; | ||
| 719 | 718 | ||
| 720 | if (!acpi_bus_get_device(dock_station->handle, &tmp)) | 719 | acpi_bus_get_device(dock_station->handle, &adev); |
| 721 | return snprintf(buf, PAGE_SIZE, "1\n"); | 720 | return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev)); |
| 722 | return snprintf(buf, PAGE_SIZE, "0\n"); | ||
| 723 | } | 721 | } |
| 724 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); | 722 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); |
| 725 | 723 | ||
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 1fb62900f32a..09e423f3d8ad 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
| @@ -55,6 +55,9 @@ MODULE_DEVICE_TABLE(acpi, fan_device_ids); | |||
| 55 | #ifdef CONFIG_PM_SLEEP | 55 | #ifdef CONFIG_PM_SLEEP |
| 56 | static int acpi_fan_suspend(struct device *dev); | 56 | static int acpi_fan_suspend(struct device *dev); |
| 57 | static int acpi_fan_resume(struct device *dev); | 57 | static int acpi_fan_resume(struct device *dev); |
| 58 | #else | ||
| 59 | #define acpi_fan_suspend NULL | ||
| 60 | #define acpi_fan_resume NULL | ||
| 58 | #endif | 61 | #endif |
| 59 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); | 62 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); |
| 60 | 63 | ||
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 52d45ea2bc4f..361b40c10c3f 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
| @@ -430,6 +430,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) | |||
| 430 | pin_name(pin)); | 430 | pin_name(pin)); |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | kfree(entry); | ||
| 433 | return 0; | 434 | return 0; |
| 434 | } | 435 | } |
| 435 | 436 | ||
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index d465ae6cdd00..dbd48498b938 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
| @@ -450,7 +450,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, | |||
| 450 | { | 450 | { |
| 451 | unsigned long x; | 451 | unsigned long x; |
| 452 | struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); | 452 | struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); |
| 453 | if (sscanf(buf, "%ld\n", &x) == 1) | 453 | if (sscanf(buf, "%lu\n", &x) == 1) |
| 454 | battery->alarm_capacity = x / | 454 | battery->alarm_capacity = x / |
| 455 | (1000 * acpi_battery_scale(battery)); | 455 | (1000 * acpi_battery_scale(battery)); |
| 456 | if (battery->present) | 456 | if (battery->present) |
| @@ -668,6 +668,8 @@ static int acpi_sbs_resume(struct device *dev) | |||
| 668 | acpi_sbs_callback(sbs); | 668 | acpi_sbs_callback(sbs); |
| 669 | return 0; | 669 | return 0; |
| 670 | } | 670 | } |
| 671 | #else | ||
| 672 | #define acpi_sbs_resume NULL | ||
| 671 | #endif | 673 | #endif |
| 672 | 674 | ||
| 673 | static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); | 675 | static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 8349a555b92b..08626c851be7 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
| @@ -102,6 +102,8 @@ MODULE_DEVICE_TABLE(acpi, thermal_device_ids); | |||
| 102 | 102 | ||
| 103 | #ifdef CONFIG_PM_SLEEP | 103 | #ifdef CONFIG_PM_SLEEP |
| 104 | static int acpi_thermal_resume(struct device *dev); | 104 | static int acpi_thermal_resume(struct device *dev); |
| 105 | #else | ||
| 106 | #define acpi_thermal_resume NULL | ||
| 105 | #endif | 107 | #endif |
| 106 | static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); | 108 | static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); |
| 107 | 109 | ||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index b727d105046d..b6ba88ed31ae 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
| @@ -81,11 +81,12 @@ static bool allow_duplicates; | |||
| 81 | module_param(allow_duplicates, bool, 0644); | 81 | module_param(allow_duplicates, bool, 0644); |
| 82 | 82 | ||
| 83 | /* | 83 | /* |
| 84 | * For Windows 8 systems: if set ture and the GPU driver has | 84 | * For Windows 8 systems: used to decide if video module |
| 85 | * registered a backlight interface, skip registering ACPI video's. | 85 | * should skip registering backlight interface of its own. |
| 86 | */ | 86 | */ |
| 87 | static bool use_native_backlight = false; | 87 | static int use_native_backlight_param = -1; |
| 88 | module_param(use_native_backlight, bool, 0644); | 88 | module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); |
| 89 | static bool use_native_backlight_dmi = false; | ||
| 89 | 90 | ||
| 90 | static int register_count; | 91 | static int register_count; |
| 91 | static struct mutex video_list_lock; | 92 | static struct mutex video_list_lock; |
| @@ -231,9 +232,17 @@ static int acpi_video_get_next_level(struct acpi_video_device *device, | |||
| 231 | static int acpi_video_switch_brightness(struct acpi_video_device *device, | 232 | static int acpi_video_switch_brightness(struct acpi_video_device *device, |
| 232 | int event); | 233 | int event); |
| 233 | 234 | ||
| 235 | static bool acpi_video_use_native_backlight(void) | ||
| 236 | { | ||
| 237 | if (use_native_backlight_param != -1) | ||
| 238 | return use_native_backlight_param; | ||
| 239 | else | ||
| 240 | return use_native_backlight_dmi; | ||
| 241 | } | ||
| 242 | |||
| 234 | static bool acpi_video_verify_backlight_support(void) | 243 | static bool acpi_video_verify_backlight_support(void) |
| 235 | { | 244 | { |
| 236 | if (acpi_osi_is_win8() && use_native_backlight && | 245 | if (acpi_osi_is_win8() && acpi_video_use_native_backlight() && |
| 237 | backlight_device_registered(BACKLIGHT_RAW)) | 246 | backlight_device_registered(BACKLIGHT_RAW)) |
| 238 | return false; | 247 | return false; |
| 239 | return acpi_video_backlight_support(); | 248 | return acpi_video_backlight_support(); |
| @@ -398,6 +407,12 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d) | |||
| 398 | return 0; | 407 | return 0; |
| 399 | } | 408 | } |
| 400 | 409 | ||
| 410 | static int __init video_set_use_native_backlight(const struct dmi_system_id *d) | ||
| 411 | { | ||
| 412 | use_native_backlight_dmi = true; | ||
| 413 | return 0; | ||
| 414 | } | ||
| 415 | |||
| 401 | static struct dmi_system_id video_dmi_table[] __initdata = { | 416 | static struct dmi_system_id video_dmi_table[] __initdata = { |
| 402 | /* | 417 | /* |
| 403 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 | 418 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 |
| @@ -442,6 +457,120 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
| 442 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), | 457 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), |
| 443 | }, | 458 | }, |
| 444 | }, | 459 | }, |
| 460 | { | ||
| 461 | .callback = video_set_use_native_backlight, | ||
| 462 | .ident = "ThinkPad T430s", | ||
| 463 | .matches = { | ||
| 464 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 465 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T430s"), | ||
| 466 | }, | ||
| 467 | }, | ||
| 468 | { | ||
| 469 | .callback = video_set_use_native_backlight, | ||
| 470 | .ident = "ThinkPad X230", | ||
| 471 | .matches = { | ||
| 472 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 473 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X230"), | ||
| 474 | }, | ||
| 475 | }, | ||
| 476 | { | ||
| 477 | .callback = video_set_use_native_backlight, | ||
| 478 | .ident = "ThinkPad X1 Carbon", | ||
| 479 | .matches = { | ||
| 480 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 481 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X1 Carbon"), | ||
| 482 | }, | ||
| 483 | }, | ||
| 484 | { | ||
| 485 | .callback = video_set_use_native_backlight, | ||
| 486 | .ident = "Lenovo Yoga 13", | ||
| 487 | .matches = { | ||
| 488 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 489 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"), | ||
| 490 | }, | ||
| 491 | }, | ||
| 492 | { | ||
| 493 | .callback = video_set_use_native_backlight, | ||
| 494 | .ident = "Dell Inspiron 7520", | ||
| 495 | .matches = { | ||
| 496 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 497 | DMI_MATCH(DMI_PRODUCT_VERSION, "Inspiron 7520"), | ||
| 498 | }, | ||
| 499 | }, | ||
| 500 | { | ||
| 501 | .callback = video_set_use_native_backlight, | ||
| 502 | .ident = "Acer Aspire 5733Z", | ||
| 503 | .matches = { | ||
| 504 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 505 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5733Z"), | ||
| 506 | }, | ||
| 507 | }, | ||
| 508 | { | ||
| 509 | .callback = video_set_use_native_backlight, | ||
| 510 | .ident = "Acer Aspire V5-431", | ||
| 511 | .matches = { | ||
| 512 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 513 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-431"), | ||
| 514 | }, | ||
| 515 | }, | ||
| 516 | { | ||
| 517 | .callback = video_set_use_native_backlight, | ||
| 518 | .ident = "HP ProBook 4340s", | ||
| 519 | .matches = { | ||
| 520 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 521 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4340s"), | ||
| 522 | }, | ||
| 523 | }, | ||
| 524 | { | ||
| 525 | .callback = video_set_use_native_backlight, | ||
| 526 | .ident = "HP ProBook 2013 models", | ||
| 527 | .matches = { | ||
| 528 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 529 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook "), | ||
| 530 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
| 531 | }, | ||
| 532 | }, | ||
| 533 | { | ||
| 534 | .callback = video_set_use_native_backlight, | ||
| 535 | .ident = "HP EliteBook 2013 models", | ||
| 536 | .matches = { | ||
| 537 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 538 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook "), | ||
| 539 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
| 540 | }, | ||
| 541 | }, | ||
| 542 | { | ||
| 543 | .callback = video_set_use_native_backlight, | ||
| 544 | .ident = "HP ZBook 14", | ||
| 545 | .matches = { | ||
| 546 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 547 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 14"), | ||
| 548 | }, | ||
| 549 | }, | ||
| 550 | { | ||
| 551 | .callback = video_set_use_native_backlight, | ||
| 552 | .ident = "HP ZBook 15", | ||
| 553 | .matches = { | ||
| 554 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 555 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15"), | ||
| 556 | }, | ||
| 557 | }, | ||
| 558 | { | ||
| 559 | .callback = video_set_use_native_backlight, | ||
| 560 | .ident = "HP ZBook 17", | ||
| 561 | .matches = { | ||
| 562 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 563 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17"), | ||
| 564 | }, | ||
| 565 | }, | ||
| 566 | { | ||
| 567 | .callback = video_set_use_native_backlight, | ||
| 568 | .ident = "HP EliteBook 8780w", | ||
| 569 | .matches = { | ||
| 570 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 571 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), | ||
| 572 | }, | ||
| 573 | }, | ||
| 445 | {} | 574 | {} |
| 446 | }; | 575 | }; |
| 447 | 576 | ||
| @@ -685,6 +814,7 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
| 685 | union acpi_object *o; | 814 | union acpi_object *o; |
| 686 | struct acpi_video_device_brightness *br = NULL; | 815 | struct acpi_video_device_brightness *br = NULL; |
| 687 | int result = -EINVAL; | 816 | int result = -EINVAL; |
| 817 | u32 value; | ||
| 688 | 818 | ||
| 689 | if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) { | 819 | if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) { |
| 690 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available " | 820 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available " |
| @@ -715,7 +845,12 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
| 715 | printk(KERN_ERR PREFIX "Invalid data\n"); | 845 | printk(KERN_ERR PREFIX "Invalid data\n"); |
| 716 | continue; | 846 | continue; |
| 717 | } | 847 | } |
| 718 | br->levels[count] = (u32) o->integer.value; | 848 | value = (u32) o->integer.value; |
| 849 | /* Skip duplicate entries */ | ||
| 850 | if (count > 2 && br->levels[count - 1] == value) | ||
| 851 | continue; | ||
| 852 | |||
| 853 | br->levels[count] = value; | ||
| 719 | 854 | ||
| 720 | if (br->levels[count] > max_level) | 855 | if (br->levels[count] > max_level) |
| 721 | max_level = br->levels[count]; | 856 | max_level = br->levels[count]; |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index a697b77b8865..19080c8e2f2a 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
| @@ -168,22 +168,6 @@ static struct dmi_system_id video_detect_dmi_table[] = { | |||
| 168 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), | 168 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), |
| 169 | }, | 169 | }, |
| 170 | }, | 170 | }, |
| 171 | { | ||
| 172 | .callback = video_detect_force_vendor, | ||
| 173 | .ident = "HP EliteBook Revolve 810", | ||
| 174 | .matches = { | ||
| 175 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 176 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook Revolve 810 G1"), | ||
| 177 | }, | ||
| 178 | }, | ||
| 179 | { | ||
| 180 | .callback = video_detect_force_vendor, | ||
| 181 | .ident = "Lenovo Yoga 13", | ||
| 182 | .matches = { | ||
| 183 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 184 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"), | ||
| 185 | }, | ||
| 186 | }, | ||
| 187 | { }, | 171 | { }, |
| 188 | }; | 172 | }; |
| 189 | 173 | ||
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 08ca8c9f41cd..cb003a6b72c8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
| @@ -1323,8 +1323,7 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, | |||
| 1323 | up_read(&policy->rwsem); | 1323 | up_read(&policy->rwsem); |
| 1324 | 1324 | ||
| 1325 | if (cpu != policy->cpu) { | 1325 | if (cpu != policy->cpu) { |
| 1326 | if (!frozen) | 1326 | sysfs_remove_link(&dev->kobj, "cpufreq"); |
| 1327 | sysfs_remove_link(&dev->kobj, "cpufreq"); | ||
| 1328 | } else if (cpus > 1) { | 1327 | } else if (cpus > 1) { |
| 1329 | new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu); | 1328 | new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu); |
| 1330 | if (new_cpu >= 0) { | 1329 | if (new_cpu >= 0) { |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index c788abf1c457..e90816105921 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
| @@ -34,8 +34,10 @@ | |||
| 34 | 34 | ||
| 35 | #define SAMPLE_COUNT 3 | 35 | #define SAMPLE_COUNT 3 |
| 36 | 36 | ||
| 37 | #define BYT_RATIOS 0x66a | 37 | #define BYT_RATIOS 0x66a |
| 38 | #define BYT_VIDS 0x66b | 38 | #define BYT_VIDS 0x66b |
| 39 | #define BYT_TURBO_RATIOS 0x66c | ||
| 40 | |||
| 39 | 41 | ||
| 40 | #define FRAC_BITS 8 | 42 | #define FRAC_BITS 8 |
| 41 | #define int_tofp(X) ((int64_t)(X) << FRAC_BITS) | 43 | #define int_tofp(X) ((int64_t)(X) << FRAC_BITS) |
| @@ -357,7 +359,7 @@ static int byt_get_min_pstate(void) | |||
| 357 | { | 359 | { |
| 358 | u64 value; | 360 | u64 value; |
| 359 | rdmsrl(BYT_RATIOS, value); | 361 | rdmsrl(BYT_RATIOS, value); |
| 360 | return value & 0xFF; | 362 | return (value >> 8) & 0xFF; |
| 361 | } | 363 | } |
| 362 | 364 | ||
| 363 | static int byt_get_max_pstate(void) | 365 | static int byt_get_max_pstate(void) |
| @@ -367,6 +369,13 @@ static int byt_get_max_pstate(void) | |||
| 367 | return (value >> 16) & 0xFF; | 369 | return (value >> 16) & 0xFF; |
| 368 | } | 370 | } |
| 369 | 371 | ||
| 372 | static int byt_get_turbo_pstate(void) | ||
| 373 | { | ||
| 374 | u64 value; | ||
| 375 | rdmsrl(BYT_TURBO_RATIOS, value); | ||
| 376 | return value & 0x3F; | ||
| 377 | } | ||
| 378 | |||
| 370 | static void byt_set_pstate(struct cpudata *cpudata, int pstate) | 379 | static void byt_set_pstate(struct cpudata *cpudata, int pstate) |
| 371 | { | 380 | { |
| 372 | u64 val; | 381 | u64 val; |
| @@ -469,7 +478,7 @@ static struct cpu_defaults byt_params = { | |||
| 469 | .funcs = { | 478 | .funcs = { |
| 470 | .get_max = byt_get_max_pstate, | 479 | .get_max = byt_get_max_pstate, |
| 471 | .get_min = byt_get_min_pstate, | 480 | .get_min = byt_get_min_pstate, |
| 472 | .get_turbo = byt_get_max_pstate, | 481 | .get_turbo = byt_get_turbo_pstate, |
| 473 | .set = byt_set_pstate, | 482 | .set = byt_set_pstate, |
| 474 | .get_vid = byt_get_vid, | 483 | .get_vid = byt_get_vid, |
| 475 | }, | 484 | }, |
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index e10b646634d7..6684e0342792 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
| @@ -1076,7 +1076,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
| 1076 | { | 1076 | { |
| 1077 | struct powernow_k8_data *data; | 1077 | struct powernow_k8_data *data; |
| 1078 | struct init_on_cpu init_on_cpu; | 1078 | struct init_on_cpu init_on_cpu; |
| 1079 | int rc; | 1079 | int rc, cpu; |
| 1080 | 1080 | ||
| 1081 | smp_call_function_single(pol->cpu, check_supported_cpu, &rc, 1); | 1081 | smp_call_function_single(pol->cpu, check_supported_cpu, &rc, 1); |
| 1082 | if (rc) | 1082 | if (rc) |
| @@ -1140,7 +1140,9 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
| 1140 | pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", | 1140 | pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", |
| 1141 | data->currfid, data->currvid); | 1141 | data->currfid, data->currvid); |
| 1142 | 1142 | ||
| 1143 | per_cpu(powernow_data, pol->cpu) = data; | 1143 | /* Point all the CPUs in this policy to the same data */ |
| 1144 | for_each_cpu(cpu, pol->cpus) | ||
| 1145 | per_cpu(powernow_data, cpu) = data; | ||
| 1144 | 1146 | ||
| 1145 | return 0; | 1147 | return 0; |
| 1146 | 1148 | ||
| @@ -1155,6 +1157,7 @@ err_out: | |||
| 1155 | static int powernowk8_cpu_exit(struct cpufreq_policy *pol) | 1157 | static int powernowk8_cpu_exit(struct cpufreq_policy *pol) |
| 1156 | { | 1158 | { |
| 1157 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); | 1159 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
| 1160 | int cpu; | ||
| 1158 | 1161 | ||
| 1159 | if (!data) | 1162 | if (!data) |
| 1160 | return -EINVAL; | 1163 | return -EINVAL; |
| @@ -1165,7 +1168,8 @@ static int powernowk8_cpu_exit(struct cpufreq_policy *pol) | |||
| 1165 | 1168 | ||
| 1166 | kfree(data->powernow_table); | 1169 | kfree(data->powernow_table); |
| 1167 | kfree(data); | 1170 | kfree(data); |
| 1168 | per_cpu(powernow_data, pol->cpu) = NULL; | 1171 | for_each_cpu(cpu, pol->cpus) |
| 1172 | per_cpu(powernow_data, cpu) = NULL; | ||
| 1169 | 1173 | ||
| 1170 | return 0; | 1174 | return 0; |
| 1171 | } | 1175 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index 4ef83df2b246..83face3f608f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c | |||
| @@ -106,6 +106,29 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t * | |||
| 106 | return 0; | 106 | return 0; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | /* | ||
| 110 | * On some platforms, _DSM(nouveau_op_dsm_muid, func0) has special | ||
| 111 | * requirements on the fourth parameter, so a private implementation | ||
| 112 | * instead of using acpi_check_dsm(). | ||
| 113 | */ | ||
| 114 | static int nouveau_check_optimus_dsm(acpi_handle handle) | ||
| 115 | { | ||
| 116 | int result; | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Function 0 returns a Buffer containing available functions. | ||
| 120 | * The args parameter is ignored for function 0, so just put 0 in it | ||
| 121 | */ | ||
| 122 | if (nouveau_optimus_dsm(handle, 0, 0, &result)) | ||
| 123 | return 0; | ||
| 124 | |||
| 125 | /* | ||
| 126 | * ACPI Spec v4 9.14.1: if bit 0 is zero, no function is supported. | ||
| 127 | * If the n-th bit is enabled, function n is supported | ||
| 128 | */ | ||
| 129 | return result & 1 && result & (1 << NOUVEAU_DSM_OPTIMUS_CAPS); | ||
| 130 | } | ||
| 131 | |||
| 109 | static int nouveau_dsm(acpi_handle handle, int func, int arg) | 132 | static int nouveau_dsm(acpi_handle handle, int func, int arg) |
| 110 | { | 133 | { |
| 111 | int ret = 0; | 134 | int ret = 0; |
| @@ -207,8 +230,7 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev) | |||
| 207 | 1 << NOUVEAU_DSM_POWER)) | 230 | 1 << NOUVEAU_DSM_POWER)) |
| 208 | retval |= NOUVEAU_DSM_HAS_MUX; | 231 | retval |= NOUVEAU_DSM_HAS_MUX; |
| 209 | 232 | ||
| 210 | if (acpi_check_dsm(dhandle, nouveau_op_dsm_muid, 0x00000100, | 233 | if (nouveau_check_optimus_dsm(dhandle)) |
| 211 | 1 << NOUVEAU_DSM_OPTIMUS_CAPS)) | ||
| 212 | retval |= NOUVEAU_DSM_HAS_OPT; | 234 | retval |= NOUVEAU_DSM_HAS_OPT; |
| 213 | 235 | ||
| 214 | if (retval & NOUVEAU_DSM_HAS_OPT) { | 236 | if (retval & NOUVEAU_DSM_HAS_OPT) { |
