]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 23:05:04 +0000 (00:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 23:05:04 +0000 (00:05 +0100)
added patches:
compat_ioctl-handle-siocoutqnsd.patch
media-exynos4-is-fix-recursive-locking-in-isp_video_release.patch
rtc-msm6242-fix-reading-of-10-hour-digit.patch
rtlwifi-remove-unnecessary-null-check-in-rtl_regd_init.patch
spi-atmel-fix-handling-of-cs_change-set-on-non-last-xfer.patch
tty-serial-imx-use-the-sg-count-from-dma_map_sg.patch
tty-serial-pch_uart-correct-usage-of-dma_unmap_sg.patch

queue-4.4/compat_ioctl-handle-siocoutqnsd.patch [new file with mode: 0644]
queue-4.4/media-exynos4-is-fix-recursive-locking-in-isp_video_release.patch [new file with mode: 0644]
queue-4.4/rtc-msm6242-fix-reading-of-10-hour-digit.patch [new file with mode: 0644]
queue-4.4/rtlwifi-remove-unnecessary-null-check-in-rtl_regd_init.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/spi-atmel-fix-handling-of-cs_change-set-on-non-last-xfer.patch [new file with mode: 0644]
queue-4.4/tty-serial-imx-use-the-sg-count-from-dma_map_sg.patch [new file with mode: 0644]
queue-4.4/tty-serial-pch_uart-correct-usage-of-dma_unmap_sg.patch [new file with mode: 0644]

diff --git a/queue-4.4/compat_ioctl-handle-siocoutqnsd.patch b/queue-4.4/compat_ioctl-handle-siocoutqnsd.patch
new file mode 100644 (file)
index 0000000..6af29fd
--- /dev/null
@@ -0,0 +1,34 @@
+From 9d7bf41fafa5b5ddd4c13eb39446b0045f0a8167 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 3 Jun 2019 23:06:00 +0200
+Subject: compat_ioctl: handle SIOCOUTQNSD
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 9d7bf41fafa5b5ddd4c13eb39446b0045f0a8167 upstream.
+
+Unlike the normal SIOCOUTQ, SIOCOUTQNSD was never handled in compat
+mode. Add it to the common socket compat handler along with similar
+ones.
+
+Fixes: 2f4e1b397097 ("tcp: ioctl type SIOCOUTQNSD returns amount of data not sent")
+Cc: Eric Dumazet <edumazet@google.com>
+Cc: netdev@vger.kernel.org
+Cc: "David S. Miller" <davem@davemloft.net>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/socket.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/socket.c
++++ b/net/socket.c
+@@ -3143,6 +3143,7 @@ static int compat_sock_ioctl_trans(struc
+       case SIOCSARP:
+       case SIOCGARP:
+       case SIOCDARP:
++      case SIOCOUTQNSD:
+       case SIOCATMARK:
+               return sock_do_ioctl(net, sock, cmd, arg);
+       }
diff --git a/queue-4.4/media-exynos4-is-fix-recursive-locking-in-isp_video_release.patch b/queue-4.4/media-exynos4-is-fix-recursive-locking-in-isp_video_release.patch
new file mode 100644 (file)
index 0000000..c7787f2
--- /dev/null
@@ -0,0 +1,36 @@
+From 704c6c80fb471d1bb0ef0d61a94617d1d55743cd Mon Sep 17 00:00:00 2001
+From: Seung-Woo Kim <sw0312.kim@samsung.com>
+Date: Fri, 18 Oct 2019 07:20:52 -0300
+Subject: media: exynos4-is: Fix recursive locking in isp_video_release()
+
+From: Seung-Woo Kim <sw0312.kim@samsung.com>
+
+commit 704c6c80fb471d1bb0ef0d61a94617d1d55743cd upstream.
+
+>From isp_video_release(), &isp->video_lock is held and subsequent
+vb2_fop_release() tries to lock vdev->lock which is same with the
+previous one. Replace vb2_fop_release() with _vb2_fop_release() to
+fix the recursive locking.
+
+Fixes: 1380f5754cb0 ("[media] videobuf2: Add missing lock held on vb2_fop_release")
+Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
+Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/platform/exynos4-is/fimc-isp-video.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
++++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
+@@ -323,7 +323,7 @@ static int isp_video_release(struct file
+               ivc->streaming = 0;
+       }
+-      vb2_fop_release(file);
++      _vb2_fop_release(file, NULL);
+       if (v4l2_fh_is_singular_file(file)) {
+               fimc_pipeline_call(&ivc->ve, close);
diff --git a/queue-4.4/rtc-msm6242-fix-reading-of-10-hour-digit.patch b/queue-4.4/rtc-msm6242-fix-reading-of-10-hour-digit.patch
new file mode 100644 (file)
index 0000000..307c5f9
--- /dev/null
@@ -0,0 +1,40 @@
+From e34494c8df0cd96fc432efae121db3212c46ae48 Mon Sep 17 00:00:00 2001
+From: Kars de Jong <jongk@linux-m68k.org>
+Date: Sat, 16 Nov 2019 12:05:48 +0100
+Subject: rtc: msm6242: Fix reading of 10-hour digit
+
+From: Kars de Jong <jongk@linux-m68k.org>
+
+commit e34494c8df0cd96fc432efae121db3212c46ae48 upstream.
+
+The driver was reading the wrong register as the 10-hour digit due to
+a misplaced ')'. It was in fact reading the 1-second digit register due
+to this bug.
+
+Also remove the use of a magic number for the hour mask and use the define
+for it which was already present.
+
+Fixes: 4f9b9bba1dd1 ("rtc: Add an RTC driver for the Oki MSM6242")
+Tested-by: Kars de Jong <jongk@linux-m68k.org>
+Signed-off-by: Kars de Jong <jongk@linux-m68k.org>
+Link: https://lore.kernel.org/r/20191116110548.8562-1-jongk@linux-m68k.org
+Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-msm6242.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/rtc/rtc-msm6242.c
++++ b/drivers/rtc/rtc-msm6242.c
+@@ -132,7 +132,8 @@ static int msm6242_read_time(struct devi
+                     msm6242_read(priv, MSM6242_SECOND1);
+       tm->tm_min  = msm6242_read(priv, MSM6242_MINUTE10) * 10 +
+                     msm6242_read(priv, MSM6242_MINUTE1);
+-      tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10 & 3)) * 10 +
++      tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10) &
++                     MSM6242_HOUR10_HR_MASK) * 10 +
+                     msm6242_read(priv, MSM6242_HOUR1);
+       tm->tm_mday = msm6242_read(priv, MSM6242_DAY10) * 10 +
+                     msm6242_read(priv, MSM6242_DAY1);
diff --git a/queue-4.4/rtlwifi-remove-unnecessary-null-check-in-rtl_regd_init.patch b/queue-4.4/rtlwifi-remove-unnecessary-null-check-in-rtl_regd_init.patch
new file mode 100644 (file)
index 0000000..d34c6c7
--- /dev/null
@@ -0,0 +1,51 @@
+From 091c6e9c083f7ebaff00b37ad13562d51464d175 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <natechancellor@gmail.com>
+Date: Tue, 22 Oct 2019 17:47:03 -0700
+Subject: rtlwifi: Remove unnecessary NULL check in rtl_regd_init
+
+From: Nathan Chancellor <natechancellor@gmail.com>
+
+commit 091c6e9c083f7ebaff00b37ad13562d51464d175 upstream.
+
+When building with Clang + -Wtautological-pointer-compare:
+
+drivers/net/wireless/realtek/rtlwifi/regd.c:389:33: warning: comparison
+of address of 'rtlpriv->regd' equal to a null pointer is always false
+[-Wtautological-pointer-compare]
+        if (wiphy == NULL || &rtlpriv->regd == NULL)
+                              ~~~~~~~~~^~~~    ~~~~
+1 warning generated.
+
+The address of an array member is never NULL unless it is the first
+struct member so remove the unnecessary check. This was addressed in
+the staging version of the driver in commit f986978b32b3 ("Staging:
+rtlwifi: remove unnecessary NULL check").
+
+While we are here, fix the following checkpatch warning:
+
+CHECK: Comparison to NULL could be written "!wiphy"
+35: FILE: drivers/net/wireless/realtek/rtlwifi/regd.c:389:
++       if (wiphy == NULL)
+
+Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
+Link:https://github.com/ClangBuiltLinux/linux/issues/750
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Acked-by: Ping-Ke Shih <pkshih@realtek.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/realtek/rtlwifi/regd.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/realtek/rtlwifi/regd.c
++++ b/drivers/net/wireless/realtek/rtlwifi/regd.c
+@@ -427,7 +427,7 @@ int rtl_regd_init(struct ieee80211_hw *h
+       struct wiphy *wiphy = hw->wiphy;
+       struct country_code_to_enum_rd *country = NULL;
+-      if (wiphy == NULL || &rtlpriv->regd == NULL)
++      if (!wiphy)
+               return -EINVAL;
+       /* init country_code from efuse channel plan */
index 95313169cae396fce6cad95d92787575da75b020..fd38ce33d763ce58d8e660f12366aa7fa5bb19db 100644 (file)
@@ -27,3 +27,10 @@ platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch
 iio-imu-adis16480-assign-bias-value-only-if-operation-succeeded.patch
 mei-fix-modalias-documentation.patch
 clk-samsung-exynos5420-preserve-cpu-clocks-configuration-during-suspend-resume.patch
+compat_ioctl-handle-siocoutqnsd.patch
+tty-serial-imx-use-the-sg-count-from-dma_map_sg.patch
+tty-serial-pch_uart-correct-usage-of-dma_unmap_sg.patch
+media-exynos4-is-fix-recursive-locking-in-isp_video_release.patch
+spi-atmel-fix-handling-of-cs_change-set-on-non-last-xfer.patch
+rtlwifi-remove-unnecessary-null-check-in-rtl_regd_init.patch
+rtc-msm6242-fix-reading-of-10-hour-digit.patch
diff --git a/queue-4.4/spi-atmel-fix-handling-of-cs_change-set-on-non-last-xfer.patch b/queue-4.4/spi-atmel-fix-handling-of-cs_change-set-on-non-last-xfer.patch
new file mode 100644 (file)
index 0000000..8f921a3
--- /dev/null
@@ -0,0 +1,63 @@
+From fed8d8c7a6dc2a76d7764842853d81c770b0788e Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans@mansr.com>
+Date: Fri, 18 Oct 2019 17:35:04 +0200
+Subject: spi: atmel: fix handling of cs_change set on non-last xfer
+
+From: Mans Rullgard <mans@mansr.com>
+
+commit fed8d8c7a6dc2a76d7764842853d81c770b0788e upstream.
+
+The driver does the wrong thing when cs_change is set on a non-last
+xfer in a message.  When cs_change is set, the driver deactivates the
+CS and leaves it off until a later xfer again has cs_change set whereas
+it should be briefly toggling CS off and on again.
+
+This patch brings the behaviour of the driver back in line with the
+documentation and common sense.  The delay of 10 us is the same as is
+used by the default spi_transfer_one_message() function in spi.c.
+[gregory: rebased on for-5.5 from spi tree]
+Fixes: 8090d6d1a415 ("spi: atmel: Refactor spi-atmel to use SPI framework queue")
+Signed-off-by: Mans Rullgard <mans@mansr.com>
+Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
+Link: https://lore.kernel.org/r/20191018153504.4249-1-gregory.clement@bootlin.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-atmel.c |   10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+--- a/drivers/spi/spi-atmel.c
++++ b/drivers/spi/spi-atmel.c
+@@ -315,7 +315,6 @@ struct atmel_spi {
+       struct atmel_spi_dma    dma;
+       bool                    keep_cs;
+-      bool                    cs_active;
+       u32                     fifo_size;
+ };
+@@ -1404,11 +1403,9 @@ static int atmel_spi_one_transfer(struct
+                                &msg->transfers)) {
+                       as->keep_cs = true;
+               } else {
+-                      as->cs_active = !as->cs_active;
+-                      if (as->cs_active)
+-                              cs_activate(as, msg->spi);
+-                      else
+-                              cs_deactivate(as, msg->spi);
++                      cs_deactivate(as, msg->spi);
++                      udelay(10);
++                      cs_activate(as, msg->spi);
+               }
+       }
+@@ -1431,7 +1428,6 @@ static int atmel_spi_transfer_one_messag
+       atmel_spi_lock(as);
+       cs_activate(as, spi);
+-      as->cs_active = true;
+       as->keep_cs = false;
+       msg->status = 0;
diff --git a/queue-4.4/tty-serial-imx-use-the-sg-count-from-dma_map_sg.patch b/queue-4.4/tty-serial-imx-use-the-sg-count-from-dma_map_sg.patch
new file mode 100644 (file)
index 0000000..d7fe6f3
--- /dev/null
@@ -0,0 +1,33 @@
+From 596fd8dffb745afcebc0ec6968e17fe29f02044c Mon Sep 17 00:00:00 2001
+From: Peng Fan <peng.fan@nxp.com>
+Date: Thu, 7 Nov 2019 06:42:53 +0000
+Subject: tty: serial: imx: use the sg count from dma_map_sg
+
+From: Peng Fan <peng.fan@nxp.com>
+
+commit 596fd8dffb745afcebc0ec6968e17fe29f02044c upstream.
+
+The dmaengine_prep_slave_sg needs to use sg count returned
+by dma_map_sg, not use sport->dma_tx_nents, because the return
+value of dma_map_sg is not always same with "nents".
+
+Fixes: b4cdc8f61beb ("serial: imx: add DMA support for imx6q")
+Signed-off-by: Peng Fan <peng.fan@nxp.com>
+Link: https://lore.kernel.org/r/1573108875-26530-1-git-send-email-peng.fan@nxp.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/imx.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/imx.c
++++ b/drivers/tty/serial/imx.c
+@@ -545,7 +545,7 @@ static void imx_dma_tx(struct imx_port *
+               dev_err(dev, "DMA mapping error for TX.\n");
+               return;
+       }
+-      desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents,
++      desc = dmaengine_prep_slave_sg(chan, sgl, ret,
+                                       DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT);
+       if (!desc) {
+               dma_unmap_sg(dev, sgl, sport->dma_tx_nents,
diff --git a/queue-4.4/tty-serial-pch_uart-correct-usage-of-dma_unmap_sg.patch b/queue-4.4/tty-serial-pch_uart-correct-usage-of-dma_unmap_sg.patch
new file mode 100644 (file)
index 0000000..3e70fdb
--- /dev/null
@@ -0,0 +1,65 @@
+From 74887542fdcc92ad06a48c0cca17cdf09fc8aa00 Mon Sep 17 00:00:00 2001
+From: Peng Fan <peng.fan@nxp.com>
+Date: Wed, 13 Nov 2019 05:37:42 +0000
+Subject: tty: serial: pch_uart: correct usage of dma_unmap_sg
+
+From: Peng Fan <peng.fan@nxp.com>
+
+commit 74887542fdcc92ad06a48c0cca17cdf09fc8aa00 upstream.
+
+Per Documentation/DMA-API-HOWTO.txt,
+To unmap a scatterlist, just call:
+       dma_unmap_sg(dev, sglist, nents, direction);
+
+.. note::
+
+       The 'nents' argument to the dma_unmap_sg call must be
+       the _same_ one you passed into the dma_map_sg call,
+       it should _NOT_ be the 'count' value _returned_ from the
+       dma_map_sg call.
+
+However in the driver, priv->nent is directly assigned with value
+returned from dma_map_sg, and dma_unmap_sg use priv->nent for unmap,
+this breaks the API usage.
+
+So introduce a new entry orig_nent to remember 'nents'.
+
+Fixes: da3564ee027e ("pch_uart: add multi-scatter processing")
+Signed-off-by: Peng Fan <peng.fan@nxp.com>
+Link: https://lore.kernel.org/r/1573623259-6339-1-git-send-email-peng.fan@nxp.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/pch_uart.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/pch_uart.c
++++ b/drivers/tty/serial/pch_uart.c
+@@ -251,6 +251,7 @@ struct eg20t_port {
+       struct dma_chan                 *chan_rx;
+       struct scatterlist              *sg_tx_p;
+       int                             nent;
++      int                             orig_nent;
+       struct scatterlist              sg_rx;
+       int                             tx_dma_use;
+       void                            *rx_buf_virt;
+@@ -804,9 +805,10 @@ static void pch_dma_tx_complete(void *ar
+       }
+       xmit->tail &= UART_XMIT_SIZE - 1;
+       async_tx_ack(priv->desc_tx);
+-      dma_unmap_sg(port->dev, sg, priv->nent, DMA_TO_DEVICE);
++      dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE);
+       priv->tx_dma_use = 0;
+       priv->nent = 0;
++      priv->orig_nent = 0;
+       kfree(priv->sg_tx_p);
+       pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT);
+ }
+@@ -1031,6 +1033,7 @@ static unsigned int dma_handle_tx(struct
+               dev_err(priv->port.dev, "%s:dma_map_sg Failed\n", __func__);
+               return 0;
+       }
++      priv->orig_nent = num;
+       priv->nent = nent;
+       for (i = 0; i < nent; i++, sg++) {