Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751439AbdFFNfP (ORCPT ); Tue, 6 Jun 2017 09:35:15 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:58426 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbdFFNfM (ORCPT ); Tue, 6 Jun 2017 09:35:12 -0400 Date: Tue, 6 Jun 2017 14:34:07 +0100 From: Alan Cox To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: linux-arm-kernel@lists.infradead.org, mp-cs@actions-semi.com, Thomas Liau , =?UTF-8?B?5byg5Lic6aOO?= , =?UTF-8?B?5YiY54Kc?= , =?UTF-8?B?5byg5aSp55uK?= , 96boards@ucrobotics.com, support@lemaker.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Subject: Re: [PATCH v4 16/28] tty: serial: owl: Implement console driver Message-ID: <20170606143407.56d15c3c@lxorguk.ukuu.org.uk> In-Reply-To: <20170606005426.26446-17-afaerber@suse.de> References: <20170606005426.26446-1-afaerber@suse.de> <20170606005426.26446-17-afaerber@suse.de> Organization: Intel Corporation X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1678 Lines: 60 > + > +static void owl_uart_set_termios(struct uart_port *port, > + struct ktermios *termios, > + struct ktermios *old) > +{ > + struct owl_uart_port *owl_port = to_owl_uart_port(port); > + unsigned int baud; > + u32 ctl; > + unsigned long flags; > + > + spin_lock_irqsave(&port->lock, flags); > + > + /* We don't support modem control lines. */ > + termios->c_cflag &= ~(HUPCL | CMSPAR); > + termios->c_cflag |= CLOCAL; CLOCAL and HUPCL are software not hardware properties so are probably best not forced (it'll confuse some apps if you do) > + > + /* We don't support BREAK character recognition. */ > + termios->c_iflag &= ~(IGNBRK | BRKINT); Ditto these You do clear CMSPAR which is right if not supported but then later on we have: > + if (termios->c_cflag & PARENB) { > + if (termios->c_cflag & CMSPAR) { > + if (termios->c_cflag & PARODD) > + ctl |= OWL_UART_CTL_PRS_MARK; > + else > + ctl |= OWL_UART_CTL_PRS_SPACE; > + } else if (termios->c_cflag & PARODD) > + ctl |= OWL_UART_CTL_PRS_ODD; > + else > + ctl |= OWL_UART_CTL_PRS_EVEN; > + } else > + ctl |= OWL_UART_CTL_PRS_NONE; Which seems to indicate you do support CMSPAR so shouldn't be clearing it. > + > + if (termios->c_cflag & CRTSCTS) > + ctl |= OWL_UART_CTL_AFE; > + else > + ctl &= ~OWL_UART_CTL_AFE; > + > + owl_uart_write(port, ctl, OWL_UART_CTL); > + > + baud = uart_get_baud_rate(port, termios, old, 9600, 3200000); > + owl_uart_change_baudrate(owl_port, baud); You should re-encode the resulting baud rate into the termios /* Don't rewrite B0 */ if (tty_termios_baud_rate(termios)) tty_termios_encode_baud_rate(termios, baud, baud);