[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

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

2019-08-05 Thread Andrey Smirnov
artup(). 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

[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] 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(&p->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 He

[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: Bhuvanchan

[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 can

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

2019-07-29 Thread Andrey Smirnov
n all 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

[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 23/24] tty: serial: fsl_lpuart: Don't enable TIE in .startup() or .resume()

2019-07-29 Thread Andrey Smirnov
artup(). 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-H

[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 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(&sport->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-Hart

[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 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 07/24] tty: serial: fsl_lpuart: Drop unnecessary uart_write_wakeup()

2019-07-29 Thread Andrey Smirnov
ommit 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

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

2019-07-29 Thread Andrey Smirnov
or us 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:

[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 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 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 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 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

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-

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] 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(&p->port) || uart_circ_empty(xmit) > > >

Re: [PATCH v2 1/2] ARM: dts: Add ZII support for ZII i.MX7 RMU2 board

2019-06-24 Thread Andrey Smirnov
On Sun, Jun 23, 2019 at 5:29 PM Shawn Guo wrote: > > On Mon, Jun 17, 2019 at 08:30:24AM -0700, Andrey Smirnov wrote: > > Add support for ZII's i.MX7 based Remote Modem Unit 2 (RMU2) board. > > > > Signed-off-by: Andrey Smirnov > > Cc: Shawn Guo > > Cc:

[PATCH v3 2/2] dt-bindings: arm: fsl: Add support for ZII i.MX7 RMU2 board

2019-06-24 Thread Andrey Smirnov
Add support for ZII i.MX7 RMU2 board. Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Reviewed-by: Rob Herring Cc: Shawn Guo Cc: Chris Healy Cc: Lucas Stach Cc: Fabio Estevam Cc: Bob Langer Cc: Liang Pan Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org

[PATCH v3 1/2] ARM: dts: Add ZII support for ZII i.MX7 RMU2 board

2019-06-24 Thread Andrey Smirnov
Add support for ZII's i.MX7 based Remote Modem Unit 2 (RMU2) board. Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Rob Herring Cc: Chris Healy Cc: Lucas Stach Cc: Fabio Estevam Cc: Bob Langer Cc: Liang Pan Cc: linux-arm-ker...@lists.infradead.org Cc:

[PATCH v2 2/2] dt-bindings: arm: fsl: Add support for ZII i.MX7 RMU2 board

2019-06-17 Thread Andrey Smirnov
Add support for ZII i.MX7 RMU2 board. Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Reviewed-by: Rob Herring Cc: Shawn Guo Cc: Chris Healy Cc: Lucas Stach Cc: Fabio Estevam Cc: Bob Langer Cc: Liang Pan Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org

[PATCH v2 1/2] ARM: dts: Add ZII support for ZII i.MX7 RMU2 board

2019-06-17 Thread Andrey Smirnov
Add support for ZII's i.MX7 based Remote Modem Unit 2 (RMU2) board. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Rob Herring Cc: Chris Healy Cc: Lucas Stach Cc: Fabio Estevam Cc: Bob Langer Cc: Liang Pan Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.o

[PATCH v3 0/5] crypto: caam - Add i.MX8MQ support

2019-06-17 Thread Andrey Smirnov
Everyone: Picking up where Chris left off (I chatted with him privately beforehead), this series adds support for i.MX8MQ to CAAM driver. Just like [v1], this series is i.MX8MQ only. Feedback is welcome! Thanks, Andrey Smirnov Changes since [v2]: - Dropped "crypto: caam - do not initi

[PATCH v3 3/5] crypto: caam - always select job ring via RSR on i.MX8MQ

2019-06-17 Thread Andrey Smirnov
apparently those are not implemented, so the case when SCFGR[VIRT_EN]=0 should be handles the same as the case when SCFGR[VIRT_EN]=1 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

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

2019-06-17 Thread Andrey Smirnov
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 welcome! Thanks, Andrey Smirnov Changes since [v5] - Rebased on recent linux-next, dropped

[PATCH v6 03/12] thermal: qoriq: Add local struct qoriq_sensor pointer

2019-06-17 Thread Andrey Smirnov
Add local struct qoriq_sensor pointer in qoriq_tmu_register_tmu_zone() for brevity. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux

[PATCH v6 01/12] thermal: qoriq: Add local struct device pointer

2019-06-17 Thread Andrey Smirnov
Use a local "struct device *dev" for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com

[PATCH v6 02/12] thermal: qoriq: Don't store struct thermal_zone_device reference

2019-06-17 Thread Andrey Smirnov
Struct thermal_zone_device reference stored as sensor's private data isn't really used anywhere in the code. Drop it. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Ang

[PATCH v6 10/12] thermal: qoriq: Do not report invalid temperature reading

2019-06-17 Thread Andrey Smirnov
Before returning measured temperature data to upper layer we need to make sure that the reading was marked as "valid" to avoid reporting bogus data. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Va

[PATCH v6 09/12] thermal: qoriq: Enable all sensors before registering them

2019-06-17 Thread Andrey Smirnov
, for the sake of simplicity, change the code to do just that. Signed-off-by: Andrey Smirnov Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kerne

[PATCH v6 07/12] thermal: qoriq: Convert driver to use devm_ioremap()

2019-06-17 Thread Andrey Smirnov
Convert driver to use devm_ioremap() to simplify memory deallocation and error handling code. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus

[PATCH v6 06/12] thermal: qoriq: Pass data to qoriq_tmu_calibration() directly

2019-06-17 Thread Andrey Smirnov
sequently would be able to drop the "err_iomap" error path. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@

[PATCH v6 11/12] thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs()

2019-06-17 Thread Andrey Smirnov
Add devres wrapper for thermal_add_hwmon_sysfs() to simplify driver code. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux

[PATCH v6 12/12] thermal: qoriq: Add hwmon support

2019-06-17 Thread Andrey Smirnov
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux

[PATCH v6 05/12] thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directly

2019-06-17 Thread Andrey Smirnov
Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a paltform device and then deriving it. This is done as a first step to simplify resource deallocation code. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc

[PATCH v6 04/12] thermal: qoriq: Embed per-sensor data into struct qoriq_tmu_data

2019-06-17 Thread Andrey Smirnov
Embed per-sensor data into struct qoriq_tmu_data so we can drop the code allocating it. This also allows us to get rid of per-sensor back reference to struct qoriq_tmu_data since now its address can be caluclated using container_of(). Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas

[PATCH v6 08/12] thermal: qoriq: Convert driver to use regmap API

2019-06-17 Thread Andrey Smirnov
Convert driver to use regmap API, drop custom LE/BE IO helpers and simplify bit manipulation using regmap_update_bits(). This also allows us to convert some register initialization to use loops and adds convenient debug access to TMU registers via debugfs. Signed-off-by: Andrey Smirnov Reviewed

[PATCH v4 09/16] crypto: caam - drop 64-bit only wr/rd_reg64()

2019-07-03 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 v4 16/16] crypto: caam - add clock entry for i.MX8MQ

2019-07-03 Thread Andrey Smirnov
Add clock entry needed to support i.MX8MQ. 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

[PATCH v4 08/16] crypto: caam - use ioread64*_hi_lo in rd_reg64

2019-07-03 Thread Andrey Smirnov
Following the same transformation logic as outlined in previous commit converting wr_reg64, convert rd_reg64 to use helpers from first. 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

[PATCH v4 15/16] crypto: caam - always select job ring via RSR on i.MX8MQ

2019-07-03 Thread Andrey Smirnov
apparently those are not implemented, so the case when SCFGR[VIRT_EN]=0 should be handles the same as the case when SCFGR[VIRT_EN]=1 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

[PATCH v4 11/16] crypto: caam - move cpu_to_caam_dma() selection to runtime

2019-07-03 Thread Andrey Smirnov
Instead of selecting the implementation of cpu_to_caam_dma()/caam_dma_to_cpu() at build time using the preprocessor, convert the code to do that at run-time using IS_ENABLED macro. This is needed to add support for i.MX8MQ. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris

Re: [PATCH v3 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-06 Thread Andrey Smirnov
On Thu, Jun 6, 2019 at 3:59 AM Andrzej Hajda wrote: > > On 05.06.2019 09:04, Andrey Smirnov wrote: > > Simplify AUX data read by removing index arithmetic and shifting with > > a helper functions that does three things: > > > > 1. Fetch data from up to 4

[PATCH v4 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-06 Thread Andrey Smirnov
Simplify AUX data read by removing index arithmetic and shifting with a helper function that does two things: 1. Fetch data from up to 4 32-bit registers from the chip 2. Copy read data into user provided array. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda

[PATCH v4 15/15] drm/bridge: tc358767: Replace magic number in tc_main_link_enable()

2019-06-06 Thread Andrey Smirnov
We don't need 8 byte array, DP_LINK_STATUS_SIZE (6) should be enough. This also gets rid of a magic number as a bonus. Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc:

[PATCH] i2c: imx: Initialize DMA before registering I2C adapter

2019-06-08 Thread Andrey Smirnov
problem was encountered on VF610 CFU1 board with CONFIG_FSL_EDMA=n. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Wolfram Sang Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/i2c/busses

Re: [PATCH v4 1/1] power: supply: Add HWMON compatibility layer

2019-07-09 Thread Andrey Smirnov
On Thu, Jun 27, 2019 at 11:27 AM Sebastian Reichel wrote: > > Hi, > > On Wed, Jun 12, 2019 at 01:44:04AM -0700, Andrey Smirnov wrote: > > Add code implementing HWMON adapter/compatibility layer to allow > > expositing various sensors present on power supply devices via H

Re: [PATCH] nvme-core: Share code between nvme_wait_ready() and nvme_shutdown_ctrl()

2019-03-08 Thread Andrey Smirnov
On Fri, Mar 8, 2019 at 5:23 AM Christoph Hellwig wrote: > > On Wed, Feb 06, 2019 at 04:13:12PM -0800, Andrey Smirnov wrote: > > Code polling NVME_CSTS_SHST_CMPLT in nvme_shutdown_ctrl() is very > > similar to polling loop in nvme_wait_ready(). Move shared polling

[PATCH 2/7] gpio: vf610: Simplify vf610_gpio_set()

2019-03-10 Thread Andrey Smirnov
The only difference between two codepaths is register offset used. Simplify the code a bit by replacing explicit calls with a single call with a variable offset. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew

[PATCH 0/7] VF610 GPIO fixes/improvments

2019-03-10 Thread Andrey Smirnov
Everyone: This series contains a number of fixes/improvements I came up with while working VF610 GPIO code. Hopefully each commit is self-explanatory. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (7): gpio: vf610: Do not share irq_chip gpio: vf610: Simplify vf610_gpio_set

[PATCH 3/7] gpio: vf610: Simplify vf610_gpio_get()

2019-03-10 Thread Andrey Smirnov
Both branches of the if statement do exactly the same thing, just at different offsets. Simplify the code a bit by moving shared action code outside of the if statement. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc

[PATCH 7/7] gpio: vf610: Don't use explicit &pdev->dev in vf610_gpio_probe()

2019-03-10 Thread Andrey Smirnov
The code already defines "dev" variable to help with that, so make sure all of the code uses it. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Fabio Estevam Cc: linux-g...@vger.kernel.org Cc: li

[PATCH 6/7] gpio: vf610: Use devres to remove gpiochip

2019-03-10 Thread Andrey Smirnov
Now that the driver's custom remove hook contains only a single action, replace it by converting the code to use devm_gpiochip_add_data() to simplify things. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc:

[PATCH 5/7] gpio: vf610: Use devres to disable clk_gpio

2019-03-10 Thread Andrey Smirnov
. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Fabio Estevam Cc: linux-g...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-...@nxp.com --- drivers/gpio/gpio-vf610.c | 6 -- 1 file changed, 4

[PATCH 4/7] gpio: vf610: Use devres to disable clk_port

2019-03-10 Thread Andrey Smirnov
removal. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Fabio Estevam Cc: linux-g...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-...@nxp.com --- drivers/gpio/gpio-vf610.c | 16 ++-- 1

[PATCH 1/7] gpio: vf610: Do not share irq_chip

2019-03-10 Thread Andrey Smirnov
Fix the warning produced by gpiochip_set_irq_hooks() by allocating a dedicated IRQ chip per GPIO chip/port. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Fabio Estevam Cc: linux-g...@vger.kernel.org Cc: linux

[PATCH] ARM: dts: vf610: Add ZII SPB4 board

2019-03-11 Thread Andrey Smirnov
Add Device Tree for VF610 based Zodiac Seat Power Box. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Fabio Estevam Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-...@nxp.com --- arch/arm/boot/dts

Re: [PATCH] arm64: dts: fsl: imx8mq: enable the thermal management unit (TMU)

2019-03-11 Thread Andrey Smirnov
, since as I mentioned above there are multiple thermal zones (CPU, GPU, VPU). > + }; > + > + thermal-zones { > + cpu-thermal { > + polling-delay-passive = <250>; > + polling-delay = <2000>; > + thermal-sensors = <&tmu>; Ditto. Thanks, Andrey Smirnov

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

2019-02-21 Thread Andrey Smirnov
On Wed, Feb 20, 2019 at 4:52 PM Eduardo Valentin wrote: > > Hey Andrey > > On Mon, Feb 18, 2019 at 11:11:29AM -0800, Andrey Smirnov wrote: > > Everyone: > > > > This series contains patches adding support for HWMON integration, > > multi-sensor suppor

Re: [PATCH 12/12] thermal: qoriq: Add support for multiple thremal sites

2019-02-21 Thread Andrey Smirnov
On Wed, Feb 20, 2019 at 4:57 PM Eduardo Valentin wrote: > > On Mon, Feb 18, 2019 at 11:11:41AM -0800, Andrey Smirnov wrote: > > TMU IP block provides temerature measurement for up to 16 sites, > > current implementation of the driver however hardcodes a single site > > I

[PATCH v2 08/13] thermal: qoriq: Pass data to qoriq_tmu_calibration() directly

2019-02-22 Thread Andrey Smirnov
sequently would be able to drop the "err_iomap" error path. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/the

[PATCH v2 02/13] thermal: qoriq: Remove unnecessary DT node is NULL check

2019-02-22 Thread Andrey Smirnov
This driver is meant to be used with Device Tree and there's no use-case where device's DT node is going to be NULL. Remove code protecting against that. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-.

[PATCH v2 06/13] thermal: qoriq: Embed per-sensor data into struct qoriq_tmu_data

2019-02-22 Thread Andrey Smirnov
Embed per-sensor data into struct qoriq_tmu_data so we can drop the code allocating it. This also allows us to get rid of per-sensor back reference to struct qoriq_tmu_data since now its address can be caluclated using container_of(). Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas

[PATCH v2 00/13] QorIQ TMU multi-sensor and HWMON support

2019-02-22 Thread Andrey Smirnov
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. Feedback is welcome! Thanks, Andrey Smirnov Changes since [v1] - Rebased on "linus"

[PATCH v2 04/13] thermal: qoriq: Don't store struct thermal_zone_device reference

2019-02-22 Thread Andrey Smirnov
Struct thermal_zone_device reference stored as sensor's private data isn't really used anywhere in the code. Drop it. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.ker

[PATCH v2 05/13] thermal: qoriq: Add local struct qoriq_sensor pointer

2019-02-22 Thread Andrey Smirnov
Add local struct qoriq_sensor pointer in qoriq_tmu_register_tmu_zone() for brevity. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH v2 09/13] thermal: qoriq: Convert driver to use devm_ioremap()

2019-02-22 Thread Andrey Smirnov
Convert driver to use devm_ioremap() to simplify memory deallocation and error handling code. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org

[PATCH v2 01/13] thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs()

2019-02-22 Thread Andrey Smirnov
Add devres wrapper for thermal_add_hwmon_sysfs() to simplify driver code. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers

[PATCH v2 07/13] thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directly

2019-02-22 Thread Andrey Smirnov
Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a paltform device and then deriving it. This is done as a first step to simplify resource deallocation code. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin

[PATCH v2 12/13] thermal: qoriq: Do not report invalid temperature reading

2019-02-22 Thread Andrey Smirnov
Before returning measured temperature data to upper layer we need to make sure that the reading was marked as "valid" to avoid reporting bogus data. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@

[PATCH v2 11/13] thermal: qoriq: Enable all sensors before registering them

2019-02-22 Thread Andrey Smirnov
, for the sake of simplicity, change the code to do just that. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/qoriq_ther

[PATCH v2 03/13] thermal: qoriq: Add local struct device pointer

2019-02-22 Thread Andrey Smirnov
Use a local "struct device *dev" for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --

[PATCH v2 10/13] thermal: qoriq: Convert driver to use regmap API

2019-02-22 Thread Andrey Smirnov
Convert driver to use regmap API, drop custom LE/BE IO helpers and simplify bit manipulation using regmap_update_bits(). This also allows us to convert some register initialization to use loops and adds convenient debug access to TMU registers via debugfs. Signed-off-by: Andrey Smirnov Cc: Chris

[PATCH v2 13/13] thermal: qoriq: Add hwmon support

2019-02-22 Thread Andrey Smirnov
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

Re: [RFC] Bluetooth: Retry configure request if result is L2CAP_CONF_UNKNOWN

2019-03-20 Thread Andrey Smirnov
On Mon, Feb 18, 2019 at 8:57 PM Andrey Smirnov wrote: > > On Mon, Feb 18, 2019 at 4:58 AM Marcel Holtmann wrote: > > > > Hi Andrey, > > > > > Due to: > > > > > > - current implementation of l2cap_config_rsp() dropping BT > > > connect

[PATCH 09/12] thermal: qoriq: Do not report invalid temperature reading

2019-02-18 Thread Andrey Smirnov
Before returning measured temperature data to upper layer we need to make sure that the reading was marked as "valid" to avoid reporting bogus data. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@

[PATCH 11/12] thermal: qoriq: Be more strict when parsing "thermal-sensors"

2019-02-18 Thread Andrey Smirnov
. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/qoriq_thermal.c | 14 +++--- 1 file changed, 7 insertions(+), 7

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

2019-02-18 Thread Andrey Smirnov
Everyone: This series contains patches adding support for HWMON integration, multi-sensor support as well as a small fix and general improvements (hopefully) for TMU driver I made while working on it on i.MX8MQ. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (12): thermal_hwmon

[PATCH 07/12] thermal: qoriq: Convert driver to use regmap API

2019-02-18 Thread Andrey Smirnov
Convert driver to use regmap API, drop custom LE/BE IO helpers and simplify bit manipulation using regmap_update_bits(). This also allows us to convert some register initialization to use loops and adds convenient debug access to TMU registers via debugfs. Signed-off-by: Andrey Smirnov Cc: Chris

[PATCH 12/12] thermal: qoriq: Add support for multiple thremal sites

2019-02-18 Thread Andrey Smirnov
TMU IP block provides temerature measurement for up to 16 sites, current implementation of the driver however hardcodes a single site ID. Change the code so it would be possible to reference multiple sites as indivudial sensors and get their temperature readings. Signed-off-by: Andrey Smirnov Cc

[PATCH 02/12] thermal: qoriq: Remove unnecessary DT node is NULL check

2019-02-18 Thread Andrey Smirnov
This driver is meant to be used with Device Tree and there's no use-case where device's DT node is going to be NULL. Remove code protecting against that. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-.

[PATCH 10/12] thermal: qoriq: Simplify error handling in qoriq_tmu_get_sensor_id()

2019-02-18 Thread Andrey Smirnov
Use goto to avoid repeating resource deallocation code. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal

[PATCH 05/12] thermal: qoriq: Convert driver to use devm_ioremap()

2019-02-18 Thread Andrey Smirnov
Convert driver to use devm_ioremap() to simplify memory deallocation and error handling code. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org

[PATCH 04/12] thermal: qoriq: Don't pass platform_device to qoriq_tmu_calibration()

2019-02-18 Thread Andrey Smirnov
sequently would be able to drop the "err_iomap" error path. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/the

[PATCH 06/12] thermal: qoriq: Add hwmon support

2019-02-18 Thread Andrey Smirnov
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH 01/12] thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs()

2019-02-18 Thread Andrey Smirnov
Add devres wrapper for thermal_add_hwmon_sysfs() to simplify driver code. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers

[PATCH 03/12] thermal: qoriq: Add local struct device pointer in qoriq_tmu_probe()

2019-02-18 Thread Andrey Smirnov
Use a local "struct device *dev" for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --

<    5   6   7   8   9   10   11   12   13   14   >