From: Greg Kroah-Hartman Date: Thu, 21 Nov 2019 07:09:21 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v5.3.13~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=870a2a44058bdb067ee08fdb48510d5a42f67b32;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: 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 --- diff --git a/queue-4.14/series b/queue-4.14/series new file mode 100644 index 00000000000..04497662104 --- /dev/null +++ b/queue-4.14/series @@ -0,0 +1,2 @@ +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 diff --git a/queue-4.14/spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch b/queue-4.14/spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch new file mode 100644 index 00000000000..76e96af306a --- /dev/null +++ b/queue-4.14/spi-mediatek-use-correct-mata-xfer_len-when-in-fifo-transfer.patch @@ -0,0 +1,38 @@ +From a4d8f64f7267a88d4688f5c216926f5f6cafbae6 Mon Sep 17 00:00:00 2001 +From: Leilk Liu +Date: Wed, 31 Oct 2018 16:49:16 +0800 +Subject: spi: mediatek: use correct mata->xfer_len when in fifo transfer + +From: Leilk Liu + +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 +Signed-off-by: Mark Brown +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + 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(®_val, diff --git a/queue-4.14/tee-optee-add-missing-of_node_put-after-of_device_is_available.patch b/queue-4.14/tee-optee-add-missing-of_node_put-after-of_device_is_available.patch new file mode 100644 index 00000000000..8252e01f20f --- /dev/null +++ b/queue-4.14/tee-optee-add-missing-of_node_put-after-of_device_is_available.patch @@ -0,0 +1,61 @@ +From c7c0d8df0b94a67377555a550b8d66ee2ad2f4ed Mon Sep 17 00:00:00 2001 +From: Julia Lawall +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 + +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): + +// +@@ +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 ...; +) +} +// + +Fixes: db878f76b9ff ("tee: optee: take DT status property into account") +Signed-off-by: Julia Lawall +Signed-off-by: Jens Wiklander +Cc: Nobuhiro Iwamatsu +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -590,8 +590,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);