* [BACKPORT 4.14.y 0/8] Candidates from Spreadtrum 4.14 product kernel
@ 2019-09-03 6:53 Baolin Wang
2019-09-03 7:01 ` [BACKPORT 4.14.y 8/8] serial: sprd: Modify the baud rate calculation formula Baolin Wang
0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2019-09-03 6:53 UTC (permalink / raw)
To: stable, chris, airlied, davem, kuznet, yoshfuji, edumazet, peterz,
mingo, vyasevich, nhorman, linus.walleij, natechancellor, sre,
paulus, gregkh
Cc: intel-gfx, dri-devel, netdev, longman, hariprasad.kelam,
linux-sctp, linux-gpio, david, linux-pm, ebiggers, linux-ppp,
lanqing.liu, linux-serial, arnd, baolin.wang, orsonzhai,
vincent.guittot, linux-kernel
With Arnd's script [1] help, I found some bugfixes in Spreadtrum 4.14 product
kernel, but missing in v4.14.141:
86fda90ab588 net: sctp: fix warning "NULL check before some freeing functions is not needed"
25a09ce79639 ppp: mppe: Revert "ppp: mppe: Add softdep to arc4"
d9b308b1f8a1 drm/i915/fbdev: Actually configure untiled displays
47d3d7fdb10a ip6: fix skb leak in ip6frag_expire_frag_queue()
5b9cea15a3de serial: sprd: Modify the baud rate calculation formula
513e1073d52e locking/lockdep: Add debug_locks check in __lock_downgrade()
957063c92473 pinctrl: sprd: Use define directive for sprd_pinconf_params values
87a2b65fc855 power: supply: sysfs: ratelimit property read error message
[1] https://lore.kernel.org/lkml/20190322154425.3852517-19-arnd@arndb.de/T/
Chris Wilson (1):
drm/i915/fbdev: Actually configure untiled displays
David Lechner (1):
power: supply: sysfs: ratelimit property read error message
Eric Biggers (1):
ppp: mppe: Revert "ppp: mppe: Add softdep to arc4"
Eric Dumazet (1):
ip6: fix skb leak in ip6frag_expire_frag_queue()
Hariprasad Kelam (1):
net: sctp: fix warning "NULL check before some freeing functions is
not needed"
Lanqing Liu (1):
serial: sprd: Modify the baud rate calculation formula
Nathan Chancellor (1):
pinctrl: sprd: Use define directive for sprd_pinconf_params values
Waiman Long (1):
locking/lockdep: Add debug_locks check in __lock_downgrade()
drivers/gpu/drm/i915/intel_fbdev.c | 12 +++++++-----
drivers/net/ppp/ppp_mppe.c | 1 -
drivers/pinctrl/sprd/pinctrl-sprd.c | 6 ++----
drivers/power/supply/power_supply_sysfs.c | 3 ++-
drivers/tty/serial/sprd_serial.c | 2 +-
include/net/ipv6_frag.h | 1 -
kernel/locking/lockdep.c | 3 +++
net/sctp/sm_make_chunk.c | 12 ++++--------
8 files changed, 19 insertions(+), 21 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [BACKPORT 4.14.y 8/8] serial: sprd: Modify the baud rate calculation formula
2019-09-03 6:53 [BACKPORT 4.14.y 0/8] Candidates from Spreadtrum 4.14 product kernel Baolin Wang
@ 2019-09-03 7:01 ` Baolin Wang
0 siblings, 0 replies; 2+ messages in thread
From: Baolin Wang @ 2019-09-03 7:01 UTC (permalink / raw)
To: stable, gregkh
Cc: lanqing.liu, linux-serial, arnd, baolin.wang, orsonzhai,
vincent.guittot, linux-kernel
From: Lanqing Liu <lanqing.liu@unisoc.com>
When the source clock is not divisible by the expected baud rate and
the remainder is not less than half of the expected baud rate, the old
formular will round up the frequency division coefficient. This will
make the actual baud rate less than the expected value and can not meet
the external transmission requirements.
Thus this patch modifies the baud rate calculation formula to support
the serial controller output the maximum baud rate.
Signed-off-by: Lanqing Liu <lanqing.liu@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/tty/serial/sprd_serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index e902494..72e96ab8 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -380,7 +380,7 @@ static void sprd_set_termios(struct uart_port *port,
/* ask the core to calculate the divisor for us */
baud = uart_get_baud_rate(port, termios, old, 0, SPRD_BAUD_IO_LIMIT);
- quot = (unsigned int)((port->uartclk + baud / 2) / baud);
+ quot = port->uartclk / baud;
/* set data length */
switch (termios->c_cflag & CSIZE) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-03 7:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-03 6:53 [BACKPORT 4.14.y 0/8] Candidates from Spreadtrum 4.14 product kernel Baolin Wang
2019-09-03 7:01 ` [BACKPORT 4.14.y 8/8] serial: sprd: Modify the baud rate calculation formula Baolin Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).