Rafael J. Wysocki | 1 Aug 02:39 2015
Picon

[PATCH] ACPI / bus: Move duplicate code to a separate new function

From: Rafael J. Wysocki <rafael.j.wysocki <at> intel.com>

After merging commit 712e960f0ee9 (ACPI / PM: Attach ACPI power
domain only once) with commit 1dcc3d3362b0 (ACPI / bus: Move ACPI
bus type registration) there is some duplicate code in
acpi_device_is_first_physical_node() and acpi_companion_match()
that can be moved to a separate routine and called from both
places.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki <at> intel.com>
---

On top of linux-pm.git/linux-next.

---
 drivers/acpi/bus.c |   51 ++++++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 29 deletions(-)

Index: linux-pm/drivers/acpi/bus.c
===================================================================
--- linux-pm.orig/drivers/acpi/bus.c
+++ linux-pm/drivers/acpi/bus.c
 <at>  <at>  -482,6 +482,26  <at>  <at>  static void acpi_device_remove_notify_ha
                              Device Matching
    -------------------------------------------------------------------------- */

+static struct acpi_device *acpi_primary_dev_companion(struct acpi_device *adev,
+						      const struct device *dev)
+{
+	struct mutex *physical_node_lock = &adev->physical_node_lock;
(Continue reading)

Rafael J. Wysocki | 30 Jul 02:52 2015

[GIT PULL] Power management and ACPI fixes for v4.2-rc5

Hi Linus,

Please pull from

 git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
 pm+acpi-4.2-rc5

to receive power management and ACPI fixes for v4.2-rc5 with
top-most commit d29809b8eb12d291d7b507fdaaa5e44707641685

 Merge branches 'pm-cpufreq' and 'acpi-pm'

on top of commit cbfe8fa6cd672011c755c3cd85c9ffd4e2d10a6f

 Linux 4.2-rc4

These fix three regressions, two recent ones (cpufreq core and
ACPI device power management) and one introduced during the 4.1
cycle (intel_pstate).

Specifics:

 - Fix a recently introduced issue in the cpufreq core causing
   it to attempt to create duplicate symbolic links to the policy
   directory in sysfs for CPUs that are offline when the cpufreq
   driver is being registered (Rafael J Wysocki).

 - Fix a recently introduced problem in the ACPI device power
   management core code causing it to store an incorrect value
   in the device object's power.state field in some cases which
(Continue reading)

Hanjun Guo | 29 Jul 12:08 2015

[PATCH v4 00/10] ACPI GIC Self-probing, GICv2m and GICv3 support

When ACPI core patches were merged into mainline, there were two TODOs for
ACPI based GIC init, one is the Self-probing for GIC, the other one is to
support stacked irq domain, also the feature of GICv2m and GICv3 is missing
in that patch set.

For ACPI Self-probing for GIC, thanks to the GIC version which is introduced
in ACPI 6.0, we can match the GIC version and GIC driver, based on that,
we introduce the self-probe infrastructure similar as IRQCHIP_DECLARE(),
please see patch 1~3.

The stacked domain thing is more complicated, Marc introduced a patchset
to slove this problem (great thanks!) - Making the generic ACPI GSI layer
irqdomain aware, which is avaiable at:

git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/gsi-irq-domain-v2

so we reworked the GICv2m and GICv3 support on top of it, and combined
them as a single patch set for review.

Note: this patchset has no ITS support for GICv3/4, it will be implmented
in the IORT patchset, which had a draft version but needs to rework it
on top of Marc's Per-device MSI domain & platform MSI patchset.

Tested on GICv2 based FVP base model and AMD Seattle platform, both wired
interrupt and MSI (with some PCI patches) work fine.

Patches are on top of Marc's branch irq/gsi-irq-domain-v2, and available
at:

git://git.linaro.org/leg/acpi/acpi.git gsi-irqdomain
(Continue reading)

Brice Adams | 28 Jul 18:57 2015
Picon

Please can I trust you?

My Dear Friend,

I am Mr. Brice Adams, staff and auditor of a Bank in Lome, Togo
Republic. I am the Account Officer to (Late Mr. Daniel I. Glade) whose
account is presently dormant, I advise you to keep this as a "top
secret" as I am still in service and intend to retire from service
after I conclude this deal with you. I have an important
Message/discussion with you about his death and his funds, the sum of
(6.5 Million Euros) left without a heir. If you can be of an
assistance to me, I will be pleased to offer to you 25% of the total
fund. Please I got your email contact through internet email directory
when I was searching for a trust worthy partner. If you are willing to
help me, I need the following information below from you;

Your full name.............
Nationality................
Telephone number..............
Profession.................
Age.........

I will be humbly waiting your soonest response. Please contact direct
to my email address (brice2adams <at> yahoo.fr) for more information.

With Respect,
Mr. Brice Adams.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Mika Westerberg | 28 Jul 12:51 2015
Picon

[PATCH] ACPI / PM: Use target_state to set the device power state

Commit 20dacb71ad28 ("ACPI / PM: Rework device power management to follow
ACPI 6") changed the device power management to use D3hot if the device
in question does not have _PR3 method even if D3cold was requested by the
caller.

However, if the device has _PR3 device->power.state is also set to D3hot
instead of D3Cold after power resources have been turned off because
device->power.state will be assigned from "state" instead of
"target_state".

Next time the device is transitioned to D0, acpi_power_transition() will
find that the current power state of the device is D3hot instead of D3cold
which causes it to power down all resources required for the current
(wrong) state D3hot.

Below is a simplified ASL example of a real touch panel device which
triggers the problem:

  Scope (TPL1)
  {
      Name (_PR0, Package (1) { \_SB.PCI0.I2C1.PXTC })
      Name (_PR3, Package (1) { \_SB.PCI0.I2C1.PXTC })
      ...
  }

In both D0 and D3hot the same power resource is required. However, when
acpi_power_transition() turns off power resources required for D3hot (as
the device is transitioned to D0) it powers down PXTC which then makes the
device to lose its power.

(Continue reading)

Pan Xinhui | 28 Jul 05:34 2015
Picon

[PATCH] cpufreq: Correct a freq check in cpufreq_set_policy

From: Pan Xinhui <xinhuix.pan <at> intel.com>

This check was originally added by commit 9c9a43ed2734 ("[CPUFREQ]
return error when failing to set minfreq").It attempt to return an error
on obviously incorrect limits when we echo xxx >.../scaling_max,min_freq
Actually we just need check if new_policy->min > new_policy->max.
Because at least one of max/min is copied from cpufreq_get_policy().

For example, when we echo xxx > .../scaling_min_freq, new_policy is
copied from policy in cpufreq_get_policy. new_policy->max is same with
policy->max. new_policy->min is set to a new value.

Let me explain it in deduction method, first statment in if ():
new_policy->min > policy->max
policy->max == new_policy->max
==> new_policy->min > new_policy->max

second statment in if():
new_policy->max < policy->min
policy->max < policy->min
==>new_policy->min > new_policy->max (induction method)

So we have proved that we only need check if new_policy->min >
new_policy->max.

After apply this patch, we can also modify ->min and ->max in same time
if new freq range is very much different from current freq range. For
example, if current freq range is 480000-960000, then we want to set
this range to 1120000-2240000, we would fail in the past because
new_policy->min > policy->max. As long as the cpufreq range is valid, we
(Continue reading)

Guenter Roeck | 28 Jul 02:32 2015
Picon

[PATCH v2] acpi: Use kstrtoul() instead of strtoul()/simple_strtoul()

simple_strtoul() is deprecated; replace with kstrtoul() and kstrtouint().
Return an error if the value passed to the sysfs attribute is not
a number.

Drop the definition of strtoul() since it is no longer needed.

Signed-off-by: Guenter Roeck <linux <at> roeck-us.net>
---
v2: An additional use of strtoul() was introduced with commit 4fa4616e.
    Replace it as well.

 drivers/acpi/acpica/evgpeinit.c | 5 +++--
 drivers/acpi/sysfs.c            | 8 ++++++--
 include/acpi/platform/aclinux.h | 1 -
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index ea4c0d3fca2d..aa1e8c1f2d4a 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
 <at>  <at>  -326,6 +326,7  <at>  <at>  acpi_ev_match_gpe_method(acpi_handle obj_handle,
 	u32 gpe_number;
 	char name[ACPI_NAME_SIZE + 1];
 	u8 type;
+	int err;

 	ACPI_FUNCTION_TRACE(ev_match_gpe_method);

 <at>  <at>  -377,8 +378,8  <at>  <at>  acpi_ev_match_gpe_method(acpi_handle obj_handle,

(Continue reading)

Zhang Rui | 26 Jul 15:54 2015
Picon

[PATCH 0/2] ACPI: boot time AML overlay support

Hi, all,

ACPICA support for OSDT (Override System Definition Table) is introduced
recently. commit fe536995f2 (ACPICA: Namespace: Add support of OSDT table)

With this support, it is able to partially override the ACPI namespace by
providing an OSDT table, which either can be used by OEMs to make fast
changes to match their BOM changes, or can be used by end user/developer
to verify/workaround some BIOS bugs.

This patch set introduces boot time AML overlay, by using the
ACPI_INITRD_TABLE_OVERRIDE feature. In this way, people can append the
compiled OSDT table to initrd, and install them at boot time, so that they
are recognized just like any other static tables described in RSDT/XSDT table.

In order to use AML overlay, we need to
1. rebuild the kernel with CONFIG_ACPI_INITRD_TABLE_OVERRIDE set
2. write an OSDT table, for example, I use the following ASL code to
   a. override the existing _SB.ADP1.PSR control method.
   b. override the existing _SB.RUIX name object.
   c. introduce new _SB.ADP2 device object, with its own name/method objects.
   DefinitionBlock ("osdt1.aml", "OSDT", 1, "", "ADPX", 0x00001000)
   {

       External (PWRS, IntObj)
       External (\_SB.ADP1, DeviceObj)

       Scope (_SB.ADP1)
       {
               Method (_PSR, 0, NotSerialized)  // _PSR: Power Source
(Continue reading)

Zhang Rui | 26 Jul 15:52 2015
Picon

[PATCH 0/2] ACPI: boot time AML overlay support

Hi, all,

ACPICA support for OSDT (Override System Definition Table) is introduced
recently. commit fe536995f2 (ACPICA: Namespace: Add support of OSDT table)

With this support, it is able to partially override the ACPI namespace by
providing an OSDT table, which either can be used by OEMs to make fast
changes to match their BOM changes, or can be used by end user/developer
to verify/workaround some BIOS bugs.

This patch set introduces boot time AML overlay, by using the
ACPI_INITRD_TABLE_OVERRIDE feature. In this way, people can append the
compiled OSDT table to initrd, and install them at boot time, so that they
are recognized just like any other static tables described in RSDT/XSDT table.

In order to use AML overlay, we need to
1. rebuild the kernel with CONFIG_ACPI_INITRD_TABLE_OVERRIDE set
2. write an OSDT table, for example, I use the following ASL code to
   a. override the existing _SB.ADP1.PSR control method.
   b. override the existing _SB.RUIX name object.
   c. introduce new _SB.ADP2 device object, with its own name/method objects.
   DefinitionBlock ("osdt1.aml", "OSDT", 1, "", "ADPX", 0x00001000)
   {

       External (PWRS, IntObj)
       External (\_SB.ADP1, DeviceObj)

       Scope (_SB.ADP1)
       {
               Method (_PSR, 0, NotSerialized)  // _PSR: Power Source
(Continue reading)

Shraddha Barke | 24 Jul 19:00 2015
Picon

[PATCH 2756/2756] Staging: acpi: Merge lines for immediate return

This patch merges two lines in a single line if immediate return is found.
This is done using Coccinelle.Semantic patch used for this is as follows:

 <at>  <at> 
expression ret;
identifier f;
 <at>  <at> 

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Shraddha Barke <shraddha.6596 <at> gmail.com>
---
 drivers/acpi/apei/erst.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 3670bba..58e1bdd 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
 <at>  <at>  -162,8 +162,7  <at>  <at>  static int erst_exec_add_value(struct apei_exec_context *ctx,
 	if (rc)
 		return rc;
 	val += ctx->value;
-	rc = __apei_exec_write_register(entry, val);
-	return rc;
+	return __apei_exec_write_register(entry, val);
 }
(Continue reading)

Guenter Roeck | 24 Jul 18:51 2015
Picon

[PATCH] acpi: Use kstrtoul() instead of strtoul()/simple_strtoul()

simple_strtoul() is deprecated; replace with kstrtoul().
Return an error if the value passed to the sysfs attribute
is not a number.

Drop the definition of strtoul() since it is no longer needed.

Signed-off-by: Guenter Roeck <linux <at> roeck-us.net>
---
 drivers/acpi/sysfs.c            | 8 ++++++--
 include/acpi/platform/aclinux.h | 1 -
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 0876d77b3206..d6ea5712ec57 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
 <at>  <at>  -616,8 +616,12  <at>  <at>  static ssize_t counter_set(struct kobject *kobj,
 			all_counters[index].count = tmp;
 		else
 			result = -EINVAL;
-	} else
-		all_counters[index].count = strtoul(buf, NULL, 0);
+	} else {
+		if (!kstrtoul(buf, 0, &tmp))
+			all_counters[index].count = tmp;
+		else
+			result = -EINVAL;
+	}

 	if (ACPI_FAILURE(result))
(Continue reading)


Gmane