Power management and ACPI fixes for v4.2-rc8

- Fix a recently introduced issue in the ACPI backlight code which
    causes lockdep to complain about a circular lock dependency during
    initialization (Hans de Goede).
 
  - Fix a possible memory during initialization in the Exynos cpufreq
    driver (Shailendra Verma).
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCAAGBQJV1lUAAAoJEILEb/54YlRxLcsQAK/pVtaXe07xY0WnknKQp5cr
 HqOKZKQ5Eq+1eAI8CoT27F5/DMBTCOga04arSlQo+NG+uWA+vEAXdLN0JtgqTwmU
 0C9KaTCI7vs0estYeHhz3h1+CNkP2iEG78JxlnZRuZo0plBbYtv8VPh0/gfseC/g
 BlTMM3KuSfIbUK1pWAVz8gTOJqJ/kPTTaTRjzy9/+HnQWcomz1kQnlqEjxxNK/BS
 moFi5ka+LiLvzfSc4OLjxHAL3O3pUVIKEOUv8Pkomx+Js4+9TYzLmBqjUCUN0kSJ
 y6VKqjDq4MeujPfW35PVkb3eFwILVik+8IUwQoymKobenb1lQyeGPrNvr9cCswAd
 WtBUvD/LIOdplrlFDQCeWEfb53SIr+5pOBDY4Pb+wrplg/HukmBLfORYYqtNWftM
 6Dx7mjxUoz7BddRciqTYiEgBzTE+oDgUPrQkX3ot2xXv6jbBPazzzc1EEh/25rZ1
 SYezK1JxS8xa5ctGUEy4ppgXqqNjXNotb4sQnhYSsuFjMNzs4eIj5Pp204Ohkd/S
 TJfzTD45FE6CQwkp0Yvh3/VRScUiC1xxLy/1uJvv9ZKZNpVQEJcaoPeF+DOMKFjf
 gFNToHr7SlhJq4Ad2dTzwFd64BA0c3Dg4MX1/jUSkZMRPRaIjINNQ4ftJ/yLfMsA
 rnYsGj+7Xntbfm9X/bu6
 =s0Ql
 -----END PGP SIGNATURE-----

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

Pull power management and ACPI fixes from Rafael Wysocki:
 "These fix a recent regression in the ACPI backlight code and a memory
  leak in the Exynos cpufreq driver.

  Specifics:

   - Fix a recently introduced issue in the ACPI backlight code which
     causes lockdep to complain about a circular lock dependency during
     initialization (Hans de Goede).

   - Fix a possible memory during initialization in the Exynos cpufreq
     driver (Shailendra Verma)"

* tag 'pm+acpi-4.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: exynos: Fix for memory leak in case SoC name does not match
  ACPI / video: Fix circular lock dependency issue in the video-detect code
This commit is contained in:
Linus Torvalds 2015-08-20 17:06:11 -07:00
commit 0bad90985d
2 changed files with 17 additions and 5 deletions

View File

@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/types.h>
#include <linux/workqueue.h>
#include <acpi/video.h>
ACPI_MODULE_NAME("video");
@ -41,6 +42,7 @@ void acpi_video_unregister_backlight(void);
static bool backlight_notifier_registered;
static struct notifier_block backlight_nb;
static struct work_struct backlight_notify_work;
static enum acpi_backlight_type acpi_backlight_cmdline = acpi_backlight_undef;
static enum acpi_backlight_type acpi_backlight_dmi = acpi_backlight_undef;
@ -262,6 +264,13 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
{ },
};
/* This uses a workqueue to avoid various locking ordering issues */
static void acpi_video_backlight_notify_work(struct work_struct *work)
{
if (acpi_video_get_backlight_type() != acpi_backlight_video)
acpi_video_unregister_backlight();
}
static int acpi_video_backlight_notify(struct notifier_block *nb,
unsigned long val, void *bd)
{
@ -269,9 +278,8 @@ static int acpi_video_backlight_notify(struct notifier_block *nb,
/* A raw bl registering may change video -> native */
if (backlight->props.type == BACKLIGHT_RAW &&
val == BACKLIGHT_REGISTERED &&
acpi_video_get_backlight_type() != acpi_backlight_video)
acpi_video_unregister_backlight();
val == BACKLIGHT_REGISTERED)
schedule_work(&backlight_notify_work);
return NOTIFY_OK;
}
@ -304,6 +312,8 @@ enum acpi_backlight_type acpi_video_get_backlight_type(void)
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, find_video, NULL,
&video_caps, NULL);
INIT_WORK(&backlight_notify_work,
acpi_video_backlight_notify_work);
backlight_nb.notifier_call = acpi_video_backlight_notify;
backlight_nb.priority = 0;
if (backlight_register_notifier(&backlight_nb) == 0)

View File

@ -180,7 +180,7 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
ret = exynos5250_cpufreq_init(exynos_info);
} else {
pr_err("%s: Unknown SoC type\n", __func__);
return -ENODEV;
ret = -ENODEV;
}
if (ret)
@ -188,12 +188,14 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
if (exynos_info->set_freq == NULL) {
dev_err(&pdev->dev, "No set_freq function (ERR)\n");
ret = -EINVAL;
goto err_vdd_arm;
}
arm_regulator = regulator_get(NULL, "vdd_arm");
if (IS_ERR(arm_regulator)) {
dev_err(&pdev->dev, "failed to get resource vdd_arm\n");
ret = -EINVAL;
goto err_vdd_arm;
}
@ -225,7 +227,7 @@ err_cpufreq_reg:
regulator_put(arm_regulator);
err_vdd_arm:
kfree(exynos_info);
return -EINVAL;
return ret;
}
static struct platform_driver exynos_cpufreq_platdrv = {