- Nov 11, 2010
-
-
Sonic Zhang authored
The port lock exists to protect these resources, so we need to grab it before making changes. Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Sonic Zhang authored
If we are using early serial, don't let the normal console rewind the log buffer, since that causes things to be printed multiple times. Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Sonic Zhang authored
We don't need to force a SSYNC here as the LSR register will already be updated by the time we get back to reading it. This speeds up TX throughput and lowers general system overhead (since SSYNC is system wide, not peripheral-specific). Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Sonic Zhang authored
On Blackfin systems, peripherals that have optional DMA support always route their interrupts through the corresponding DMA channel -- even when DMA is not being used. So in PIO mode, we still need to request the DMA channel (so interrupts are delivered) which means we need to always include the DMA header for the DMA defines/functions. Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Lawrence Rust authored
Calling tcsetattr prevents any thread(s) currently suspended in ioctl TIOCMIWAIT for the same device from ever resuming. If a thread is suspended inside a call to ioctl TIOCMIWAIT, waiting for a modem status change, then the 8250 driver enables modem status interrupts (MSI). The device interrupt service routine resumes the suspended thread(s) on the next MSI. If while the thread(s) are suspended, another thread calls tcsetattr then the 8250 driver disables MSI (unless CTS/RTS handshaking is enabled) thus preventing the suspended thread(s) from ever being resumed. This patch only disables MSI in tcsetattr handling if there are no suspended threads. Program to demonstrate bug & fix: /* gcc miwait.c -o miwait -l pthread */ #include <stdio.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include <pthread.h> #include <termios.h> #include <sys/ioctl.h> #include <linux/serial.h> static void* monitor( void* pv); static int s_fd; int main( void) { const char kszDev[] = "/dev/ttyS0"; pthread_t t; struct termios tio; s_fd = open( kszDev, O_RDWR | O_NONBLOCK); if ( s_fd < 0) return fprintf( stderr, "Error(%d) opening %s: %s\n", errno, kszDev, strerror( errno)), 1; pthread_create( &t, NULL, &monitor, NULL); /* Modem status changes seen here */ puts( "Main: awaiting status changes"); sleep( 5); tcgetattr( s_fd, &tio); tio.c_cflag ^= CSTOPB; /* But not after here */ puts( "Main: tcsetattr called"); tcsetattr( s_fd, TCSANOW, &tio); for (;;) sleep( 1); } static void* monitor( void* pv) { (void)pv; for(;;) { unsigned uModem; struct serial_icounter_struct cnt; if ( ioctl( s_fd, TIOCMGET, &uModem) < 0) fprintf( stderr, "Error(%d) in TIOCMGET: %s\n", errno, strerror( errno)); printf( "Modem status:%s%s%s%s%s%s\n", (uModem & TIOCM_RTS) ? " RTS" : "", (uModem & TIOCM_DTR) ? " DTR" : "", (uModem & TIOCM_CTS) ? " CTS" : "", (uModem & TIOCM_DSR) ? " DSR" : "", (uModem & TIOCM_CD) ? " CD" : "", (uModem & TIOCM_RI) ? " RI" : "" ); if ( ioctl( s_fd, TIOCGICOUNT, &cnt) < 0) fprintf( stderr, "Error(%d) in TIOCGICOUNT: %s\n", errno, strerror( errno)); printf( "Irqs: CTS:%d DSR:%d RNG:%d DCD:%d Rx:%d Tx:%d Frame:%d Orun:%d Par:%d Brk:%d Oflow:%d\n", cnt.cts, cnt.dsr, cnt.rng, cnt.dcd, cnt.rx, cnt.tx, cnt.frame, cnt.overrun, cnt.parity, cnt.brk, cnt.buf_overrun ); fputs( "Waiting...", stdout), fflush( stdout); if ( 0 > ioctl( s_fd, TIOCMIWAIT, (unsigned long)(TIOCM_CAR | TIOCM_RNG | TIOCM_DSR | TIOCM_CTS))) fprintf( stderr, "\nError(%d) in TIOCMIWAIT: %s\n", errno, strerror( errno)); fputs( "\n", stdout); } return NULL; } Signed-off by Lawrence Rust <lawrence@softsystem.co.uk> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Nov 09, 2010
-
-
Maciej Szmigiero authored
[SERIAL]blacklist si3052 chip Si3052-based softmodems aren't serial ports so don't bind serial driver to them. Allows proper driver to bind to them. Signed-off-by:
Maciej Szmigiero <mhej@o2.pl> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Joe Perches authored
Signed-off-by:
Joe Perches <joe@perches.com> Acked-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Mikulas Patocka authored
Add support for Kouwell KW-L221N-2 card. Signed-off-by:
Mikulas Patocka <mpatocka@redhat.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Nov 03, 2010
-
-
Dmitry Torokhov authored
Use the newly exported input_reset_device() call to reset LED state and mark all keys/buttons as released on all keyboard-like devices when exiting the debugger. [jason.wessel@windriver.com: fix compile without keyboard input driver] Signed-off-by:
Jason Wessel <jason.wessel@windriver.com> Signed-off-by:
Dmitry Torokhov <dtor@mail.ru>
-
- Oct 28, 2010
-
-
Jesper Nilsson authored
Very recently, the RS485 interface has been fixed by adding two further fields (see commit 1b633184). Check the value of the flag SER_RS485_RTS_BEFORE_SEND before delaying. Signed-off-by:
Claudio Scordino <claudio@evidence.eu.com> Signed-off-by:
Jesper Nilsson <jesper.nilsson@axis.com>
-
Jesper Nilsson authored
Lead to a compile error when the struct was no longer typedef'd. Signed-off-by:
Jesper Nilsson <jesper.nilsson@axis.com>
-
- Oct 22, 2010
-
-
Jason Wessel authored
Fix the following sparse warnings: kdb_main.c:328:5: warning: symbol 'kdbgetu64arg' was not declared. Should it be static? kgdboc.c:246:12: warning: symbol 'kgdboc_early_init' was not declared. Should it be static? kgdb.c:652:26: warning: incorrect type in argument 1 (different address spaces) kgdb.c:652:26: expected void const *ptr kgdb.c:652:26: got struct perf_event *[noderef] <asn:3>*pev The one in kgdb.c required the (void * __force) because of the return code from register_wide_hw_breakpoint looking like: return (void __percpu __force *)ERR_PTR(err); Signed-off-by:
Jason Wessel <jason.wessel@windriver.com>
-
Daniel Drake authored
Running a serial console, if too many kernel messages are generated within a short time causing a lot of serial I/O, the 8250 driver will generate another kernel message reporting this, which just adds to the I/O. It has a cascading effect and quickly results the system being brought to its knees by a flood of "too much work" messages. Ratelimit the error message to avoid this. [akpm@linux-foundation.org: use the superior printk_ratelimited()] [akpm@linux-foundation.org: printk_ratelimited() needs ratelimit.h] Signed-off-by:
Daniel Drake <dsd@laptop.org> Acked-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Sonic Zhang authored
The actual uart baud rate of devices vary between +/-2% of what is asked. The SPORT RX sample rate should be faster than double of the worst case. Otherwise, wrong data may be received. So set SPORT RX clock to be 3% faster in general. Reported-by:
Olivier STOCK <ostockemer@ereca.fr> Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Alan Cox authored
Not every platform that has generic legacy 8250 ports manages to have them clocked the right way or without errata. Provide a generic interface to allow platforms to override the default behaviour in a manner that dumps the complexity in *their* code not the 8250 driver. Signed-off-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Dirk Brandewie <dirk.brandewie@gmail.com> Acked-by:
Thomas Gleixner <tglx@linutronix.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Volker Ernst authored
The .start_tx callback (imx_start_tx here) isn't only called when the buffer is non-empty. E.g. after resume or when handshaking is enabled and the other side starts to signal being ready. So check for an empty puffer already before sending the first character. This prevents sending out stale (or uninitialised) data. Signed-off-by:
Volker Ernst <volker.ernst@txtr.com> Signed-off-by:
Daniel Mack <daniel@caiaq.de> Cc: Andy Green <andy@warmcat.com> [ukl: reword commit log, put check in while condition] Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Feng Tang authored
Add more baud rates support referring the baud_table[] defined in drivers/char/tty_ioctl.c: 3000000/2000000/1000000/500000 Signed-off-by:
Feng Tang <feng.tang@intel.com> Acked-by:
Alan Cox <alan.cox@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Breno Leitao authored
If kzmalloc fails, the uart port is not removed causing a leak. This patch just add another label that removes the uart when the kzmalloc fails. Signed-off-by:
Breno Leitao <leitao@linux.vnet.ibm.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Manuel Lauss authored
Add a hook for platforms to specify custom pm methods. Signed-off-by:
Manuel Lauss <manuel.lauss@googlemail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Anton Vorontsov authored
Fixes sparse warning. Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Acked-by:
Tobias Klauser <tklauser@distanz.ch>
-
Anton Vorontsov authored
port->flags is of type upf_t, which corresponds to UPF_* flags. ASYNC_BOOT_AUTOCONF is an unsigned integer, which happen to be the same as UPF_BOOT_AUTOCONF. Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Acked-by:
Tobias Klauser <tklauser@distanz.ch> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Anton Vorontsov authored
This fixes tty name, major and minor numbers. The major number 204 is used across many platform-specific serial drivers, so we use that. Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Acked-by:
Tobias Klauser <tklauser@distanz.ch> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Anton Vorontsov authored
Some controllers implement registers with a stride, to support those we must implement the proper IO accessors. Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Acked-by:
Tobias Klauser <tklauser@distanz.ch> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Anton Vorontsov authored
This makes it much easier to integrate the driver with the rest of the Linux (e.g. MFD subsystem). The old method is still supported though. Also, from now on, there is one platform device per port (no changes are needed for the platform code, as no one registers the devices anywhere in-tree yet). Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Acked-by:
Tobias Klauser <tklauser@distanz.ch> Cc: Alan Cox <alan@linux.intel.com>, Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Anton Vorontsov authored
Some Altera UART implementations doesn't route the IRQ line, so we have to work in polling mode. Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Acked-by:
Tobias Klauser <tklauser@distanz.ch> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Anton Vorontsov authored
Soon we will use that handy function in the altera_uart driver. Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
David Daney authored
The loop in wait_for_xmitr() is delaying one extra uS after the ready condition has been met. Rewrite the loop to only delay if the transmitter is not ready. Signed-off-by:
David Daney <ddaney@caviumnetworks.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Alan Cox authored
Again basically cut and paste Convert the main driver set to use the hooks for GICOUNT Signed-off-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Alan Cox authored
Dan Rosenberg noted that various drivers return the struct with uncleared fields. Instead of spending forever trying to stomp all the drivers that get it wrong (and every new driver) do the job in one place. This first patch adds the needed operations and hooks them up, including the needed USB midlayer and serial core plumbing. Signed-off-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Davidlohr Bueso authored
Fix memory leaks in max3107_probe() when returning on error. Signed-off-by:
Davidlohr Bueso <dave@gnu.org> Acked-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Alan Cox authored
And while we are at it allow it to fail to find one. Without this the IRQ option will cause the 3110 driver to fail on 0.7 SFI firmware. Acked-by:
Feng Tang <feng.tang@intel.com> Signed-off-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Feng Tang authored
The cleanup for mrst_max3110 includes: * remove unneeded head files * make the spi_transfer dma safe, so that driver is more portable * add more check for error return value * use mutex_trylock for read thread Signed-off-by:
Feng Tang <feng.tang@intel.com> Signed-off-by:
Alan Cox <alan@linux.intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Jason Wang authored
The commit 4547be78 rewrites suspend and resume functions. According to this rewrite, when a serial port is a printk console device and can suspend(without set no_console_suspend flag), it will definitely call set_termios function during its resume, but parameter termios isn't initialized, this will pass an unpredictable config to the serial port. If this serial port is not a userspace opened tty device , a suspend and resume action will make this serial port unusable. I.E. ttyS0 is a printk console device, ttyS1 or keyboard+display is userspace tty device, a suspend/resume action will make ttyS0 unusable. If a serial port is both a printk console device and an opened tty device, this issue can be overcome because it will call set_termios again with the correct parameter in the uart_change_speed function. Refer to the deleted content of commit 4547be78, revert parts relate to restore settings into parameter termios. It is safe because if a serial port is a printk console only device, the only meaningful field in termios is c_cflag and its old config is saved in uport->cons->cflag, if this port is also an opened tty device, it will clear uport->cons->cflag in the uart_open and the old config is saved in tty->termios. Signed-off-by:
Jason Wang <jason77.wang@gmail.com> Acked-by:
Stanislav Brabec <sbrabec@suse.cz> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Jason Wang authored
The commit 4547be78 rewrites suspend and resume functions, this introduces a problem on the OMAP3EVM platoform. when the kernel boots with no_console_suspend and we suspend the kernel, then resume it, the serial console will be not usable. This problem should be common for all platforms. The cause for this problem is that when enter suspend, if we choose no_console_suspend, the console_stop will be skiped. But in resume function, the console port will be set to uninitialized state by calling set_termios function and the console_start is called without checking whether the no_console_suspend is set, Now fix it. Signed-off-by:
Jason Wang <jason77.wang@gmail.com> Acked-by:
Stanislav Brabec <sbrabec@suse.cz> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Michal Simek authored
CONSOLE_POLL support for uartlite enables KGDB debugging over serial line. Signed-off-by:
Michal Simek <monstr@monstr.eu> Signed-off-by:
Jason Wessel <jason.wessel@windriver.com> Acked-by:
Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
Dan Carpenter authored
snprintf() returns the number of bytes which would have been written so it can be larger than the size of the buffer. In this case it's fine, but people copy and paste this code so I've fixed it. Signed-off-by:
Dan Carpenter <error27@gmail.com> Acked-by:
Feng Tang <feng.tang@intel.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Oct 20, 2010
-
-
Christian Dietrich authored
CONFIG_68328_SERIAL_UART2 doesn't exist in Kconfig, therefore removing all references to it from the source. Signed-off-by:
Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> Signed-off-by:
Greg Ungerer <gerg@uclinux.org>
-
- Oct 19, 2010
-
-
Julia Lawall authored
In this code, 0 is returned on memory allocation failure, even though other failures return -ENOMEM or other similar values. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/ ) // <smpl> @@ expression ret; expression x,e1,e2,e3; @@ ret = 0 ... when != ret = e1 *x = \(kmalloc\|kcalloc\|kzalloc\)(...) ... when != ret = e2 if (x == NULL) { ... when != ret = e3 return ret; } // </smpl> Signed-off-by:
Julia Lawall <julia@diku.dk> To: Pat Gefre <pfg@sgi.com> Cc: kernel-janitors@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/1704/ Signed-off-by:
Ralf Baechle <ralf@linux-mips.org>
-
- Oct 18, 2010
-
-
Kukjin Kim authored
This patch adds UART serial port support for S5P6450 SoC. The S5P6450 has 6 UARTs, so adds resource of UART4 and UART5. And to fix membase which is in serial/samsung.c is from Ben Dooks. Signed-off-by:
Kukjin Kim <kgene.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org>
-
Justin P. Mattock authored
The patch below updates broken web addresses in the kernel Signed-off-by:
Justin P. Mattock <justinmattock@gmail.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Finn Thain <fthain@telegraphics.com.au> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Matt Turner <mattst88@gmail.com> Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Acked-by:
Ben Pfaff <blp@cs.stanford.edu> Acked-by:
Hans J. Koch <hjk@linutronix.de> Reviewed-by:
Finn Thain <fthain@telegraphics.com.au> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
-