1
linux/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 [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
8250_accent.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_acorn.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
8250_acpi.c [ACPI] 8250 driver now checks for acpi_register_gsi() errors 2005-08-04 22:22:18 -04:00
8250_au1x00.c [SERIAL] Support Au1x00 8250 UARTs using the generic 8250 driver. 2005-11-06 09:07:03 +00:00
8250_boca.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_early.c [SERIAL] 8250_early.c passing 0 instead of NULL 2005-11-03 21:07:37 +00:00
8250_fourport.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_gsc.c [PARISC] Fix mux.c driver 2005-10-21 22:58:03 -04:00
8250_hp300.c [PATCH] Serial: Convert 8250_hp300 to use serial8250_{un,}register_port 2005-04-26 15:37:45 +01:00
8250_hub6.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_mca.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
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
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
21285.c [ARM] 2907/1: GCC 4 serial driver compile fixes 2005-09-14 22:36:03 +01:00
68328serial.c [PATCH] move pm_register/etc. to CONFIG_PM_LEGACY, pm_legacy.h 2005-11-13 18:14:10 -08:00
68328serial.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
68360serial.c [PATCH] move 68360serial.c over use initcalls 2005-09-07 16:57:24 -07: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 [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
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 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dz.c [SERIAL] dz: Use CKSEG1ADDR to setup mappings. 2005-11-12 22:00:27 +00:00
dz.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
icom.c [PATCH] Remove non-arch consumers of asm/segment.h 2005-09-07 16:57:34 -07:00
icom.h [PATCH] serial/icom: Remove custom msescs_to_jiffies() macro 2005-06-25 16:25:01 -07:00
imx.c [SERIAL] imx: Fix missed platform_driver_unregister 2005-11-21 17:05:21 +00:00
ioc4_serial.c [PATCH] ioc4 serial support - mostly cleanup 2005-10-30 17:37:24 -08:00
ip22zilog.c [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
ip22zilog.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig [SPARC]: introduce a SPARC Kconfig symbol 2005-12-22 23:09:54 -08:00
m32r_sio_reg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
m32r_sio.c [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
m32r_sio.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [SERIAL] Support Au1x00 8250 UARTs using the generic 8250 driver. 2005-11-06 09:07:03 +00:00
mcfserial.c [PATCH] m68knommu: add 5208 ColdFire UART support to ColdFire serial driver 2005-11-07 08:00:46 -08:00
mcfserial.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 [PATCH] ppc annotations: mpsc 2005-04-25 18:32:12 -07:00
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 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 [ARM] 2907/1: GCC 4 serial driver compile fixes 2005-09-14 22:36:03 +01:00
serial_txx9.c [PATCH] txx9 serial update 2005-09-09 13:57:27 -07:00
sh-sci.c [PATCH] sh-sci.c sci_start_tx error 2005-10-14 17:10:13 -07:00
sh-sci.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sn_console.c [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
suncore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
suncore.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sunsab.c [SPARC64]: Fix oops on runlevel change with serial console. 2005-10-10 20:43:22 -07:00
sunsab.h [SUNSAB]: Defer register updates until transmitter is idle. 2005-05-11 11:34:32 -07:00
sunsu.c [SUNSU]: Do not mark sunsu_console_setup() __init 2005-11-07 14:10:21 -08:00
sunzilog.c [SPARC64]: Fix oops on runlevel change with serial console. 2005-10-10 20:43:22 -07:00
sunzilog.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
uart00.c [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
v850e_uart.c [SERIAL] Clean up and fix tty transmission start/stoping 2005-08-31 10:12:14 +01:00
vr41xx_siu.c [DRIVER MODEL] Convert platform drivers to use struct platform_driver 2005-11-09 22:32:44 +00:00