Power management fixes for 5.1-rc2

- Rearrange the generic power domains (genpd) code to avoid a
    potential deadlock possible due to its interactions with the
    clock framework (Jiada Wang).
 
  - Make turbostat return the exit status of the command run
    under it if that command fails (David Arcari).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJclLQMAAoJEILEb/54YlRxcZ4QALHPxGJFBGYo0XXL/pDcOm6+
 ie3MmI1dR+3TXziYMU2tsV7ZaFC/LDsjHA5Nq6bKH3g+BVjFuF+NDFBwWFEqqy+n
 n5QHxG0IiGWqc6Ty4TxKiw9fDSKHYBv4n4MQqibi9SIDaEdJVDM/AUXUZXVm+8bM
 AkGPjmPoxRAw7ui0z/HefWI/40piZRlYMZvFao4LY6VmZBhSMlnnWXFUXJjnfns7
 u1cPbqlzapmI9TeI0+vZKX3Xt2gJzlKB25IN5ZV6o5kZy05m6HQKvP4QKEJ3VhAX
 fHZjLYiewE1125Yit0A2vDlJC08jptSxhA5M+3zQ4gLdn+qD/NmpvQOI9e5Dqxf0
 E1wk2DjNoIEs55OaXeyQlluigXtc4hxZPgZ+vqFmf0iw1Q8CrwI29kWElqWF6LPi
 tYJ+QUCy2ZqqYgxQ0SLqyCkTyVV8OBLsSG3P3DNkCy18Z+ii+tHehbFzsYsuJrEg
 TRB9jzqs0eJ/XvR24++Ltw0l8mUtOW8qGf7Vq9XmrzOG5eeAY1OU9cld5ziZ6Sgw
 AAwxujy3nLL3dn4fr/d151EWLitMCebJpEgCTrV2ucnW288XcfMR5ev1nT2SI5MV
 qBiSDKFRCSuHtVMOrgieawYswXgcjLW8kFhIrHxk3SUrcFRSlkUhqoCiVSsKYBuS
 oJx4F5Zoa0U6LBu8lMvt
 =RgAd
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These rearrange some code in the generic power domains (genpd)
  framework to avoid a potential deadlock and make the turbostat utility
  behave more as expected.

  Specifics:

   - Rearrange the generic power domains (genpd) code to avoid a
     potential deadlock possible due to its interactions with the clock
     framework (Jiada Wang)

   - Make turbostat return the exit status of the command run under it
     if that command fails (David Arcari)"

* tag 'pm-5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM / Domains: Avoid a potential deadlock
  tools/power turbostat: return the exit status of a command
This commit is contained in:
Linus Torvalds 2019-03-22 12:03:19 -07:00
commit b44290a022
2 changed files with 9 additions and 7 deletions

View file

@ -1469,12 +1469,12 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
if (IS_ERR(gpd_data))
return PTR_ERR(gpd_data);
genpd_lock(genpd);
ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0;
if (ret)
goto out;
genpd_lock(genpd);
dev_pm_domain_set(dev, &genpd->domain);
genpd->device_count++;
@ -1482,9 +1482,8 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
list_add_tail(&gpd_data->base.list_node, &genpd->dev_list);
out:
genpd_unlock(genpd);
out:
if (ret)
genpd_free_dev_data(dev, gpd_data);
else
@ -1533,15 +1532,15 @@ static int genpd_remove_device(struct generic_pm_domain *genpd,
genpd->device_count--;
genpd->max_off_time_changed = true;
if (genpd->detach_dev)
genpd->detach_dev(genpd, dev);
dev_pm_domain_set(dev, NULL);
list_del_init(&pdd->list_node);
genpd_unlock(genpd);
if (genpd->detach_dev)
genpd->detach_dev(genpd, dev);
genpd_free_dev_data(dev, gpd_data);
return 0;

View file

@ -5077,6 +5077,9 @@ int fork_it(char **argv)
signal(SIGQUIT, SIG_IGN);
if (waitpid(child_pid, &status, 0) == -1)
err(status, "waitpid");
if (WIFEXITED(status))
status = WEXITSTATUS(status);
}
/*
* n.b. fork_it() does not check for errors from for_all_cpus()