From: Greg Kroah-Hartman Date: Thu, 4 Oct 2018 18:13:49 +0000 (-0700) Subject: 4.9-stable patches X-Git-Tag: v4.4.160~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab2dc2962d75eb966e5602af4d2dfba98eab7856;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch time-introduce-jiffies64_to_nsecs.patch --- 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 index 00000000000..9325e40ce74 --- /dev/null +++ b/queue-4.9/serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch @@ -0,0 +1,40 @@ +From e0bf2d4982fe7d9ddaf550dd023803ea286f47fc Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Sun, 26 Aug 2018 19:49:32 +0200 +Subject: serial: mvebu-uart: Fix reporting of effective CSIZE to userspace + +From: Jan Kiszka + +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 +Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") +Cc: stable # 4.6+ +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..42e46a55c14 --- /dev/null +++ b/queue-4.9/time-introduce-jiffies64_to_nsecs.patch @@ -0,0 +1,79 @@ +From 07e5f5e353aaa61696c8353d87050994a0c4648a Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Tue, 31 Jan 2017 04:09:17 +0100 +Subject: time: Introduce jiffies64_to_nsecs() + +From: Frederic Weisbecker + +commit 07e5f5e353aaa61696c8353d87050994a0c4648a upstream. + +This will be needed for the cputime_t to nsec conversion. + +Signed-off-by: Frederic Weisbecker +Cc: Benjamin Herrenschmidt +Cc: Paul Mackerras +Cc: Michael Ellerman +Cc: Heiko Carstens +Cc: Martin Schwidefsky +Cc: Tony Luck +Cc: Fenghua Yu +Cc: Peter Zijlstra +Cc: Rik van Riel +Cc: Stanislaw Gruszka +Cc: Wanpeng Li +Link: http://lkml.kernel.org/r/1485832191-26889-2-git-send-email-fweisbec@gmail.com +Signed-off-by: Ingo Molnar +Signed-off-by: Ivan Delalande +Signed-off-by: Greg Kroah-Hartman + +--- + 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"