03 Oct, 2020

9 commits

  • s3c64xx_spi_hwinit() disables interrupts. In s3c64xx_spi_probe() after
    calling s3c64xx_spi_hwinit() they are enabled with the following call.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-10-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Increase timeout by 30 ms for some wiggle room and set the minimum value
    to 100 ms. This ensures a non-zero value for short transfers which
    may take less than 1 ms. The timeout value does not affect
    performance because it is used with a completion.

    Similar formula is used in other drivers e.g. sun4i, sun6i.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-9-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Make sure the cur_speed value used in s3c64xx_enable_datapath()
    to configure DMA channel and in s3c64xx_wait_for_*() to calculate the
    transfer timeout is set to the actual value of (half) the clock speed.

    Don't change non-CMU case, because no frequency calculation errors have
    been reported.

    Reviewed-by: Krzysztof Kozlowski
    Suggested-by: Tomasz Figa
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-8-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Remove descriptions for non-existent fields and fix indentation.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-7-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Rename S3C64XX_SPI_SLAVE_* to S3C64XX_SPI_CS_* to match documentation.

    Signed-off-by: Łukasz Stelmach
    Reviewed-by: Krzysztof Kozlowski
    Link: https://lore.kernel.org/r/20201002122243.26849-6-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Report amount of pending data when a transfer stops due to errors.

    Report if DMA was used to transfer data and print the status code.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-5-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Check return values in prepare_dma() and s3c64xx_spi_config() and
    propagate errors upwards.

    Fixes: 788437273fa8 ("spi: s3c64xx: move to generic dmaengine API")
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-4-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without
    the patches such transfers fail.

    The vendor kernel for ARTIK5 handles CS in a simmilar way.

    Signed-off-by: Łukasz Stelmach
    Reviewed-by: Krzysztof Kozlowski
    Link: https://lore.kernel.org/r/20201002122243.26849-3-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     
  • Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without
    the patches such transfers fail to complete. This solution to the problem
    is found in the vendor kernel for ARTIK5 boards based on Exynos3250.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Łukasz Stelmach
    Link: https://lore.kernel.org/r/20201002122243.26849-2-l.stelmach@samsung.com
    Signed-off-by: Mark Brown

    Łukasz Stelmach
     

17 Jul, 2020

1 commit

  • Fixes the following W=1 kernel build warning(s):

    drivers/spi/spi-s3c64xx.c:150: warning: Function parameter or member 'quirks' not described in 's3c64xx_spi_port_config'
    drivers/spi/spi-s3c64xx.c:150: warning: Function parameter or member 'clk_ioclk' not described in 's3c64xx_spi_port_config'
    drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'pdev' not described in 's3c64xx_spi_driver_data'
    drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'rx_dma' not described in 's3c64xx_spi_driver_data'
    drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'tx_dma' not described in 's3c64xx_spi_driver_data'
    drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'port_conf' not described in 's3c64xx_spi_driver_data'
    drivers/spi/spi-s3c64xx.c:189: warning: Function parameter or member 'port_id' not described in 's3c64xx_spi_driver_data'

    Signed-off-by: Lee Jones
    Cc: Kukjin Kim
    Cc: Krzysztof Kozlowski
    Cc: Andi Shyti
    Cc: Jaswinder Singh
    Cc: linux-samsung-soc@vger.kernel.org
    Link: https://lore.kernel.org/r/20200717135424.2442271-8-lee.jones@linaro.org
    Signed-off-by: Mark Brown

    Lee Jones
     

15 Nov, 2019

1 commit


17 May, 2018

1 commit

  • Since Linux v4.10 release (commit 1d9174fbc55e "PM / Runtime: Defer
    resuming of the device in pm_runtime_force_resume()"),
    pm_runtime_force_resume() function doesn't runtime resume device if it was
    not runtime active before system suspend. Thus, driver should not do any
    register access after pm_runtime_force_resume() without checking the
    runtime status of the device. To fix this issue, simply move
    s3c64xx_spi_hwinit() call to s3c64xx_spi_runtime_resume() to ensure that
    hardware is always properly initialized. This fixes Synchronous external
    abort issue on system suspend/resume cycle on newer Exynos SoCs.

    Signed-off-by: Marek Szyprowski
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Marek Szyprowski
     

25 Apr, 2018

1 commit


18 Apr, 2018

4 commits


17 Apr, 2018

4 commits


08 Jan, 2018

1 commit


04 Nov, 2017

1 commit


20 Feb, 2017

1 commit


14 Feb, 2017

1 commit

  • Commit a92e7c3d82a1 ("spi: s3c64xx: consider the case when the CS
    line is not connected") introduced an inconsistency between the
    binding, where the disconnected CS line was marked as
    'no-cs-readback', and the driver.

    The driver is erroneously checking for that attribute with
    property name of 'broken-cs'.

    Check for 'no-cs-readback' in the driver as well.

    Fixes: a92e7c3d82a1 ("spi: s3c64xx: consider the case when the CS line is not connected")
    Signed-off-by: Andi Shyti
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Andi Shyti
     

18 Jan, 2017

1 commit

  • We accidentally mixed up freeing the rx and tx channels which would a
    leak and an oops.

    Fixes: 3d63a47a380a ("spi: s3c64xx: Don't request/release DMA channels for each SPI transfer")
    Signed-off-by: Dan Carpenter
    Acked-by: Marek Szyprowski
    Acked-by: Andi Shyti
    Signed-off-by: Mark Brown

    Dan Carpenter
     

09 Jan, 2017

1 commit

  • Requesting a DMA channel might be a time consuming operation, so there is
    no need to acquire and release DMA channel for each SPI transfer.
    DMA channels can be requested during driver probe and kept all the time,
    also because there are no shared nor dynamically allocated channels on
    Samsung S3C/S5P/Exynos platforms.

    While moving dma_requrest_slave_channel calls, lets switch to
    dma_request_slave_channel_reason(), which returns error codes on failure,
    which can be properly propagated to the caller (this for example defers
    SPI probe when DMA controller is not yet available).

    Signed-off-by: Marek Szyprowski
    Reviewed-by: Andi Shyti
    Tested-by: Andi Shyti
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown

    Marek Szyprowski
     

17 Nov, 2016

1 commit


15 Jul, 2016

5 commits

  • Patch a9e93e8 has erroneously removed some comments which are
    important to understand why the bus frequency is multiplied by
    two during the spi transfer.

    Reword the previous comment to a more appropriate message.

    Suggested-by: Sylwester Nawrocki
    Signed-off-by: Andi Shyti
    Reviewed-by: Michael Turquette
    Signed-off-by: Mark Brown

    Andi Shyti
     
  • The new compatible is related to the Samsung Exynos5433 SoC. The
    difference between the previous is that in the exynos5433 the SPI
    controller is driven by three clocks instead of only one.

    The new clock (ioclk) is controlling the input/output clock
    whenever the controller is slave or master.

    The presence of the clock line is detected from the compatibility
    structure (exynos5433_spi_port_config) as a boolean value.

    The probe function checks whether the ioclk is present and if so,
    it acquires.

    The runtime suspend and resume functions will handle the clock
    enabling and disabling as well.

    Signed-off-by: Andi Shyti
    Reviewed-by: Michael Turquette
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown

    Andi Shyti
     
  • If clk_prepare_enable() fails do not return -EBUSY but use the
    value provided by the function itself.

    Suggested-by: Krzysztof Kozlowski
    Signed-off-by: Andi Shyti
    Reviewed-by: Michael Turquette
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown

    Andi Shyti
     
  • The goto labels of the style of

    err4:
    err3:
    err2:
    err1:

    are complex to insert in between new errors without renaming all
    the goto statements. Replace the errX naming style to meaningful
    names in order to make it easier to insert new goto exit points.

    Signed-off-by: Andi Shyti
    Reviewed-by: Krzysztof Kozlowski
    Reviewed-by: Michael Turquette
    Signed-off-by: Mark Brown

    Andi Shyti
     
  • Once a spi_master_get() call succeeds, we need an additional
    spi_master_put() call to free the memory, otherwise we will
    leak a reference to master. Fix by removing the unnecessary
    spi_master_get() call.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Andi Shyti
    Signed-off-by: Mark Brown

    Wei Yongjun
     

07 Jul, 2016

1 commit

  • When the clock is coming from the cmu it is not required to be
    disabled and then re-enabled in order to change the rate.

    Besides, some exynos chipsets (e.g. exynos5433) do not deliver
    any to the SFR if one from the pclk ("spi" in this case) or sclk
    ("busclk") is disabled.

    Remove the clock disabling/enabling to avoid falling into this
    situation.

    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Andi Shyti
    Signed-off-by: Mark Brown

    Andi Shyti
     

04 Jul, 2016

1 commit


30 Jun, 2016

4 commits


31 Dec, 2015

1 commit