16 Jan, 2015

1 commit

  • commit 015760563ec77bf17cec712fa94afdf53b285287 upstream.

    SH-MSIOF driver is enabled autosuspend API of spi framework.
    But autosuspend framework doesn't work during initializing.
    So runtime PM lock is added in SH-MSIOF driver initializing.

    Fixes: e2a0ba547ba31c (spi: sh-msiof: Convert to spi core auto_runtime_pm framework)
    Signed-off-by: Hisashi Nakamura
    Signed-off-by: Yoshihiro Kaneko
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Hisashi Nakamura
     

27 Nov, 2014

2 commits


18 Nov, 2014

1 commit

  • commit 8c328a262f ("spi: sirf: Avoid duplicate code in various
    bits_per_word cases") is wrong in setting data width register of
    fifo is not right, it should use sspi->word_width >> 1 to set
    related bits. According to hardware spec, the mapping between
    register value and data width:
    0 - byte
    1 - WORD
    2 - DWORD

    Fixes: 8c328a262f ("spi: sirf: Avoid duplicate code in various bits_per_word cases") is wrong in setting data width register of
    Signed-off-by: Qipan Li
    Signed-off-by: Barry Song
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Qipan Li
     

17 Nov, 2014

1 commit

  • We can only use page_address on memory that has been mapped using kmap,
    when the buffer passed to the SPI has been allocated by vmalloc the page
    has not necessarily been mapped through kmap. This means sometimes
    page_address will return NULL causing the pointer we pass to sg_set_buf
    to be invalid.

    As we only call page_address so that we can pass a virtual address to
    sg_set_buf which will then immediately call virt_to_page on it, fix this
    by calling sg_set_page directly rather then relying on the sg_set_buf
    helper.

    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Charles Keepax
     

07 Nov, 2014

1 commit

  • An IOCTL call that calls spi_setup() and then dw_spi_setup() will
    overwrite the persisted last transfer speed. On each transfer, the
    SPI speed is compared to the last transfer speed to determine if the
    clock divider registers need to be updated (did the speed change?).
    This bug was observed with the spidev driver using spi-config to
    update the max transfer speed.

    This fix: Don't overwrite the persisted last transaction clock speed
    when updating the SPI parameters in dw_spi_setup(). On the next
    transaction, the new speed won't match the persisted last speed
    and the hardware registers will be updated.
    On initialization, the persisted last transaction clock
    speed will be 0 but will be updated after the first SPI
    transaction.

    Move zeroed clock divider check into clock change test because
    chip->clk_div is zero on startup and would cause a divide-by-zero
    error. The calculation was wrong as well (can't support odd #).

    Reported-by: Vlastimil Setka
    Signed-off-by: Vlastimil Setka
    Signed-off-by: Thor Thayer
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Thor Thayer
     

06 Nov, 2014

2 commits

  • Mark Brown
     
  • If PM_RUNTIME is enabled, it is easy to trigger the following backtrace
    on pxa2xx hosts:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 1 at /home/lumag/linux/arch/arm/mach-pxa/clock.c:35 clk_disable+0xa0/0xa8()
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-00007-g1b3d2ee-dirty #104
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (warn_slowpath_common+0x6c/0x8c)
    [] (warn_slowpath_common) from [] (warn_slowpath_null+0x1c/0x24)
    [] (warn_slowpath_null) from [] (clk_disable+0xa0/0xa8)
    [] (clk_disable) from [] (pxa2xx_spi_suspend+0x2c/0x34)
    [] (pxa2xx_spi_suspend) from [] (platform_pm_suspend+0x2c/0x54)
    [] (platform_pm_suspend) from [] (dpm_run_callback.isra.14+0x2c/0x74)
    [] (dpm_run_callback.isra.14) from [] (__device_suspend+0x120/0x2f8)
    [] (__device_suspend) from [] (dpm_suspend+0x50/0x208)
    [] (dpm_suspend) from [] (suspend_devices_and_enter+0x8c/0x3a0)
    [] (suspend_devices_and_enter) from [] (pm_suspend+0x214/0x2a8)
    [] (pm_suspend) from [] (test_suspend+0x14c/0x1dc)
    [] (test_suspend) from [] (do_one_initcall+0x8c/0x1fc)
    [] (do_one_initcall) from [] (kernel_init_freeable+0xf4/0x1b4)
    [] (kernel_init_freeable) from [] (kernel_init+0x8/0xec)
    [] (kernel_init) from [] (ret_from_fork+0x14/0x24)
    ---[ end trace 46524156d8faa4f6 ]---

    This happens because suspend function tries to disable a clock that is
    already disabled by runtime_suspend callback. Add if
    (!pm_runtime_suspended()) checks to suspend/resume path.

    Fixes: 7d94a505858 (spi/pxa2xx: add support for runtime PM)
    Signed-off-by: Dmitry Eremin-Solenikov
    Reported-by: Andrea Adami
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Dmitry Eremin-Solenikov
     

04 Nov, 2014

1 commit

  • There are only 4 CTAR registers (CTAR0 - CTAR3) so we can only use the
    lower 2 bits of the chip select to select a CTAR register.
    SPI_PUSHR_CTAS used the lower 3 bits which would result in wrong bit values
    if the chip selects 4/5 are used. For those chip selects SPI_CTAR even
    calculated offsets of non-existing registers.

    Signed-off-by: Alexander Stein
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Alexander Stein
     

27 Oct, 2014

1 commit


22 Oct, 2014

1 commit

  • It's possible that the call to of_match_device() (introduced in commit
    df59fa7f ["spi: orion: support armada extended baud rates"]) may return
    a NULL if there is no match in the device tree (or perhaps no device tree
    at all). Check the return pointer and set the local device data to the
    lowest common denominator orion device data if it is NULL.

    Reported-by: Karl Beldan
    Signed-off-by: Greg Ungerer
    Signed-off-by: Mark Brown

    Greg Ungerer
     

19 Oct, 2014

1 commit

  • Pull slave-dmaengine updates from Vinod Koul:
    "For dmaengine contributions we have:
    - designware cleanup by Andy
    - my series moving device_control users to dmanegine_xxx APIs for
    later removal of device_control API
    - minor fixes spread over drivers mainly mv_xor, pl330, mmp, imx-sdma
    etc"

    * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (60 commits)
    serial: atmel: add missing dmaengine header
    dmaengine: remove FSLDMA_EXTERNAL_START
    dmaengine: freescale: remove FSLDMA_EXTERNAL_START control method
    carma-fpga: move to fsl_dma_external_start()
    carma-fpga: use dmaengine_xxx() API
    dmaengine: freescale: add and export fsl_dma_external_start()
    dmaengine: add dmaengine_prep_dma_sg() helper
    video: mx3fb: use dmaengine_terminate_all() API
    serial: sh-sci: use dmaengine_terminate_all() API
    net: ks8842: use dmaengine_terminate_all() API
    mtd: sh_flctl: use dmaengine_terminate_all() API
    mtd: fsmc_nand: use dmaengine_terminate_all() API
    V4L2: mx3_camer: use dmaengine_pause() API
    dmaengine: coh901318: use dmaengine_terminate_all() API
    pata_arasan_cf: use dmaengine_terminate_all() API
    dmaengine: edma: check for echan->edesc => NULL in edma_dma_pause()
    dmaengine: dw: export probe()/remove() and Co to users
    dmaengine: dw: enable and disable controller when needed
    dmaengine: dw: always export dw_dma_{en,dis}able
    dmaengine: dw: introduce dw_dma_on() helper
    ...

    Linus Torvalds
     

17 Oct, 2014

1 commit


15 Oct, 2014

2 commits


13 Oct, 2014

2 commits

  • When mapped RX DMA entries are unmapped in an error condition when DMA
    is firstly configured in the driver, the number of TX DMA entries was
    passed in, which is incorrect

    Signed-off-by: Ray Jui
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ray Jui
     
  • By using separate TX and RX bounce buffers, we avoid potential cache
    flush and invalidation sequence issue that may be encountered when a
    single bounce buffer is shared between TX and RX

    Signed-off-by: Ray Jui
    Reviewed-by: JD (Jiandong) Zheng
    Signed-off-by: Mark Brown

    Ray Jui
     

10 Oct, 2014

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "Features-wise, to me the most important this time is a rework of
    wakeup interrupts handling in the core that makes them work
    consistently across all of the available sleep states, including
    suspend-to-idle. Many thanks to Thomas Gleixner for his help with
    this work.

    Second is an update of the generic PM domains code that has been in
    need of some care for quite a while. Unused code is being removed, DT
    support is being added and domains are now going to be attached to
    devices in bus type code in analogy with the ACPI PM domain. The
    majority of work here was done by Ulf Hansson who also has been the
    most active developer this time.

    Apart from this we have a traditional ACPICA update, this time to
    upstream version 20140828 and a few ACPI wakeup interrupts handling
    patches on top of the general rework mentioned above. There also are
    several cpufreq commits including renaming the cpufreq-cpu0 driver to
    cpufreq-dt, as this is what implements generic DT-based cpufreq
    support, and a new DT-based idle states infrastructure for cpuidle.

    In addition to that, the ACPI LPSS driver is updated, ACPI support for
    Apple machines is improved, a few bugs are fixed and a few cleanups
    are made all over.

    Finally, the Adaptive Voltage Scaling (AVS) subsystem now has a tree
    maintained by Kevin Hilman that will be merged through the PM tree.

    Numbers-wise, the generic PM domains update takes the lead this time
    with 32 non-merge commits, second is cpufreq (15 commits) and the 3rd
    place goes to the wakeup interrupts handling rework (13 commits).

    Specifics:

    - Rework the handling of wakeup IRQs by the IRQ core such that all of
    them will be switched over to "wakeup" mode in suspend_device_irqs()
    and in that mode the first interrupt will abort system suspend in
    progress or wake up the system if already in suspend-to-idle (or
    equivalent) without executing any interrupt handlers. Among other
    things that eliminates the wakeup-related motivation to use the
    IRQF_NO_SUSPEND interrupt flag with interrupts which don't really
    need it and should not use it (Thomas Gleixner and Rafael Wysocki)

    - Switch over ACPI to handling wakeup interrupts with the help of the
    new mechanism introduced by the above IRQ core rework (Rafael Wysocki)

    - Rework the core generic PM domains code to eliminate code that's
    not used, add DT support and add a generic mechanism by which
    devices can be added to PM domains automatically during enumeration
    (Ulf Hansson, Geert Uytterhoeven and Tomasz Figa).

    - Add debugfs-based mechanics for debugging generic PM domains
    (Maciej Matraszek).

    - ACPICA update to upstream version 20140828. Included are updates
    related to the SRAT and GTDT tables and the _PSx methods are in the
    METHOD_NAME list now (Bob Moore and Hanjun Guo).

    - Add _OSI("Darwin") support to the ACPI core (unfortunately, that
    can't really be done in a straightforward way) to prevent
    Thunderbolt from being turned off on Apple systems after boot (or
    after resume from system suspend) and rework the ACPI Smart Battery
    Subsystem (SBS) driver to work correctly with Apple platforms
    (Matthew Garrett and Andreas Noever).

    - ACPI LPSS (Low-Power Subsystem) driver update cleaning up the code,
    adding support for 133MHz I2C source clock on Intel Baytrail to it
    and making it avoid using UART RTS override with Auto Flow Control
    (Heikki Krogerus).

    - ACPI backlight updates removing the video_set_use_native_backlight
    quirk which is not necessary any more, making the code check the
    list of output devices returned by the _DOD method to avoid
    creating acpi_video interfaces that won't work and adding a quirk
    for Lenovo Ideapad Z570 (Hans de Goede, Aaron Lu and Stepan Bujnak)

    - New Win8 ACPI OSI quirks for some Dell laptops (Edward Lin)

    - Assorted ACPI code cleanups (Fabian Frederick, Rasmus Villemoes,
    Sudip Mukherjee, Yijing Wang, and Zhang Rui)

    - cpufreq core updates and cleanups (Viresh Kumar, Preeti U Murthy,
    Rasmus Villemoes)

    - cpufreq driver updates: cpufreq-cpu0/cpufreq-dt (driver name change
    among other things), ppc-corenet, powernv (Viresh Kumar, Preeti U
    Murthy, Shilpasri G Bhat, Lucas Stach)

    - cpuidle support for DT-based idle states infrastructure, new ARM64
    cpuidle driver, cpuidle core cleanups (Lorenzo Pieralisi, Rasmus
    Villemoes)

    - ARM big.LITTLE cpuidle driver updates: support for DT-based
    initialization and Exynos5800 compatible string (Lorenzo Pieralisi,
    Kevin Hilman)

    - Rework of the test_suspend kernel command line argument and a new
    trace event for console resume (Srinivas Pandruvada, Todd E Brandt)

    - Second attempt to optimize swsusp_free() (hibernation core) to make
    it avoid going through all PFNs which may be way too slow on some
    systems (Joerg Roedel)

    - devfreq updates (Paul Bolle, Punit Agrawal, Ãrjan Eide).

    - rockchip-io Adaptive Voltage Scaling (AVS) driver and AVS entry
    update in MAINTAINERS (Heiko Stübner, Kevin Hilman)

    - PM core fix related to clock management (Geert Uytterhoeven)

    - PM core's sysfs code cleanup (Johannes Berg)"

    * tag 'pm+acpi-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (105 commits)
    ACPI / fan: printk replacement
    PM / clk: Fix crash in clocks management code if !CONFIG_PM_RUNTIME
    PM / Domains: Rename cpu_data to cpuidle_data
    cpufreq: cpufreq-dt: fix potential double put of cpu OF node
    cpufreq: cpu0: rename driver and internals to 'cpufreq_dt'
    PM / hibernate: Iterate over set bits instead of PFNs in swsusp_free()
    cpufreq: ppc-corenet: remove duplicate update of cpu_data
    ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle
    PM / sleep: Rename platform suspend/resume functions in suspend.c
    PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq()
    ACPICA: Introduce acpi_enable_all_wakeup_gpes()
    ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block()
    ACPI / video: check _DOD list when creating backlight devices
    PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h
    cpufreq: Replace strnicmp with strncasecmp
    cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec
    cpufreq: powernv: Set the pstate of the last hotplugged out cpu in policy->cpus to minimum
    cpufreq: Allow stop CPU callback to be used by all cpufreq drivers
    PM / devfreq: exynos: Enable building exynos PPMU as module
    PM / devfreq: Export helper functions for drivers
    ...

    Linus Torvalds
     

09 Oct, 2014

1 commit


07 Oct, 2014

1 commit

  • * pm-domains: (32 commits)
    PM / Domains: Rename cpu_data to cpuidle_data
    PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h
    PM / Domains: Remove legacy API for adding devices through DT
    PM / Domains: Add genpd attach/detach callbacks
    PM / Domains: add debugfs listing of struct generic_pm_domain-s
    ACPI / PM: Convert acpi_dev_pm_detach() into a static function
    ARM: exynos: Move to generic PM domain DT bindings
    amba: Add support for attach/detach of PM domains
    spi: core: Convert to dev_pm_domain_attach|detach()
    mmc: sdio: Convert to dev_pm_domain_attach|detach()
    i2c: core: Convert to dev_pm_domain_attach|detach()
    drivercore / platform: Convert to dev_pm_domain_attach|detach()
    PM / Domains: Add APIs to attach/detach a PM domain for a device
    PM / Domains: Add generic OF-based PM domain look-up
    ACPI / PM: Assign the ->detach() callback when attaching the PM domain
    PM / Domains: Add a detach callback to the struct dev_pm_domain
    PM / domains: Spelling s/domian/domain/
    PM / domains: Keep declaration of dev_power_governors together
    PM / domains: Remove default_stop_ok() API
    drivers: sh: Leave disabling of unused PM domains to genpd
    ...

    Rafael J. Wysocki
     

03 Oct, 2014

12 commits


02 Oct, 2014

1 commit

  • The Armada SoC family implementation of this SPI hardware module has
    extended the configuration register to allow for a wider range of SPI
    clock rates. Specifically the Serial Baud Rate Pre-selection bits in the
    SPI Interface Configuration Register now also use bits 6 and 7 as well.

    Modify the baud rate calculation to handle these differences for the
    Armada case. Potentially a baud rate can be setup using a number of
    different pre-scalar and scalar combinations. This code tries all
    possible pre-scalar divisors (8 in total) to try and find the most
    accurate set.

    This change introduces (and documents) a new device tree compatible
    device name "armada-370-spi" to support this.

    Signed-off-by: Greg Ungerer
    Tested-by: Ezequiel Garcia
    Reviewed-by: Ezequiel Garcia
    Signed-off-by: Mark Brown

    Greg Ungerer
     

30 Sep, 2014

2 commits

  • The commit 46420dd73b80 (PM / Domains: Add APIs to attach/detach a PM
    domain for a device) started using errno values in pm.h header file.
    It also failed to include the header for these, thus it caused
    compiler errors.

    Instead of including the errno header to pm.h, let's move the functions
    to pm_domain.h, since it's a better match.

    Fixes: 46420dd73b80 (PM / Domains: Add APIs to attach/detach a PM domain for a device)
    Signed-off-by: Ulf Hansson
    Acked-by: Geert Uytterhoeven
    Acked-by: Wolfram Sang
    Acked-by: Mark Brown
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • Sort all the include headers alphabetically for the freescale
    spi drivers. If the inlcude headers sorted out of order, maybe
    the best logical choice is to append new ones after the exist
    ones, while this may create a lot of potential for duplicates
    and conflicts for each diffenent changes will add new headers
    in the same location.

    Signed-off-by: Xiubo Li
    Signed-off-by: Mark Brown

    Xiubo Li
     

26 Sep, 2014

2 commits


25 Sep, 2014

2 commits


24 Sep, 2014

1 commit

  • Add support for a extended PL022 which has an extra register for controlling up
    to five chip select signals. This controller is found on the AXM5516 SoC.
    Unfortunately the PrimeCell identification registers are identical to a
    standard ARM PL022. To work around this, the peripheral ID must be overridden
    in the device tree using the "arm,primecell-periphid" property with the value
    0x000b6022.

    Signed-off-by: Anders Berg
    Acked-by: Linus Walleij
    Acked-by: Russell King
    Signed-off-by: Mark Brown

    Anders Berg