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] [day] [month] [year] [list]
Message-ID: <20110426205809.39a96279@lxorguk.ukuu.org.uk>
Date:	Tue, 26 Apr 2011 20:58:09 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	John Linn <john.linn@...inx.com>
Cc:	<linux-kernel@...r.kernel.org>, <linux-serial@...r.kernel.org>,
	<michal.simek@...alogix.com>, <joe@...ches.com>,
	<grant.likely@...retlab.ca>, <greg@...ah.com>
Subject: Re: [PATCH V3] tty/serial: add support for Xilinx PS UART

O
> +	if (percent_err >= 3)
> +		dev_err(port->dev, "Error too large, baud rate not set\n");

So in this cause baud isn't the one the user asked. Also the user can
make it spew errors by continually generating wrong rates.

If the error is large go for the nearest you can and return it. The core
tty code will do all the rest including reporting to the user they didn't
get their wishes.

> +	else {
> +		/* Set the values for the new baud rate */
> +		xuartps_writel(brgr_val, XUARTPS_BAUDGEN_OFFSET);
> +		xuartps_writel(brdiv_val, XUARTPS_BAUDDIV_OFFSET);

and in this it may not be exact.

I suspect this routine needs to return the actual baud rate (or maybe
baudrate/error code)


> +	/* Min baud rate = 6bps and Max Baud Rate is 10Mbps for 100Mhz clk */
> +	baud = uart_get_baud_rate(port, termios, old, 0, 10000000);
> +	xuartps_set_baud_rate(port, baud);
> +	if (tty_termios_baud_rate(termios))
> +		tty_termios_encode_baud_rate(termios, baud, baud);

and this should do something like

	baud = xuartps_set_baud_rate(port baud);

> +
> +	/*
> +	 * Update the per-port timeout.
> +	 */
> +	uart_update_timeout(port, termios->c_cflag, baud);

[which would also fix this timeout!]

Otherwise looks ready to merge
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ