ACPI and power management fixes for 3.11-rc3

- Revert of the ACPI video commit that I hoped would help fix
   backlight problems related to Windows 8 compatibility on some
   systems.  Unfortunately, it turned out to cause problems to happen
   too.
 
 - Fix for two problems in intel_pstate, a possible failure to respond
   to a load change on a quiet system and a possible failure to select
   the highest available P-state on some systems.  From Dirk Brandewie.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJR8ub/AAoJEKhOf7ml8uNsgeQP+QFcSyDmkVCPTiLg5UYwFAIj
 nptNB108tFH3ac9eZKNNdkYUeO3aeQooACMG3OqDEMzM88EUlQY33/yWJf9LXaq9
 CYh6wNhGIFLWbIm2NcdP7akbXfz9dnoty2ELvD6kfVkRfVUgdo5LJlTn+sBcKwcu
 kKUWODj4776dbFvg1Qv5Q6SrFNFWvpWZpsedpAQZWZE88sLy0pwpfq2H88naH551
 9PxHqJ3trihq8i2cPSgKAipcIotqubPSHKm0HGYOKo8+C+V64TcJxWIaFwYawnvB
 LrnsdjC3l+0DyQIy7OztEzWr/gTi6fdeiWuTU6+6IVbJ7P1waTdVy+B/wy/25PLL
 zCJ+DXfqVTiaeSh4nriQVny30XTdZL/jpeFHRdL707FbuK1LLoFSlhH+uDx9EQUc
 yIabX+roV6WX2ohNc+cu+pRPuG45vs7/gPUPa167UvqR0rxNc2Qf/kWWwVH7fwFz
 g5FMMWqdNRxa7XKo0VbazG9mTk023CB37CVNEHWNe9g1a3XHe6zcgq2Ea8+i4QRi
 WALLCSzV8+1eA/upS1wQs8M2o3Mh+Okdu7WEN89OANQHMgyTVjHGHWIyV820XXWc
 MrhvB2DeqjyREl1ks2qiuUhrGO5nipCIlgKLvI2qD0jumasLob+9e3ozMSpSrtvi
 J8qR46N4/fB9eLNdPCZt
 =mGfr
 -----END PGP SIGNATURE-----

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

Pull ACPI and power management fixes from Rafael Wysocki:
 "These are just two fixes, a revert of the would-be backlight fix that
  didn't work and an intel_pstate fix for two problems related to
  maximum P-state selection.

  Specifics:

   - Revert of the ACPI video commit that I hoped would help fix
     backlight problems related to Windows 8 compatibility on some
     systems.  Unfortunately, it turned out to cause problems to happen
     too.

   - Fix for two problems in intel_pstate, a possible failure to respond
     to a load change on a quiet system and a possible failure to select
     the highest available P-state on some systems.  From Dirk
     Brandewie"

* tag 'pm+acpi-3.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "ACPI / video / i915: No ACPI backlight if firmware expects Windows 8"
  cpufreq / intel_pstate: Change to scale off of max P-state
This commit is contained in:
Linus Torvalds 2013-07-26 14:37:18 -07:00
commit 0f74665025
7 changed files with 17 additions and 93 deletions

View File

@ -169,10 +169,8 @@ int acpi_create_platform_device(struct acpi_device *adev,
-------------------------------------------------------------------------- */
#if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)
bool acpi_video_backlight_quirks(void);
bool acpi_video_verify_backlight_support(void);
#else
static inline bool acpi_video_backlight_quirks(void) { return false; }
static inline bool acpi_video_verify_backlight_support(void) { return false; }
#endif
#endif /* _ACPI_INTERNAL_H_ */

View File

@ -911,7 +911,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
if (acpi_video_init_brightness(device))
return;
if (acpi_video_verify_backlight_support()) {
if (acpi_video_backlight_support()) {
struct backlight_properties props;
struct pci_dev *pdev;
acpi_handle acpi_parent;
@ -1366,8 +1366,8 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event)
unsigned long long level_current, level_next;
int result = -EINVAL;
/* no warning message if acpi_backlight=vendor or a quirk is used */
if (!acpi_video_verify_backlight_support())
/* no warning message if acpi_backlight=vendor is used */
if (!acpi_video_backlight_support())
return 0;
if (!device->brightness)
@ -1875,46 +1875,6 @@ static int acpi_video_bus_remove(struct acpi_device *device)
return 0;
}
static acpi_status video_unregister_backlight(acpi_handle handle, u32 lvl,
void *context, void **rv)
{
struct acpi_device *acpi_dev;
struct acpi_video_bus *video;
struct acpi_video_device *dev, *next;
if (acpi_bus_get_device(handle, &acpi_dev))
return AE_OK;
if (acpi_match_device_ids(acpi_dev, video_device_ids))
return AE_OK;
video = acpi_driver_data(acpi_dev);
if (!video)
return AE_OK;
acpi_video_bus_stop_devices(video);
mutex_lock(&video->device_list_lock);
list_for_each_entry_safe(dev, next, &video->video_device_list, entry) {
if (dev->backlight) {
backlight_device_unregister(dev->backlight);
dev->backlight = NULL;
kfree(dev->brightness->levels);
kfree(dev->brightness);
}
if (dev->cooling_dev) {
sysfs_remove_link(&dev->dev->dev.kobj,
"thermal_cooling");
sysfs_remove_link(&dev->cooling_dev->device.kobj,
"device");
thermal_cooling_device_unregister(dev->cooling_dev);
dev->cooling_dev = NULL;
}
}
mutex_unlock(&video->device_list_lock);
acpi_video_bus_start_devices(video);
return AE_OK;
}
static int __init is_i740(struct pci_dev *dev)
{
if (dev->device == 0x00D1)
@ -1946,25 +1906,14 @@ static int __init intel_opregion_present(void)
return opregion;
}
int __acpi_video_register(bool backlight_quirks)
int acpi_video_register(void)
{
bool no_backlight;
int result;
no_backlight = backlight_quirks ? acpi_video_backlight_quirks() : false;
int result = 0;
if (register_count) {
/*
* If acpi_video_register() has been called already, don't try
* to register acpi_video_bus, but unregister backlight devices
* if no backlight support is requested.
* if the function of acpi_video_register is already called,
* don't register the acpi_vide_bus again and return no error.
*/
if (no_backlight)
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
video_unregister_backlight,
NULL, NULL, NULL);
return 0;
}
@ -1980,7 +1929,7 @@ int __acpi_video_register(bool backlight_quirks)
return 0;
}
EXPORT_SYMBOL(__acpi_video_register);
EXPORT_SYMBOL(acpi_video_register);
void acpi_video_unregister(void)
{

View File

@ -238,12 +238,7 @@ static void acpi_video_caps_check(void)
bool acpi_video_backlight_quirks(void)
{
if (acpi_gbl_osi_data >= ACPI_OSI_WIN_8) {
acpi_video_caps_check();
acpi_video_support |= ACPI_VIDEO_SKIP_BACKLIGHT;
return true;
}
return false;
return acpi_gbl_osi_data >= ACPI_OSI_WIN_8;
}
EXPORT_SYMBOL(acpi_video_backlight_quirks);
@ -291,14 +286,6 @@ int acpi_video_backlight_support(void)
}
EXPORT_SYMBOL(acpi_video_backlight_support);
/* For the ACPI video driver use only. */
bool acpi_video_verify_backlight_support(void)
{
return (acpi_video_support & ACPI_VIDEO_SKIP_BACKLIGHT) ?
false : acpi_video_backlight_support();
}
EXPORT_SYMBOL(acpi_video_verify_backlight_support);
/*
* Use acpi_backlight=vendor/video to force that backlight switching
* is processed by vendor specific acpi drivers or video.ko driver.

View File

@ -103,10 +103,10 @@ struct pstate_adjust_policy {
static struct pstate_adjust_policy default_policy = {
.sample_rate_ms = 10,
.deadband = 0,
.setpoint = 109,
.p_gain_pct = 17,
.setpoint = 97,
.p_gain_pct = 20,
.d_gain_pct = 0,
.i_gain_pct = 4,
.i_gain_pct = 0,
};
struct perf_limits {
@ -468,12 +468,12 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu)
static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu)
{
int32_t busy_scaled;
int32_t core_busy, turbo_pstate, current_pstate;
int32_t core_busy, max_pstate, current_pstate;
core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy);
turbo_pstate = int_tofp(cpu->pstate.turbo_pstate);
max_pstate = int_tofp(cpu->pstate.max_pstate);
current_pstate = int_tofp(cpu->pstate.current_pstate);
busy_scaled = mul_fp(core_busy, div_fp(turbo_pstate, current_pstate));
busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate));
return fp_toint(busy_scaled);
}

View File

@ -1648,7 +1648,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
if (INTEL_INFO(dev)->num_pipes) {
/* Must be done after probing outputs */
intel_opregion_init(dev);
acpi_video_register_with_quirks();
acpi_video_register();
}
if (IS_GEN5(dev))

View File

@ -17,21 +17,12 @@ struct acpi_device;
#define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200
#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
extern int __acpi_video_register(bool backlight_quirks);
static inline int acpi_video_register(void)
{
return __acpi_video_register(false);
}
static inline int acpi_video_register_with_quirks(void)
{
return __acpi_video_register(true);
}
extern int acpi_video_register(void);
extern void acpi_video_unregister(void);
extern int acpi_video_get_edid(struct acpi_device *device, int type,
int device_id, void **edid);
#else
static inline int acpi_video_register(void) { return 0; }
static inline int acpi_video_register_with_quirks(void) { return 0; }
static inline void acpi_video_unregister(void) { return; }
static inline int acpi_video_get_edid(struct acpi_device *device, int type,
int device_id, void **edid)

View File

@ -191,7 +191,6 @@ extern bool wmi_has_guid(const char *guid);
#define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800
#define ACPI_VIDEO_SKIP_BACKLIGHT 0x1000
#if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)