1. 10 Sep, 2019 1 commit
    • Lukas Wunner's avatar
      spi: bcm2835: Work around DONE bit erratum · 4c524191
      Lukas Wunner authored
      Commit 3bd7f658 ("spi: bcm2835: Overcome sglist entry length
      limitation") amended the BCM2835 SPI driver with support for DMA
      transfers whose buffers are not aligned to 4 bytes and require more than
      one sglist entry.
      
      When testing this feature with upcoming commits to speed up TX-only and
      RX-only transfers, I noticed that SPI transmission sometimes breaks.
      A function introduced by the commit, bcm2835_spi_transfer_prologue(),
      performs one or two PIO transmissions as a prologue to the actual DMA
      transmission.  It turns out that the breakage goes away if the DONE bit
      in the CS register is set when ending such a PIO transmission.
      
      The DONE bit signifies emptiness of the TX FIFO.  According to the spec,
      the bit is of type RO, so writing it should never have any effect.
      Perhaps the spec is wrong and the bit is actually of type RW1C.
      E.g. the I2C controller on the BCM2835 does have an RW1C DONE bit which
      needs to be cleared by the driver.  Another, possibly more likely
      explanation is that it's a hardware erratum since the issue does not
      occur consistently.
      
      Either way, amend bcm2835_spi_transfer_prologue() to always write the
      DONE bit.
      
      Usually a transmission is ended by bcm2835_spi_reset_hw().  If the
      transmission was successful, the TX FIFO is empty and thus the DONE bit
      is set when bcm2835_spi_reset_hw() reads the CS register.  The bit is
      then written back to the register, so we happen to do the right thing.
      
      However if DONE is not set, e.g. because transmission is aborted with
      a non-empty TX FIFO, the bit won't be written by bcm2835_spi_reset_hw()
      and it seems possible that transmission might subsequently break.  To be
      on the safe side, likewise amend bcm2835_spi_reset_hw() to always write
      the bit.
      Tested-by: default avatarNuno Sá <nuno.sa@analog.com>
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Acked-by: default avatarStefan Wahren <wahrenst@gmx.net>
      Acked-by: default avatarMartin Sperl <kernel@martin.sperl.org>
      Link: https://lore.kernel.org/r/edb004dff4af6106f6bfcb89e1a96391e96eb857.1564825752.git.lukas@wunner.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      4c524191
  2. 03 Sep, 2019 1 commit
  3. 30 Aug, 2019 1 commit
  4. 23 Aug, 2019 1 commit
  5. 20 Aug, 2019 2 commits
  6. 12 Aug, 2019 1 commit
  7. 07 Aug, 2019 1 commit
  8. 02 Aug, 2019 1 commit
  9. 24 Jul, 2019 1 commit
  10. 22 Jul, 2019 1 commit
  11. 17 Jul, 2019 1 commit
    • Linus Walleij's avatar
      spi: gpio: Add SPI_MASTER_GPIO_SS flag · 2922d1cc
      Linus Walleij authored
      The GPIO SPI master has some code in its local CS
      callback to set the initial sck GPIO value. This was
      lost in the commit converting it to use SPI core
      GPIO handling as this callback isn't called if the
      internal GPIO handling is active.
      
      Add the special SPI_MASTER_GPIO_SS to ascertain it
      gets called anyway so we get the initial SCK setting
      right. There is some platform provided GPIO handling
      there as well but this will be skipped as the cs_gpios
      will be NULL.
      
      My test targets seem not to care about the initial
      SCK value so I am uncertain if this is a regression,
      but to preserve the previous semantic we better do
      this.
      
      Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
      Fixes: 249e2632 ("spi: gpio: Don't request CS GPIO in DT use-case")
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Link: https://lore.kernel.org/r/20190716204651.7743-1-linus.walleij@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      2922d1cc
  12. 10 Jul, 2019 2 commits
  13. 03 Jul, 2019 1 commit
  14. 02 Jul, 2019 3 commits
  15. 28 Jun, 2019 2 commits
  16. 24 Jun, 2019 1 commit
  17. 20 Jun, 2019 2 commits
  18. 19 Jun, 2019 1 commit
    • Ard Biesheuvel's avatar
      spi/acpi: fix incorrect ACPI parent check · b5e3cf41
      Ard Biesheuvel authored
      The ACPI device object parsing code for SPI slaves enumerates the
      entire ACPI namespace to look for devices that refer to the master
      in question via the 'resource_source' field in the 'SPISerialBus'
      resource. If that field does not refer to a valid ACPI device or
      if it refers to the wrong SPI master, we should disregard the
      device.
      
      Current, the valid device check is wrong, since it gets the
      polarity of 'status' wrong. This could cause issues if the
      'resource_source' field is bogus but parent_handle happens to
      refer to the correct master (which is not entirely imaginary
      since this code runs in a loop)
      
      So test for ACPI_FAILURE() instead, to make the code more
      self explanatory.
      
      Fixes: 4c3c5954 ("spi/acpi: enumerate all SPI slaves in the namespace")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: andy.shevchenko@gmail.com
      Cc: masahisa.kojima@linaro.org
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
      Cc: linux-acpi@vger.kernel.org
      Cc: Lukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      b5e3cf41
  19. 18 Jun, 2019 1 commit
  20. 17 Jun, 2019 2 commits
  21. 13 Jun, 2019 1 commit
    • Ard Biesheuvel's avatar
      spi/acpi: enumerate all SPI slaves in the namespace · 4c3c5954
      Ard Biesheuvel authored
      Currently, the ACPI enumeration that takes place when registering a
      SPI master only considers immediate child devices in the ACPI namespace,
      rather than checking the ResourceSource field in the SpiSerialBus()
      resource descriptor.
      
      This is incorrect: SPI slaves could reside anywhere in the ACPI
      namespace, and so we should enumerate the entire namespace and look for
      any device that refers to the newly registered SPI master in its
      resource descriptor.
      
      So refactor the existing code and use a lookup structure so that
      allocating the SPI device structure is deferred until we have identified
      the device as an actual child of the controller. This approach is
      loosely based on the way the I2C subsystem handles ACPI enumeration.
      
      Note that Apple x86 hardware does not rely on SpiSerialBus() resources
      in _CRS but uses nested devices below the controller's device node in
      the ACPI namespace, with a special set of device properties. This means
      we have to take care to only parse those properties for device nodes
      that are direct children of the controller node.
      
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: linux-spi@vger.kernel.org
      Cc: broonie@kernel.org
      Cc: andy.shevchenko@gmail.com
      Cc: masahisa.kojima@linaro.org
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
      Cc: linux-acpi@vger.kernel.org
      Cc: Lukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      4c3c5954
  22. 10 Jun, 2019 2 commits
    • Mark Brown's avatar
      Merge tag 'v5.2-rc4' into spi-5.3 · 4343f611
      Mark Brown authored
      Linux 5.2-rc4
      4343f611
    • Gustavo A. R. Silva's avatar
      spi: Use struct_size() helper · aef97522
      Gustavo A. R. Silva authored
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct spi_replaced_transfers {
      	...
              struct spi_transfer inserted_transfers[];
      };
      
      Make use of the struct_size() helper instead of an open-coded version
      in order to avoid any potential type mistakes.
      
      So, replace the following form:
      
      insert * sizeof(struct spi_transfer) + sizeof(struct spi_replaced_transfers)
      
      with:
      
      struct_size(rxfer, inserted_transfers, insert)
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      aef97522
  23. 09 Jun, 2019 1 commit
  24. 08 Jun, 2019 9 commits
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.2-rc4' of git://github.com/ceph/ceph-client · 2759e05c
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "A change to call iput() asynchronously to avoid a possible deadlock
        when iput_final() needs to wait for in-flight I/O (e.g. readahead) and
        a fixup for a cleanup that went into -rc1"
      
      * tag 'ceph-for-5.2-rc4' of git://github.com/ceph/ceph-client:
        ceph: fix error handling in ceph_get_caps()
        ceph: avoid iput_final() while holding mutex or in dispatch thread
        ceph: single workqueue for inode related works
      2759e05c
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.2b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 8e61f6f7
      Linus Torvalds authored
      Pull xen fix from Juergen Gross:
       "Just one fix for the Xen block frontend driver avoiding allocations
        with order > 0"
      
      * tag 'for-linus-5.2b-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen-blkfront: switch kcalloc to kvcalloc for large array allocation
      8e61f6f7
    • Linus Torvalds's avatar
      Merge tag 's390-5.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 3d4645bf
      Linus Torvalds authored
      Pull s390 fixes from Heiko Carstens:
      
       - fix stack unwinder: the stack unwinder rework has on off-by-one bug
         which prevents following stack backchains over more than one context
         (e.g. irq -> process).
      
       - fix address space detection in exception handler: if user space
         switches to access register mode, which is not supported anymore, the
         exception handler may resolve to the wrong address space.
      
      * tag 's390-5.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/unwind: correct stack switching during unwind
        s390/mm: fix address space detection in exception handling
      3d4645bf
    • Linus Torvalds's avatar
      Merge tag 'mips_fixes_5.2_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · d0cc617a
      Linus Torvalds authored
      Pull MIPS fixes from Paul Burton:
      
       - Declare ginvt() __always_inline due to its use of an argument as an
         inline asm immediate.
      
       - A VDSO build fix following Kbuild changes made this cycle.
      
       - A fix for boot failures on txx9 systems following memory
         initialization changes made this cycle.
      
       - Bounds check virt_addr_valid() to prevent it spuriously indicating
         that bogus addresses are valid, in turn fixing hardened usercopy
         failures that have been present since v4.12.
      
       - Build uImage.gz for pistachio systems by default, since this is the
         image we need in order to actually boot on a board.
      
       - Remove an unused variable in our uprobes code.
      
      * tag 'mips_fixes_5.2_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: uprobes: remove set but not used variable 'epc'
        MIPS: pistachio: Build uImage.gz by default
        MIPS: Make virt_addr_valid() return bool
        MIPS: Bounds check virt_addr_valid
        MIPS: TXx9: Fix boot crash in free_initmem()
        MIPS: remove a space after -I to cope with header search paths for VDSO
        MIPS: mark ginvt() as __always_inline
      d0cc617a
    • Linus Torvalds's avatar
      Merge tag 'spdx-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 9331b674
      Linus Torvalds authored
      Pull yet more SPDX updates from Greg KH:
       "Another round of SPDX header file fixes for 5.2-rc4
      
        These are all more "GPL-2.0-or-later" or "GPL-2.0-only" tags being
        added, based on the text in the files. We are slowly chipping away at
        the 700+ different ways people tried to write the license text. All of
        these were reviewed on the spdx mailing list by a number of different
        people.
      
        We now have over 60% of the kernel files covered with SPDX tags:
      	$ ./scripts/spdxcheck.py -v 2>&1 | grep Files
      	Files checked:            64533
      	Files with SPDX:          40392
      	Files with errors:            0
      
        I think the majority of the "easy" fixups are now done, it's now the
        start of the longer-tail of crazy variants to wade through"
      
      * tag 'spdx-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (159 commits)
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 450
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 449
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 448
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 446
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 444
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 443
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 442
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 440
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 438
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 437
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 436
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 435
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 434
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 433
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 432
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 431
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 430
        treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 429
        ...
      9331b674
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 1ce2c851
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char and misc driver fixes for 5.2-rc4 to resolve
        a number of reported issues.
      
        The most "notable" one here is the kernel headers in proc^Wsysfs
        fixes. Those changes move the header file info into sysfs and fixes
        the build issues that you reported.
      
        Other than that, a bunch of small habanalabs driver fixes, some fpga
        driver fixes, and a few other tiny driver fixes.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'char-misc-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        habanalabs: Read upper bits of trace buffer from RWPHI
        habanalabs: Fix virtual address access via debugfs for 2MB pages
        fpga: zynqmp-fpga: Correctly handle error pointer
        habanalabs: fix bug in checking huge page optimization
        habanalabs: Avoid using a non-initialized MMU cache mutex
        habanalabs: fix debugfs code
        uapi/habanalabs: add opcode for enable/disable device debug mode
        habanalabs: halt debug engines on user process close
        test_firmware: Use correct snprintf() limit
        genwqe: Prevent an integer overflow in the ioctl
        parport: Fix mem leak in parport_register_dev_model
        fpga: dfl: expand minor range when registering chrdev region
        fpga: dfl: Add lockdep classes for pdata->lock
        fpga: dfl: afu: Pass the correct device to dma_mapping_error()
        fpga: stratix10-soc: fix use-after-free on s10_init()
        w1: ds2408: Fix typo after 49695ac4 (reset on output_write retry with readback)
        kheaders: Do not regenerate archive if config is not changed
        kheaders: Move from proc to sysfs
        lkdtm/bugs: Adjust recursion test to avoid elision
        lkdtm/usercopy: Moves the KERNEL_DS test to non-canonical
      1ce2c851
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 902b2edf
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "I2C has a driver bugfix and a MAINTAINERS fix"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        MAINTAINERS: Karthikeyan Ramasubramanian is MIA
        i2c: xiic: Add max_read_len quirk
      902b2edf
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-5.2-rc4' of git://git.infradead.org/users/vkoul/slave-dma · 66b59f2b
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
      
       - jz4780 transfer fix for acking descriptors early
      
       - fsl-qdma: clean registers on error
      
       - dw-axi-dmac: null pointer dereference fix
      
       - mediatek-cqdma: fix sleeping in atomic context
      
       - tegra210-adma: fix bunch os issues like crashing in driver probe,
         channel FIFO configuration etc.
      
       - sprd: Fixes for possible crash on descriptor status, block length
         overflow. For 2-stage transfer fix incorrect start, configuration and
         interrupt handling.
      
      * tag 'dmaengine-fix-5.2-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: sprd: Add interrupt support for 2-stage transfer
        dmaengine: sprd: Fix the right place to configure 2-stage transfer
        dmaengine: sprd: Fix block length overflow
        dmaengine: sprd: Fix the incorrect start for 2-stage destination channels
        dmaengine: sprd: Add validation of current descriptor in irq handler
        dmaengine: sprd: Fix the possible crash when getting descriptor status
        dmaengine: tegra210-adma: Fix spelling
        dmaengine: tegra210-adma: Fix channel FIFO configuration
        dmaengine: tegra210-adma: Fix crash during probe
        dmaengine: mediatek-cqdma: sleeping in atomic context
        dmaengine: dw-axi-dmac: fix null dereference when pointer first is null
        dmaengine: fsl-qdma: Add improvement
        dmaengine: jz4780: Fix transfers being ACKed too soon
      66b59f2b
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190608' of git://git.kernel.dk/linux-block · 8d72e5bd
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Allow symlink from the bfq.weight cgroup parameter to the general
         weight (Angelo)
      
       - Damien is new skd maintainer (Bart)
      
       - NVMe pull request from Sagi, with a few small fixes.
      
       - Ensure we set DMA segment size properly, dma-debug is now tripping on
         these (Christoph)
      
       - Remove useless debugfs_create() return check (Greg)
      
       - Remove redundant unlikely() check on IS_ERR() (Kefeng)
      
       - Fixup request freeing on exit (Ming)
      
      * tag 'for-linus-20190608' of git://git.kernel.dk/linux-block:
        block, bfq: add weight symlink to the bfq.weight cgroup parameter
        cgroup: let a symlink too be created with a cftype file
        block: free sched's request pool in blk_cleanup_queue
        nvme-rdma: use dynamic dma mapping per command
        nvme: Fix u32 overflow in the number of namespace list calculation
        mmc: also set max_segment_size in the device
        mtip32xx: also set max_segment_size in the device
        rsxx: don't call dma_set_max_seg_size
        nvme-pci: don't limit DMA segement size
        block: Drop unlikely before IS_ERR(_OR_NULL)
        block: aoe: no need to check return value of debugfs_create functions
        nvmet: fix data_len to 0 for bdev-backed write_zeroes
        MAINTAINERS: Hand over skd maintainership
        nvme-tcp: fix queue mapping when queue count is limited
        nvme-rdma: fix queue mapping when queue count is limited
      8d72e5bd