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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 12 Apr 2011 09:28:43 +0200
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	linux-serial@...r.kernel.org, torvalds@...ux-foundation.org,
	kernel@...gutronix.de
Subject: Re: Wrong GIT author ? also bugs: serial: Add uart driver for
 i.MX23/28

On Tue, Mar 29, 2011 at 10:33:35AM +0100, Alan Cox wrote:
> > I don't understand how to do this and didn't find something like that in
> > other drivers. (I checked amba-pl011.c and imx.c.) Also
> > Documentation/serial/driver doesn't describe this. (It is also silent
> > about CMSPAR and doesn't even advise to clear unsupported bits.)
> > Can you be a bit more verbose here?
> 
> 8250.c is the best place to look.
> 
> Basically on return from your routine the _hardware_ bits of the termios
> struct should be the ones set.
> 
> So eg if you only supported 8bit characters you'd wipe the CSx bits and
> set CS8.
> 
> For the speed there is a helper so you probably want
> 
>         /* Don't rewrite B0 */
>         if (tty_termios_baud_rate(termios))
>                 tty_termios_encode_baud_rate(termios, baud, baud);
OK, I will review the function to assert that the other bits are updated
accordingly.

> > @@ -286,6 +283,9 @@ static void mxs_auart_settermios(struct uart_port *u,
> >  {
> >  	u32 bm, ctrl, ctrl2, div;
> >  	unsigned int cflag, baud;
> > +	unsigned long flags;
> > +
> > +	spin_lock_irqsave(&u->lock, flags);
> 
> Termios you don't need the lock - just the IRQ handler and you still
> really want the tty_port_tty_get()/tty_kref_put() if that wasn't already
> dealt with.
If I look at 8250.c spin_lock_irqsave seems OK :-)

To be honest, it felt much better when a simpler driver than 8250 could
be used to copy from. Documentation/serial/driver (which is IMHO very
helpful) declares amba_pl011.c to be the reference implementation. It
uses neither tty_termios_encode_baud_rate nor
tty_port_tty_get()/tty_kref_put() :-(

Anyhow, I'll do my best to implement both requests.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists