]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 18:13:49 +0000 (11:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 18:13:49 +0000 (11:13 -0700)
added patches:
serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch
time-introduce-jiffies64_to_nsecs.patch

queue-4.9/serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch [new file with mode: 0644]
queue-4.9/time-introduce-jiffies64_to_nsecs.patch [new file with mode: 0644]

diff --git a/queue-4.9/serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch b/queue-4.9/serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch
new file mode 100644 (file)
index 0000000..9325e40
--- /dev/null
@@ -0,0 +1,40 @@
+From e0bf2d4982fe7d9ddaf550dd023803ea286f47fc Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <jan.kiszka@siemens.com>
+Date: Sun, 26 Aug 2018 19:49:32 +0200
+Subject: serial: mvebu-uart: Fix reporting of effective CSIZE to userspace
+
+From: Jan Kiszka <jan.kiszka@siemens.com>
+
+commit e0bf2d4982fe7d9ddaf550dd023803ea286f47fc upstream.
+
+Apparently, this driver (or the hardware) does not support character
+length settings. It's apparently running in 8-bit mode, but it makes
+userspace believe it's in 5-bit mode. That makes tcsetattr with CS8
+incorrectly fail, breaking e.g. getty from busybox, thus the login shell
+on ttyMVx.
+
+Fix by hard-wiring CS8 into c_cflag.
+
+Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port")
+Cc: stable <stable@vger.kernel.org> # 4.6+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/mvebu-uart.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/mvebu-uart.c
++++ b/drivers/tty/serial/mvebu-uart.c
+@@ -327,8 +327,10 @@ static void mvebu_uart_set_termios(struc
+       if ((termios->c_cflag & CREAD) == 0)
+               port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR;
+-      if (old)
++      if (old) {
+               tty_termios_copy_hw(termios, old);
++              termios->c_cflag |= CS8;
++      }
+       baud = uart_get_baud_rate(port, termios, old, 0, 460800);
+       uart_update_timeout(port, termios->c_cflag, baud);
diff --git a/queue-4.9/time-introduce-jiffies64_to_nsecs.patch b/queue-4.9/time-introduce-jiffies64_to_nsecs.patch
new file mode 100644 (file)
index 0000000..42e46a5
--- /dev/null
@@ -0,0 +1,79 @@
+From 07e5f5e353aaa61696c8353d87050994a0c4648a Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Tue, 31 Jan 2017 04:09:17 +0100
+Subject: time: Introduce jiffies64_to_nsecs()
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 07e5f5e353aaa61696c8353d87050994a0c4648a upstream.
+
+This will be needed for the cputime_t to nsec conversion.
+
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Paul Mackerras <paulus@samba.org>
+Cc: Michael Ellerman <mpe@ellerman.id.au>
+Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Tony Luck <tony.luck@intel.com>
+Cc: Fenghua Yu <fenghua.yu@intel.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Rik van Riel <riel@redhat.com>
+Cc: Stanislaw Gruszka <sgruszka@redhat.com>
+Cc: Wanpeng Li <wanpeng.li@hotmail.com>
+Link: http://lkml.kernel.org/r/1485832191-26889-2-git-send-email-fweisbec@gmail.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Ivan Delalande <colona@arista.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/jiffies.h  |    2 ++
+ kernel/time/time.c       |   10 ++++++++++
+ kernel/time/timeconst.bc |    6 ++++++
+ 3 files changed, 18 insertions(+)
+
+--- a/include/linux/jiffies.h
++++ b/include/linux/jiffies.h
+@@ -292,6 +292,8 @@ static inline u64 jiffies_to_nsecs(const
+       return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;
+ }
++extern u64 jiffies64_to_nsecs(u64 j);
++
+ extern unsigned long __msecs_to_jiffies(const unsigned int m);
+ #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
+ /*
+--- a/kernel/time/time.c
++++ b/kernel/time/time.c
+@@ -704,6 +704,16 @@ u64 nsec_to_clock_t(u64 x)
+ #endif
+ }
++u64 jiffies64_to_nsecs(u64 j)
++{
++#if !(NSEC_PER_SEC % HZ)
++      return (NSEC_PER_SEC / HZ) * j;
++# else
++      return div_u64(j * HZ_TO_NSEC_NUM, HZ_TO_NSEC_DEN);
++#endif
++}
++EXPORT_SYMBOL(jiffies64_to_nsecs);
++
+ /**
+  * nsecs_to_jiffies64 - Convert nsecs in u64 to jiffies64
+  *
+--- a/kernel/time/timeconst.bc
++++ b/kernel/time/timeconst.bc
+@@ -98,6 +98,12 @@ define timeconst(hz) {
+               print "#define HZ_TO_USEC_DEN\t\t", hz/cd, "\n"
+               print "#define USEC_TO_HZ_NUM\t\t", hz/cd, "\n"
+               print "#define USEC_TO_HZ_DEN\t\t", 1000000/cd, "\n"
++
++              cd=gcd(hz,1000000000)
++              print "#define HZ_TO_NSEC_NUM\t\t", 1000000000/cd, "\n"
++              print "#define HZ_TO_NSEC_DEN\t\t", hz/cd, "\n"
++              print "#define NSEC_TO_HZ_NUM\t\t", hz/cd, "\n"
++              print "#define NSEC_TO_HZ_DEN\t\t", 1000000000/cd, "\n"
+               print "\n"
+               print "#endif /* KERNEL_TIMECONST_H */\n"