]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Nov 2019 07:15:05 +0000 (08:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Nov 2019 07:15:05 +0000 (08:15 +0100)
added patches:
i2c-mediatek-modify-threshold-passed-to-i2c_get_dma_safe_msg_buf.patch
spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch
tee-optee-add-missing-of_node_put-after-of_device_is_available.patch

queue-4.19/i2c-mediatek-modify-threshold-passed-to-i2c_get_dma_safe_msg_buf.patch [new file with mode: 0644]
queue-4.19/series [new file with mode: 0644]
queue-4.19/spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch [new file with mode: 0644]
queue-4.19/tee-optee-add-missing-of_node_put-after-of_device_is_available.patch [new file with mode: 0644]

diff --git a/queue-4.19/i2c-mediatek-modify-threshold-passed-to-i2c_get_dma_safe_msg_buf.patch b/queue-4.19/i2c-mediatek-modify-threshold-passed-to-i2c_get_dma_safe_msg_buf.patch
new file mode 100644 (file)
index 0000000..ba00b24
--- /dev/null
@@ -0,0 +1,61 @@
+From bc1a7f75c85e226e82f183d30d75c357f92b6029 Mon Sep 17 00:00:00 2001
+From: Hsin-Yi Wang <hsinyi@chromium.org>
+Date: Fri, 15 Feb 2019 17:02:02 +0800
+Subject: i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf()
+
+From: Hsin-Yi Wang <hsinyi@chromium.org>
+
+commit bc1a7f75c85e226e82f183d30d75c357f92b6029 upstream.
+
+DMA with zero-length transfers doesn't make sense and this HW doesn't
+support them at all, so increase the threshold.
+
+Fixes: fc66b39fe36a ("i2c: mediatek: Use DMA safe buffers for i2c transactions")
+Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
+[wsa: reworded commit message]
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-mt65xx.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-mt65xx.c
++++ b/drivers/i2c/busses/i2c-mt65xx.c
+@@ -503,7 +503,7 @@ static int mtk_i2c_do_transfer(struct mt
+               writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG);
+               writel(I2C_DMA_CON_RX, i2c->pdmabase + OFFSET_CON);
+-              dma_rd_buf = i2c_get_dma_safe_msg_buf(msgs, 0);
++              dma_rd_buf = i2c_get_dma_safe_msg_buf(msgs, 1);
+               if (!dma_rd_buf)
+                       return -ENOMEM;
+@@ -526,7 +526,7 @@ static int mtk_i2c_do_transfer(struct mt
+               writel(I2C_DMA_INT_FLAG_NONE, i2c->pdmabase + OFFSET_INT_FLAG);
+               writel(I2C_DMA_CON_TX, i2c->pdmabase + OFFSET_CON);
+-              dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 0);
++              dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 1);
+               if (!dma_wr_buf)
+                       return -ENOMEM;
+@@ -549,7 +549,7 @@ static int mtk_i2c_do_transfer(struct mt
+               writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_INT_FLAG);
+               writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_CON);
+-              dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 0);
++              dma_wr_buf = i2c_get_dma_safe_msg_buf(msgs, 1);
+               if (!dma_wr_buf)
+                       return -ENOMEM;
+@@ -561,7 +561,7 @@ static int mtk_i2c_do_transfer(struct mt
+                       return -ENOMEM;
+               }
+-              dma_rd_buf = i2c_get_dma_safe_msg_buf((msgs + 1), 0);
++              dma_rd_buf = i2c_get_dma_safe_msg_buf((msgs + 1), 1);
+               if (!dma_rd_buf) {
+                       dma_unmap_single(i2c->dev, wpaddr,
+                                        msgs->len, DMA_TO_DEVICE);
diff --git a/queue-4.19/series b/queue-4.19/series
new file mode 100644 (file)
index 0000000..7e625f3
--- /dev/null
@@ -0,0 +1,3 @@
+spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch
+i2c-mediatek-modify-threshold-passed-to-i2c_get_dma_safe_msg_buf.patch
+tee-optee-add-missing-of_node_put-after-of_device_is_available.patch
diff --git a/queue-4.19/spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch b/queue-4.19/spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch
new file mode 100644 (file)
index 0000000..76e96af
--- /dev/null
@@ -0,0 +1,38 @@
+From a4d8f64f7267a88d4688f5c216926f5f6cafbae6 Mon Sep 17 00:00:00 2001
+From: Leilk Liu <leilk.liu@mediatek.com>
+Date: Wed, 31 Oct 2018 16:49:16 +0800
+Subject: spi: mediatek: use correct mata->xfer_len when in fifo transfer
+
+From: Leilk Liu <leilk.liu@mediatek.com>
+
+commit a4d8f64f7267a88d4688f5c216926f5f6cafbae6 upstream.
+
+when xfer_len is greater than 64 bytes and use fifo mode
+to transfer, the actual length from the third time is mata->xfer_len
+but not len in mtk_spi_interrupt().
+
+Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-mt65xx.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/spi/spi-mt65xx.c
++++ b/drivers/spi/spi-mt65xx.c
+@@ -522,11 +522,11 @@ static irqreturn_t mtk_spi_interrupt(int
+               mdata->xfer_len = min(MTK_SPI_MAX_FIFO_SIZE, len);
+               mtk_spi_setup_packet(master);
+-              cnt = len / 4;
++              cnt = mdata->xfer_len / 4;
+               iowrite32_rep(mdata->base + SPI_TX_DATA_REG,
+                               trans->tx_buf + mdata->num_xfered, cnt);
+-              remainder = len % 4;
++              remainder = mdata->xfer_len % 4;
+               if (remainder > 0) {
+                       reg_val = 0;
+                       memcpy(&reg_val,
diff --git a/queue-4.19/tee-optee-add-missing-of_node_put-after-of_device_is_available.patch b/queue-4.19/tee-optee-add-missing-of_node_put-after-of_device_is_available.patch
new file mode 100644 (file)
index 0000000..0b89e84
--- /dev/null
@@ -0,0 +1,61 @@
+From c7c0d8df0b94a67377555a550b8d66ee2ad2f4ed Mon Sep 17 00:00:00 2001
+From: Julia Lawall <Julia.Lawall@lip6.fr>
+Date: Sat, 23 Feb 2019 14:20:36 +0100
+Subject: tee: optee: add missing of_node_put after of_device_is_available
+
+From: Julia Lawall <Julia.Lawall@lip6.fr>
+
+commit c7c0d8df0b94a67377555a550b8d66ee2ad2f4ed upstream.
+
+Add an of_node_put when a tested device node is not available.
+
+The semantic patch that fixes this problem is as follows
+(http://coccinelle.lip6.fr):
+
+// <smpl>
+@@
+identifier f;
+local idexpression e;
+expression x;
+@@
+
+e = f(...);
+... when != of_node_put(e)
+    when != x = e
+    when != e = x
+    when any
+if (<+...of_device_is_available(e)...+>) {
+  ... when != of_node_put(e)
+(
+  return e;
+|
++ of_node_put(e);
+  return ...;
+)
+}
+// </smpl>
+
+Fixes: db878f76b9ff ("tee: optee: take DT status property into account")
+Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
+Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
+Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tee/optee/core.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/tee/optee/core.c
++++ b/drivers/tee/optee/core.c
+@@ -696,8 +696,10 @@ static int __init optee_driver_init(void
+               return -ENODEV;
+       np = of_find_matching_node(fw_np, optee_match);
+-      if (!np || !of_device_is_available(np))
++      if (!np || !of_device_is_available(np)) {
++              of_node_put(np);
+               return -ENODEV;
++      }
+       optee = optee_probe(np);
+       of_node_put(np);