linux_dsm_epyc7002/drivers/tty/serial
Geert Uytterhoeven ff1cab374a serial: sh-sci: Remove cpufreq notifier to fix crash/deadlock
The BSP team noticed that there is spin/mutex lock issue on sh-sci when
CPUFREQ is used.  The issue is that the notifier function may call
mutex_lock() while the spinlock is held, which can lead to a BUG().
This may happen if CPUFREQ is changed while another CPU calls
clk_get_rate().

Taking the spinlock was added to the notifier function in commit
e552de2413 ("sh-sci: add platform device private data"), to
protect the list of serial ports against modification during traversal.
At that time the Common Clock Framework didn't exist yet, and
clk_get_rate() just returned clk->rate without taking a mutex.
Note that since commit d535a2305f ("serial: sh-sci: Require a
device per port mapping."), there's no longer a list of serial ports to
traverse, and taking the spinlock became superfluous.

To fix the issue, just remove the cpufreq notifier:
  1. The notifier doesn't work correctly: all it does is update stored
     clock rates; it does not update the divider in the hardware.
     The divider will only be updated when calling sci_set_termios().
     I believe this was broken back in 2004, when the old
     drivers/char/sh-sci.c driver (where the notifier did update the
     divider) was replaced by drivers/serial/sh-sci.c (where the
     notifier just updated port->uartclk).
     Cfr. full-history-linux commits 6f8deaef2e9675d9 ("[PATCH] sh: port
     sh-sci driver to the new API") and 3f73fe878dc9210a ("[PATCH]
     Remove old sh-sci driver").
  2. On modern SoCs, the sh-sci parent clock rate is no longer related
     to the CPU clock rate anyway, so using a cpufreq notifier is
     futile.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-07 21:08:05 -08:00
..
8250 serial: 8250: of: Fix the driver and actually compile the 8250_of 2016-01-07 14:45:53 -08:00
cpm_uart tty: serial: cpm_uart: Fix module autoload for OF platform driver 2015-10-04 19:09:21 +01:00
jsm serial/jsm: Deinline neo_parse_isr, save 688 bytes 2015-12-13 19:59:48 -08:00
21285.c
68328serial.c drivers: tty: 68328serial.c: Remove parentheses after return 2015-12-13 19:59:48 -08:00
altera_jtaguart.c
altera_uart.c serial: altera_uart: Use of_property_read_u32 instead of open-coding it 2015-10-04 17:47:49 +01:00
amba-pl010.c
amba-pl011.c tty: amba-pl011: use iotype instead of access_32b to track 32-bit I/O 2016-01-06 21:02:45 -08:00
amba-pl011.h tty: amba-pl011: clean up LCR register offsets 2015-12-13 19:59:48 -08:00
apbuart.c tty: serial: apbuart: Fix module autoload for OF platform driver 2015-10-04 19:09:21 +01:00
apbuart.h
ar933x_uart.c
arc_uart.c
atmel_serial.c drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular 2015-12-13 19:59:48 -08:00
bcm63xx_uart.c serial/bcm63xx_uart: Deinline wait_for_xmitr, save 374 bytes 2015-12-13 19:59:48 -08:00
bfin_sport_uart.c
bfin_sport_uart.h
bfin_uart.c serial:bfin-uart:Remove 'struct timeval' 2015-12-13 19:59:48 -08:00
clps711x.c serial: mctrl-gpio: rename init function 2015-10-04 18:46:43 +01:00
crisv10.c tty: Remove tty_port::close_wait 2015-10-17 21:11:29 -07:00
crisv10.h
digicolor-usart.c
dz.c
dz.h
earlycon-arm-semihost.c
earlycon.c Merge 4.4-rc6 into tty-next 2015-12-21 11:06:07 -08:00
efm32-uart.c
etraxfs-uart.c serial: etraxfs-uart: Fix crash 2015-11-20 16:19:54 -08:00
fsl_lpuart.c serial: fsl_lpuart: add earlycon support 2015-10-17 21:18:30 -07:00
icom.c tty: Remove unused SERIAL_DO_RESTART define 2015-12-13 19:59:48 -08:00
icom.h
ifx6x60.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
ifx6x60.h
imx.c serial: imx: implement handshaking using gpios with the mctrl_gpio helper 2015-12-13 20:01:47 -08:00
ioc3_serial.c
ioc4_serial.c
ip22zilog.c
ip22zilog.h
Kconfig serial: imx: implement handshaking using gpios with the mctrl_gpio helper 2015-12-13 20:01:47 -08:00
kgdb_nmi.c
kgdboc.c
lantiq.c drivers/tty: make serial/lantic.c driver explicitly non-modular 2015-07-23 18:27:41 -07:00
lpc32xx_hs.c tty: serial: lpc32xx_hs: fix handling platform_get_irq result 2015-10-04 19:09:21 +01:00
m32r_sio_reg.h
m32r_sio.c serial/m32r_sio: Deinline wait_for_xmitr, save 165 bytes 2015-12-13 19:59:48 -08:00
m32r_sio.h
Makefile serial: 8250: move of_serial code to 8250 directory 2015-12-13 19:59:48 -08:00
max310x.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
max3100.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
mcf.c
men_z135_uart.c serial/men_z135_uart: Deinline men_z135_reg_clr, save 176 bytes 2015-12-13 19:59:48 -08:00
meson_uart.c ARM: meson: serial: check for tx-irq enabled in irq code 2015-12-13 19:59:48 -08:00
mpc52xx_uart.c serial: mpc52xx: add delay after resetting transmitter to fix broken chars 2015-10-04 17:27:56 +01:00
mpsc.c tty: disable unbind for old 74xx based serial/mpsc console port 2015-10-17 21:18:30 -07:00
msm_serial.c tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation 2015-10-04 19:15:17 +01:00
msm_serial.h tty: serial: msm: Add RX DMA support 2015-10-04 19:15:17 +01:00
mux.c parisc: serial/mux: Convert to uart_console_device instead of open-coded 2015-10-22 15:44:28 +02:00
mxs-auart.c serial: mctrl-gpio: rename init function 2015-10-04 18:46:43 +01:00
netx-serial.c
omap-serial.c serial/omap-serial: Deinline wait_for_xmitr, save 165 bytes 2015-12-13 19:59:48 -08:00
pch_uart.c
pmac_zilog.c
pmac_zilog.h
pnx8xxx_uart.c
pxa.c serial/pxa: Deinline wait_for_xmitr, save 165 bytes 2015-12-13 19:59:48 -08:00
rp2.c
sa1100.c
samsung.c serial: samsung: Fix UART status handling in DMA mode 2015-10-04 17:44:52 +01:00
samsung.h serial: samsung: fix DMA mode enter condition for small FIFO sizes 2015-08-04 22:07:23 -07:00
sb1250-duart.c
sc16is7xx.c sc16is7xx: Fix TX buffer overrun caused by wrong tx fifo level read-out 2015-12-13 19:59:48 -08:00
sccnxp.c
serial_core.c serial: support 16-bit register interface for console 2015-12-13 19:59:48 -08:00
serial_ks8695.c tty/serial: kill off set_irq_flags usage 2015-06-09 12:26:32 -07:00
serial_mctrl_gpio.c serial: mctrl_gpio: export mctrl_gpio_disable_ms and mctrl_gpio_init 2015-12-13 20:01:47 -08:00
serial_mctrl_gpio.h serial: fix mctrl helper functions 2015-10-17 21:21:07 -07:00
serial_txx9.c
serial-tegra.c serial: tegra: Add helper function for handling RX buffer 2015-10-17 21:07:57 -07:00
sh-sci.c serial: sh-sci: Remove cpufreq notifier to fix crash/deadlock 2016-01-07 21:08:05 -08:00
sh-sci.h serial: sh-sci: Add BRG register definitions 2015-12-17 11:18:44 +01:00
sirfsoc_uart.c serial: sirf: let uart's receive start in right place 2015-07-23 15:32:04 -07:00
sirfsoc_uart.h serial: sirf: let uart's receive start in right place 2015-07-23 15:32:04 -07:00
sn_console.c drivers/tty: make serial/sn_console.c driver explicitly non-modular 2015-07-23 18:27:41 -07:00
sprd_serial.c serial/sprd_serial: Deinline wait_for_xmitr, save 165 bytes 2015-12-13 19:59:48 -08:00
st-asc.c tty/serial: st-asc: drop the use of IRQF_NO_SUSPEND 2015-10-04 19:11:05 +01:00
stm32-usart.c tty/serial: st-asc: drop the use of IRQF_NO_SUSPEND 2015-10-04 19:11:05 +01:00
suncore.c drivers/tty: make serial/suncore.c driver explicitly non-modular 2015-07-23 18:27:41 -07:00
sunhv.c drivers/tty: make serial/sunhv.c driver explicitly non-modular 2015-07-23 18:27:41 -07:00
sunsab.c
sunsab.h
sunsu.c serial/sunsu: Deinline wait_for_xmitr, save 165 bytes 2015-12-13 19:59:48 -08:00
sunzilog.c
sunzilog.h
tilegx.c
timbuart.c
timbuart.h
uartlite.c
ucc_uart.c serial/uuc_uart: Support higher bitrates than 115200 Bit/s 2015-07-23 18:05:00 -07:00
vr41xx_siu.c
vt8500_serial.c serial/vt8500_serial: Deinline wait_for_xmitr, save 165 bytes 2015-12-13 19:59:48 -08:00
xilinx_uartps.c
zs.c
zs.h