1. 10 Aug, 2020 3 commits
  2. 05 Aug, 2020 1 commit
  3. 03 Aug, 2020 1 commit
    • Lukas Wunner's avatar
      spi: Prevent adding devices below an unregistering controller · ddf75be4
      Lukas Wunner authored
      CONFIG_OF_DYNAMIC and CONFIG_ACPI allow adding SPI devices at runtime
      using a DeviceTree overlay or DSDT patch.  CONFIG_SPI_SLAVE allows the
      same via sysfs.
      
      But there are no precautions to prevent adding a device below a
      controller that's being removed.  Such a device is unusable and may not
      even be able to unbind cleanly as it becomes inaccessible once the
      controller has been torn down.  E.g. it is then impossible to quiesce
      the device's interrupt.
      
      of_spi_notify() and acpi_spi_notify() do hold a ref on the controller,
      but otherwise run lockless against spi_unregister_controller().
      
      Fix by holding the spi_add_lock in spi_unregister_controller() and
      bailing out of spi_add_device() if the controller has been unregistered
      concurrently.
      
      Fixes: ce79d54a ("spi/of: Add OF notifier handler")
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Cc: stable@vger.kernel.org # v3.19+
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Octavian Purdila <octavian.purdila@intel.com>
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Link: https://lore.kernel.org/r/a8c3205088a969dc8410eec1eba9aface60f36af.1596451035.git.lukas@wunner.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      ddf75be4
  4. 29 Jul, 2020 5 commits
    • Mark Brown's avatar
      Merge series "Some bug fix for lpspi" from Clark Wang <xiaoning.wang@nxp.com>: · 1d5cd4e7
      Mark Brown authored
      Hi,
      
      This patchset mainly fixes some recently discovered problems about CS for
      LPSPI module on i.MX8DXLEVK.
      
      Add the dt-bindings description for the new property.
      
      Clark Wang (4):
        spi: lpspi: Fix kernel warning dump when probe fail after calling
          spi_register
        spi: lpspi: remove unused fsl_lpspi->chipselect
        spi: lpspi: fix using CS discontinuously on i.MX8DXLEVK
        dt-bindings: lpspi: New property in document DT bindings for LPSPI
      
       .../bindings/spi/spi-fsl-lpspi.yaml           |  7 ++++++
       drivers/spi/spi-fsl-lpspi.c                   | 25 +++++++++++--------
       2 files changed, 21 insertions(+), 11 deletions(-)
      
      --
      2.17.1
      1d5cd4e7
    • Clark Wang's avatar
      dt-bindings: lpspi: New property in document DT bindings for LPSPI · 7ac9bbf6
      Clark Wang authored
      Add "fsl,spi-only-use-cs1-sel" to fit i.MX8DXL-EVK.
      Spi common code does not support use of CS signals discontinuously.
      It only uses CS1 without using CS0. So, add this property to re-config
      chipselect value.
      Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
      Link: https://lore.kernel.org/r/20200727031513.31774-1-xiaoning.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      7ac9bbf6
    • Clark Wang's avatar
      spi: lpspi: fix using CS discontinuously on i.MX8DXLEVK · 2a052590
      Clark Wang authored
      SPI common code does not support using CS discontinuously for now.
      However, i.MX8DXL-EVK only uses CS1 without CS0. Therefore, add a flag
      is_only_cs1 to set the correct TCR[PCS].
      Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
      Link: https://lore.kernel.org/r/20200727031448.31661-4-xiaoning.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      2a052590
    • Clark Wang's avatar
      spi: lpspi: remove unused fsl_lpspi->chipselect · 768ba490
      Clark Wang authored
      The cs-gpio is initailized by spi_get_gpio_descs() now. Remove the
      chipselect.
      Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
      Link: https://lore.kernel.org/r/20200727031448.31661-3-xiaoning.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      768ba490
    • Clark Wang's avatar
      spi: lpspi: Fix kernel warning dump when probe fail after calling spi_register · 16d79185
      Clark Wang authored
      Calling devm_spi_register_controller() too early will cause problem.
      When probe failed occurs after calling devm_spi_register_controller(),
      the call of spi_controller_put() will trigger the following warning dump.
      
      [    2.092138] ------------[ cut here ]------------
      [    2.096876] kernfs: can not remove 'uevent', no directory
      [    2.102440] WARNING: CPU: 0 PID: 181 at fs/kernfs/dir.c:1503 kernfs_remove_by_name_ns+0xa0/0xb0
      [    2.111142] Modules linked in:
      [    2.114207] CPU: 0 PID: 181 Comm: kworker/0:7 Not tainted 5.4.24-05024-g775c6e8a738c-dirty #1314
      [    2.122991] Hardware name: Freescale i.MX8DXL EVK (DT)
      [    2.128141] Workqueue: events deferred_probe_work_func
      [    2.133281] pstate: 60000005 (nZCv daif -PAN -UAO)
      [    2.138076] pc : kernfs_remove_by_name_ns+0xa0/0xb0
      [    2.142958] lr : kernfs_remove_by_name_ns+0xa0/0xb0
      [    2.147837] sp : ffff8000122bba70
      [    2.151145] x29: ffff8000122bba70 x28: ffff8000119d6000
      [    2.156462] x27: 0000000000000000 x26: ffff800011edbce8
      [    2.161779] x25: 0000000000000000 x24: ffff00003ae4f700
      [    2.167096] x23: ffff000010184c10 x22: ffff00003a3d6200
      [    2.172412] x21: ffff800011a464a8 x20: ffff000010126a68
      [    2.177729] x19: ffff00003ae5c800 x18: 000000000000000e
      [    2.183046] x17: 0000000000000001 x16: 0000000000000019
      [    2.188362] x15: 0000000000000004 x14: 000000000000004c
      [    2.193679] x13: 0000000000000000 x12: 0000000000000001
      [    2.198996] x11: 0000000000000000 x10: 00000000000009c0
      [    2.204313] x9 : ffff8000122bb7a0 x8 : ffff00003a3d6c20
      [    2.209630] x7 : ffff00003a3d6380 x6 : 0000000000000001
      [    2.214946] x5 : 0000000000000001 x4 : ffff00003a05eb18
      [    2.220263] x3 : 0000000000000005 x2 : ffff8000119f1c48
      [    2.225580] x1 : 2bcbda323bf5a800 x0 : 0000000000000000
      [    2.230898] Call trace:
      [    2.233345]  kernfs_remove_by_name_ns+0xa0/0xb0
      [    2.237879]  sysfs_remove_file_ns+0x14/0x20
      [    2.242065]  device_del+0x12c/0x348
      [    2.245555]  device_unregister+0x14/0x30
      [    2.249492]  spi_unregister_controller+0xac/0x120
      [    2.254201]  devm_spi_unregister+0x10/0x18
      [    2.258304]  release_nodes+0x1a8/0x220
      [    2.262055]  devres_release_all+0x34/0x58
      [    2.266069]  really_probe+0x1b8/0x318
      [    2.269733]  driver_probe_device+0x54/0xe8
      [    2.273833]  __device_attach_driver+0x80/0xb8
      [    2.278194]  bus_for_each_drv+0x74/0xc0
      [    2.282034]  __device_attach+0xdc/0x138
      [    2.285876]  device_initial_probe+0x10/0x18
      [    2.290063]  bus_probe_device+0x90/0x98
      [    2.293901]  deferred_probe_work_func+0x64/0x98
      [    2.298442]  process_one_work+0x198/0x320
      [    2.302451]  worker_thread+0x1f0/0x420
      [    2.306208]  kthread+0xf0/0x120
      [    2.309352]  ret_from_fork+0x10/0x18
      [    2.312927] ---[ end trace 58abcdfae01bd3c7 ]---
      
      So put this function at the end of the probe sequence.
      Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
      Link: https://lore.kernel.org/r/20200727031448.31661-2-xiaoning.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      16d79185
  5. 28 Jul, 2020 5 commits
  6. 27 Jul, 2020 3 commits
  7. 22 Jul, 2020 14 commits
  8. 17 Jul, 2020 8 commits
    • Mark Brown's avatar
      Merge series "Add support for... · 2b2d441d
      Mark Brown authored
      Merge series "Add support for [H]SCIF/TMU/CMT/THS/SDHI/MSIOF/CAN[FD]/I2C/IIC/RWDT on R8A774E1" from Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>:
      
      Hi All,
      
      This patch series enables support for following on RZ/G2H SoC,
      * CPU OPP
      * THS
      * CMT/TMU
      * I2C/IIC
      * MSIOF
      * RWDT
      * SDHI
      * SCIF/HSCIF
      * CAN/CANFD
      
      Cheers,
      Prabhakar
      
      Lad Prabhakar (14):
        dt-bindings: thermal: rcar-gen3-thermal: Add r8a774e1 support
        dt-bindings: timer: renesas,cmt: Document r8a774e1 CMT support
        arm64: dts: renesas: r8a774e1: Add SCIF and HSCIF nodes
        arm64: dts: renesas: r8a774e1: Add SDHI nodes
        dt-bindings: i2c: renesas,i2c: Document r8a774e1 support
        dt-bindings: i2c: renesas,iic: Document r8a774e1 support
        arm64: dts: renesas: r8a774e1: Add I2C and IIC-DVFS support
        dt-bindings: spi: renesas,sh-msiof: Add r8a774e1 support
        arm64: dts: renesas: r8a774e1: Add MSIOF nodes
        dt-bindings: watchdog: renesas,wdt: Document r8a774e1 support
        arm64: dts: renesas: r8a774e1: Add RWDT node
        dt-bindings: can: rcar_can: Document r8a774e1 support
        dt-bindings: can: rcar_canfd: Document r8a774e1 support
        arm64: dts: renesas: r8a774e1: Add CAN[FD] support
      
      Marian-Cristian Rotariu (6):
        arm64: dts: renesas: r8a774e1: Add operating points
        thermal: rcar_gen3_thermal: Add r8a774e1 support
        arm64: dts: renesas: r8a774e1: Add RZ/G2H thermal support
        arm64: dts: renesas: r8a774e1: Add CMT device nodes
        dt-bindings: timer: renesas,tmu: Document r8a774e1 bindings
        arm64: dts: renesas: r8a774e1: Add TMU device nodes
      
       .../devicetree/bindings/i2c/renesas,i2c.txt   |   1 +
       .../devicetree/bindings/i2c/renesas,iic.txt   |   1 +
       .../devicetree/bindings/net/can/rcar_can.txt  |   1 +
       .../bindings/net/can/rcar_canfd.txt           |   1 +
       .../bindings/spi/renesas,sh-msiof.yaml        |   1 +
       .../bindings/thermal/rcar-gen3-thermal.yaml   |   1 +
       .../bindings/timer/renesas,cmt.yaml           |   2 +
       .../devicetree/bindings/timer/renesas,tmu.txt |   1 +
       .../bindings/watchdog/renesas,wdt.yaml        |   1 +
       arch/arm64/boot/dts/renesas/r8a774e1.dtsi     | 713 +++++++++++++++++-
       drivers/thermal/rcar_gen3_thermal.c           |   4 +
       11 files changed, 715 insertions(+), 12 deletions(-)
      
      --
      2.17.1
      2b2d441d
    • Lee Jones's avatar
      spi: spi-amd: Do not define 'struct acpi_device_id' when !CONFIG_ACPI · 85ed0f63
      Lee Jones authored
      Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
      struct 'spi_acpi_match' becomes defined but unused.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-amd.c:297:36: warning: ‘spi_acpi_match’ defined but not used [-Wunused-const-variable=]
       297 | static const struct acpi_device_id spi_acpi_match[] = {
       | ^~~~~~~~~~~~~~
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Cc: Sanjay R Mehta <sanju.mehta@amd.com>
      Link: https://lore.kernel.org/r/20200717135424.2442271-15-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      85ed0f63
    • Lee Jones's avatar
      spi: spi-pxa2xx: Do not define 'struct acpi_device_id' when !CONFIG_ACPI · 9b2d6119
      Lee Jones authored
      Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
      struct 'pxa2xx_spi_acpi_match' becomes defined but unused.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-pxa2xx.c:1435:36: warning: ‘pxa2xx_spi_acpi_match’ defined but not used [-Wunused-const-variable=]
       1435 | static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
       | ^~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Cc: Daniel Mack <daniel@zonque.org>
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Link: https://lore.kernel.org/r/20200717135424.2442271-14-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      9b2d6119
    • Lee Jones's avatar
      spi: spi-at91-usart: Remove unused OF table 'struct of_device_id' · c894c265
      Lee Jones authored
      The only way this driver can be probed by MFD via its parent device.
      
      No other reference to 'microchip,at91sam9g45-usart-spi' exists in the kernel.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-at91-usart.c:684:34: warning: ‘at91_usart_spi_dt_ids’ defined but not used [-Wunused-const-variable=]
       684 | static const struct of_device_id at91_usart_spi_dt_ids[] = {
       | ^~~~~~~~~~~~~~~~~~~~~
      Suggested-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Radu Pirea <radu_nicolae.pirea@upb.ro>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
      Link: https://lore.kernel.org/r/20200717135424.2442271-13-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      c894c265
    • Lee Jones's avatar
      spi: spi-topcliff-pch: Add missing descriptions to 'struct pch_spi_data' · decf5326
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'io_base_addr' not described in 'pch_spi_data'
       drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'pkt_tx_buff' not described in 'pch_spi_data'
       drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'pkt_rx_buff' not described in 'pch_spi_data'
       drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'dma' not described in 'pch_spi_data'
       drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'use_dma' not described in 'pch_spi_data'
       drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'save_total_len' not described in 'pch_spi_data'
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20200717135424.2442271-12-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      decf5326
    • Lee Jones's avatar
      spi: spi-zynqmp-gqspi: Correct a couple of misspellings in kerneldoc · 4b42b0b4
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-zynqmp-gqspi.c:205: warning: Function parameter or member 'slavecs' not described in 'zynqmp_gqspi_selectslave'
       drivers/spi/spi-zynqmp-gqspi.c:205: warning: Function parameter or member 'slavebus' not described in 'zynqmp_gqspi_selectslave'
       drivers/spi/spi-zynqmp-gqspi.c:205: warning: Excess function parameter 'flashcs' description in 'zynqmp_gqspi_selectslave'
       drivers/spi/spi-zynqmp-gqspi.c:205: warning: Excess function parameter 'flashbus' description in 'zynqmp_gqspi_selectslave'
       drivers/spi/spi-zynqmp-gqspi.c:902: warning: Function parameter or member 'dev' not described in 'zynqmp_qspi_suspend'
       drivers/spi/spi-zynqmp-gqspi.c:902: warning: Excess function parameter '_dev' description in 'zynqmp_qspi_suspend'
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Reviewed-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Link: https://lore.kernel.org/r/20200717135424.2442271-11-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      4b42b0b4
    • Lee Jones's avatar
      spi: spi-zynq-qspi: Add description for 2 missing attributes/parameters · e867feec
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-zynq-qspi.c:143: warning: Function parameter or member 'dev' not described in 'zynq_qspi'
       drivers/spi/spi-zynq-qspi.c:334: warning: Function parameter or member 'spi' not described in 'zynq_qspi_config_op'
       drivers/spi/spi-zynq-qspi.c:334: warning: Excess function parameter 'qspi' description in 'zynq_qspi_config_op'
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Reviewed-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Cc: Sureshkumar Relli <nagasure@xilinx.com>
      Link: https://lore.kernel.org/r/20200717135424.2442271-10-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      e867feec
    • Lee Jones's avatar
      spi: spi-pl022: Provide missing struct attribute/function param docs · c7cd1dfb
      Lee Jones authored
      Also demote non-worthy kerneldoc headers to standard comment blocks.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/spi/spi-pl022.c:304: warning: cannot understand function prototype: 'enum ssp_writing '
       drivers/spi/spi-pl022.c:330: warning: Function parameter or member 'loopback' not described in 'vendor_data'
       drivers/spi/spi-pl022.c:398: warning: Function parameter or member 'rx_lev_trig' not described in 'pl022'
       drivers/spi/spi-pl022.c:398: warning: Function parameter or member 'tx_lev_trig' not described in 'pl022'
       drivers/spi/spi-pl022.c:398: warning: Function parameter or member 'dma_running' not described in 'pl022'
       drivers/spi/spi-pl022.c:670: warning: Function parameter or member 'pl022' not described in 'readwriter'
       drivers/spi/spi-pl022.c:1250: warning: Function parameter or member 'irq' not described in 'pl022_interrupt_handler'
       drivers/spi/spi-pl022.c:1250: warning: Function parameter or member 'dev_id' not described in 'pl022_interrupt_handler'
       drivers/spi/spi-pl022.c:1343: warning: Function parameter or member 'pl022' not described in 'set_up_next_transfer'
       drivers/spi/spi-pl022.c:1343: warning: Function parameter or member 'transfer' not described in 'set_up_next_transfer'
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Cc: Sachin Verma <sachin.verma@st.com>
      Link: https://lore.kernel.org/r/20200717135424.2442271-9-lee.jones@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      c7cd1dfb