lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87vb654wg9.fsf@free-electrons.com>
Date:	Wed, 03 Feb 2016 16:58:46 +0100
From:	Gregory CLEMENT <gregory.clement@...e-electrons.com>
To:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Cc:	Jason Cooper <jason@...edaemon.net>, Andrew Lunn <andrew@...n.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	arm@...nel.org, Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will.deacon@....com>,
	Jonathan Corbet <corbet@....net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.com>, linux-serial@...r.kernel.org,
	Tejun Heo <tj@...nel.org>, Hans de Goede <hdegoede@...hat.com>,
	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
	Mark Rutland <mark.rutland@....com>,
	devicetree@...r.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	linux-arm-kernel@...ts.infradead.org,
	Wilson Ding <dingwei@...vell.com>,
	Nadav Haklai <nadavh@...vell.com>
Subject: Re: [PATCH 01/10] serial: mvebu-uart: initial support for Armada-3700 serial port

Hi,
 
 On mar., févr. 02 2016, One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ