linux-stable-rt/drivers/serial
Aristeu Sergio Rozanski Filho 03929c76f3 [PATCH] ppc32: cpm_uart: fix xchar sending
while using SCC as uart and as serial console at same time I got this:

[  138.214258] Oops: kernel access of bad area, sig: 11 [#1]
[  138.218832] PREEMPT
[  138.221021] NIP: C0105C48 LR: C0105E60 SP: C03D5D10 REGS: c03d5c60 TRAP: 0300    Not tainted
[  138.229280] MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
[  138.234713] DAR: 00000000, DSISR: C0000000
[  138.238745] TASK = c0349420[693] 'sh' THREAD: c03d4000
[  138.243754] Last syscall: 6
[  138.246402] GPR00: FEFFFFFF C03D5D10 C0349420 C01FB094 00000011 00000000 C1ECFBBC C01F24B0
[  138.254602] GPR08: FF002820 00000000 FF0028C0 00000000 19133615 A0CBCD5E 02000300 00000000
[  138.262804] GPR16: 00000000 01FF9E4C 00000000 7FA9A770 00000000 00000000 1003E2A8 00000000
[  138.271003] GPR24: 100562F4 7F9B6EF4 C0210000 C02A5338 C01FB094 00000000 C01FB094 C1F14574
[  138.279376] NIP [c0105c48] cpm_uart_tx_pump+0x4c/0x22c
[  138.284419] LR [c0105e60] cpm_uart_start_tx+0x38/0xb0
[  138.289361] Call trace:
[  138.291762]  [c0105e60] cpm_uart_start_tx+0x38/0xb0
[  138.296547]  [c010277c] uart_send_xchar+0x88/0x118
[  138.301244]  [c01029a0] uart_unthrottle+0x6c/0x138
[  138.305942]  [c00ece10] check_unthrottle+0x60/0x64
[  138.310641]  [c00ecec4] reset_buffer_flags+0xb0/0x138
[  138.315595]  [c00ecf64] n_tty_flush_buffer+0x18/0x78
[  138.320465]  [c00e81b0] tty_ldisc_flush+0x64/0x7c
[  138.325078]  [c010410c] uart_close+0xf0/0x2c8
[  138.329348]  [c00e9c48] release_dev+0x724/0x8d4
[  138.333790]  [c00e9e18] tty_release+0x20/0x3c
[  138.338061]  [c006e544] __fput+0x178/0x1e0
[  138.342076]  [c006c43c] filp_close+0x54/0xac
[  138.346261]  [c0002d90] ret_from_syscall+0x0/0x44
[  138.352386] note: sh[693] exited with preempt_count 2

a easy way to reproduce it is log into the system using ssh and do:
	cat >/dev/ttyCPM0
then, switch to minicom and write some stuff on it back to ssh, a control C
produce the oops

this happens because uart_close calls uart_shutdown which frees xmit.buf,
currently used by xchar sending in cpm_uart_tx_pump(), which seems wrong.

the attached patch fixes the oops and also fixes xchar sending.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:44:26 +11:00
..
cpm_uart [PATCH] ppc32: cpm_uart: fix xchar sending 2006-01-09 15:44:26 +11:00
jsm
8250.c [SERIAL] Remove _INLINE_ 2006-01-04 19:43:24 +00:00
8250.h [SERIAL] Remove _INLINE_ 2006-01-04 19:43:24 +00:00
8250_accent.c
8250_acorn.c
8250_acpi.c
8250_au1x00.c [SERIAL] Support Au1x00 8250 UARTs using the generic 8250 driver. 2005-11-06 09:07:03 +00:00
8250_boca.c
8250_early.c [SERIAL] 8250_early.c passing 0 instead of NULL 2005-11-03 21:07:37 +00:00
8250_fourport.c
8250_gsc.c
8250_hp300.c
8250_hub6.c
8250_mca.c
8250_pci.c [SERIAL] 8520_pci: build fix 2006-01-05 10:55:26 +00:00
8250_pnp.c [SERIAL] Claim Wacom tablet device on HP tc1100 tablet 2005-11-12 22:06:31 +00:00
21285.c
68328serial.c [PATCH] move pm_register/etc. to CONFIG_PM_LEGACY, pm_legacy.h 2005-11-13 18:14:10 -08:00
68328serial.h
68360serial.c
Kconfig [SPARC]: introduce a SPARC Kconfig symbol 2005-12-22 23:09:54 -08:00
Makefile [SERIAL] Support Au1x00 8250 UARTs using the generic 8250 driver. 2005-11-06 09:07:03 +00:00
amba-pl010.c [ARM] Move AMBA include files to include/linux/amba/ 2006-01-07 13:52:45 +00:00
amba-pl011.c [ARM] Move asm/hardware/clock.h to linux/clk.h 2006-01-07 16:15:52 +00:00
au1x00_uart.c
clps711x.c [PATCH] ARM: Reverted 2918/1: [update] Base port of Comdial MP1000 platfrom 2005-11-04 17:28:34 +00:00
crisv10.c [PATCH] serial: fix-up schedule_timeout() usage 2005-11-07 07:53:59 -08:00
crisv10.h
dz.c [SERIAL] dz: Use CKSEG1ADDR to setup mappings. 2005-11-12 22:00:27 +00:00
dz.h
icom.c
icom.h
imx.c [SERIAL] imx: Fix missed platform_driver_unregister 2005-11-21 17:05:21 +00:00
ioc4_serial.c
ip22zilog.c
ip22zilog.h
m32r_sio.c
m32r_sio.h
m32r_sio_reg.h
mcfserial.c [PATCH] m68knommu: add 5208 ColdFire UART support to ColdFire serial driver 2005-11-07 08:00:46 -08:00
mcfserial.h
mpc52xx_uart.c [PATCH] ppc32/serial: Change mpc52xx_uart.c to use the Low Density Serial port major 2006-01-06 08:33:30 -08:00
mpsc.c [DRIVER MODEL] Convert platform drivers to use struct platform_driver 2005-11-09 22:32:44 +00:00
mpsc.h
mux.c [PARISC] Define port->timeout to fix a long msleep in mux.c 2005-11-17 16:38:28 -05:00
pmac_zilog.c [PATCH] powerpc: Remove device_node addrs/n_addr 2006-01-09 14:53:55 +11:00
pmac_zilog.h
pxa.c [ARM] 3216/1: indent and typo in drivers/serial/pxa.c 2005-12-30 15:57:35 +00:00
s3c2410.c [ARM] Move asm/hardware/clock.h to linux/clk.h 2006-01-07 16:15:52 +00:00
sa1100.c [SERIAL] Remove unused variable in sa1100.c 2005-11-19 11:26:17 +00:00
serial_core.c [SERIAL] Fix matching of MMIO ports 2006-01-04 18:09:44 +00:00
serial_cs.c [PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback 2006-01-06 00:03:24 +01:00
serial_lh7a40x.c
serial_txx9.c
sh-sci.c
sh-sci.h
sn_console.c
suncore.c
suncore.h
sunsab.c
sunsab.h
sunsu.c [SUNSU]: Do not mark sunsu_console_setup() __init 2005-11-07 14:10:21 -08:00
sunzilog.c
sunzilog.h
uart00.c
v850e_uart.c
vr41xx_siu.c [DRIVER MODEL] Convert platform drivers to use struct platform_driver 2005-11-09 22:32:44 +00:00