]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jul 2017 11:32:39 +0000 (13:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jul 2017 11:32:39 +0000 (13:32 +0200)
added patches:
arm64-assembler-make-adr_l-work-in-modules-under-kaslr.patch
hid-i2c-hid-add-sleep-between-power-on-and-reset.patch
scsi-lpfc-avoid-double-free-of-resource-identifiers.patch
spi-davinci-use-dma_mapping_error.patch

queue-4.4/arm64-assembler-make-adr_l-work-in-modules-under-kaslr.patch [new file with mode: 0644]
queue-4.4/hid-i2c-hid-add-sleep-between-power-on-and-reset.patch [new file with mode: 0644]
queue-4.4/scsi-lpfc-avoid-double-free-of-resource-identifiers.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/spi-davinci-use-dma_mapping_error.patch [new file with mode: 0644]

diff --git a/queue-4.4/arm64-assembler-make-adr_l-work-in-modules-under-kaslr.patch b/queue-4.4/arm64-assembler-make-adr_l-work-in-modules-under-kaslr.patch
new file mode 100644 (file)
index 0000000..4f77f7c
--- /dev/null
@@ -0,0 +1,103 @@
+From foo@baz Mon Jul  3 13:29:24 CEST 2017
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Date: Wed, 11 Jan 2017 14:54:53 +0000
+Subject: arm64: assembler: make adr_l work in modules under KASLR
+
+From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+
+
+[ Upstream commit 41c066f2c4d436c535616fe182331766c57838f0 ]
+
+When CONFIG_RANDOMIZE_MODULE_REGION_FULL=y, the offset between loaded
+modules and the core kernel may exceed 4 GB, putting symbols exported
+by the core kernel out of the reach of the ordinary adrp/add instruction
+pairs used to generate relative symbol references. So make the adr_l
+macro emit a movz/movk sequence instead when executing in module context.
+
+While at it, remove the pointless special case for the stack pointer.
+
+Acked-by: Mark Rutland <mark.rutland@arm.com>
+Acked-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/include/asm/assembler.h |   36 +++++++++++++++++++++++++++---------
+ 1 file changed, 27 insertions(+), 9 deletions(-)
+
+--- a/arch/arm64/include/asm/assembler.h
++++ b/arch/arm64/include/asm/assembler.h
+@@ -147,22 +147,25 @@ lr       .req    x30             // link register
+ /*
+  * Pseudo-ops for PC-relative adr/ldr/str <reg>, <symbol> where
+- * <symbol> is within the range +/- 4 GB of the PC.
++ * <symbol> is within the range +/- 4 GB of the PC when running
++ * in core kernel context. In module context, a movz/movk sequence
++ * is used, since modules may be loaded far away from the kernel
++ * when KASLR is in effect.
+  */
+       /*
+        * @dst: destination register (64 bit wide)
+        * @sym: name of the symbol
+-       * @tmp: optional scratch register to be used if <dst> == sp, which
+-       *       is not allowed in an adrp instruction
+        */
+-      .macro  adr_l, dst, sym, tmp=
+-      .ifb    \tmp
++      .macro  adr_l, dst, sym
++#ifndef MODULE
+       adrp    \dst, \sym
+       add     \dst, \dst, :lo12:\sym
+-      .else
+-      adrp    \tmp, \sym
+-      add     \dst, \tmp, :lo12:\sym
+-      .endif
++#else
++      movz    \dst, #:abs_g3:\sym
++      movk    \dst, #:abs_g2_nc:\sym
++      movk    \dst, #:abs_g1_nc:\sym
++      movk    \dst, #:abs_g0_nc:\sym
++#endif
+       .endm
+       /*
+@@ -173,6 +176,7 @@ lr .req    x30             // link register
+        *       the address
+        */
+       .macro  ldr_l, dst, sym, tmp=
++#ifndef MODULE
+       .ifb    \tmp
+       adrp    \dst, \sym
+       ldr     \dst, [\dst, :lo12:\sym]
+@@ -180,6 +184,15 @@ lr        .req    x30             // link register
+       adrp    \tmp, \sym
+       ldr     \dst, [\tmp, :lo12:\sym]
+       .endif
++#else
++      .ifb    \tmp
++      adr_l   \dst, \sym
++      ldr     \dst, [\dst]
++      .else
++      adr_l   \tmp, \sym
++      ldr     \dst, [\tmp]
++      .endif
++#endif
+       .endm
+       /*
+@@ -189,8 +202,13 @@ lr        .req    x30             // link register
+        *       while <src> needs to be preserved.
+        */
+       .macro  str_l, src, sym, tmp
++#ifndef MODULE
+       adrp    \tmp, \sym
+       str     \src, [\tmp, :lo12:\sym]
++#else
++      adr_l   \tmp, \sym
++      str     \src, [\tmp]
++#endif
+       .endm
+ /*
diff --git a/queue-4.4/hid-i2c-hid-add-sleep-between-power-on-and-reset.patch b/queue-4.4/hid-i2c-hid-add-sleep-between-power-on-and-reset.patch
new file mode 100644 (file)
index 0000000..5642254
--- /dev/null
@@ -0,0 +1,51 @@
+From foo@baz Mon Jul  3 13:29:24 CEST 2017
+From: Brendan McGrath <redmcg@redmandi.dyndns.org>
+Date: Sat, 7 Jan 2017 08:01:38 +1100
+Subject: HID: i2c-hid: Add sleep between POWER ON and RESET
+
+From: Brendan McGrath <redmcg@redmandi.dyndns.org>
+
+
+[ Upstream commit a89af4abdf9b353cdd6f61afc0eaaac403304873 ]
+
+Support for the Asus Touchpad was recently added. It turns out this
+device can fail initialisation (and become unusable) when the RESET
+command is sent too soon after the POWER ON command.
+
+Unfortunately the i2c-hid specification does not specify the need for
+a delay between these two commands. But it was discovered the Windows
+driver has a 1ms delay.
+
+As a result, this patch modifies the i2c-hid module to add a sleep
+inbetween the POWER ON and RESET commands which lasts between 1ms and 5ms.
+
+See https://github.com/vlasenko/hid-asus-dkms/issues/24 for further
+details.
+
+Signed-off-by: Brendan McGrath <redmcg@redmandi.dyndns.org>
+Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/i2c-hid/i2c-hid.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/hid/i2c-hid/i2c-hid.c
++++ b/drivers/hid/i2c-hid/i2c-hid.c
+@@ -364,6 +364,15 @@ static int i2c_hid_hwreset(struct i2c_cl
+       if (ret)
+               return ret;
++      /*
++       * The HID over I2C specification states that if a DEVICE needs time
++       * after the PWR_ON request, it should utilise CLOCK stretching.
++       * However, it has been observered that the Windows driver provides a
++       * 1ms sleep between the PWR_ON and RESET requests and that some devices
++       * rely on this.
++       */
++      usleep_range(1000, 5000);
++
+       i2c_hid_dbg(ihid, "resetting...\n");
+       ret = i2c_hid_command(client, &hid_reset_cmd, NULL, 0);
diff --git a/queue-4.4/scsi-lpfc-avoid-double-free-of-resource-identifiers.patch b/queue-4.4/scsi-lpfc-avoid-double-free-of-resource-identifiers.patch
new file mode 100644 (file)
index 0000000..f10e7b5
--- /dev/null
@@ -0,0 +1,52 @@
+From foo@baz Mon Jul  3 13:29:24 CEST 2017
+From: Roberto Sassu <rsassu@suse.de>
+Date: Wed, 11 Jan 2017 11:06:42 +0100
+Subject: scsi: lpfc: avoid double free of resource identifiers
+
+From: Roberto Sassu <rsassu@suse.de>
+
+
+[ Upstream commit cd60be4916ae689387d04b86b6fc15931e4c95ae ]
+
+Set variables initialized in lpfc_sli4_alloc_resource_identifiers() to
+NULL if an error occurred. Otherwise, lpfc_sli4_driver_resource_unset()
+attempts to free the memory again.
+
+Signed-off-by: Roberto Sassu <rsassu@suse.de>
+Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
+Acked-by: James Smart <james.smart@broadcom.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/lpfc/lpfc_sli.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/scsi/lpfc/lpfc_sli.c
++++ b/drivers/scsi/lpfc/lpfc_sli.c
+@@ -5887,18 +5887,25 @@ lpfc_sli4_alloc_resource_identifiers(str
+  free_vfi_bmask:
+       kfree(phba->sli4_hba.vfi_bmask);
++      phba->sli4_hba.vfi_bmask = NULL;
+  free_xri_ids:
+       kfree(phba->sli4_hba.xri_ids);
++      phba->sli4_hba.xri_ids = NULL;
+  free_xri_bmask:
+       kfree(phba->sli4_hba.xri_bmask);
++      phba->sli4_hba.xri_bmask = NULL;
+  free_vpi_ids:
+       kfree(phba->vpi_ids);
++      phba->vpi_ids = NULL;
+  free_vpi_bmask:
+       kfree(phba->vpi_bmask);
++      phba->vpi_bmask = NULL;
+  free_rpi_ids:
+       kfree(phba->sli4_hba.rpi_ids);
++      phba->sli4_hba.rpi_ids = NULL;
+  free_rpi_bmask:
+       kfree(phba->sli4_hba.rpi_bmask);
++      phba->sli4_hba.rpi_bmask = NULL;
+  err_exit:
+       return rc;
+ }
index 19b7c958d14982ffe2b777b3e0ab71cfdd0628a0..e044952035491e52be044b87778ff3d8460f085b 100644 (file)
@@ -66,3 +66,7 @@ virtio_net-fix-page_size-64k.patch
 vxlan-do-not-age-static-remote-mac-entries.patch
 ibmveth-add-a-proper-check-for-the-availability-of-the-checksum-features.patch
 kernel-panic.c-add-missing-n.patch
+hid-i2c-hid-add-sleep-between-power-on-and-reset.patch
+scsi-lpfc-avoid-double-free-of-resource-identifiers.patch
+spi-davinci-use-dma_mapping_error.patch
+arm64-assembler-make-adr_l-work-in-modules-under-kaslr.patch
diff --git a/queue-4.4/spi-davinci-use-dma_mapping_error.patch b/queue-4.4/spi-davinci-use-dma_mapping_error.patch
new file mode 100644 (file)
index 0000000..48986ef
--- /dev/null
@@ -0,0 +1,41 @@
+From foo@baz Mon Jul  3 13:29:24 CEST 2017
+From: Kevin Hilman <khilman@baylibre.com>
+Date: Wed, 11 Jan 2017 18:18:40 -0800
+Subject: spi: davinci: use dma_mapping_error()
+
+From: Kevin Hilman <khilman@baylibre.com>
+
+
+[ Upstream commit c5a2a394835f473ae23931eda5066d3771d7b2f8 ]
+
+The correct error checking for dma_map_single() is to use
+dma_mapping_error().
+
+Signed-off-by: Kevin Hilman <khilman@baylibre.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/spi/spi-davinci.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/spi/spi-davinci.c
++++ b/drivers/spi/spi-davinci.c
+@@ -651,7 +651,7 @@ static int davinci_spi_bufs(struct spi_d
+                       buf = t->rx_buf;
+               t->rx_dma = dma_map_single(&spi->dev, buf,
+                               t->len, DMA_FROM_DEVICE);
+-              if (!t->rx_dma) {
++              if (dma_mapping_error(&spi->dev, !t->rx_dma)) {
+                       ret = -EFAULT;
+                       goto err_rx_map;
+               }
+@@ -665,7 +665,7 @@ static int davinci_spi_bufs(struct spi_d
+                       buf = (void *)t->tx_buf;
+               t->tx_dma = dma_map_single(&spi->dev, buf,
+                               t->len, DMA_TO_DEVICE);
+-              if (!t->tx_dma) {
++              if (dma_mapping_error(&spi->dev, t->tx_dma)) {
+                       ret = -EFAULT;
+                       goto err_tx_map;
+               }