From a10219c03a21614a9b9f0fd571da2d346e672d08 Mon Sep 17 00:00:00 2001 From: Tom Knot Date: Wed, 27 Jun 2018 17:37:58 +0200 Subject: [PATCH] Added more spinlocks to TX_PROC --- modules/unipi/src/unipi_spi.c | 2 +- modules/unipi/src/unipi_uart.c | 7 +++++-- version.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/unipi/src/unipi_spi.c b/modules/unipi/src/unipi_spi.c index 9277b19..ac0b13a 100644 --- a/modules/unipi/src/unipi_spi.c +++ b/modules/unipi/src/unipi_spi.c @@ -1315,7 +1315,7 @@ reg1001: %x, reg1002: %x, reg1003: %x, reg1004: %x\n", #if NEURONSPI_DETAILED_DEBUG > 0 printk(KERN_DEBUG "NEURONSPI: UART registration 1\n"); #endif - n_spi->uart_buf = kzalloc(NEURONSPI_FIFO_SIZE, GFP_KERNEL); + n_spi->uart_buf = kzalloc(NEURONSPI_FIFO_SIZE, GFP_ATOMIC); neuronspi_uart_probe(spi, n_spi->neuron_index); #if NEURONSPI_DETAILED_DEBUG > 0 printk(KERN_DEBUG "NEURONSPI: UART PROBE MCTRL:%d\n", neuronspi_spi_uart_get_cflag(spi, 0)); diff --git a/modules/unipi/src/unipi_uart.c b/modules/unipi/src/unipi_uart.c index 7e19bb3..26d2d31 100644 --- a/modules/unipi/src/unipi_uart.c +++ b/modules/unipi/src/unipi_uart.c @@ -317,12 +317,15 @@ void neuronspi_uart_handle_tx(struct neuronspi_port *port) return; } + spin_lock_irqsave(&port->port.lock, flags); if (uart_circ_empty(xmit) || uart_tx_stopped(&port->port)) { + spin_unlock_irqrestore(&port->port.lock, flags); spin_lock_irqsave(&port->tx_lock, flags); port->tx_work_count--; spin_unlock_irqrestore(&port->tx_lock, flags); return; } + spin_unlock_irqrestore(&port->port.lock, flags); /* Get length of data pending in circular buffer */ spin_lock_irqsave(&port->port.lock, flags); @@ -373,11 +376,11 @@ void neuronspi_uart_handle_tx(struct neuronspi_port *port) port->tx_work_count--; spin_unlock_irqrestore(&port->tx_lock, flags); + spin_lock_irqsave(&port->port.lock, flags); if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) { - spin_lock_irqsave(&port->port.lock, flags); uart_write_wakeup(&port->port); - spin_unlock_irqrestore(&port->port.lock, flags); } + spin_unlock_irqrestore(&port->port.lock, flags); } void neuronspi_uart_handle_irq(struct neuronspi_uart_data *uart_data, u32 portno) diff --git a/version.txt b/version.txt index 658478c..89d9908 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -Repository:neuron-kernel ActiveBranch:[uart_timeout] PrecedingRelease:v.0.12 PrecedingRevision:68(b7675a2) LatestCommit:Wed Jun 27 17:06:39 CEST 2018 +Repository:neuron-kernel ActiveBranch:[uart_timeout] PrecedingRelease:v.0.12 PrecedingRevision:69(77704e8) LatestCommit:Wed Jun 27 17:37:58 CEST 2018 -- 2.34.1