Skip to content
  1. Nov 29, 2021
  2. Nov 13, 2021
  3. Oct 30, 2021
  4. Oct 29, 2021
    • Vinod Koul's avatar
      spi: spi-geni-qcom: Add support for GPI dma · b59c1224
      Vinod Koul authored
      
      
      We can use GPI DMA for devices where it is enabled by firmware. Add
      support for this mode
      
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      --
      -Changes since v4:
       - Fix the kbuild bot warning
      
      -Changes since v3:
       - Drop merged spi core, geni patches
       - Remove global structs and use local variables instead
       - modularize code more as suggested by Doug
       - fix kbuild bot warning
      
      drivers/spi/spi-geni-qcom.c | 254 +++++++++++++++++++++++++++++++++---
       1 file changed, 239 insertions(+), 15 deletions(-)
      Link: https://lore.kernel.org/r/20211020060954.1531783-1-vkoul@kernel.org
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      b59c1224
  5. Oct 27, 2021
  6. Oct 20, 2021
  7. Oct 15, 2021
  8. Oct 14, 2021
    • Mark Brown's avatar
      Merge branch 'spi-5.15' into spi-5.16 · 531558b5
      Mark Brown authored
      531558b5
    • Uwe Kleine-König's avatar
      spi-mux: Fix false-positive lockdep splats · 16a8e2fb
      Uwe Kleine-König authored
      
      
      io_mutex is taken by spi_setup() and spi-mux's .setup() callback calls
      spi_setup() which results in a nested lock of io_mutex.
      
      add_lock is taken by spi_add_device(). The device_add() call in there
      can result in calling spi-mux's .probe() callback which registers its
      own spi controller which in turn results in spi_add_device() being
      called again.
      
      To fix this initialize the controller's locks already in
      spi_alloc_controller() to give spi_mux_probe() a chance to set the
      lockdep subclass.
      
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Link: https://lore.kernel.org/r/20211013133710.2679703-2-u.kleine-koenig@pengutronix.de
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      16a8e2fb
    • Mark Brown's avatar
      spi: Fix deadlock when adding SPI controllers on SPI buses · 6098475d
      Mark Brown authored
      
      
      Currently we have a global spi_add_lock which we take when adding new
      devices so that we can check that we're not trying to reuse a chip
      select that's already controlled.  This means that if the SPI device is
      itself a SPI controller and triggers the instantiation of further SPI
      devices we trigger a deadlock as we try to register and instantiate
      those devices while in the process of doing so for the parent controller
      and hence already holding the global spi_add_lock.  Since we only care
      about concurrency within a single SPI bus move the lock to be per
      controller, avoiding the deadlock.
      
      This can be easily triggered in the case of spi-mux.
      
      Reported-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      6098475d
  9. Oct 13, 2021
    • Arnd Bergmann's avatar
      spi: cadence-quadspi: fix dma_unmap_single() call · d9c55c95
      Arnd Bergmann authored
      There are separate constants for the dma-mapping API and the dmaengine
      API, mixing them up causes a warning in some builds:
      
      In file included from drivers/spi/spi-cadence-quadspi.c:12:
      drivers/spi/spi-cadence-quadspi.c: In function 'cqspi_versal_indirect_read_dma':
      drivers/spi/spi-cadence-quadspi.c:950:55: error: implicit conversion from 'enum dma_transfer_direction' to 'enum dma_data_direction' [-Werror=enum-conversion]
        950 |         dma_unmap_single(dev, dma_addr, bytes_to_dma, DMA_DEV_TO_MEM);
            |                                                       ^~~~~~~~~~~~~~
      include/linux/dma-mapping.h:407:70: note: in definition of macro 'dma_unmap_single'
        407 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
            |                                                                      ^
      
      Fixes: 1a6f854f
      
       ("spi: cadence-quadspi: Add Xilinx Versal external DMA support")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20211013144600.2378037-1-arnd@kernel.org
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      d9c55c95
    • Arnd Bergmann's avatar
      spi: tegra20: fix build with CONFIG_PM_SLEEP=n · 7dc9b956
      Arnd Bergmann authored
      There is another one of these warnings:
      
      drivers/spi/spi-tegra20-slink.c:1197:12: error: 'tegra_slink_runtime_resume' defined but not used [-Werror=unused-function]
       1197 | static int tegra_slink_runtime_resume(struct device *dev)
            |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Give it the same treatment as the other functions in this file.
      
      Fixes: efafec27 ("spi: Fix tegra20 build with CONFIG_PM=n")
      Fixes: 2bab9409
      
       ("spi: tegra20-slink: Declare runtime suspend and resume functions conditionally")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Link: https://lore.kernel.org/r/20211013144538.2346533-1-arnd@kernel.org
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      7dc9b956
  10. Oct 11, 2021
  11. Oct 08, 2021
    • Mark Brown's avatar
      Merge series "spi: Various Cleanups" from Uwe Kleine-König <u.kleine-koenig@pengutronix.de>: · a0ecee32
      Mark Brown authored
      Hello,
      
      while trying to understand how the spi framework makes use of the core
      device driver stuff (to fix a deadlock) I found these simplifications
      and improvements.
      
      They are build-tested with allmodconfig on arm64, m68k, powerpc, riscv,
      s390, sparc64 and x86_64.
      
      Best regards
      Uwe
      
      Uwe Kleine-König (4):
        spi: Move comment about chipselect check to the right place
        spi: Remove unused function spi_busnum_to_master()
        spi: Reorder functions to simplify the next commit
        spi: Make several public functions private to spi.c
      
       Documentation/spi/spi-summary.rst |   8 -
       drivers/spi/spi.c                 | 237 ++++++++++++------------------
       include/linux/spi/spi.h           |  55 -------
       3 files changed, 95 insertions(+), 205 deletions(-)
      
      base-commit: 9e1ff307
      --
      2.30.2
      a0ecee32
    • Mark Brown's avatar
      Merge branch 'spi-5.15' into spi-5.16 · 5fe7bd5a
      Mark Brown authored
      5fe7bd5a
  12. Oct 07, 2021
  13. Oct 05, 2021
  14. Oct 04, 2021
    • Parshuram Thombare's avatar
      spi: cadence: fix static checker warning · 79bffb1e
      Parshuram Thombare authored
      This patch fixes Smatch static checker warning.
      CDNS_XSPI_CMD_REG_5 is used in ACMD mode and currently
      only STIG mode is enabled which doesn't use CDNS_XSPI_CMD_REG_5
      and hence everything was working in STIG mode.
      Since plan is to use same function cdns_xspi_trigger_command()
      in ACMD mode, increasing size of the array passed to it.
      
      Fixes: a16cc807
      
       ("spi: cadence: add support for Cadence XSPI controller")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/linux-spi/20210930134231.GA14363@kili/
      Signed-off-by: default avatarParshuram Thombare <pthombar@cadence.com>
      Link: https://lore.kernel.org/r/1633336704-22735-1-git-send-email-pthombar@cadence.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      79bffb1e
    • Linus Torvalds's avatar
      Linux 5.15-rc4 · 9e1ff307
      Linus Torvalds authored
      v5.15-rc4
      9e1ff307
    • Chen Jingwen's avatar
      elf: don't use MAP_FIXED_NOREPLACE for elf interpreter mappings · 9b2f72cc
      Chen Jingwen authored
      In commit b212921b ("elf: don't use MAP_FIXED_NOREPLACE for elf
      executable mappings") we still leave MAP_FIXED_NOREPLACE in place for
      load_elf_interp.
      
      Unfortunately, this will cause kernel to fail to start with:
      
          1 (init): Uhuuh, elf segment at 00003ffff7ffd000 requested but the memory is mapped already
          Failed to execute /init (error -17)
      
      The reason is that the elf interpreter (ld.so) has overlapping segments.
      
        readelf -l ld-2.31.so
        Program Headers:
          Type           Offset             VirtAddr           PhysAddr
                         FileSiz            MemSiz              Flags  Align
          LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                         0x000000000002c94c 0x000000000002c94c  R E    0x10000
          LOAD           0x000000000002dae0 0x000000000003dae0 0x000000000003dae0
                         0x00000000000021e8 0x0000000000002320  RW     0x10000
          LOAD           0x000000000002fe00 0x000000000003fe00 0x000000000003fe00
                         0x00000000000011ac 0x0000000000001328  RW     0x10000
      
      The reason for this problem is the same as described in commit
      ad55eac7 ("elf: enforce MAP_FIXED on overlaying elf segments").
      
      Not only executable binaries, elf interpreters (e.g. ld.so) can have
      overlapping elf segments, so we better drop MAP_FIXED_NOREPLACE and go
      back to MAP_FIXED in load_elf_interp.
      
      Fixes: 4ed28639
      
       ("fs, elf: drop MAP_FIXED usage from elf_map")
      Cc: <stable@vger.kernel.org> # v4.19
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarChen Jingwen <chenjingwen6@huawei.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9b2f72cc
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · ca3cef46
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix a number of ext4 bugs in fast_commit, inline data, and delayed
        allocation.
      
        Also fix error handling code paths in ext4_dx_readdir() and
        ext4_fill_super().
      
        Finally, avoid a grabbing a journal head in the delayed allocation
        write in the common cases where we are overwriting a pre-existing
        block or appending to an inode"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: recheck buffer uptodate bit under buffer lock
        ext4: fix potential infinite loop in ext4_dx_readdir()
        ext4: flush s_error_work before journal destroy in ext4_fill_super
        ext4: fix loff_t overflow in ext4_max_bitmap_size()
        ext4: fix reserved space counter leakage
        ext4: limit the number of blocks in one ADD_RANGE TLV
        ext4: enforce buffer head state assertion in ext4_da_map_blocks
        ext4: remove extent cache entries when truncating inline data
        ext4: drop unnecessary journal handle in delalloc write
        ext4: factor out write end code of inline file
        ext4: correct the error path of ext4_write_inline_data_end()
        ext4: check and update i_disksize properly
        ext4: add error checking to ext4_ext_replay_set_iblocks()
      ca3cef46
    • Linus Torvalds's avatar
      objtool: print out the symbol type when complaining about it · 7fab1c12
      Linus Torvalds authored
      The objtool warning that the kvm instruction emulation code triggered
      wasn't very useful:
      
          arch/x86/kvm/emulate.o: warning: objtool: __ex_table+0x4: don't know how to handle reloc symbol type: kvm_fastop_exception
      
      in that it helpfully tells you which symbol name it had trouble figuring
      out the relocation for, but it doesn't actually say what the unknown
      symbol type was that triggered it all.
      
      In this case it was because of missing type information (type 0, aka
      STT_NOTYPE), but on the whole it really should just have printed that
      out as part of the message.
      
      Because if this warning triggers, that's very much the first thing you
      want to know - why did reloc2sec_off() return failure for that symbol?
      
      So rather than just saying you can't handle some type of symbol without
      saying what the type _was_, just print out the type number too.
      
      Fixes: 24ff6525
      
       ("objtool: Teach get_alt_entry() about more relocation types")
      Link: https://lore.kernel.org/lkml/CAHk-=wiZwq-0LknKhXN4M+T8jbxn_2i9mcKpO+OaBSSq_Eh7tg@mail.gmail.com/
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7fab1c12
    • Linus Torvalds's avatar
      kvm: fix objtool relocation warning · 291073a5
      Linus Torvalds authored
      The recent change to make objtool aware of more symbol relocation types
      (commit 24ff6525: "objtool: Teach get_alt_entry() about more
      relocation types") also added another check, and resulted in this
      objtool warning when building kvm on x86:
      
          arch/x86/kvm/emulate.o: warning: objtool: __ex_table+0x4: don't know how to handle reloc symbol type: kvm_fastop_exception
      
      The reason seems to be that kvm_fastop_exception() is marked as a global
      symbol, which causes the relocation to ke kept around for objtool.  And
      at the same time, the kvm_fastop_exception definition (which is done as
      an inline asm statement) doesn't actually set the type of the global,
      which then makes objtool unhappy.
      
      The minimal fix is to just not mark kvm_fastop_exception as being a
      global symbol.  It's only used in that one compilation unit anyway, so
      it was always pointless.  That's how all the other local exception table
      labels are done.
      
      I'm not entirely happy about the kinds of games that the kvm code plays
      with doing its own exception handling, and the fact that it confused
      objtool is most definitely a symptom of the code being a bit too subtle
      and ad-hoc.  But at least this trivial one-liner makes objtool no longer
      upset about what is going on.
      
      Fixes: 24ff6525
      
       ("objtool: Teach get_alt_entry() about more relocation types")
      Link: https://lore.kernel.org/lkml/CAHk-=wiZwq-0LknKhXN4M+T8jbxn_2i9mcKpO+OaBSSq_Eh7tg@mail.gmail.com/
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Cc: Wanpeng Li <wanpengli@tencent.com>
      Cc: Jim Mattson <jmattson@google.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      291073a5
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 6761a0ae
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small misc driver fixes for 5.15-rc4. They are in two
        "groups":
      
         - ipack driver fixes for issues found by Johan Hovold
      
         - interconnect driver fixes for reported problems
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'char-misc-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        ipack: ipoctal: fix module reference leak
        ipack: ipoctal: fix missing allocation-failure check
        ipack: ipoctal: fix tty-registration error handling
        ipack: ipoctal: fix tty registration race
        ipack: ipoctal: fix stack information leak
        interconnect: qcom: sdm660: Add missing a2noc qos clocks
        dt-bindings: interconnect: sdm660: Add missing a2noc qos clocks
        interconnect: qcom: sdm660: Correct NOC_QOS_PRIORITY shift and mask
        interconnect: qcom: sdm660: Fix id of slv_cnoc_mnoc_cfg
      6761a0ae
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.15-rc4' of... · 84928ce3
      Linus Torvalds authored
      Merge tag 'driver-core-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fixes from Greg KH:
       "Here are some driver core and kernfs fixes for reported issues for
        5.15-rc4. These fixes include:
      
         - kernfs positive dentry bugfix
      
         - debugfs_create_file_size error path fix
      
         - cpumask sysfs file bugfix to preserve the user/kernel abi (has been
           reported multiple times.)
      
         - devlink fixes for mdiobus devices as reported by the subsystem
           maintainers.
      
        Also included in here are some devlink debugging changes to make it
        easier for people to report problems when asked. They have already
        helped with the mdiobus and other subsystems reporting issues.
      
        All of these have been linux-next for a while with no reported issues"
      
      * tag 'driver-core-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kernfs: also call kernfs_set_rev() for positive dentry
        driver core: Add debug logs when fwnode links are added/deleted
        driver core: Create __fwnode_link_del() helper function
        driver core: Set deferred probe reason when deferred by driver core
        net: mdiobus: Set FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD for mdiobus parents
        driver core: fw_devlink: Add support for FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD
        driver core: fw_devlink: Improve handling of cyclic dependencies
        cpumask: Omit terminating null byte in cpumap_print_{list,bitmask}_to_buf
        debugfs: debugfs_create_file_size(): use IS_ERR to check for error
      84928ce3