Prev: loop: add some basic read-only sysfs attributes
Next: Questions concerning memory mapping in stackable filesystems
From: Alan Cox on 29 Jul 2010 09:50 > In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port That may not be reliable given the other 8250 clones around but looks generally sane. > @@ -2238,6 +2254,10 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, > unsigned long flags; > unsigned int baud, quot; > > + /* Possibly call pre_set_termios function. */ > + if (port->pre_set_termios) > + port->pre_set_termios(port, termios, old); > + Ok I think it might be better to have serial8250_do_set_termios(...) { /* Existing set_termios code here */ } EXPORT_SYMBOL(serial8250_do_set_termios); serial8250_set_termios(...) { if (port->set_termios) return port->set_termios(...) else serial8250_do_set_termions(...) } That allows people to wrap it with before/after/both handling, or replace it entirely. So in your case it would my_set_termios() { /* pre set termios code here */ return serial8250_do_set_termios(); } Looks ok to me though - it splits the special bits out from the core nicely -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Alan Cox on 29 Jul 2010 11:20 On Thu, 29 Jul 2010 17:13:57 +0200 Philippe Langlais <philippe.langlais(a)stericsson.com> wrote: > UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone): > * Fully compatible with industry standard 16C550 and 16C450 from various Acked-by: Alan Cox <alan(a)linux.intel.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andrew Morton on 4 Aug 2010 16:00 On Mon, 2 Aug 2010 10:58:39 +0200 Philippe Langlais <philippe.langlais(a)stericsson.com> wrote: > UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone): > * Fully compatible with industry standard 16C550 and 16C450 from various > manufacturers > * RX and TX 64 byte FIFO reduces CPU interrupts > * Full double buffering > * Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only) > * Automatic baud rate selection > * Manual or automatic RTS/CTS smart hardware flow control > * Programmable serial characteristics: > ___ Baud rate generation (50 to 3.25M baud) > ___ 5, 6, 7 or 8-bit characters > ___ Even, odd or no-parity bit generation and detection > ___ 1, 1.5 or 2 stop bit generation > * Independent control of transmit, receive, line status, data set interrupts and FIFOs > * Full status-reporting capabilities > * Separate DMA signaling for RX and TX > * Timed interrupt to spread receive interrupt on known duration > * DMA time-out interrupt to allow detection of end of reception > * Carkit pulse coding and decoding compliant with USB carkit control interface [40] > > In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port > Add set_termios hook & export serial8250_do_set_termios to change uart > clock following baudrate Confused. > ... > > --- a/include/linux/serial_8250.h > +++ b/include/linux/serial_8250.h > @@ -32,6 +32,9 @@ struct plat_serial8250_port { > unsigned int type; /* If UPF_FIXED_TYPE */ > unsigned int (*serial_in)(struct uart_port *, int); > void (*serial_out)(struct uart_port *, int, int); > + void (*set_termios)(struct uart_port *, > + struct ktermios *new, > + struct ktermios *old); > }; > > ... > > --- a/include/linux/serial_core.h > +++ b/include/linux/serial_core.h > @@ -279,6 +279,9 @@ struct uart_port { > unsigned char __iomem *membase; /* read/write[bwl] */ > unsigned int (*serial_in)(struct uart_port *, int); > void (*serial_out)(struct uart_port *, int, int); > + void (*set_termios)(struct uart_port *, > + struct ktermios *new, > + struct ktermios *old); > unsigned int irq; /* irq number */ > unsigned long irqflags; /* irq flags */ > unsigned int uartclk; /* base uart clock */ The patch adds these .set_termios hooks but doesn't actually use them for anything. The changelog doesn't tell us _why_ this was done (it should) and lacking any code to look at it's all a bit mysterious. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Philippe Langlais on 5 Aug 2010 03:20 On 08/04/10 21:52, Andrew Morton wrote: > On Mon, 2 Aug 2010 10:58:39 +0200 > Philippe Langlais<philippe.langlais(a)stericsson.com> wrote: > > >> UART Features extract from STEricsson U6715 data-sheet (arm926 SoC for mobile phone): >> * Fully compatible with industry standard 16C550 and 16C450 from various >> manufacturers >> * RX and TX 64 byte FIFO reduces CPU interrupts >> * Full double buffering >> * Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only) >> * Automatic baud rate selection >> * Manual or automatic RTS/CTS smart hardware flow control >> * Programmable serial characteristics: >> ___ Baud rate generation (50 to 3.25M baud) >> ___ 5, 6, 7 or 8-bit characters >> ___ Even, odd or no-parity bit generation and detection >> ___ 1, 1.5 or 2 stop bit generation >> * Independent control of transmit, receive, line status, data set interrupts and FIFOs >> * Full status-reporting capabilities >> * Separate DMA signaling for RX and TX >> * Timed interrupt to spread receive interrupt on known duration >> * DMA time-out interrupt to allow detection of end of reception >> * Carkit pulse coding and decoding compliant with USB carkit control interface [40] >> >> In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port >> Add set_termios hook& export serial8250_do_set_termios to change uart >> clock following baudrate >> > Confused. > > >> ... >> >> --- a/include/linux/serial_8250.h >> +++ b/include/linux/serial_8250.h >> @@ -32,6 +32,9 @@ struct plat_serial8250_port { >> unsigned int type; /* If UPF_FIXED_TYPE */ >> unsigned int (*serial_in)(struct uart_port *, int); >> void (*serial_out)(struct uart_port *, int, int); >> + void (*set_termios)(struct uart_port *, >> + struct ktermios *new, >> + struct ktermios *old); >> }; >> >> ... >> >> --- a/include/linux/serial_core.h >> +++ b/include/linux/serial_core.h >> @@ -279,6 +279,9 @@ struct uart_port { >> unsigned char __iomem *membase; /* read/write[bwl] */ >> unsigned int (*serial_in)(struct uart_port *, int); >> void (*serial_out)(struct uart_port *, int, int); >> + void (*set_termios)(struct uart_port *, >> + struct ktermios *new, >> + struct ktermios *old); >> unsigned int irq; /* irq number */ >> unsigned long irqflags; /* irq flags */ >> unsigned int uartclk; /* base uart clock */ >> > The patch adds these .set_termios hooks but doesn't actually use them > for anything. > > The changelog doesn't tell us _why_ this was done (it should) and > lacking any code to look at it's all a bit mysterious. > > This feature is used in our U6715 8250 platform serial driver, to avoid hack in 8250.c set_termios (Alan Cox requirement). In this driver the input uart clock frequency depends on baud rate and is computed in our set_termios override function. The U6715 paltform serial patch has been submitted on linux-arm mailing list, and is ready to enter Russell King Linux tree. More things to do ? Philippe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andrew Morton on 5 Aug 2010 03:30
On Thu, 5 Aug 2010 09:14:40 +0200 Philippe Langlais <philippe.langlais(a)stericsson.com> wrote: > > >> > > The patch adds these .set_termios hooks but doesn't actually use them > > for anything. > > > > The changelog doesn't tell us _why_ this was done (it should) and > > lacking any code to look at it's all a bit mysterious. > > > > > This feature is used in our U6715 8250 platform serial driver, to avoid > hack in 8250.c set_termios (Alan Cox requirement). > In this driver the input uart clock frequency depends on baud rate and > is computed in our set_termios override function. > The U6715 paltform serial patch has been submitted on linux-arm mailing > list, > and is ready to enter Russell King Linux tree. Oh. > More things to do ? Update the changelog to include this rather important information. As the patches are dependent, treat them as a single series. Russell can merge them both with Greg's ack or Greg can merge them both with Russell's ack. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |