1. 03 Sep, 2016 1 commit
  2. 24 Aug, 2016 1 commit
  3. 09 Aug, 2016 1 commit
  4. 05 Aug, 2016 1 commit
  5. 27 Jul, 2016 3 commits
  6. 25 Jul, 2016 1 commit
    • Mark Brown's avatar
      spi: Split bus and I/O locking · ef4d96ec
      Mark Brown authored
      The current SPI code attempts to use bus_lock_mutex for two purposes. One
      is to implement spi_bus_lock() which grants exclusive access to the bus.
      The other is to serialize access to the physical hardware. This duplicate
      purpose causes confusion which leads to cases where access is not locked
      when a caller holds the bus lock mutex. Fix this by splitting out the I/O
      functionality into a new io_mutex.
      
      This means taking both mutexes in the DMA path, replacing the existing
      mutex with the new I/O one in the message pump (the mutex now always
      being taken in the message pump) and taking the bus lock mutex in
      spi_sync(), allowing __spi_sync() to have no mutex handling.
      
      While we're at it hoist the mutex further up the message pump before we
      power up the device so that all power up/down of the block is covered by
      it and there are no races with in-line pumping of messages.
      Reported-by: default avatarRich Felker <dalias@libc.org>
      Tested-by: default avatarRich Felker <dalias@libc.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      ef4d96ec
  7. 24 Jul, 2016 7 commits
  8. 20 Jul, 2016 1 commit
    • Brian Norris's avatar
      spi: rockchip: limit transfers to (64K - 1) bytes · 5185a81c
      Brian Norris authored
      The Rockchip SPI controller's length register only supports 16-bits,
      yielding a maximum length of 64KiB (the CTRLR1 register holds "length -
      1"). Trying to transfer more than that (e.g., with a large SPI flash
      read) will cause the driver to hang.
      
      Now, it seems that while theoretically we should be able to program
      CTRLR1 with 0xffff, and get a 64KiB transfer, but that also seems to
      cause the core to choke, so stick with a maximum of 64K - 1 bytes --
      i.e., 0xffff.
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      5185a81c
  9. 15 Jul, 2016 2 commits
  10. 14 Jul, 2016 5 commits
  11. 12 Jul, 2016 1 commit
  12. 11 Jul, 2016 2 commits
    • Bhaktipriya Shridhar's avatar
      spi: spi-sh: Remove deprecated create_singlethread_workqueue · 38e09920
      Bhaktipriya Shridhar authored
      The workqueue has a single workitem(&ss->ws) and hence doesn't require
      ordering. Also, it is not being used on a memory reclaim path. Hence, the
      singlethreaded workqueue has been replaced with the use of system_wq.
      
      System workqueues have been able to handle high level of concurrency
      for a long time now and hence it's not required to have a singlethreaded
      workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
      created with create_singlethread_workqueue(), system_wq allows multiple
      work items to overlap executions even on the same CPU; however, a
      per-cpu workqueue doesn't have any CPU locality or global ordering
      guarantee unless the target CPU is explicitly specified and thus the
      increase of local concurrency shouldn't make any difference.
      
      Work item has been flushed in spi_sh_remove() to ensure that
      there are no pending tasks while disconnecting the driver.
      Signed-off-by: default avatarBhaktipriya Shridhar <bhaktipriya96@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      38e09920
    • Bhaktipriya Shridhar's avatar
      spi: spi-topcliff-pch: Remove deprecated create_singlethread_workqueue · 0d357739
      Bhaktipriya Shridhar authored
      The workqueue "wk" serves as a queue for carrying out execution
      of requests. It has a single work item(&drv_data->work) and hence doesn't
      require ordering. Also, it is not being used on a memory reclaim path.
      Hence, the singlethreaded workqueue has been replaced with the use of
      system_wq.
      
      System workqueues have been able to handle high level of concurrency
      for a long time now and hence it's not required to have a singlethreaded
      workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
      created with create_singlethread_workqueue(), system_wq allows multiple
      work items to overlap executions even on the same CPU; however, a
      per-cpu workqueue doesn't have any CPU locality or global ordering
      guarantee unless the target CPU is explicitly specified and thus the
      increase of local concurrency shouldn't make any difference.
      
      Work item has been flushed in pch_spi_free_resources() to ensure that
      there are no pending tasks while disconnecting the driver.
      
      Also dropped the label 'err_return' since it's not being used anymore.
      Signed-off-by: default avatarBhaktipriya Shridhar <bhaktipriya96@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      0d357739
  13. 08 Jul, 2016 3 commits
    • Octavian Purdila's avatar
      spi / ACPI: add support for ACPI reconfigure notifications · 7f24467f
      Octavian Purdila authored
      This patch adds supports for SPI device enumeration and removal via
      ACPI reconfiguration notifications that are send as a result of an
      ACPI table load or unload operation.
      
      The code is very similar with the device tree reconfiguration code
      with only small differences in the way we test and set the enumerated
      state of the device:
      
       * the equivalent of device tree's OF_POPULATED flag is the
         flags.visited field in the ACPI device and the following wrappers
         are used to manipulate it: acpi_device_enumerated(),
         acpi_device_set_enumerated() and acpi_device_clear_enumerated()
      
       * the device tree code checks of status of the OF_POPULATED flag to
         avoid trying to create duplicate Linux devices in two places: once
         when the controller is probed, and once when the reconfigure event
         is received; in the ACPI code the check is performed only once when
         the ACPI namespace is searched because this code path is invoked in
         both of the two mentioned cases
      
      The rest of the enumeration handling is similar with device tree: when
      the Linux device is unregistered the ACPI device is marked as not
      enumerated; also, when a device remove notification is received we
      check that the device is in the enumerated state before continuing
      with the removal of the Linux device.
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7f24467f
    • Franklin S Cooper Jr's avatar
      spi: omap2-mcspi: Use the SPI framework to handle DMA mapping · 0ba1870f
      Franklin S Cooper Jr authored
      Currently, the driver handles mapping buffers to be used by the DMA.
      However, there are times that the current mapping implementation will
      fail for certain buffers. Fortunately, the SPI framework can detect
      and map buffers so its usable by the DMA.
      
      Update the driver to utilize the SPI framework for buffer
      mapping instead. Also incorporate hooks that the framework uses to
      determine if the DMA can or can not be used.
      
      This will result in the original omap2_mcspi_transfer_one function being
      deleted and omap2_mcspi_work_one being renamed to
      omap2_mcspi_transfer_one. Previously transfer_one was only responsible
      for mapping and work_one handled the transfer. But now only transferring
      needs to be handled by the driver.
      Signed-off-by: default avatarFranklin S Cooper Jr <fcooper@ti.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      0ba1870f
    • Franklin S Cooper Jr's avatar
      spi: omap2-mcspi: Select SPI_SPLIT · 2b32e987
      Franklin S Cooper Jr authored
      The function sg_split will be used by spi-omap2-mcspi to handle a SoC
      workaround in the SPI driver. Therefore, select SG_SPLIT so this function
      is available to the driver.
      Signed-off-by: default avatarFranklin S Cooper Jr <fcooper@ti.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      2b32e987
  14. 07 Jul, 2016 4 commits
  15. 05 Jul, 2016 1 commit
  16. 04 Jul, 2016 6 commits