19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

28 Nov, 2017

1 commit

  • The driver has been successfully tested with Xilinx's core
    axi-quad-spi-1.0.0a. Documented on DS843:

    https://www.xilinx.com/support/documentation/ip_documentation/axi_quad_spi/v1_00_a/ds843_axi_quad_spi.pdf

    Cc: Mark Brown
    Cc: Rob Herring
    Cc: devicetree@vger.kernel.org
    Signed-off-by: Ricardo Ribalda Delgado
    Acked-by: Rob Herring
    Signed-off-by: Mark Brown

    Ricardo Ribalda
     

24 Nov, 2017

1 commit

  • When the core is configured in C_SPI_MODE > 0, it integrates a
    lookup table that automatically configures the core in dual or quad mode
    based on the command (first byte on the tx fifo).

    Unfortunately, that list mode_?_memoy_*.mif does not contain all the
    supported commands by the flash.

    Since 4.14 spi-nor automatically tries to probe the flash using SFDP
    (command 0x5a), and that command is not part of the list_mode table.

    Whit the right combination of C_SPI_MODE and C_SPI_MEMORY this leads
    into a stall that can only be recovered with a soft rest.

    This patch detects this kind of stall and returns -EIO to the caller on
    those commands. spi-nor can handle this error properly:

    m25p80 spi0.0: Detected stall. Check C_SPI_MODE and C_SPI_MEMORY. 0x21 0x2404
    m25p80 spi0.0: SPI transfer failed: -5
    spi_master spi0: failed to transfer one message from queue
    m25p80 spi0.0: s25sl064p (8192 Kbytes)

    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ricardo Ribalda
     

15 Jul, 2016

2 commits

  • Return IRQ_NONE from the interrupt handler if the handler is running, but
    no interrupt was detected. This allows the system to recover in case of an
    interrupt storm due to an invalid interrupt configuration or faulty
    hardware.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     
  • The Xilinx SPI driver can operate without an IRQ, but not every error
    returned by platform_get_irq() means that no IRQ was specified. It will
    also return an error if the IRQ specification is invalid or the IRQ
    provider is not yet available (EPROBE_DEFER).

    So instead of ignoring all errors only ignore ENXIO, which means no IRQ was
    specified, and propagate all other errors to device driver core.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

29 Oct, 2015

1 commit

  • Some users have reported that in polled mode the driver fails randomly
    to read the last word of the transfer.

    The end condition used for the transmissions (in polled and irq mode)
    has been the TX_EMPTY flag. But Lars-Peter Clausen has identified a delay
    from the TX_EMPTY to the actual end of the data rx.

    I believe that this race condition has not been detected until now
    because of the latency added by the IRQ handler or the PCIe bridge.
    This bugs affects setups with low latency access to the spi core.

    This patch replaces the readout logic:

    For all the words, except the last one, the TX_EMPTY flag is used (and
    cached).

    If !TX_EMPY or is the last word. The status register is read and the
    RX_EMPTY flag is used.

    The performance is not affected: there is an extra read of the
    Status Register, but the readout can start as soon as there is a word
    in the buffer.

    Reported-by: Edward Kigwana
    Initial-fix-by: Lars-Peter Clausen
    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ricardo Ribalda Delgado
     

14 Aug, 2015

1 commit

  • The ACK of an inexistent IRQ can trigger an spurious IRQ that breaks the
    txrx logic. This has been observed on axi_quad_spi:3.2 core.

    This patch only ACKs IRQs that have not been Acknowledge jet.

    Reported-by: Edward Kigwana
    Tested-by: Edward Kigwana
    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ricardo Ribalda Delgado
     

13 Aug, 2015

1 commit

  • Once the module process a transfer in irq mode, the next poll transfer
    will not work because the transmitter is left in inhibited state.

    Fixes: 22417352f6b7f623 (Use polling mode on small transfers)
    Reported-by: Edward Kigwana
    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ricardo Ribalda Delgado
     

02 Feb, 2015

1 commit


30 Jan, 2015

1 commit


29 Jan, 2015

15 commits


28 Jan, 2015

1 commit

  • The number of words in the read buffer will be exactly the same as the
    number of words written on write buffer, once the transaction has
    finished.

    Instead of cheking the rx_empty flags for every word simply save the
    number of words written by fill_tx_fifo.

    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Mark Brown

    Ricardo Ribalda Delgado
     

27 Jan, 2015

2 commits


17 Aug, 2014

1 commit

  • There is no need to init .owner field.

    Based on the patch from Peter Griffin
    "mmc: remove .owner field for drivers using module_platform_driver"

    This patch removes the superflous .owner field for drivers which
    use the module_platform_driver API, as this is overriden in
    platform_driver_register anyway."

    Signed-off-by: Michal Simek
    Signed-off-by: Mark Brown

    Michal Simek
     

10 Jul, 2014

1 commit

  • The Xilinx SPI driver initializes the bus_num field of the SPI master to
    pdev->dev.id. pdev->dev.id is always 0 for platform devices which causes bus
    number conflicts for the SPI controller when creating multiple device instances
    of the driver. Instead use pdev->id which will have the assignt platform device
    id. If the device is instantiated via devicetree pdev->id is -1 which will cause
    the SPI core to dynamically assign a id (or use the id defined via a alias in
    the devicetree).

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Mark Brown

    Lars-Peter Clausen
     

30 Mar, 2014

1 commit


27 Feb, 2014

1 commit


23 Feb, 2014

1 commit

  • Set bits_per_word_mask so spi core will reject transfers that attempt to use
    an unsupported bits_per_word value.

    spi_bitbang requires custom setup_transfer() to be defined if there is a
    custom txrx_bufs(). Thus keep the empty xilinx_spi_setup_transfer() function
    in the code.

    Signed-off-by: Axel Lin
    Acked-by: Michal Simek
    Signed-off-by: Mark Brown

    Axel Lin
     

03 Feb, 2014

1 commit


15 Nov, 2013

1 commit


17 Sep, 2013

1 commit

  • Many drivers that use bitbang library have a leak on probe error paths.
    This is because once a spi_master_get() call succeeds, we need an additional
    spi_master_put() call to free the memory.

    Fix this issue by moving the code taking a reference to master to
    spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
    success. With this change, the caller is responsible for calling
    spi_bitbang_stop() to decrement the reference and spi_master_put() as
    counterpart of spi_alloc_master() to prevent a memory leak.

    So now we have below patten for drivers using bitbang library:

    probe:
    spi_alloc_master -> Init reference count to 1
    spi_bitbang_start -> Increment reference count
    remove:
    spi_bitbang_stop -> Decrement reference count
    spi_master_put -> Decrement reference count (reference count reaches 0)

    Fixup all users accordingly.

    Signed-off-by: Axel Lin
    Suggested-by: Uwe Kleine-Koenig
    Acked-by: Uwe Kleine-Koenig
    Signed-off-by: Mark Brown

    Axel Lin
     

01 Sep, 2013

1 commit


29 Aug, 2013

2 commits


10 Aug, 2013

1 commit