Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: mfd: remove the timeout workaround for A0

This is kind of a revert for commit 669b7a0938e "hsu: add a periodic
timer to check dma rx channel", which is a workaround for a bug in A0
stepping silicon, where a dma rx data timeout is missing for some case.
Since new silicon has fixed it and the old version is phasing out, no
need to carry on it any more.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Feng Tang and committed by
Greg Kroah-Hartman
a5f4dbf0 940f3be4

-38
-38
drivers/tty/serial/mfd.c
··· 51 51 #define mfd_readl(obj, offset) readl(obj->reg + offset) 52 52 #define mfd_writel(obj, offset, val) writel(val, obj->reg + offset) 53 53 54 - #define HSU_DMA_TIMEOUT_CHECK_FREQ (HZ/10) 55 - 56 54 struct hsu_dma_buffer { 57 55 u8 *buf; 58 56 dma_addr_t dma_addr; ··· 63 65 enum dma_data_direction dirt; 64 66 struct uart_hsu_port *uport; 65 67 void __iomem *reg; 66 - struct timer_list rx_timer; /* only needed by RX channel */ 67 68 }; 68 69 69 70 struct uart_hsu_port { ··· 352 355 | (0x1 << 24) /* timeout bit, see HSU Errata 1 */ 353 356 ); 354 357 chan_writel(rxc, HSU_CH_CR, 0x3); 355 - 356 - mod_timer(&rxc->rx_timer, jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ); 357 358 } 358 359 359 360 /* Protected by spin_lock_irqsave(port->lock) */ ··· 415 420 chan_writel(chan, HSU_CH_CR, 0x3); 416 421 return; 417 422 } 418 - del_timer(&chan->rx_timer); 419 423 420 424 dma_sync_single_for_cpu(port->dev, dbuf->dma_addr, 421 425 dbuf->dma_size, DMA_FROM_DEVICE); ··· 442 448 tty_flip_buffer_push(tty); 443 449 444 450 chan_writel(chan, HSU_CH_CR, 0x3); 445 - chan->rx_timer.expires = jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ; 446 - add_timer(&chan->rx_timer); 447 451 448 452 } 449 453 ··· 861 869 struct uart_hsu_port *up = 862 870 container_of(port, struct uart_hsu_port, port); 863 871 unsigned long flags; 864 - 865 - del_timer_sync(&up->rxc->rx_timer); 866 872 867 873 /* Disable interrupts from this port */ 868 874 up->ier = 0; ··· 1333 1343 return ret; 1334 1344 } 1335 1345 1336 - static void hsu_dma_rx_timeout(unsigned long data) 1337 - { 1338 - struct hsu_dma_chan *chan = (void *)data; 1339 - struct uart_hsu_port *up = chan->uport; 1340 - struct hsu_dma_buffer *dbuf = &up->rxbuf; 1341 - int count = 0; 1342 - unsigned long flags; 1343 - 1344 - spin_lock_irqsave(&up->port.lock, flags); 1345 - 1346 - count = chan_readl(chan, HSU_CH_D0SAR) - dbuf->dma_addr; 1347 - 1348 - if (!count) { 1349 - mod_timer(&chan->rx_timer, jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ); 1350 - goto exit; 1351 - } 1352 - 1353 - hsu_dma_rx(up, 0); 1354 - exit: 1355 - spin_unlock_irqrestore(&up->port.lock, flags); 1356 - } 1357 - 1358 1346 static void hsu_global_init(void) 1359 1347 { 1360 1348 struct hsu_port *hsu; ··· 1395 1427 dchan->reg = hsu->reg + HSU_DMA_CHANS_REG_OFFSET + 1396 1428 i * HSU_DMA_CHANS_REG_LENGTH; 1397 1429 1398 - /* Work around for RX */ 1399 - if (dchan->dirt == DMA_FROM_DEVICE) { 1400 - init_timer(&dchan->rx_timer); 1401 - dchan->rx_timer.function = hsu_dma_rx_timeout; 1402 - dchan->rx_timer.data = (unsigned long)dchan; 1403 - } 1404 1430 dchan++; 1405 1431 } 1406 1432