From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757248AbcBCQC0 (ORCPT ); Wed, 3 Feb 2016 11:02:26 -0500 Received: from down.free-electrons.com ([37.187.137.238]:45717 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756009AbcBCQCX convert rfc822-to-8bit (ORCPT ); Wed, 3 Feb 2016 11:02:23 -0500 From: Gregory CLEMENT To: One Thousand Gnomes Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , arm@kernel.org, Catalin Marinas , Will Deacon , Jonathan Corbet , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Tejun Heo , Hans de Goede , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , devicetree@vger.kernel.org, Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Wilson Ding , Nadav Haklai Subject: Re: [PATCH 01/10] serial: mvebu-uart: initial support for Armada-3700 serial port References: <1454436468-4241-1-git-send-email-gregory.clement@free-electrons.com> <1454436468-4241-2-git-send-email-gregory.clement@free-electrons.com> <20160202181935.19b4ab7e@lxorguk.ukuu.org.uk> Date: Wed, 03 Feb 2016 16:58:46 +0100 In-Reply-To: <20160202181935.19b4ab7e@lxorguk.ukuu.org.uk> (One Thousand Gnomes's message of "Tue, 2 Feb 2016 18:19:35 +0000") Message-ID: <87vb654wg9.fsf@free-electrons.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On mar., févr. 02 2016, One Thousand Gnomes wrote: >> +static void mvebu_uart_set_termios(struct uart_port *port, >> + struct ktermios *termios, >> + struct ktermios *old) >> +{ >> + unsigned long flags; >> + unsigned int baud; >> + >> + spin_lock_irqsave(&port->lock, flags); >> + >> + port->read_status_mask = STAT_RX_RDY | STAT_OVR_ERR | >> + STAT_TX_RDY | STAT_TX_FIFO_FUL; >> + >> + if (termios->c_iflag & INPCK) >> + port->read_status_mask |= STAT_FRM_ERR | STAT_PAR_ERR; >> + >> + port->ignore_status_mask = 0; >> + if (termios->c_iflag & IGNPAR) >> + port->ignore_status_mask |= >> + STAT_FRM_ERR | STAT_PAR_ERR | STAT_OVR_ERR; >> + >> + if ((termios->c_cflag & CREAD) == 0) >> + port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR; > > If you don't support parity or charactive size then you should be forcing > those bits in the tty->termios so that the caller sees what settings they > get. tty_termios_copy_hw is close to what you need except that you can > support IGNPAR. OK thanks for the pointer. > > You also want to provide the actual baud rate chosen (see how 8250.c does > it using tty_termios_encode_baud_rate(). > > >> +static struct uart_driver mvebu_uart_driver = { >> + .owner = THIS_MODULE, >> + .driver_name = "serial", >> + .dev_name = "ttyS", >> + .major = TTY_MAJOR, >> + .minor = 64, > > NAK > > TTY_MAJOR 64+ is the 8250 driver and ttyS is the 8250 driver name. You > should be using a dynamic major (0) for all new drivers and you need to > pick a different and unused ttyXXX format name. I missed this one, I will remove .major and .minor and use our own ttyXX. Thanks, Gregory > > Alan -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com