25 Mar, 2020

1 commit

  • [ Upstream commit 136b5cd2e2f97581ae560cff0db2a3b5369112da ]

    spi_qup_suspend() will cause synchronous external abort when
    runtime suspend is enabled and applied, as it tries to
    access SPI controller register while clock is already disabled
    in spi_qup_pm_suspend_runtime().

    Signed-off-by: Yuji sasaki
    Signed-off-by: Vinod Koul
    Link: https://lore.kernel.org/r/20200214074340.2286170-1-vkoul@kernel.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Yuji Sasaki
     

05 Jul, 2019

2 commits


13 Jun, 2019

1 commit

  • - DMA/PIO:
    If an error IRQ occurred during PIO or DMA mode make sure to log it so
    on completion the transfer can be marked as an error.

    - PIO:
    Do not complete a transaction until all data has been transferred or
    an error IRQ was flagged.

    1) If there was no error IRQ, ignore the done flag IRQ
    (QUP_OP_MAX_INPUT_DONE_FLAG) until all data for the transfer has been
    processed: not doing so risks completing the transfer returning
    uninitialized data in the buffers.

    2) Under stress testing we have identified the need to
    protect read/write operations against spurious IN/OUT service events.

    Signed-off-by: Jorge Ramirez-Ortiz
    Signed-off-by: Mark Brown

    Jorge Ramirez-Ortiz
     

11 Jun, 2019

1 commit


05 Jun, 2019

1 commit

  • Based on 1 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 rev 2 and only
    rev 2 as published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     

04 Jun, 2019

1 commit


10 Aug, 2017

2 commits

  • On 64-bit systems, pointers are wider than 'int' variables,
    so we get a warning about a cast between them:

    drivers/spi/spi-qup.c:1060:23: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

    This changes the code to use the correct uintptr_t cast.

    Fixes: 4d023737b2ef ("spi: qup: Fix QUP version identify method")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mark Brown

    Arnd Bergmann
     
  • The added conditionals in this function apparently confused
    gcc to the point that it no longer sees the code is safe and
    instead shows a false-positive warning:

    drivers/spi/spi-qup.c: In function 'spi_qup_transfer_one':
    drivers/spi/spi-qup.c:507:28: error: 'tx_nents' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    drivers/spi/spi-qup.c:464:17: note: 'tx_nents' was declared here
    drivers/spi/spi-qup.c:505:28: error: 'rx_nents' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    drivers/spi/spi-qup.c:464:7: note: 'rx_nents' was declared here

    This moves the initialization to a place that makes it obvious
    to the compiler.

    Fixes: 5884e17ef3cb ("spi: qup: allow multiple DMA transactions per spi xfer")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mark Brown

    Arnd Bergmann
     

08 Aug, 2017

14 commits

  • Use of_device_get_match_data to identify QUP version instead
    of of_device_is_compatible.

    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • This patch fixes an issue where a SPI transaction has completed, but the
    done condition is missed. This occurs because at the time of interrupt the
    MAX_INPUT_DONE_FLAG is not asserted. However, in the process of reading
    blocks of data from the FIFO, the last portion of data comes in.

    The opflags read at the beginning of the irq handler no longer matches the
    current opflag state. To get around this condition, the block read
    function should update the opflags so that done detection is correct after
    the return.

    Signed-off-by: Andy Gross
    Signed-off-by: Abhishek Sahu
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Much like the block mode changes, we are breaking up DMA transactions
    into 64K chunks so we can reset the QUP engine.

    Signed-off-by: Matthew McClintock
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Take specific sgl and nent to be prepared. This is in
    preparation for splitting DMA into multiple transacations, this
    contains no code changes just refactoring.

    Signed-off-by: Matthew McClintock
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • This let's you write more to the SPI bus than 64K-1 which is important
    if the block size of a SPI device is >= 64K or some other device wants
    to do something larger.

    This has the benefit of completely removing spi_message from the spi-qup
    transactions

    Signed-off-by: Matthew McClintock
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • DMA transactions should only only need to call io_config only once, but
    block mode might call it several times to setup several transactions so
    it can handle reads/writes larger than the max size per transaction, so
    we move the call to the do_ functions.

    This is just refactoring, there should be no functional change

    Signed-off-by: Matthew McClintock
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • This is in preparation for handling transactions larger than
    64K-1 bytes in block mode, which is currently unsupported and
    quietly fails.

    We need to break these into two functions 1) prep is
    called once per spi_message and 2) io_config is called
    once per spi-qup bus transaction

    This is just refactoring, there should be no functional
    change

    Signed-off-by: Matthew McClintock
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • This patch corrects the behavior of the BLOCK
    transactions. During block transactions, the controller
    must be read/written to in block size transactions.

    Signed-off-by: Andy Gross
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Wait to signal done until we get all of the interrupts we are expecting
    to get for a transaction. If we don't wait for the input done flag, we
    can be in between transactions when the done flag comes in and this can
    mess up the next transaction.

    While here cleaning up the code which sets controller->xfer = NULL and
    restores it in the ISR. This looks to be some debug code which is not
    required.

    Signed-off-by: Andy Gross
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Signed-off-by: Andy Gross
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Add i/o completion timeout for DMA and PIO modes.

    Signed-off-by: Andy Gross
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • To operate in DMA mode, the buffer should be aligned and
    the size of the transfer should be a multiple of block size
    (for v1). And the no. of words being transferred should
    be programmed in the count registers appropriately.

    Signed-off-by: Andy Gross
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     
  • Enable chip select support for QUP versions later than v1. The
    chip select support was broken in QUP version 1. Hence the chip
    select support was removed earlier in an earlier commit
    (4a8573abe "spi: qup: Remove chip select function"). Since the
    chip select support is functional in recent versions of QUP,
    re-enabling it for QUP versions later than v1.

    Signed-off-by: Sham Muthayyan
    Signed-off-by: Varadarajan Narayanan
    Signed-off-by: Mark Brown

    Varadarajan Narayanan
     

01 Oct, 2016

1 commit


02 Sep, 2016

1 commit

  • If the spi device is already runtime suspended, if spi_qup_suspend is
    executed during suspend-to-idle or suspend-to-ram it will result in the
    a splat from unpreparing a non-prepared clock.

    This patch fixes the issue by executing clk_disable_unprepare conditionally
    in spi_qup_suspend.

    [Reworded commit message to remove irrelevant backtrace -- broonie]
    Signed-off-by: Sudeep Holla
    Tested-by: Andy Gross
    Signed-off-by: Mark Brown

    Sudeep Holla
     

28 Jul, 2016

1 commit

  • The call to spi_master_put() in spi_qup_remove() is redundant since
    the master is registered using devm_spi_register_master() and no
    reference hold by using spi_master_get() in spi_qup_remove().

    This is detected by Coccinelle semantic patch.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Mark Brown

    Wei Yongjun
     

02 May, 2016

2 commits


12 Apr, 2015

1 commit


07 Mar, 2015

2 commits

  • This patch adds DMA capabilities to the spi-qup driver. If DMA channels are
    present, the QUP will use DMA instead of block mode for transfers to/from SPI
    peripherals for transactions larger than the length of a block.

    Signed-off-by: Andy Gross
    Signed-off-by: Stanimir Varbanov
    Reviewed-by: Ivan T. Ivanov

    Andy Gross
     
  • num-cs is 32 bit property, don't read just upper 16 bits.

    Fixes: 4a8573abe965 (spi: qup: Remove chip select function)
    Signed-off-by: Ivan T. Ivanov
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ivan T. Ivanov
     

30 Dec, 2014

1 commit


19 Dec, 2014

1 commit

  • Pull more ACPI and power management updates from Rafael Wysocki:
    "These are regression fixes (leds-gpio, ACPI backlight driver,
    operating performance points library, ACPI device enumeration
    messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device
    PM), some cleanups in the operating performance points (OPP)
    framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of
    minor intel_pstate driver changes, a new MAINTAINERS entry for it and
    an ACPI fan driver change needed for better support of thermal
    management in user space.

    Specifics:

    - Fix a regression in leds-gpio introduced by a recent commit that
    inadvertently changed the name of one of the properties used by the
    driver (Fabio Estevam).

    - Fix a regression in the ACPI backlight driver introduced by a
    recent fix that missed one special case that had to be taken into
    account (Aaron Lu).

    - Drop the level of some new kernel messages from the ACPI core
    introduced by a recent commit to KERN_DEBUG which they should have
    used from the start and drop some other unuseful KERN_ERR messages
    printed by ACPI (Rafael J Wysocki).

    - Revert an incorrect commit modifying the cpupower tool (Prarit
    Bhargava).

    - Fix two regressions introduced by recent commits in the OPP library
    and clean up some existing minor issues in that code (Viresh
    Kumar).

    - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the
    tree (or drop it where that can be done) in order to make it
    possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf
    Hansson, Ludovic Desroches).

    There will be one more "CONFIG_PM_RUNTIME removal" batch after this
    one, because some new uses of it have been introduced during the
    current merge window, but that should be sufficient to finally get
    rid of it.

    - Make the ACPI EC driver more robust against race conditions related
    to GPE handler installation failures (Lv Zheng).

    - Prevent the ACPI device PM core code from attempting to disable
    GPEs that it has not enabled which confuses ACPICA and makes it
    report errors unnecessarily (Rafael J Wysocki).

    - Add a "force" command line switch to the intel_pstate driver to
    make it possible to override the blacklisting of some systems in
    that driver if needed (Ethan Zhao).

    - Improve intel_pstate code documentation and add a MAINTAINERS entry
    for it (Kristen Carlson Accardi).

    - Make the ACPI fan driver create cooling device interfaces witn
    names that reflect the IDs of the ACPI device objects they are
    associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B").

    That's necessary for user space thermal management tools to be able
    to connect the fans with the parts of the system they are supposed
    to be cooling properly. From Srinivas Pandruvada"

    * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
    MAINTAINERS: add entry for intel_pstate
    ACPI / video: update the skip case for acpi_video_device_in_dod()
    power / PM: Eliminate CONFIG_PM_RUNTIME
    NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / EC: Fix unexpected ec_remove_handlers() invocations
    Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()"
    tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c
    PM: Remove the SET_PM_RUNTIME_PM_OPS() macro
    mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro
    PM / Kconfig: Replace PM_RUNTIME with PM in dependencies
    ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / PM: Do not disable wakeup GPEs that have not been enabled
    ACPI / utils: Drop error messages from acpi_evaluate_reference()
    ...

    Linus Torvalds
     

13 Dec, 2014

1 commit

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
    depending on CONFIG_PM_RUNTIME may now be changed to depend on
    CONFIG_PM.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
    drivers/spi/.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Mark Brown

    Rafael J. Wysocki
     

20 Oct, 2014

1 commit


05 Aug, 2014

1 commit


22 Jun, 2014

1 commit

  • This patch removes the chip select function. Chip select should instead be
    supported using GPIOs, defining the DT entry "cs-gpios", and letting the SPI
    core assert/deassert the chip select as it sees fit.

    The chip select control inside the controller is buggy. It is supposed to
    automatically assert the chip select based on the activity in the controller,
    but it is buggy and doesn't work at all. So instead we elect to use GPIOs.

    Signed-off-by: Andy Gross
    Signed-off-by: Mark Brown

    Andy Gross
     

21 Jun, 2014

2 commits


03 Jun, 2014

1 commit