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]
Date:   Thu, 22 Sep 2016 14:56:15 -0500
From:   <tthayer@...nsource.altera.com>
To:     <gregkh@...uxfoundation.org>, <robh+dt@...nel.org>,
        <mark.rutland@....com>, <lftan@...era.com>, <jslaby@...e.com>,
        <arnd@...db.de>, <peter@...leysoftware.com>,
        <andriy.shevchenko@...ux.intel.com>, <anton.wuerfel@....de>,
        <phillip.raffeck@....de>, <yegorslists@...glemail.com>,
        <matwey@....msu.ru>, <mail@...iej.szmigiero.name>
CC:     <peter.ujfalusi@...com>, <jonathanh@...dia.com>,
        <dongsheng.wang@....com>, <luis@...ethencourt.com>,
        <linux-kernel@...r.kernel.org>, <linux-serial@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <tthayer.linux@...il.com>,
        <tthayer@...nsource.altera.com>, <nios2-dev@...ts.rocketboards.org>
Subject: [PATCHv2 2/4] serial: 8250: of: Load TX FIFO Threshold from DT

From: Thor Thayer <tthayer@...nsource.altera.com>

Initialize the tx_loadsz parameter from passed in devicetree
tx-threshold parameter.
The tx_loadsz is calculated as the number of bytes to fill FIFO
when tx-threshold is triggered.

Signed-off-by: Thor Thayer <tthayer@...nsource.altera.com>
---
v2  Change from reading tx-loadsz parameter to reading
    tx-threshold and calculating tx_loadsz.
---
 drivers/tty/serial/8250/8250_of.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 38963d7..7a8b5fc 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -195,6 +195,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
 	switch (port_type) {
 	case PORT_8250 ... PORT_MAX_8250:
 	{
+		u32 tx_threshold;
 		struct uart_8250_port port8250;
 		memset(&port8250, 0, sizeof(port8250));
 		port8250.port = port;
@@ -202,6 +203,12 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
 		if (port.fifosize)
 			port8250.capabilities = UART_CAP_FIFO;
 
+		/* Check for TX FIFO threshold & set tx_loadsz */
+		if ((of_property_read_u32(ofdev->dev.of_node, "tx-threshold",
+					  &tx_threshold) == 0) &&
+		    (tx_threshold < port.fifosize))
+			port8250.tx_loadsz = port.fifosize - tx_threshold;
+
 		if (of_property_read_bool(ofdev->dev.of_node,
 					  "auto-flow-control"))
 			port8250.capabilities |= UART_CAP_AFE;
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ