diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/ioc4_serial.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index f94d2e712cad..d3f4542616c6 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c | |||
@@ -1272,8 +1272,9 @@ static inline int set_rx_timeout(struct ioc4_port *port, int timeout) | |||
1272 | * and set the rx threshold to that amount. There are 4 chars | 1272 | * and set the rx threshold to that amount. There are 4 chars |
1273 | * per ring entry, so we'll divide the number of chars that will | 1273 | * per ring entry, so we'll divide the number of chars that will |
1274 | * arrive in timeout by 4. | 1274 | * arrive in timeout by 4. |
1275 | * So .... timeout * baud / 10 / HZ / 4, with HZ = 100. | ||
1275 | */ | 1276 | */ |
1276 | threshold = timeout * port->ip_baud / 10 / HZ / 4; | 1277 | threshold = timeout * port->ip_baud / 4000; |
1277 | if (threshold == 0) | 1278 | if (threshold == 0) |
1278 | threshold = 1; /* otherwise we'll intr all the time! */ | 1279 | threshold = 1; /* otherwise we'll intr all the time! */ |
1279 | 1280 | ||
@@ -1285,8 +1286,10 @@ static inline int set_rx_timeout(struct ioc4_port *port, int timeout) | |||
1285 | 1286 | ||
1286 | writel(port->ip_sscr, &port->ip_serial_regs->sscr); | 1287 | writel(port->ip_sscr, &port->ip_serial_regs->sscr); |
1287 | 1288 | ||
1288 | /* Now set the rx timeout to the given value */ | 1289 | /* Now set the rx timeout to the given value |
1289 | timeout = timeout * IOC4_SRTR_HZ / HZ; | 1290 | * again timeout * IOC4_SRTR_HZ / HZ |
1291 | */ | ||
1292 | timeout = timeout * IOC4_SRTR_HZ / 100; | ||
1290 | if (timeout > IOC4_SRTR_CNT) | 1293 | if (timeout > IOC4_SRTR_CNT) |
1291 | timeout = IOC4_SRTR_CNT; | 1294 | timeout = IOC4_SRTR_CNT; |
1292 | 1295 | ||
@@ -1380,7 +1383,7 @@ config_port(struct ioc4_port *port, | |||
1380 | if (port->ip_tx_lowat == 0) | 1383 | if (port->ip_tx_lowat == 0) |
1381 | port->ip_tx_lowat = 1; | 1384 | port->ip_tx_lowat = 1; |
1382 | 1385 | ||
1383 | set_rx_timeout(port, port->ip_rx_timeout); | 1386 | set_rx_timeout(port, 2); |
1384 | 1387 | ||
1385 | return 0; | 1388 | return 0; |
1386 | } | 1389 | } |