- 03 2月, 2015 6 次提交
-
-
由 Stefan Agner 提交于
On uart buffer flush, serial core resets the circular buffer. If a DMA transfer is in progress at that time, the callback lpuart_dma_tx_complete will move buffer's tail unconditionally, hence tail moves beyond head. Use the flush_buffer hook to terminate the DMA imeaditely and avoid lpuart_dma_tx_complete being called in this situation. This bug often showed up while shutdown and lead to duplicate serial console output. Signed-off-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Yuan Yao 提交于
For power management support, we should disable TX and TX interrupt so that kernel can prepare for deep sleep. Retain RX and RX interrupt for wakeup the kernel when receive the input character. Signed-off-by: NYuan Yao <yao.yuan@freescale.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Stefan Agner 提交于
To end a DMA transfer which did not consume a whole buffer (e.g. one character only), a RX timer is used. When lots of data are received the DMA transfer will complete and setup another DMA transfer, which in turn might complete again. In this cases, it is not necessary to abort the DMA transfers using the RX timer. This change pushes the RX timer timeout into the future each time a DMA transfer completed. Aborting the DMA was not very harmful, since the next received character lead to setup of another RX DMA. Signed-off-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Stefan Agner 提交于
Move the DMA channel request to probe to avoid requesting the DMA channel on each opening of the ttyLPx device. This also fixes a potential issue that TX channel is not freed when only RX channel allocation fails. The DMA channels are now handled independently, so one could use UART with DMA only in TX direction for instance. Signed-off-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Stefan Agner 提交于
When the UART is in DMA receive mode (RDMAS set) and one character just arrived while another interrupt is handled (e.g. TX), the RDRF (receiver data register full flag) is set due to the water level of 1. But since the DMA will take care of this character, there is no need to handle it by calling lpuart_prepare_rx. Handling it leads to adding the RX timeout timer twice: [ 74.336698] Kernel BUG at 80053070 [verbose debug info unavailable] [ 74.342999] Internal error: Oops - BUG: 0 [#1] ARM0:00.00 khungtaskd [ 74.347817] Modules linked in: 0 S 0.0 0.0 0:00.00 writeback [ 74.350926] CPU: 0 PID: 0 Comm: swapper Not tainted 3.19.0-rc3-00001-g39d78e2 #1788 [ 74.358617] Hardware name: Freescale Vybrid VF610 (Device Tree)t [ 74.364563] task: 807a7678 ti: 8079c000 task.ti: 8079c000 kblockd [ 74.370002] PC is at add_timer+0x24/0x28.0 0.0 0:00.09 kworker/u2:1 [ 74.373960] LR is at lpuart_int+0x15c/0x3d8 [ 74.378171] pc : [<80053070>] lr : [<802e0d88>] psr: a0010193 [ 74.378171] sp : 8079de10 ip : 8079de20 fp : 8079de1c [ 74.389694] r10: 807d44c0 r9 : 8688c300 r8 : 00000013 [ 74.394943] r7 : 20010193 r6 : 00000000 r5 : 000000a0 r4 : 86997210 [ 74.401498] r3 : ffffa7da r2 : 80817868 r1 : 86997210 r0 : 86997344 [ 74.408052] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel [ 74.415489] Control: 10c5387d Table: 8611c059 DAC: 00000015 [ 74.421265] Process swapper (pid: 0, stack limit = 0x8079c230) ... Solve this by only execute the receiver path (lpuart_prepare_rx) if the DMA receive mode (RDMAS) is not set. Also, make sure the flag is cleared on initialization, in case it has been left set. This can be best reproduced using UART as a serial console, then running top while dd'ing data into the terminal. Signed-off-by: NStefan Agner <stefan@agner.ch> Cc: stable <stable@vger.kernel.org> # 3.14 Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Stefan Agner 提交于
If the serial port gets closed while a RX transfer is in progress, the timer might fire after the serial port shutdown finished. This leads in a NULL pointer dereference: [ 7.508324] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 7.516590] pgd = 86348000 [ 7.519445] [00000000] *pgd=86179831, *pte=00000000, *ppte=00000000 [ 7.526145] Internal error: Oops: 17 [#1] ARM [ 7.530611] Modules linked in: [ 7.533876] CPU: 0 PID: 123 Comm: systemd Not tainted 3.19.0-rc3-00004-g5b11ea7 #1778 [ 7.541827] Hardware name: Freescale Vybrid VF610 (Device Tree) [ 7.547862] task: 861c3400 ti: 86ac8000 task.ti: 86ac8000 [ 7.553392] PC is at lpuart_timer_func+0x24/0xf8 [ 7.558127] LR is at lpuart_timer_func+0x20/0xf8 [ 7.562857] pc : [<802df99c>] lr : [<802df998>] psr: 600b0113 [ 7.562857] sp : 86ac9b90 ip : 86ac9b90 fp : 86ac9bbc [ 7.574467] r10: 80817180 r9 : 80817b98 r8 : 80817998 [ 7.579803] r7 : 807acee0 r6 : 86989000 r5 : 00000100 r4 : 86997210 [ 7.586444] r3 : 86ac8000 r2 : 86ac9bc0 r1 : 86997210 r0 : 00000000 [ 7.593085] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 7.600341] Control: 10c5387d Table: 86348059 DAC: 00000015 [ 7.606203] Process systemd (pid: 123, stack limit = 0x86ac8230) Setup the timer on UART startup which allows to delete the timer unconditionally on shutdown. This also saves the initialization on each transfer. Signed-off-by: NStefan Agner <stefan@agner.ch> Cc: stable <stable@vger.kernel.org> # 3.14 Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 10 1月, 2015 34 次提交
-
-
由 Vineet Gupta 提交于
In early 8250, IER is already zero so no point in writing this - twice per line This helped improve the SystemC model based ARC OSCI platform Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.cz> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Rob Herring <robh@kernel.org> Cc: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: NVineet Gupta <vgupta@synopsys.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Vijay Rai 提交于
Some of FSL SoCs like T1040 has new version of UART controller which can support 64byte FiFo. To enable 64 byte support, following needs to be done: -FCR[EN64] needs to be programmed to 1 to enable it. -Also, when FCR[EN64]==1, RTL bits to be used as below to define various Receive Trigger Levels: -FCR[RTL] = 00 1 byte -FCR[RTL] = 01 16 bytes -FCR[RTL] = 10 32 bytes -FCR[RTL] = 11 56 bytes -tx_loadsz is set to 63-bytes instead of 64-bytes to implement workaround of errata A-008006 which states that tx_loadsz should be configured less than Maximum supported fifo bytes Signed-off-by: NVijay Rai <vijay.rai@freescale.com> Signed-off-by: NPriyanka Jain <Priyanka.Jain@freescale.com> Signed-off-by: NPoonam Aggrwal <poonam.aggrwal@freescale.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Baruch Siach 提交于
Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Eric Nelson 提交于
When IGNPAR is set in termios->c_iflag, characters with framing errors should be ignored. Signed-off-by: NEric Nelson <eric.nelson@boundarydevices.com> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Eric Nelson 提交于
If IGNPAR/INPCK are clear in termios->c_iflag, characters received with parity or framing errors should be preserved and passed to the upper layers of the tty stack. Specifically, the decision of whether to set the character value to zero should be made by n_tty.c/n_tty_receive_parity_error(). Signed-off-by: NEric Nelson <eric.nelson@boundarydevices.com> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Ley Foon Tan 提交于
Add device pointer to port->dev. Before: "(NULL device *): ttyAL0 at MMIO 0x2020 (irq = 6, base_baud = 3125000) is a Altera UART" After: "altera_uart 2020.serial: ttyAL0 at MMIO 0x2020 (irq = 6, base_baud = 3125000) is a Altera UART" Signed-off-by: NLey Foon Tan <lftan@altera.com> Acked-by: NTobias Klauser <tklauser@distanz.ch> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Ley Foon Tan 提交于
Add device pointer to port->dev. Before: "(NULL device *): ttyJ0 at MMIO 0x1008 (irq = 2, base_baud = 0) is a Altera JTAG UART" After: "altera_jtaguart 1008.serial: ttyJ0 at MMIO 0x1008 (irq = 2, base_baud = 0) is a Altera JTAG UART" Signed-off-by: NLey Foon Tan <lftan@altera.com> Acked-by: NTobias Klauser <tklauser@distanz.ch> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robert Baldyga 提交于
Add RX DMA transfers support for samsung serial driver. It's enabled when DMA controller for RX channel is specified in device-tree. DMA transactions are started when number of bytes in RX FIFO reaches trigger level, otherwise PIO mode is used. DMA transfer size is always PAGE_SIZE which can cause large latency when smaller data amount is transferred, so we always terminate DMA transaction on RX timeout interrupt. Timeout interval is set to 64 frame times. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robert Baldyga 提交于
Add TX DMA transfers support for samsung serial driver. It's enabled when "dmas" property is defined in serial device-tree node, otherwise TX transfers are prerformed using PIO. TX DMA is used for data segments larger than fifosize to reduce number of interrupts during data transmission. For buffers shorter than fifosize PIO mode is selected. Data blocks for DMA transfers are aligned to cache line size to avoid problems with coherency (some areas of TX circ buffer can be used by CPU during DMA transaction, so we have to ensure that our data is always consistent). Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robert Baldyga 提交于
Add functions requesting and releasing RX and TX DMA channels. This function are called only when "dmas" property in serial device-tree node is defined. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robert Baldyga 提交于
When we have "dmas" property in serial node in device-tree, we do memory alocation for dma structure which will be used in DMA handling code. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robert Baldyga 提交于
This struct contains DMA configuration for each serial port. It will be used in next commits adding DMA support in driver. Based on previous work of Sylwester Nawrocki and Lukasz Czerwinski. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
This patch adds Software flow control support in DMA mode. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
After send out x_char in UART driver, x_char needs to be cleared by UART driver itself, otherwise data in TXFIFO can no longer be sent out. Also tx counter needs to be increased to keep track of correct number of transmitted data. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
Other than enable Receiver Overrun Interrupt Enable (UCR4_OREN) in start_tx interface, UCR4_OREN should be enabled before enable of Receiver. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robin Gong 提交于
Start rx_dma once RXFIFO is not empty that can avoid dma request lost and causes data delay issue. Signed-off-by: NRobin Gong <b38343@freescale.com> Signed-off-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Anton Bondarenko 提交于
DMA mode for UART can be used even w/o HW flow control with RTS/CTS. So it need to be initialized and enabled earlier. Signed-off-by: NAnton Bondarenko <anton_bondarenko@mentor.com> Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dirk Behme 提交于
Terminating the DMA, make sure the interrupt is disabled, too. This fixes random kernel Oops due to dma_tx_call() called for invalid transmissions. If we disable the TDMAEN, make sure it's enabled again if a TX DMA is started. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
Currently in dma_tx_callback(), no matter if there is still remaining data pending in circle buffer or not, DMA transmit will be terminated. This will result in some data never get transmitted. In order to fix this issue, call imx_dma_tx() again in dma_tx_callback, when there is pending data and uart hasn't been stopped. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
This reverts commit 2ad28e3e. Instead of always wake up write_wait process in TX callback, TX callback should call imx_dma_tx() again, and let imx_dma_tx transfer the remaining data in circle buffer. The issue with commit 2ad28e3e is, in case there is remaining data in circle buffer, but no process is waiting on write_wait queue, then as no following uart_write() will be called after uart_write_wakeup(), thus cause data loss. Moreover according to Documentation/serial/driver, uart_write_wakeup() should be called in case the transmit buffer have dropped below a threshold. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dirk Behme 提交于
To synchronize between dma_tx_callback() and imx_dma_tx() use the same variable, dma_is_txing. This prevents any race between these two functions and ensures that a new DMA can start only after the first has been finished. Before the new DMA can be set up, update the circular buffer logic, first. Therefore, change dma_is_txing after that update, instead of before. While doing this, in dma_tx_callback() extend the locking to dma_unmap_sg() and the update of dma_is_txing. Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dirk Behme 提交于
First, reformat the code to exit immediately. This allows us to add more code in more readable format. In case the TX DMA was still running, remove and disable it's resources. Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dirk Behme 提交于
In case dmaengine_prep_slave_sg() fails, add the missing dma_unmap_sg(). Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NAnton Bondarenko <anton_bondarenko@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dirk Behme 提交于
Inverting the logic of the if statement for the sg initialization makes the if statement easier and better to read. No functional change. Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dirk Behme 提交于
Use imx_start_tx() just to enable the TX interrupt. It's the job of the TX interrupt ISR to fill the transmit buffer, then. If the transmit buffer is empty, the TX interrupt should be executed as soon as the start_tx() enables the interrupt, so there is no reason for the extra imx_transmit_buffer() call, here. Remove it. Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Signed-off-by: NAndy Lowe <andy_lowe@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
Several places are accessing the UCR1 register without locking. This probably will cause a race issue when another thread is accessing the same register. Add locking to preventing concurrent access of the UCR1 register. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jiada Wang 提交于
Add CREAD flag hanlding in set_termios and UART DMA mode which ignores all received chars when CREAD flag cleared. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NAnton Bondarenko <anton_bondarenko@mentor.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Cyrille Pitchen 提交于
Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Cyrille Pitchen 提交于
This patch fixes many bugs in the code dealing with the hardware handshake. As an example, in atmel_set_termios(), we used to test whether the CRTSCTS c_cflag was set. If so, we selected the "Hardware Handshake" mode through the Mode Register. However, few lines below the mode was reset to "Normal" (0). So there was no way to select the "Hardware Handshake" mode. To fix this issue, we moved the CRTSCRTS c_cflag test AFTER the mode has been reset to "Normal". Also setting the RTSEN and RTSDIS bits in the Control Register has different results whether the USART is set in "Normal" or "Hardware Handshake" mode: 1) "Normal" mode - the RTSEN bit forces the RTS line to low level, which tells the remote peer that we are ready to received new data. - the RTSDIS bit forces the RTS line to high level, which tells the remote peer to stop sending new data. 2) "Hardware Handshake" mode - the RTSEN bit forces the RTS line to high level. - the RTSDIS bit lets the hardware control the RTS line. WARNING: when FIFOs are not available or not enabled, the RTS line is controlled by the PDC. This is why using the Hardware Handshake mode requires using the PDC channel for reception. However the Hardware Handshake mode DOES NOT work with DMA controller since it cannot control the RTS line. Future designs with FIFOs will introduce a new feature: the RTS line will be controlled by the RX FIFO using thresholds. This patch was tested with this new design. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Cyrille Pitchen 提交于
-EDEFER error wasn't handle properly by atmel_serial_probe(). As an example, when atmel_serial_probe() is called for the first time, we pass the test_and_set_bit() test to check whether the port has already been initalized. Then we call atmel_init_port(), which may return -EDEFER, possibly returned before by clk_get(). Consequently atmel_serial_probe() used to return this error code WITHOUT clearing the port bit in the "atmel_ports_in_use" mask. When atmel_serial_probe() was called for the second time, it used to fail on the test_and_set_bit() function then returning -EBUSY. When atmel_serial_probe() fails, this patch make it clear the port bit in the "atmel_ports_in_use" mask, if needed, before returning the error code. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Cc: <stable@vger.kernel.org> # 3.12+ Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Cyrille Pitchen 提交于
atmel_serial_probe() calls atmel_init_port(). In turn, atmel_init_port() calls clk_disable_unprepare() to disable the peripheral clock before returning. Later atmel_serial_probe() accesses some I/O registers such as the Mode and Control registers for RS485 support then the Name and Version registers, through a call to atmel_get_ip_name(), but at that moment the peripheral clock was still disabled. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Cc: <stable@vger.kernel.org> # 3.12+ Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Cyrille Pitchen 提交于
dma_sync_*_for_cpu() and dma_sync_*_for_device() use 'enum dma_data_direction', not 'enum dma_transfer_direction' Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Barry Song 提交于
MARCO will not be supported any more and the project was dropped. it has been replaced by CSR atlas7. Signed-off-by: NBarry Song <Baohua.Song@csr.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Wolfram Sang 提交于
This platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-