]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Oct 2015 14:32:23 +0000 (07:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Oct 2015 14:32:23 +0000 (07:32 -0700)
added patches:
drm-nouveau-fbcon-take-runpm-reference-when-userspace-has-an-open-fd.patch
drm-qxl-fix-framebuffer-dirty-rectangle-tracking.patch
i2c-designware-do-not-use-parameters-from-acpi-on-dell-inspiron-7348.patch
i2c-designware-platdrv-enable-runtimepm-before-registering-to-the-core.patch
i2c-rcar-enable-runtimepm-before-registering-to-the-core.patch
i2c-s3c2410-enable-runtimepm-before-registering-to-the-core.patch
kvm-x86-clean-up-kvm_arch_vcpu_runnable.patch
kvm-x86-fix-rsm-into-64-bit-protected-mode.patch
kvm-x86-fix-smi-to-halted-vcpu.patch
mfd-max77843-fix-max77843_chg_init-return-on-error.patch
workqueue-make-sure-delayed-work-run-in-local-cpu.patch

12 files changed:
queue-4.2/drm-nouveau-fbcon-take-runpm-reference-when-userspace-has-an-open-fd.patch [new file with mode: 0644]
queue-4.2/drm-qxl-fix-framebuffer-dirty-rectangle-tracking.patch [new file with mode: 0644]
queue-4.2/i2c-designware-do-not-use-parameters-from-acpi-on-dell-inspiron-7348.patch [new file with mode: 0644]
queue-4.2/i2c-designware-platdrv-enable-runtimepm-before-registering-to-the-core.patch [new file with mode: 0644]
queue-4.2/i2c-rcar-enable-runtimepm-before-registering-to-the-core.patch [new file with mode: 0644]
queue-4.2/i2c-s3c2410-enable-runtimepm-before-registering-to-the-core.patch [new file with mode: 0644]
queue-4.2/kvm-x86-clean-up-kvm_arch_vcpu_runnable.patch [new file with mode: 0644]
queue-4.2/kvm-x86-fix-rsm-into-64-bit-protected-mode.patch [new file with mode: 0644]
queue-4.2/kvm-x86-fix-smi-to-halted-vcpu.patch [new file with mode: 0644]
queue-4.2/mfd-max77843-fix-max77843_chg_init-return-on-error.patch [new file with mode: 0644]
queue-4.2/series
queue-4.2/workqueue-make-sure-delayed-work-run-in-local-cpu.patch [new file with mode: 0644]

diff --git a/queue-4.2/drm-nouveau-fbcon-take-runpm-reference-when-userspace-has-an-open-fd.patch b/queue-4.2/drm-nouveau-fbcon-take-runpm-reference-when-userspace-has-an-open-fd.patch
new file mode 100644 (file)
index 0000000..b718470
--- /dev/null
@@ -0,0 +1,65 @@
+From f231976c2e8964ceaa9250e57d27c35ff03825c2 Mon Sep 17 00:00:00 2001
+From: Ben Skeggs <bskeggs@redhat.com>
+Date: Fri, 2 Oct 2015 14:03:19 +1000
+Subject: drm/nouveau/fbcon: take runpm reference when userspace has an open fd
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+commit f231976c2e8964ceaa9250e57d27c35ff03825c2 upstream.
+
+We need to do this in order to prevent accesses to the device while it's
+powered down.  Userspace may have an mmap of the fb, and there's no good
+way (that I know of) to prevent it from touching the device otherwise.
+
+This fixes some nasty races between runpm and plymouth on some systems,
+which result in the GPU getting very upset and hanging the boot.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/nouveau/nouveau_fbcon.c |   24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
++++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+@@ -178,8 +178,30 @@ nouveau_fbcon_sync(struct fb_info *info)
+       return 0;
+ }
++static int
++nouveau_fbcon_open(struct fb_info *info, int user)
++{
++      struct nouveau_fbdev *fbcon = info->par;
++      struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
++      int ret = pm_runtime_get_sync(drm->dev->dev);
++      if (ret < 0 && ret != -EACCES)
++              return ret;
++      return 0;
++}
++
++static int
++nouveau_fbcon_release(struct fb_info *info, int user)
++{
++      struct nouveau_fbdev *fbcon = info->par;
++      struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
++      pm_runtime_put(drm->dev->dev);
++      return 0;
++}
++
+ static struct fb_ops nouveau_fbcon_ops = {
+       .owner = THIS_MODULE,
++      .fb_open = nouveau_fbcon_open,
++      .fb_release = nouveau_fbcon_release,
+       .fb_check_var = drm_fb_helper_check_var,
+       .fb_set_par = drm_fb_helper_set_par,
+       .fb_fillrect = nouveau_fbcon_fillrect,
+@@ -195,6 +217,8 @@ static struct fb_ops nouveau_fbcon_ops =
+ static struct fb_ops nouveau_fbcon_sw_ops = {
+       .owner = THIS_MODULE,
++      .fb_open = nouveau_fbcon_open,
++      .fb_release = nouveau_fbcon_release,
+       .fb_check_var = drm_fb_helper_check_var,
+       .fb_set_par = drm_fb_helper_set_par,
+       .fb_fillrect = cfb_fillrect,
diff --git a/queue-4.2/drm-qxl-fix-framebuffer-dirty-rectangle-tracking.patch b/queue-4.2/drm-qxl-fix-framebuffer-dirty-rectangle-tracking.patch
new file mode 100644 (file)
index 0000000..35aaa4a
--- /dev/null
@@ -0,0 +1,50 @@
+From 60906529bec506a4bde93f04eb5e7a9dd9c42a3b Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel@redhat.com>
+Date: Mon, 5 Oct 2015 12:20:26 +0200
+Subject: drm/qxl: fix framebuffer dirty rectangle tracking.
+
+From: Gerd Hoffmann <kraxel@redhat.com>
+
+commit 60906529bec506a4bde93f04eb5e7a9dd9c42a3b upstream.
+
+Commit "c0fe07a drm/qxl: rewrite framebuffer support" has a bug in the
+dirty rectangle tracking:  Instead of ignoring an empty dirty rectangle
+when adding a new dirty region the dirty region gets extended to the
+upper left corner.  Fix it.
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/qxl/qxl_fb.c |   19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+--- a/drivers/gpu/drm/qxl/qxl_fb.c
++++ b/drivers/gpu/drm/qxl/qxl_fb.c
+@@ -144,14 +144,17 @@ static void qxl_dirty_update(struct qxl_
+       spin_lock_irqsave(&qfbdev->dirty.lock, flags);
+-      if (qfbdev->dirty.y1 < y)
+-              y = qfbdev->dirty.y1;
+-      if (qfbdev->dirty.y2 > y2)
+-              y2 = qfbdev->dirty.y2;
+-      if (qfbdev->dirty.x1 < x)
+-              x = qfbdev->dirty.x1;
+-      if (qfbdev->dirty.x2 > x2)
+-              x2 = qfbdev->dirty.x2;
++      if ((qfbdev->dirty.y2 - qfbdev->dirty.y1) &&
++          (qfbdev->dirty.x2 - qfbdev->dirty.x1)) {
++              if (qfbdev->dirty.y1 < y)
++                      y = qfbdev->dirty.y1;
++              if (qfbdev->dirty.y2 > y2)
++                      y2 = qfbdev->dirty.y2;
++              if (qfbdev->dirty.x1 < x)
++                      x = qfbdev->dirty.x1;
++              if (qfbdev->dirty.x2 > x2)
++                      x2 = qfbdev->dirty.x2;
++      }
+       qfbdev->dirty.x1 = x;
+       qfbdev->dirty.x2 = x2;
diff --git a/queue-4.2/i2c-designware-do-not-use-parameters-from-acpi-on-dell-inspiron-7348.patch b/queue-4.2/i2c-designware-do-not-use-parameters-from-acpi-on-dell-inspiron-7348.patch
new file mode 100644 (file)
index 0000000..04b514f
--- /dev/null
@@ -0,0 +1,108 @@
+From 56d4b8a24cef5d66f0d10ac778a520d3c2c68a48 Mon Sep 17 00:00:00 2001
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+Date: Thu, 24 Sep 2015 12:06:54 +0300
+Subject: i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
+
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+
+commit 56d4b8a24cef5d66f0d10ac778a520d3c2c68a48 upstream.
+
+ACPI SSCN/FMCN methods were originally added because then the platform can
+provide the most accurate HCNT/LCNT values to the driver. However, this
+seems not to be true for Dell Inspiron 7348 where using these causes the
+touchpad to fail in boot:
+
+  i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
+  i2c_designware INT3433:00: i2c_dw_handle_tx_abort: lost arbitration
+  i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
+  i2c_designware INT3433:00: controller timed out
+
+The values received from ACPI are (in fast mode):
+
+  HCNT: 72
+  LCNT: 160
+
+this translates to following timings (input clock is 100MHz on Broadwell):
+
+  tHIGH: 720 ns (spec min 600 ns)
+  tLOW: 1600 ns (spec min 1300 ns)
+  Bus period: 2920 ns (assuming 300 ns tf and tr)
+  Bus speed: 342.5 kHz
+
+Both tHIGH and tLOW are within the I2C specification.
+
+The calculated values when ACPI parameters are not used are (in fast mode):
+
+  HCNT: 87
+  LCNT: 159
+
+which translates to:
+
+  tHIGH: 870 ns (spec min 600 ns)
+  tLOW: 1590 ns (spec min 1300 ns)
+  Bus period 3060 ns (assuming 300 ns tf and tr)
+  Bus speed 326.8 kHz
+
+These values are also within the I2C specification.
+
+Since both ACPI and calculated values meet the I2C specification timing
+requirements it is hard to say why the touchpad does not function properly
+with the ACPI values except that the bus speed is higher in this case (but
+still well below the max 400kHz).
+
+Solve this by adding DMI quirk to the driver that disables using ACPI
+parameters on this particulare machine.
+
+Reported-by: Pavel Roskin <plroskin@gmail.com>
+Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Tested-by: Pavel Roskin <plroskin@gmail.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-designware-platdrv.c |   20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- a/drivers/i2c/busses/i2c-designware-platdrv.c
++++ b/drivers/i2c/busses/i2c-designware-platdrv.c
+@@ -24,6 +24,7 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/delay.h>
++#include <linux/dmi.h>
+ #include <linux/i2c.h>
+ #include <linux/clk.h>
+ #include <linux/clk-provider.h>
+@@ -51,6 +52,22 @@ static u32 i2c_dw_get_clk_rate_khz(struc
+ }
+ #ifdef CONFIG_ACPI
++/*
++ * The HCNT/LCNT information coming from ACPI should be the most accurate
++ * for given platform. However, some systems get it wrong. On such systems
++ * we get better results by calculating those based on the input clock.
++ */
++static const struct dmi_system_id dw_i2c_no_acpi_params[] = {
++      {
++              .ident = "Dell Inspiron 7348",
++              .matches = {
++                      DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++                      DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),
++              },
++      },
++      { }
++};
++
+ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
+                              u16 *hcnt, u16 *lcnt, u32 *sda_hold)
+ {
+@@ -58,6 +75,9 @@ static void dw_i2c_acpi_params(struct pl
+       acpi_handle handle = ACPI_HANDLE(&pdev->dev);
+       union acpi_object *obj;
++      if (dmi_check_system(dw_i2c_no_acpi_params))
++              return;
++
+       if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))
+               return;
diff --git a/queue-4.2/i2c-designware-platdrv-enable-runtimepm-before-registering-to-the-core.patch b/queue-4.2/i2c-designware-platdrv-enable-runtimepm-before-registering-to-the-core.patch
new file mode 100644 (file)
index 0000000..2e6bb17
--- /dev/null
@@ -0,0 +1,51 @@
+From 36d48fb5766aee9717e429f772046696b215282d Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Date: Fri, 9 Oct 2015 10:39:24 +0100
+Subject: i2c: designware-platdrv: enable RuntimePM before registering to the core
+
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+commit 36d48fb5766aee9717e429f772046696b215282d upstream.
+
+The core may register clients attached to this master which may use
+funtionality from the master. So, RuntimePM must be enabled before, otherwise
+this will fail.
+
+Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-designware-platdrv.c |   13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-designware-platdrv.c
++++ b/drivers/i2c/busses/i2c-designware-platdrv.c
+@@ -273,12 +273,6 @@ static int dw_i2c_probe(struct platform_
+       adap->dev.parent = &pdev->dev;
+       adap->dev.of_node = pdev->dev.of_node;
+-      r = i2c_add_numbered_adapter(adap);
+-      if (r) {
+-              dev_err(&pdev->dev, "failure adding adapter\n");
+-              return r;
+-      }
+-
+       if (dev->pm_runtime_disabled) {
+               pm_runtime_forbid(&pdev->dev);
+       } else {
+@@ -288,6 +282,13 @@ static int dw_i2c_probe(struct platform_
+               pm_runtime_enable(&pdev->dev);
+       }
++      r = i2c_add_numbered_adapter(adap);
++      if (r) {
++              dev_err(&pdev->dev, "failure adding adapter\n");
++              pm_runtime_disable(&pdev->dev);
++              return r;
++      }
++
+       return 0;
+ }
diff --git a/queue-4.2/i2c-rcar-enable-runtimepm-before-registering-to-the-core.patch b/queue-4.2/i2c-rcar-enable-runtimepm-before-registering-to-the-core.patch
new file mode 100644 (file)
index 0000000..ef2da74
--- /dev/null
@@ -0,0 +1,44 @@
+From 4f7effddf4549d57114289f273710f077c4c330a Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Date: Fri, 9 Oct 2015 10:39:25 +0100
+Subject: i2c: rcar: enable RuntimePM before registering to the core
+
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+commit 4f7effddf4549d57114289f273710f077c4c330a upstream.
+
+The core may register clients attached to this master which may use
+funtionality from the master. So, RuntimePM must be enabled before, otherwise
+this will fail. While here, move drvdata, too.
+
+Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-rcar.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-rcar.c
++++ b/drivers/i2c/busses/i2c-rcar.c
+@@ -690,15 +690,16 @@ static int rcar_i2c_probe(struct platfor
+               return ret;
+       }
++      pm_runtime_enable(dev);
++      platform_set_drvdata(pdev, priv);
++
+       ret = i2c_add_numbered_adapter(adap);
+       if (ret < 0) {
+               dev_err(dev, "reg adap failed: %d\n", ret);
++              pm_runtime_disable(dev);
+               return ret;
+       }
+-      pm_runtime_enable(dev);
+-      platform_set_drvdata(pdev, priv);
+-
+       dev_info(dev, "probed\n");
+       return 0;
diff --git a/queue-4.2/i2c-s3c2410-enable-runtimepm-before-registering-to-the-core.patch b/queue-4.2/i2c-s3c2410-enable-runtimepm-before-registering-to-the-core.patch
new file mode 100644 (file)
index 0000000..dcd4dfa
--- /dev/null
@@ -0,0 +1,48 @@
+From eadd709f5d2e8aebb1b7bf49460e97a68d81a9b0 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Date: Sat, 10 Oct 2015 08:24:23 +0100
+Subject: i2c: s3c2410: enable RuntimePM before registering to the core
+
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+commit eadd709f5d2e8aebb1b7bf49460e97a68d81a9b0 upstream.
+
+The core may register clients attached to this master which may use
+funtionality from the master. So, RuntimePM must be enabled before, otherwise
+this will fail. While here, move drvdata, too.
+
+Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Acked-by: Kukjin Kim <kgene@kernel.org>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-s3c2410.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-s3c2410.c
++++ b/drivers/i2c/busses/i2c-s3c2410.c
+@@ -1243,17 +1243,19 @@ static int s3c24xx_i2c_probe(struct plat
+       i2c->adap.nr = i2c->pdata->bus_num;
+       i2c->adap.dev.of_node = pdev->dev.of_node;
++      platform_set_drvdata(pdev, i2c);
++
++      pm_runtime_enable(&pdev->dev);
++
+       ret = i2c_add_numbered_adapter(&i2c->adap);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "failed to add bus to i2c core\n");
++              pm_runtime_disable(&pdev->dev);
+               s3c24xx_i2c_deregister_cpufreq(i2c);
+               clk_unprepare(i2c->clk);
+               return ret;
+       }
+-      platform_set_drvdata(pdev, i2c);
+-
+-      pm_runtime_enable(&pdev->dev);
+       pm_runtime_enable(&i2c->adap.dev);
+       dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
diff --git a/queue-4.2/kvm-x86-clean-up-kvm_arch_vcpu_runnable.patch b/queue-4.2/kvm-x86-clean-up-kvm_arch_vcpu_runnable.patch
new file mode 100644 (file)
index 0000000..a9a7be4
--- /dev/null
@@ -0,0 +1,90 @@
+From 5d9bc648b94dd719022343b8675e6c4381f0c45f Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Tue, 13 Oct 2015 10:18:53 +0200
+Subject: KVM: x86: clean up kvm_arch_vcpu_runnable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Paolo Bonzini <pbonzini@redhat.com>
+
+commit 5d9bc648b94dd719022343b8675e6c4381f0c45f upstream.
+
+Split the huge conditional in two functions.
+
+Fixes: 64d6067057d9658acb8675afcfba549abdb7fc16
+Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/x86.c |   39 +++++++++++++++++++++++++++++----------
+ 1 file changed, 29 insertions(+), 10 deletions(-)
+
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -6706,6 +6706,12 @@ static inline int vcpu_block(struct kvm
+       return 1;
+ }
++static inline bool kvm_vcpu_running(struct kvm_vcpu *vcpu)
++{
++      return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
++              !vcpu->arch.apf.halted);
++}
++
+ static int vcpu_run(struct kvm_vcpu *vcpu)
+ {
+       int r;
+@@ -6714,8 +6720,7 @@ static int vcpu_run(struct kvm_vcpu *vcp
+       vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
+       for (;;) {
+-              if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
+-                  !vcpu->arch.apf.halted)
++              if (kvm_vcpu_running(vcpu))
+                       r = vcpu_enter_guest(vcpu);
+               else
+                       r = vcpu_block(kvm, vcpu);
+@@ -8011,19 +8016,33 @@ void kvm_arch_flush_shadow_memslot(struc
+       kvm_mmu_invalidate_zap_all_pages(kvm);
+ }
++static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu)
++{
++      if (!list_empty_careful(&vcpu->async_pf.done))
++              return true;
++
++      if (kvm_apic_has_events(vcpu))
++              return true;
++
++      if (vcpu->arch.pv.pv_unhalted)
++              return true;
++
++      if (atomic_read(&vcpu->arch.nmi_queued))
++              return true;
++
++      if (kvm_arch_interrupt_allowed(vcpu) &&
++          kvm_cpu_has_interrupt(vcpu))
++              return true;
++
++      return false;
++}
++
+ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
+ {
+       if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events)
+               kvm_x86_ops->check_nested_events(vcpu, false);
+-      return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
+-              !vcpu->arch.apf.halted)
+-              || !list_empty_careful(&vcpu->async_pf.done)
+-              || kvm_apic_has_events(vcpu)
+-              || vcpu->arch.pv.pv_unhalted
+-              || atomic_read(&vcpu->arch.nmi_queued) ||
+-              (kvm_arch_interrupt_allowed(vcpu) &&
+-               kvm_cpu_has_interrupt(vcpu));
++      return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu);
+ }
+ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
diff --git a/queue-4.2/kvm-x86-fix-rsm-into-64-bit-protected-mode.patch b/queue-4.2/kvm-x86-fix-rsm-into-64-bit-protected-mode.patch
new file mode 100644 (file)
index 0000000..ea07d9d
--- /dev/null
@@ -0,0 +1,58 @@
+From b10d92a54dac25a6152f1aa1ffc95c12908035ce Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Wed, 14 Oct 2015 15:25:52 +0200
+Subject: KVM: x86: fix RSM into 64-bit protected mode
+
+From: Paolo Bonzini <pbonzini@redhat.com>
+
+commit b10d92a54dac25a6152f1aa1ffc95c12908035ce upstream.
+
+In order to get into 64-bit protected mode, you need to enable
+paging while EFER.LMA=1.  For this to work, CS.L must be 0.
+Currently, we load the segments before CR0 and CR4, which means
+that if RSM returns into 64-bit protected mode CS.L is already 1
+and everything breaks.
+
+Luckily, CS.L=0 is always the case when executing RSM, because it
+is forbidden to execute RSM from 64-bit protected mode.  Hence it
+is enough to load CR0 and CR4 first, and only then the segments.
+
+Fixes: 660a5d517aaab9187f93854425c4c63f4a09195c
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/emulate.c |   10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/arch/x86/kvm/emulate.c
++++ b/arch/x86/kvm/emulate.c
+@@ -2418,7 +2418,7 @@ static int rsm_load_state_64(struct x86_
+       u64 val, cr0, cr4;
+       u32 base3;
+       u16 selector;
+-      int i;
++      int i, r;
+       for (i = 0; i < 16; i++)
+               *reg_write(ctxt, i) = GET_SMSTATE(u64, smbase, 0x7ff8 - i * 8);
+@@ -2460,13 +2460,17 @@ static int rsm_load_state_64(struct x86_
+       dt.address =                GET_SMSTATE(u64, smbase, 0x7e68);
+       ctxt->ops->set_gdt(ctxt, &dt);
++      r = rsm_enter_protected_mode(ctxt, cr0, cr4);
++      if (r != X86EMUL_CONTINUE)
++              return r;
++
+       for (i = 0; i < 6; i++) {
+-              int r = rsm_load_seg_64(ctxt, smbase, i);
++              r = rsm_load_seg_64(ctxt, smbase, i);
+               if (r != X86EMUL_CONTINUE)
+                       return r;
+       }
+-      return rsm_enter_protected_mode(ctxt, cr0, cr4);
++      return X86EMUL_CONTINUE;
+ }
+ static int em_rsm(struct x86_emulate_ctxt *ctxt)
diff --git a/queue-4.2/kvm-x86-fix-smi-to-halted-vcpu.patch b/queue-4.2/kvm-x86-fix-smi-to-halted-vcpu.patch
new file mode 100644 (file)
index 0000000..6f9893b
--- /dev/null
@@ -0,0 +1,32 @@
+From 73917739334c6509833b0403b81d4a04a8784bdf Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Tue, 13 Oct 2015 10:19:35 +0200
+Subject: KVM: x86: fix SMI to halted VCPU
+
+From: Paolo Bonzini <pbonzini@redhat.com>
+
+commit 73917739334c6509833b0403b81d4a04a8784bdf upstream.
+
+An SMI to a halted VCPU must wake it up, hence a VCPU with a pending
+SMI must be considered runnable.
+
+Fixes: 64d6067057d9658acb8675afcfba549abdb7fc16
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/x86.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -8030,6 +8030,9 @@ static inline bool kvm_vcpu_has_events(s
+       if (atomic_read(&vcpu->arch.nmi_queued))
+               return true;
++      if (test_bit(KVM_REQ_SMI, &vcpu->requests))
++              return true;
++
+       if (kvm_arch_interrupt_allowed(vcpu) &&
+           kvm_cpu_has_interrupt(vcpu))
+               return true;
diff --git a/queue-4.2/mfd-max77843-fix-max77843_chg_init-return-on-error.patch b/queue-4.2/mfd-max77843-fix-max77843_chg_init-return-on-error.patch
new file mode 100644 (file)
index 0000000..0798f6b
--- /dev/null
@@ -0,0 +1,34 @@
+From 1b52e50f2a402a266f1ba2281f0a57e87637a047 Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javier@osg.samsung.com>
+Date: Mon, 21 Sep 2015 14:26:54 +0200
+Subject: mfd: max77843: Fix max77843_chg_init() return on error
+
+From: Javier Martinez Canillas <javier@osg.samsung.com>
+
+commit 1b52e50f2a402a266f1ba2281f0a57e87637a047 upstream.
+
+If i2c_new_dummy() fails in max77843_chg_init(), an PTR_ERR(NULL) is
+returned which is 0. So the function was wrongly returning a success
+value instead of an error code.
+
+Fixes: c7f585fe46d8 ("mfd: max77843: Add max77843 MFD driver core driver")
+Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
+Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/max77843.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mfd/max77843.c
++++ b/drivers/mfd/max77843.c
+@@ -79,7 +79,7 @@ static int max77843_chg_init(struct max7
+       if (!max77843->i2c_chg) {
+               dev_err(&max77843->i2c->dev,
+                               "Cannot allocate I2C device for Charger\n");
+-              return PTR_ERR(max77843->i2c_chg);
++              return -ENODEV;
+       }
+       i2c_set_clientdata(max77843->i2c_chg, max77843);
index a05e47a114ea2224be3320277e255730472aaa0a..e22655db3444f8b3f4ae2f8bb6640f02810b43bf 100644 (file)
@@ -28,3 +28,14 @@ btrfs-fix-use-after-free-iterating-extrefs.patch
 arm64-errata-use-kbuild_cflags_module-for-erratum-843419.patch
 arm-ux500-simplify-secondary-cpu-boot.patch
 nfsd-blocklayout-accept-any-minlength.patch
+mfd-max77843-fix-max77843_chg_init-return-on-error.patch
+i2c-rcar-enable-runtimepm-before-registering-to-the-core.patch
+i2c-s3c2410-enable-runtimepm-before-registering-to-the-core.patch
+i2c-designware-do-not-use-parameters-from-acpi-on-dell-inspiron-7348.patch
+i2c-designware-platdrv-enable-runtimepm-before-registering-to-the-core.patch
+workqueue-make-sure-delayed-work-run-in-local-cpu.patch
+kvm-x86-clean-up-kvm_arch_vcpu_runnable.patch
+kvm-x86-fix-smi-to-halted-vcpu.patch
+kvm-x86-fix-rsm-into-64-bit-protected-mode.patch
+drm-qxl-fix-framebuffer-dirty-rectangle-tracking.patch
+drm-nouveau-fbcon-take-runpm-reference-when-userspace-has-an-open-fd.patch
diff --git a/queue-4.2/workqueue-make-sure-delayed-work-run-in-local-cpu.patch b/queue-4.2/workqueue-make-sure-delayed-work-run-in-local-cpu.patch
new file mode 100644 (file)
index 0000000..c832407
--- /dev/null
@@ -0,0 +1,78 @@
+From 874bbfe600a660cba9c776b3957b1ce393151b76 Mon Sep 17 00:00:00 2001
+From: Shaohua Li <shli@fb.com>
+Date: Wed, 30 Sep 2015 09:05:30 -0700
+Subject: workqueue: make sure delayed work run in local cpu
+
+From: Shaohua Li <shli@fb.com>
+
+commit 874bbfe600a660cba9c776b3957b1ce393151b76 upstream.
+
+My system keeps crashing with below message. vmstat_update() schedules a delayed
+work in current cpu and expects the work runs in the cpu.
+schedule_delayed_work() is expected to make delayed work run in local cpu. The
+problem is timer can be migrated with NO_HZ. __queue_work() queues work in
+timer handler, which could run in a different cpu other than where the delayed
+work is scheduled. The end result is the delayed work runs in different cpu.
+The patch makes __queue_delayed_work records local cpu earlier. Where the timer
+runs doesn't change where the work runs with the change.
+
+[   28.010131] ------------[ cut here ]------------
+[   28.010609] kernel BUG at ../mm/vmstat.c:1392!
+[   28.011099] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN
+[   28.011860] Modules linked in:
+[   28.012245] CPU: 0 PID: 289 Comm: kworker/0:3 Tainted: G        W4.3.0-rc3+ #634
+[   28.013065] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014
+[   28.014160] Workqueue: events vmstat_update
+[   28.014571] task: ffff880117682580 ti: ffff8800ba428000 task.ti: ffff8800ba428000
+[   28.015445] RIP: 0010:[<ffffffff8115f921>]  [<ffffffff8115f921>]vmstat_update+0x31/0x80
+[   28.016282] RSP: 0018:ffff8800ba42fd80  EFLAGS: 00010297
+[   28.016812] RAX: 0000000000000000 RBX: ffff88011a858dc0 RCX:0000000000000000
+[   28.017585] RDX: ffff880117682580 RSI: ffffffff81f14d8c RDI:ffffffff81f4df8d
+[   28.018366] RBP: ffff8800ba42fd90 R08: 0000000000000001 R09:0000000000000000
+[   28.019169] R10: 0000000000000000 R11: 0000000000000121 R12:ffff8800baa9f640
+[   28.019947] R13: ffff88011a81e340 R14: ffff88011a823700 R15:0000000000000000
+[   28.020071] FS:  0000000000000000(0000) GS:ffff88011a800000(0000)knlGS:0000000000000000
+[   28.020071] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+[   28.020071] CR2: 00007ff6144b01d0 CR3: 00000000b8e93000 CR4:00000000000006f0
+[   28.020071] Stack:
+[   28.020071]  ffff88011a858dc0 ffff8800baa9f640 ffff8800ba42fe00ffffffff8106bd88
+[   28.020071]  ffffffff8106bd0b 0000000000000096 0000000000000000ffffffff82f9b1e8
+[   28.020071]  ffffffff829f0b10 0000000000000000 ffffffff81f18460ffff88011a81e340
+[   28.020071] Call Trace:
+[   28.020071]  [<ffffffff8106bd88>] process_one_work+0x1c8/0x540
+[   28.020071]  [<ffffffff8106bd0b>] ? process_one_work+0x14b/0x540
+[   28.020071]  [<ffffffff8106c214>] worker_thread+0x114/0x460
+[   28.020071]  [<ffffffff8106c100>] ? process_one_work+0x540/0x540
+[   28.020071]  [<ffffffff81071bf8>] kthread+0xf8/0x110
+[   28.020071]  [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200
+[   28.020071]  [<ffffffff81a6522f>] ret_from_fork+0x3f/0x70
+[   28.020071]  [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200
+
+Signed-off-by: Shaohua Li <shli@fb.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/workqueue.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/kernel/workqueue.c
++++ b/kernel/workqueue.c
+@@ -1458,13 +1458,13 @@ static void __queue_delayed_work(int cpu
+       timer_stats_timer_set_start_info(&dwork->timer);
+       dwork->wq = wq;
++      /* timer isn't guaranteed to run in this cpu, record earlier */
++      if (cpu == WORK_CPU_UNBOUND)
++              cpu = raw_smp_processor_id();
+       dwork->cpu = cpu;
+       timer->expires = jiffies + delay;
+-      if (unlikely(cpu != WORK_CPU_UNBOUND))
+-              add_timer_on(timer, cpu);
+-      else
+-              add_timer(timer);
++      add_timer_on(timer, cpu);
+ }
+ /**