1. 03 9月, 2020 1 次提交
    • V
      spi: spi-loopback-test: Fix out-of-bounds read · 837ba18d
      Vincent Whitchurch 提交于
      The "tx/rx-transfer - crossing PAGE_SIZE" test always fails when
      len=131071 and rx_offset >= 5:
      
       spi-loopback-test spi0.0: Running test tx/rx-transfer - crossing PAGE_SIZE
       ...
         with iteration values: len = 131071, tx_off = 0, rx_off = 3
         with iteration values: len = 131071, tx_off = 0, rx_off = 4
         with iteration values: len = 131071, tx_off = 0, rx_off = 5
       loopback strangeness - rx changed outside of allowed range at: ...a4321000
         spi_msg@ffffffd5a4157690
           frame_length:  131071
           actual_length: 131071
           spi_transfer@ffffffd5a41576f8
             len:    131071
             tx_buf: ffffffd5a4340ffc
      
      Note that rx_offset > 3 can only occur if the SPI controller driver sets
      ->dma_alignment to a higher value than 4, so most SPI controller drivers
      are not affect.
      
      The allocated Rx buffer is of size SPI_TEST_MAX_SIZE_PLUS, which is 132
      KiB (assuming 4 KiB pages).  This test uses an initial offset into the
      rx_buf of PAGE_SIZE - 4, and a len of 131071, so the range expected to
      be written in this transfer ends at (4096 - 4) + 5 + 131071 == 132 KiB,
      which is also the end of the allocated buffer.  But the code which
      verifies the content of the buffer reads a byte beyond the allocated
      buffer and spuriously fails because this out-of-bounds read doesn't
      return the expected value.
      
      Fix this by using ITERATE_LEN instead of ITERATE_MAX_LEN to avoid
      testing sizes which cause out-of-bounds reads.
      Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com>
      Link: https://lore.kernel.org/r/20200902132341.7079-1-vincent.whitchurch@axis.comSigned-off-by: NMark Brown <broonie@kernel.org>
      837ba18d
  2. 26 8月, 2020 1 次提交
  3. 24 8月, 2020 1 次提交
  4. 11 8月, 2020 7 次提交
  5. 05 8月, 2020 1 次提交
  6. 03 8月, 2020 1 次提交
    • L
      spi: Prevent adding devices below an unregistering controller · ddf75be4
      Lukas Wunner 提交于
      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: NLukas 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: NMark Brown <broonie@kernel.org>
      ddf75be4
  7. 29 7月, 2020 10 次提交
  8. 27 7月, 2020 3 次提交
  9. 22 7月, 2020 14 次提交
  10. 17 7月, 2020 1 次提交
    • M
      Merge series "Add support for... · 2b2d441d
      Mark Brown 提交于
      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