Currently, KVM ARM/ARM64 only provides in-kernel emulation of Power State
and Coordination Interface (PSCI) v0.1.
This patchset aims at providing newer PSCI v0.2 for KVM ARM/ARM64 VCPUs
such that it does not break current KVM ARM/ARM64 ABI. Also, the patchset
provides emulation of only few PSCI v0.2 functions such as PSCI_VERSION,
CPU_ON, and CPU_OFF. Emulation of other PSCI v0.2 functions will be added
later.
The user space tools (i.e. QEMU or KVMTOOL) will have to explicitly enable
KVM_ARM_VCPU_PSCI_0_2 feature using KVM_ARM_VCPU_INIT ioctl for providing
PSCI v0.2 to VCPUs.
Changlog:
V2:
- Don't rename PSCI return values KVM_PSCI_RET_NI and KVM_PSCI_RET_INVAL
- Added kvm_psci_version() to get PSCI version available to VCPU
- Fixed grammer in Documentation/virtual/kvm/api.txt
V1:
- Initial RFC PATCH
Anup Patel (3):
KVM: Add capability to advertise PSCI v0.2 support
ARM/ARM64: KVM: Add support for PSCI v0.2 emulation
KVM: Documentation: Add info regarding KVM_ARM_VCPU_PSCI_0_2 feature
Documentation/virtual/kvm/api.txt | 2 +
arch/arm/include/asm/kvm_host.h | 2 +-
arch/arm/include/asm/kvm_psci.h | 4 ++
arch/arm/include/uapi/asm/kvm.h | 35 ++++++++++++++-
arch/arm/kvm/arm.c | 1 +
arch/arm/kvm/psci.c | 85 +++++++++++++++++++++++++++++++------
arch/arm64/include/asm/kvm_host.h | 2 +-
arch/arm64/include/asm/kvm_psci.h | 4 ++
arch/arm64/include/uapi/asm/kvm.h | 35 ++++++++++++++-
include/uapi/linux/kvm.h | 1 +
10 files changed, 155 insertions(+), 16 deletions(-)
--
1.7.9.5
Patchset related to hibernation resume:
- enhancement to make the use of an existing resume file more general
- add kstrimdup function which trims and duplicates a string
Both patches are based on the 3.13 tag. This was tested on a
Beaglebone black with partial hibernation support, and compiled for
x86_64.
[PATCH v4 1/2] mm: add kstrimdup function
include/linux/string.h | 1 +
mm/util.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
Adds the kstrimdup function to duplicate and trim whitespace
from a string. This is useful for working with user input to
sysfs.
[PATCH v4 2/2] PM / Hibernate: use name_to_dev_t to parse resume
kernel/power/hibernate.c | 33
+++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
Use name_to_dev_t to parse the /sys/power/resume file making the
syntax more flexible. It supports the previous use syntax
and additionally can support other formats such as
/dev/devicenode and UUID= formats.
By changing /sys/debug/resume to accept the same syntax as
the resume=device parameter, we can parse the resume=device
in the initrd init script and use the resume device directly
from the kernel command line.
Changes in v4:
--------------
* Dropped name_to_dev_t rework in favor of adding kstrimdup
* adjusted resume_store
Changes in v3:
--------------
* Dropped documentation patch as it went in through trivial
* Added patch for name_to_dev_t to support directly parsing userspace
buffer
Changes in v2:
--------------
* Added check for null return of kstrndup in hibernate.c
Thanks,
Sebastian
From: Mark Brown <broonie(a)linaro.org>
If the device is runtime suspended then we can't interact with it as it
may have been powered off and the register map will be in cache only
mode.
Signed-off-by: Mark Brown <broonie(a)linaro.org>
---
sound/soc/codecs/wm8962.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 97db3b45b411..aa7ae76d5e28 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3003,6 +3003,12 @@ static irqreturn_t wm8962_irq(int irq, void *data)
unsigned int active;
int reg, ret;
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0) {
+ dev_err(dev, "Failed to resume: %d\n", ret);
+ return ret;
+ }
+
ret = regmap_read(wm8962->regmap, WM8962_INTERRUPT_STATUS_2_MASK,
&mask);
if (ret != 0) {
@@ -3019,8 +3025,10 @@ static irqreturn_t wm8962_irq(int irq, void *data)
active &= ~mask;
- if (!active)
+ if (!active) {
+ pm_runtime_put(dev);
return IRQ_NONE;
+ }
/* Acknowledge the interrupts */
ret = regmap_write(wm8962->regmap, WM8962_INTERRUPT_STATUS_2, active);
@@ -3070,6 +3078,8 @@ static irqreturn_t wm8962_irq(int irq, void *data)
msecs_to_jiffies(250));
}
+ pm_runtime_put(dev);
+
return IRQ_HANDLED;
}
--
1.9.rc1
Patchset related to hibernation resume:
- enhancement to make the use of an existing resume file more general
- add kstrimdup function which trims and duplicates a string
Both patches are based on the 3.13 tag. This was tested on a
Beaglebone black with partial hibernation support, and compiled for
x86_64.
[PATCH v6 1/2] mm: add kstrimdup function
include/linux/string.h | 1 +
mm/util.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
Adds the kstrimdup function to duplicate and trim whitespace
from a string. This is useful for working with user input to
sysfs.
[PATCH v6 2/2] PM / Hibernate: use name_to_dev_t to parse resume
kernel/power/hibernate.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
Use name_to_dev_t to parse the /sys/power/resume file making the
syntax more flexible. It supports the previous use syntax
and additionally can support other formats such as
/dev/devicenode and UUID= formats.
By changing /sys/debug/resume to accept the same syntax as
the resume=device parameter, we can parse the resume=device
in the initrd init script and use the resume device directly
from the kernel command line.
Changes in v6:
--------------
* Revert tricky / confusing while loop indexing
Changes in v5:
--------------
* Change kstrimdup to minimize allocated memory. Now allocates only
the memory needed for the string instead of using strim.
Changes in v4:
--------------
* Dropped name_to_dev_t rework in favor of adding kstrimdup
* adjusted resume_store
Changes in v3:
--------------
* Dropped documentation patch as it went in through trivial
* Added patch for name_to_dev_t to support directly parsing userspace
buffer
Changes in v2:
--------------
* Added check for null return of kstrndup in hibernate.c
Thanks,
Sebastian
Automated DT boot report for various ARM defconfigs.
Tree/Branch: next
Git describe: next-20140131
Full Report
===========
bcm_defconfig
-------------
bcm28155-ap PASS: 0 min 58.9 sec
exynos_defconfig
----------------
exynos5250-arndale PASS: 0 min 29.1 sec