[PATCH v2 07/22] watchdog: ziirave_wdt: Check packet length only once

2019-08-12 Thread Andrey Smirnov
We don't need to check for packet length more than once, so drop the extra check in ziirave_firm_upload(). While at it move the check at the very start of __ziirave_firm_write_pkt(), as to not waste any time preparing a packet we'll never use. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc

[PATCH v2 22/22] watchdog: ziirave_wdt: Update checked I2C functionality mask

2019-08-12 Thread Andrey Smirnov
Update checked I2C functionality mask to reflect all of the SMBus primitives used by this driver. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 5

[PATCH v2 12/22] watchdog: ziirave_wdt: Don't check if ihex record length is zero

2019-08-12 Thread Andrey Smirnov
Ihex_next_binrec() will return NULL if next record's 'len' is zero, so explicit checks for that in the driver are unnecessary. Drop them. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH v2 11/22] watchdog: ziirave_wdt: Make use of put_unaligned_le16

2019-08-12 Thread Andrey Smirnov
Instead of doing this explicitly use put_unaligned_le16() to place 16-bit address value into command payload. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog

[PATCH v2 09/22] watchdog: ziirave_wdt: Fix incorrect use of ARRAY_SIZE

2019-08-12 Thread Andrey Smirnov
Both memset() and ziirave_firm_write_block_data() expect length in bytes as an argument, not a number of elements in array. It just happens that in this particular case both values are equal. Modify the code to use sizeof() instead. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter

[PATCH v2 15/22] watchdog: ziirave_wdt: Fix misleading error message

2019-08-12 Thread Andrey Smirnov
via kernel parameter or Device Tree. Re-phase the log message to be more clear about benign nature of this event. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave

[PATCH v2 21/22] watchdog: ziirave_wdt: Drop ziirave_firm_write_block_data()

2019-08-12 Thread Andrey Smirnov
There's only one user of ziirave_firm_write_block_data(), so we may as well inline it. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 31

[PATCH v2 08/22] watchdog: ziirave_wdt: Skip zeros when calculating checksum

2019-08-12 Thread Andrey Smirnov
Zeros don't contribute anything to checksum value, so we can skip unused portion of the packet when calculating its checksum. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers

[PATCH v2 02/22] watchdog: ziirave_wdt: Be verbose about errors in probe()

2019-08-12 Thread Andrey Smirnov
The driver is quite silent in case of probe failure, which makes it more difficult to diagnose problem from the kernel log. Add logging to all of the silent error paths ziirave_wdt_probe() to improve that. Signed-off-by: Andrey Smirnov Reviewed-by: Guenter Roeck Cc: Chris Healy Cc: Guenter

[PATCH v2 20/22] watchdog: ziirave_wdt: Fix DOWNLOAD_START payload

2019-08-12 Thread Andrey Smirnov
i2c_smbus_write_byte() instead. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions

[PATCH v2 01/22] watchdog: ziirave_wdt: Add missing newline

2019-08-12 Thread Andrey Smirnov
Add missing newline. Signed-off-by: Andrey Smirnov Reviewed-by: Guenter Roeck Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 00/22] Ziirave_wdt driver fixes

2019-08-12 Thread Andrey Smirnov
Everyone, This series contains various fixes/improvements for ziirave_wdt driver. Hopefully each commit is self-explanatory. Feedback is welcome! Thanks, Andrey Smirnov Changes since [v1]: - Collected Reviewied-by from Guenter - Added two more error messages to "watchdog: ziirav

[PATCH v2 19/22] watchdog: ziirave_wdt: Drop status polling code

2019-08-12 Thread Andrey Smirnov
with a simple single byte read to simplify things. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 28 +++- 1 file changed, 7

[PATCH v2 05/22] watchdog: ziirave_wdt: Log bootloader/firmware info during probe

2019-08-12 Thread Andrey Smirnov
Log bootloader/firmware info during probe. This information is available via sysfs already, but it's really helpful to have this in kernel log during startup as well. Signed-off-by: Andrey Smirnov Reviewed-by: Guenter Roeck Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux

Re: [PATCH v6 00/12] QorIQ TMU multi-sensor and HWMON support

2019-08-12 Thread Andrey Smirnov
On Mon, Jun 17, 2019 at 9:15 AM Andrey Smirnov wrote: > > Everyone: > > This series contains patches adding support for HWMON integration, bug > fixes and general improvements (hopefully) for TMU driver I made while > working on it on i.MX8MQ.n > > Feedback is welco

[PATCH] iio: hi8435: Drop hi8435_remove()

2019-08-10 Thread Andrey Smirnov
Convert the remainder of hi8435_probe() to use devres and get rid of hi8435_remove(). Signed-off-by: Andrey Smirnov Cc: linux-kernel@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: Jonathan Cameron Cc: Chris Healy --- drivers/iio/adc/hi8435.c | 30 +- 1 file

[PATCH] iio: hi8435: Use gpiod_set_value_cansleep()

2019-08-10 Thread Andrey Smirnov
Use gpiod_set_value_cansleep() instead of gpiod_set_value() to support the case when reset pin is connected to a GPIO expander. See ZII VF610 SCU4 AIB for one such example. Signed-off-by: Andrey Smirnov Cc: linux-kernel@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: Jonathan Cameron Cc

Re: [PATCH 4/5] watchdog: ziirave_wdt: Don't bail out on unexpected timeout value

2019-08-10 Thread Andrey Smirnov
On Wed, Jul 31, 2019 at 11:09 AM Guenter Roeck wrote: > > On Wed, Jul 31, 2019 at 10:42:51AM -0700, Andrey Smirnov wrote: > > Reprogramming bootloader on watchdog MCU will result in reported > > default timeout value of "0". That in turn will be unnecesarily >

Re: [PATCH] tty: serial: Introduce uart_tx_stoppped_or_empty()

2019-08-06 Thread Andrey Smirnov
On Mon, Aug 5, 2019 at 11:48 PM Andy Shevchenko wrote: > > On Mon, Aug 5, 2019 at 10:36 PM Andrey Smirnov > wrote: > > > > The vast majority of the serial drivers check for > > > > uart_tx_stopped(>port) || uart_circ_empty(xmit) > > > > condit

[PATCH] tty: serial: Introduce uart_tx_stoppped_or_empty()

2019-08-05 Thread Andrey Smirnov
The vast majority of the serial drivers check for uart_tx_stopped(>port) || uart_circ_empty(xmit) condition one or more times. Create a dedicated helper function and convert drivers to use it. Signed-off-by: Andrey Smirnov Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Chris Healy Cc: li

[PATCH v3 5/6] tty: serial: fsl_lpuart: Don't enable TIE in .startup() or .resume()

2019-08-05 Thread Andrey Smirnov
(). This change will also not enable TIE in .resume(), but it seems that, similart to .startup(), transmit interrupt shouldn't be enabled there either. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH v3 4/6] tty: serial: fsl_lpuart: Introduce lpuart*_setup_watermark_enable()

2019-08-05 Thread Andrey Smirnov
Most users of lpuart*_setup_watermark() enable identical set of flags right after the call, so combine those two action into a subroutine and make use of it. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby

[PATCH v3 0/6] LPUART fixes and improvements

2019-08-05 Thread Andrey Smirnov
erial: fsl_lpuart: Drop unnecessary sg_set_buf() call" due to being a duplicate of "tty: serial: fsl_lpuart: remove sg_set_buf() for sport->rx_sgl" - Fixed build break in "tty: serial: fsl_lpuart: Introduce lpuart_tx_dma_startup()" Thanks, Andre

[PATCH v3 6/6] tty: serial: fsl_lpuart: Ignore TX/RX interrupts if DMA is enabled

2019-08-05 Thread Andrey Smirnov
In a mixed DMA/IRQ use-case (e.g.: DMA for TX, IRQ for RX), interrupt handler might try to handle Rx/Tx condition it shouldn't. Change the code to only handle TX/RX event if corresponding path isn't being handled by DMA. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory

[PATCH v3 3/6] tty: serial: fsl_lpuart: Introduce lpuart32_configure()

2019-08-05 Thread Andrey Smirnov
Code doing final steps of TX/RX configuration in lpuart32_startup() and lpuart_resume() is identical, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH v3 1/6] tty: serial: fsl_lpuart: Introduce lpuart_tx_dma_startup()

2019-08-05 Thread Andrey Smirnov
Code configure DMA TX path in lpuart_startup(), lpuart32_startup() and lpuart_resume() is doing exactly the same thing, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri

[PATCH v3 2/6] tty: serial: fsl_lpuart: Introduce lpuart_rx_dma_startup()

2019-08-05 Thread Andrey Smirnov
Code doing initial DMA RX configuration in lpuart_startup() and lpuart32_startup() is exactly the same, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH] ARM: imx: Drop imx_anatop_init()

2019-07-31 Thread Andrey Smirnov
datasheet it appears to have a different USB PHY IP block, so executing i.MX6 charger disable configuration seems unnecessary. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Shawn Guo Cc: Fabio Estevam Cc: Peter Chen Cc: linux-...@nxp.com Cc: linux-arm-ker...@lists.infradead.org Cc: li

[PATCH 3/5] watchdog: ziirave_wdt: Be more verbose during firmware update

2019-07-31 Thread Andrey Smirnov
Add more error logging to ziirave_firm_upload() for diagnostics. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 8 ++-- 1 file changed, 6

[PATCH 2/5] watchdog: ziirave_wdt: Be verbose about errors in probe()

2019-07-31 Thread Andrey Smirnov
The driver is quite silent in case of probe failure, which makes it more difficult to diagnose problem from the kernel log. Add logging to all of the silent error paths ziirave_wdt_probe() to improve that. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc

[PATCH 0/5] Ziirave_wdt driver fixes

2019-07-31 Thread Andrey Smirnov
Everyone, This series contains various fixes/improvements for ziirave_wdt driver. Hopefully each commit is self-explanatory. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (5): watchdog: ziirave_wdt: Add missing newline watchdog: ziirave_wdt: Be verbose about errors in probe

[PATCH 1/5] watchdog: ziirave_wdt: Add missing newline

2019-07-31 Thread Andrey Smirnov
Add missing newline. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog

[PATCH 4/5] watchdog: ziirave_wdt: Don't bail out on unexpected timeout value

2019-07-31 Thread Andrey Smirnov
the value unconditionally to fix the above. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/watchdog/ziirave_wdt.c | 22 +- 1 file changed, 9 insertions(+), 13 deletion

[PATCH 5/5] watchdog: ziirave_wdt: Log bootloader/firmware info during probe

2019-07-31 Thread Andrey Smirnov
Log bootloader/firmware info during probe. This information is available via sysfs already, but it's really helpful to have this in kernel log during startup as well. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watch...@vger.kernel.org Cc

[PATCH] dmaengine: fsl-edma: implement .device_synchronize callback

2019-07-31 Thread Andrey Smirnov
Implement .device_synchronize callback in order to be able to use dmaengine_terminate_sync() and other primitives relying on said callback. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Vinod Koul Cc: linux-...@nxp.com Cc: dmaeng...@vger.kernel.org Cc: linux-kernel

[PATCH v2 23/23] tty: serial: fsl_lpuart: Ignore TX/RX interrupts if DMA is enabled

2019-07-31 Thread Andrey Smirnov
In a mixed DMA/IRQ use-case (e.g.: DMA for TX, IRQ for RX), interrupt handler might try to handle Rx/Tx condition it shouldn't. Change the code to only handle TX/RX event if corresponding path isn't being handled by DMA. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory

[PATCH v2 22/23] tty: serial: fsl_lpuart: Don't enable TIE in .startup() or .resume()

2019-07-31 Thread Andrey Smirnov
(). This change will also not enable TIE in .resume(), but it seems that, similart to .startup(), transmit interrupt shouldn't be enabled there either. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH v2 21/23] tty: serial: fsl_lpuart: Introduce lpuart*_setup_watermark_enable()

2019-07-31 Thread Andrey Smirnov
Most users of lpuart*_setup_watermark() enable identical set of flags right after the call, so combine those two action into a subroutine and make use of it. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby

[PATCH v2 06/23] tty: serial: fsl_lpuart: Drop unnecessary uart_write_wakeup()

2019-07-31 Thread Andrey Smirnov
5e42e9a30cda ("serial: imx: Fix x_char handling and tx flow control") where this problem was fixed in a very similarly structured i.MX UART driver. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby

[PATCH v2 04/23] tty: serial: fsl_lpuart: Simplify RX/TX IRQ handlers

2019-07-31 Thread Andrey Smirnov
to restrict the prototype of the handler to irqreturn_t foo(int, void *) and we can drop all of uneened boilerplate code by changing it void foo(struct lpuart_port *). Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc

[PATCH v2 14/23] tty: serial: fsl_lpuart: Use cpu_relax() instead of barrier()

2019-07-31 Thread Andrey Smirnov
Use cpu_relax() instead of barrier() in a tight polling loops to make them a bit more idiomatic. Should also improve things on ARM64 a bit since cpu_relax() will expand into "yield" instruction there. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar

[PATCH v2 20/23] tty: serial: fsl_lpuart: Introduce lpuart32_configure()

2019-07-31 Thread Andrey Smirnov
Code doing final steps of TX/RX configuration in lpuart32_startup() and lpuart_resume() is identical, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH v2 17/23] tty: serial: fsl_lpuart: Introduce lpuart_dma_shutdown()

2019-07-31 Thread Andrey Smirnov
Last steps of .shutdown() code are identical for lpuart and lpuart32 cases, so move it all into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser

[PATCH v2 11/23] tty: serial: fsl_lpuart: Clear CSTOPB unconditionally

2019-07-31 Thread Andrey Smirnov
Clearing CSTOPB bit if it is set is functionally equivalent to jsut clearing it unconditionally. Drop unnecessary check. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser

[PATCH v2 15/23] tty: serial: fsl_lpuart: Introduce lpuart_stopped_or_empty()

2019-07-31 Thread Andrey Smirnov
The check for uart_circ_empty(xmit) || uart_tx_stopped(>port) appears in multiple places in the driver. Move it into a helper function. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: li

[PATCH v2 12/23] tty: serial: fsl_lpuart: Use appropriate lpuart32_* I/O funcs

2019-07-31 Thread Andrey Smirnov
When dealing with 32-bit variant of LPUART IP block appropriate I/O helpers have to be used to properly deal with endianness differences. Change all of the offending code to do that. Fixes: a5fa2660d787 ("tty/serial/fsl_lpuart: Add CONSOLE_POLL support for lpuart32.") Signed-off-

[PATCH v2 18/23] tty: serial: fsl_lpuart: Introduce lpuart_tx_dma_startup()

2019-07-31 Thread Andrey Smirnov
Code configure DMA TX path in lpuart_startup(), lpuart32_startup() and lpuart_resume() is doing exactly the same thing, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri

[PATCH v2 19/23] tty: serial: fsl_lpuart: Introduce lpuart_rx_dma_startup()

2019-07-31 Thread Andrey Smirnov
Code doing initial DMA RX configuration in lpuart_startup() and lpuart32_startup() is exactly the same, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH v2 13/23] tty: serial: fsl_lpuart: Introduce lpuart_wait_bit_set()

2019-07-31 Thread Andrey Smirnov
Busy polling on a bit in a register is used in multiple places in the driver. Move it into a shared function. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser

[PATCH v2 09/23] tty: serial: fsl_lpuart: Drop no-op bit opearation

2019-07-31 Thread Andrey Smirnov
The check for termios->c_cflag & CRTSCTS ensure that if we reach else branch, CRTSCTS in termios->c_cflag is already going to be cleard. Doing so explicitly there is not necessary. Drop it. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach

[PATCH v2 10/23] tty: serial: fsl_lpuart: Drop unnecessary extra parenthesis

2019-07-31 Thread Andrey Smirnov
Drop unnecessary extra parenthesis in the driver. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/tty

[PATCH v2 16/23] tty: serial: fsl_lpuart: Drop unnecessary lpuart*_stop_tx()

2019-07-31 Thread Andrey Smirnov
that, drop the call to lpuart_stop_tx() in lpuart_shutdown(). In case of lpuart32_shutdown()/lpuart32_stop_tx(), TIE won't even be set if lpuart_dma_tx_use is true. Drop it there as well. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg

[PATCH v2 07/23] tty: serial: fsl_lpuart: Fix issue in software flow control

2019-07-31 Thread Andrey Smirnov
f-by: Greg Kroah-Hartman should apply here as well. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/

[PATCH v2 08/23] tty: serial: fls_lpuart: Split shared TX IRQ handler into two

2019-07-31 Thread Andrey Smirnov
lpuart_txint into lpuart_txint and lpuart32_txint so we can drop all extra lpuart_is_32() check and make the code flow more linear. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux

[PATCH v2 01/23] tty: serial: fsl_lpuart: fix framing error handling when using DMA

2019-07-31 Thread Andrey Smirnov
during this operation and when reading the data register to minimize potential interference. Signed-off-by: Stefan Agner Acked-by: Max Krummenacher Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH v2 05/23] tty: serial: fsl_lpuart: Fix bogus indentation

2019-07-31 Thread Andrey Smirnov
Fix bogus indentation in rx_dma_timer_init(). Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/tty/serial

[PATCH v2 03/23] tty: serial: fsl_lpuart: Flush HW FIFOs in .flush_buffer

2019-07-31 Thread Andrey Smirnov
Switching baud rate might cause bogus data to appear in HW FIFO. Add code to do a HW FIFO flush to .flush_buffer callback to avoid that. Signed-off-by: Fugang Duan Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri

[PATCH v2 02/23] tty: serial: fsl_lpuart: flush receive FIFO after overruns

2019-07-31 Thread Andrey Smirnov
From: Stefan Agner After overruns the FIFO pointers become misaligned. This typically shows by characters still being stuck in the FIFO despite the empty flag being asserted. After the first assertion of the overrun flag the empty flag still seems to indicate FIFO state correctly and all data

[PATCH v2 00/23] LPUART fixes and improvements

2019-07-31 Thread Andrey Smirnov
duplicate of "tty: serial: fsl_lpuart: remove sg_set_buf() for sport->rx_sgl" - Fixed build break in "tty: serial: fsl_lpuart: Introduce lpuart_tx_dma_startup()" Thanks, Andrey Smirnov Andrey Smirnov (21): tty: serial: fsl_lpuart: Flush HW FIFOs in .flush

Re: [PATCH 19/24] tty: serial: fsl_lpuart: Introduce lpuart_tx_dma_startup()

2019-07-30 Thread Andrey Smirnov
On Tue, Jul 30, 2019 at 8:56 AM Greg Kroah-Hartman wrote: > > On Mon, Jul 29, 2019 at 12:52:21PM -0700, Andrey Smirnov wrote: > > Code configure DMA TX path in lpuart_startup(), lpuart32_startup() and > > lpuart_resume() is doing exactly the same thing, so move it into a > &g

Re: [PATCH 06/24] tty: serial: fsl_lpuart: Drop unnecessary sg_set_buf() call

2019-07-30 Thread Andrey Smirnov
On Tue, Jul 30, 2019 at 8:51 AM Greg Kroah-Hartman wrote: > > On Mon, Jul 29, 2019 at 12:52:08PM -0700, Andrey Smirnov wrote: > > Sg_init_one() will already call sg_set_buf(), so another explicit call > > right after it is unnecessary. Drop it. > > > > Signed-

[PATCH 00/24] LPUART fixes and improvements

2019-07-29 Thread Andrey Smirnov
Everyone: This series contains fixes/improvements to LPUART dirver I came up with recently as well as fixes picked up from Toradex and NXP Vybrid repos. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (22): tty: serial: fsl_lpuart: Flush HW FIFOs in .flush_buffer tty: serial

[PATCH 01/24] tty: serial: fsl_lpuart: fix framing error handling when using DMA

2019-07-29 Thread Andrey Smirnov
during this operation and when reading the data register to minimize potential interference. Signed-off-by: Stefan Agner Acked-by: Max Krummenacher Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri

[PATCH 10/24] tty: serial: fsl_lpuart: Drop no-op bit opearation

2019-07-29 Thread Andrey Smirnov
The check for termios->c_cflag & CRTSCTS ensure that if we reach else branch, CRTSCTS in termios->c_cflag is already going to be cleard. Doing so explicitly there is not necessary. Drop it. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory

[PATCH 15/24] tty: serial: fsl_lpuart: Use cpu_relax() instead of barrier()

2019-07-29 Thread Andrey Smirnov
Use cpu_relax() instead of barrier() in a tight polling loops to make them a bit more idiomatic. Should also improve things on ARM64 a bit since cpu_relax() will expand into "yield" instruction there. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy

[PATCH 13/24] tty: serial: fsl_lpuart: Use appropriate lpuart32_* I/O funcs

2019-07-29 Thread Andrey Smirnov
When dealing with 32-bit variant of LPUART IP block appropriate I/O helpers have to be used to properly deal with endianness differences. Change all of the offending code to do that. Fixes: a5fa2660d787 ("tty/serial/fsl_lpuart: Add CONSOLE_POLL support for lpuart32.") Signed-off-

[PATCH 03/24] tty: serial: fsl_lpuart: Flush HW FIFOs in .flush_buffer

2019-07-29 Thread Andrey Smirnov
Switching baud rate might cause bogus data to appear in HW FIFO. Add code to do a HW FIFO flush to .flush_buffer callback to avoid that. Signed-off-by: Fugang Duan Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg

[PATCH 12/24] tty: serial: fsl_lpuart: Clear CSTOPB unconditionally

2019-07-29 Thread Andrey Smirnov
Clearing CSTOPB bit if it is set is functionally equivalent to jsut clearing it unconditionally. Drop unnecessary check. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH 11/24] tty: serial: fsl_lpuart: Drop unnecessary extra parenthesis

2019-07-29 Thread Andrey Smirnov
Drop unnecessary extra parenthesis in the driver. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser...@vger.kernel.org Cc: linux-kernel

[PATCH 04/24] tty: serial: fsl_lpuart: Simplify RX/TX IRQ handlers

2019-07-29 Thread Andrey Smirnov
to restrict the prototype of the handler to irqreturn_t foo(int, void *) and we can drop all of uneened boilerplate code by changing it void foo(struct lpuart_port *). Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg

[PATCH 07/24] tty: serial: fsl_lpuart: Drop unnecessary uart_write_wakeup()

2019-07-29 Thread Andrey Smirnov
5e42e9a30cda ("serial: imx: Fix x_char handling and tx flow control") where this problem was fixed in a very similarly structured i.MX UART driver. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc:

[PATCH 20/24] tty: serial: fsl_lpuart: Introduce lpuart_rx_dma_startup()

2019-07-29 Thread Andrey Smirnov
Code doing initial DMA RX configuration in lpuart_startup() and lpuart32_startup() is exactly the same, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc

[PATCH 16/24] tty: serial: fsl_lpuart: Introduce lpuart_stopped_or_empty()

2019-07-29 Thread Andrey Smirnov
The check for uart_circ_empty(xmit) || uart_tx_stopped(>port) appears in multiple places in the driver. Move it into a helper function. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: J

[PATCH 19/24] tty: serial: fsl_lpuart: Introduce lpuart_tx_dma_startup()

2019-07-29 Thread Andrey Smirnov
Code configure DMA TX path in lpuart_startup(), lpuart32_startup() and lpuart_resume() is doing exactly the same thing, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah

[PATCH 23/24] tty: serial: fsl_lpuart: Don't enable TIE in .startup() or .resume()

2019-07-29 Thread Andrey Smirnov
(). This change will also not enable TIE in .resume(), but it seems that, similart to .startup(), transmit interrupt shouldn't be enabled there either. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc

[PATCH 22/24] tty: serial: fsl_lpuart: Introduce lpuart*_setup_watermark_enable()

2019-07-29 Thread Andrey Smirnov
Most users of lpuart*_setup_watermark() enable identical set of flags right after the call, so combine those two action into a subroutine and make use of it. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah

[PATCH 05/24] tty: serial: fsl_lpuart: Fix bogus indentation

2019-07-29 Thread Andrey Smirnov
Fix bogus indentation in rx_dma_timer_init(). Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH 09/24] tty: serial: fls_lpuart: Split shared TX IRQ handler into two

2019-07-29 Thread Andrey Smirnov
lpuart_txint into lpuart_txint and lpuart32_txint so we can drop all extra lpuart_is_32() check and make the code flow more linear. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH 06/24] tty: serial: fsl_lpuart: Drop unnecessary sg_set_buf() call

2019-07-29 Thread Andrey Smirnov
Sg_init_one() will already call sg_set_buf(), so another explicit call right after it is unnecessary. Drop it. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc

[PATCH 21/24] tty: serial: fsl_lpuart: Introduce lpuart32_configure()

2019-07-29 Thread Andrey Smirnov
Code doing final steps of TX/RX configuration in lpuart32_startup() and lpuart_resume() is identical, so move it into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri

[PATCH 17/24] tty: serial: fsl_lpuart: Drop unnecessary lpuart*_stop_tx()

2019-07-29 Thread Andrey Smirnov
that, drop the call to lpuart_stop_tx() in lpuart_shutdown(). In case of lpuart32_shutdown()/lpuart32_stop_tx(), TIE won't even be set if lpuart_dma_tx_use is true. Drop it there as well. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc

[PATCH 24/24] tty: serial: fsl_lpuart: Ignore TX/RX interrupts if DMA is enabled

2019-07-29 Thread Andrey Smirnov
In a mixed DMA/IRQ use-case (e.g.: DMA for TX, IRQ for RX), interrupt handler might try to handle Rx/Tx condition it shouldn't. Change the code to only handle TX/RX event if corresponding path isn't being handled by DMA. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc

[PATCH 02/24] tty: serial: fsl_lpuart: flush receive FIFO after overruns

2019-07-29 Thread Andrey Smirnov
From: Stefan Agner After overruns the FIFO pointers become misaligned. This typically shows by characters still being stuck in the FIFO despite the empty flag being asserted. After the first assertion of the overrun flag the empty flag still seems to indicate FIFO state correctly and all data

[PATCH 14/24] tty: serial: fsl_lpuart: Introduce lpuart_wait_bit_set()

2019-07-29 Thread Andrey Smirnov
Busy polling on a bit in a register is used in multiple places in the driver. Move it into a shared function. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc

[PATCH 18/24] tty: serial: fsl_lpuart: Introduce lpuart_dma_shutdown()

2019-07-29 Thread Andrey Smirnov
Last steps of .shutdown() code are identical for lpuart and lpuart32 cases, so move it all into a standalone subroutine. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux

[PATCH 08/24] tty: serial: fsl_lpuart: Fix issue in software flow control

2019-07-29 Thread Andrey Smirnov
f-by: Greg Kroah-Hartman should apply here as well. Signed-off-by: Andrey Smirnov Cc: Stefan Agner Cc: Bhuvanchandra DV Cc: Chris Healy Cc: Cory Tusar Cc: Lucas Stach Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-...@nxp.com Cc: linux-ser...@vger.kernel.org Cc: linux-kernel@vger.

[PATCH v6 08/14] crypto: caam - make CAAM_PTR_SZ dynamic

2019-07-17 Thread Andrey Smirnov
nal change intended. Signed-off-by: Andrey Smirnov Cc: Chris Spencer Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: Horia Geantă Cc: Aymen Sghaier Cc: Leonard Crestez Cc: linux-cry...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/crypto/caam/caamalg.c | 2 +- drivers/c

[PATCH v6 07/14] crypto: caam - drop 64-bit only wr/rd_reg64()

2019-07-17 Thread Andrey Smirnov
Since 32-bit of both wr_reg64 and rd_reg64 now use 64-bit IO helpers, these functions should no longer be necessary. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris Spencer Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: Horia Geantă Cc: Aymen Sghaier Cc: Leonard

[PATCH 2/3] ARM: dts: vf610-zii-scu4-aib: Fix pinctrl_i2c1's identation

2019-07-17 Thread Andrey Smirnov
Fix pinctrl_i2c1's inconsistent identation. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Fabio Estevam Cc: Cory Tusar Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/vf610-zii-scu4-aib.dts | 3 ++- 1 file changed, 2

[PATCH 1/3] ARM: dts: vf610-zii-spb4: Drop unused pinctrl_i2c1 pinmux config

2019-07-17 Thread Andrey Smirnov
Pinctrl_i2c1 pinmux config is not used anywhere. Drop it. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Fabio Estevam Cc: Cory Tusar Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/vf610-zii-spb4.dts | 7 --- 1 file

[PATCH 3/3] ARM: dts: vf610-zii-scu4-aib: Drop unused pinctrl_i2c3 pinmux config

2019-07-17 Thread Andrey Smirnov
Pinctrl_i2c3 pinmux config is not used anywhere. Drop it. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Fabio Estevam Cc: Cory Tusar Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/vf610-zii-scu4-aib.dts | 7 --- 1 file

[PATCH v2] clk: Constify struct clk_bulk_data * where possible

2019-07-17 Thread Andrey Smirnov
the second argument of clk_bulk_prepare_enable() and clk_bulk_disable_unprepare(), since the functions they are comprised of already accept const clk_bulk_data *. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Stephen Boyd Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel

Re: [PATCH 1/6] clk: Sync prototypes for clk_bulk_enable()

2019-07-17 Thread Andrey Smirnov
On Mon, Jul 15, 2019 at 3:00 PM Stephen Boyd wrote: > > Quoting Andrey Smirnov (2019-07-15 13:12:29) > > No-op version of clk_bulk_enable() should have the same protoype as > > the real implementation, so constify the last argument to make it so. > > > > Signed-

[PATCH 1/6] clk: Sync prototypes for clk_bulk_enable()

2019-07-15 Thread Andrey Smirnov
No-op version of clk_bulk_enable() should have the same protoype as the real implementation, so constify the last argument to make it so. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- include/linux/clk.h | 3

[PATCH 6/6] clk: Constify second argument of clk_bulk_disable_unprepare()

2019-07-15 Thread Andrey Smirnov
Both clk_bulk_disable() and clk_bulk_unprepare() take const struct clk_bulk_data, so change clk_bulk_disable_unprepare() to do so as well. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel

[PATCH 2/6] clk: Sync prototypes for clk_bulk_prepare()

2019-07-15 Thread Andrey Smirnov
No-op version of clk_bulk_prepare() should have the same protoype as the real implementation, so constify the last argument to make it so. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- include/linux/clk.h | 3

[PATCH 5/6] clk: Sync prototypes for clk_bulk_unprepare()

2019-07-15 Thread Andrey Smirnov
No-op version of clk_bulk_unprepare() should have the same protoype as the real implementation, so constify the last argument to make it so. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- include/linux/clk.h

[PATCH 4/6] clk: Sync prototypes for clk_bulk_disable()

2019-07-15 Thread Andrey Smirnov
No-op version of clk_bulk_disable() should have the same protoype as the real implementation, so constify the last argument to make it so. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- include/linux/clk.h | 2

[PATCH 3/6] clk: Constify second argument of clk_bulk_prepare_enable()

2019-07-15 Thread Andrey Smirnov
Both clk_bulk_prepare() and clk_bulk_enable() take const struct clk_bulk_data, so change clk_bulk_prepare_enable() to do so as well. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Russell King Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH 1/2] usb: dwc3: Use devres to get clocks

2019-07-12 Thread Andrey Smirnov
Use devres to get clocks and drop explicit clock freeing. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Felipe Balbi Cc: Chris Healy Cc: Greg Kroah-Hartman Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/usb/dwc3/core.c | 7 ++- 1 file

<    1   2   3   4   5   6   7   8   9   10   >