]> Git Repo - J-linux.git/commitdiff
Merge tag 'spi-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
authorLinus Torvalds <[email protected]>
Tue, 16 Jul 2024 01:03:43 +0000 (18:03 -0700)
committerLinus Torvalds <[email protected]>
Tue, 16 Jul 2024 01:03:43 +0000 (18:03 -0700)
Pull spi updates from Mark Brown:
 "There's some quite exciting core work in this release, we've got the
  beginnings of support for hardware initiated transfers which is itself
  independently useful for optimising fast paths in existing drivers.

  We also have a rework of the DMA mapping which allows finer grained
  decisions about DMA mapping messages and also helps remove some bodges
  that we'd had.

  Otherwise it's a fairly quiet release, a few new drivers and features
  for existing drivers, together with various cleanups and DT binding
  conversions.

  One regmap SPI fix made it's way in here too which I should probably
  have sent as a regmap fix instead.

  Summary:

   - Support for pre-optimising messages, reducing the overhead for
     messages that are repeatedly used (eg, reading the interrupt status
     from a device). This will also be used for hardware initiated
     transfers in future.

   - A reworking of how DMA mapping is done, introducing a new helper
     and allowing the DMA mapping decision to be done per transfer
     instead of per message.

   - Support for Atmel SAMA7D64, Freescale LX2160A DSPI and WCH CH341A"

* tag 'spi-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (72 commits)
  spi: dt-bindings: at91: Add sama7d65 compatible string
  spi: add ch341a usb2spi driver
  spi: dt-bindings: fsl-dspi: add compatible string 'fsl,lx2160a-dspi'
  spi: dt-bindings: fsl-dspi: add dmas and dma-names properties
  spi: spi: Remove unnecessary ‘0’ values from status
  spi: spi: Remove unnecessary ‘0’ values from rc
  spi: xcomm: fix coding style
  spi: xcomm: remove i2c_set_clientdata()
  spi: xcomm: make use of devm_spi_alloc_host()
  spi: xcomm: add gpiochip support
  spi: dt-bindings: snps,dw-apb-ssi.yaml: update compatible property
  spi: dt-bindings: fsl-dspi: Convert to yaml format
  spi: fsl-dspi: use common proptery 'spi-cs-setup(hold)-delay-ns'
  spi: axi-spi-engine: remove platform_set_drvdata()
  spi: spi-fsl-lpspi: Pass pm_ptr()
  spi: spi-imx: Pass pm_ptr()
  spi: spi-fsl-lpspi: Switch to SYSTEM_SLEEP_PM_OPS()
  spi: spi-imx: Switch to RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()
  spi: add EXPORT_SYMBOL_GPL(devm_spi_optimize_message)
  spi: add devm_spi_optimize_message() helper
  ...

1  2 
MAINTAINERS
drivers/spi/spi-axi-spi-engine.c
drivers/spi/spi-omap2-mcspi.c
drivers/spi/spi.c
include/linux/spi/spi.h

diff --combined MAINTAINERS
index 81d05219bfc44318d254b4d198438422a14d2104,763b79fd7fdb600b79f138686d1e17ca983c76fc..af4b4c27134205404b121ffddfb21c0eb3ab93d4
@@@ -846,6 -846,12 +846,6 @@@ ALPS PS/2 TOUCHPAD DRIVE
  R:    Pali Rohár <[email protected]>
  F:    drivers/input/mouse/alps.*
  
 -ALTERA I2C CONTROLLER DRIVER
 -M:    Thor Thayer <[email protected]>
 -S:    Maintained
 -F:    Documentation/devicetree/bindings/i2c/i2c-altera.txt
 -F:    drivers/i2c/busses/i2c-altera.c
 -
  ALTERA MAILBOX DRIVER
  M:    Mun Yew Tham <[email protected]>
  S:    Maintained
@@@ -865,6 -871,21 +865,6 @@@ L:        [email protected]
  S:    Maintained
  F:    drivers/gpio/gpio-altera.c
  
 -ALTERA SYSTEM MANAGER DRIVER
 -M:    Thor Thayer <[email protected]>
 -S:    Maintained
 -F:    drivers/mfd/altera-sysmgr.c
 -F:    include/linux/mfd/altera-sysmgr.h
 -
 -ALTERA SYSTEM RESOURCE DRIVER FOR ARRIA10 DEVKIT
 -M:    Thor Thayer <[email protected]>
 -S:    Maintained
 -F:    drivers/gpio/gpio-altera-a10sr.c
 -F:    drivers/mfd/altera-a10sr.c
 -F:    drivers/reset/reset-a10sr.c
 -F:    include/dt-bindings/reset/altr,rst-mgr-a10sr.h
 -F:    include/linux/mfd/altera-a10sr.h
 -
  ALTERA TRIPLE SPEED ETHERNET DRIVER
  M:    Joyce Ooi <[email protected]>
  L:    [email protected]
@@@ -1023,7 -1044,7 +1023,7 @@@ M:      Joerg Roedel <[email protected]
  R:    Suravee Suthikulpanit <[email protected]>
  L:    [email protected]
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
  F:    drivers/iommu/amd/
  F:    include/linux/amd-iommu.h
  
@@@ -2871,7 -2892,7 +2871,7 @@@ F:      drivers/edac/altera_edac.[ch
  ARM/SPREADTRUM SoC SUPPORT
  M:    Orson Zhai <[email protected]>
  M:    Baolin Wang <[email protected]>
 -M:    Chunyan Zhang <[email protected]>
 +R:    Chunyan Zhang <[email protected]>
  S:    Maintained
  F:    arch/arm64/boot/dts/sprd
  N:    sprd
@@@ -3549,15 -3570,6 +3549,15 @@@ W:    https://ez.analog.com/linux-software
  F:    Documentation/devicetree/bindings/spi/adi,axi-spi-engine.yaml
  F:    drivers/spi/spi-axi-spi-engine.c
  
 +AXI PWM GENERATOR
 +M:    Michael Hennerich <[email protected]>
 +M:    Nuno Sá <[email protected]>
 +L:    [email protected]
 +S:    Supported
 +W:    https://ez.analog.com/linux-software-drivers
 +F:    Documentation/devicetree/bindings/pwm/adi,axi-pwmgen.yaml
 +F:    drivers/pwm/pwm-axi-pwmgen.c
 +
  AXXIA I2C CONTROLLER
  M:    Krzysztof Adamski <[email protected]>
  L:    [email protected]
@@@ -3589,9 -3601,10 +3589,9 @@@ W:     https://wireless.wiki.kernel.org/en/
  F:    drivers/net/wireless/broadcom/b43/
  
  B43LEGACY WIRELESS DRIVER
 -M:    Larry Finger <[email protected]>
  L:    [email protected]
  L:    [email protected]
 -S:    Maintained
 +S:    Orphan
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/b43
  F:    drivers/net/wireless/broadcom/b43legacy/
  
@@@ -3768,20 -3781,6 +3768,20 @@@ F:    include/linux/blk
  F:    kernel/trace/blktrace.c
  F:    lib/sbitmap.c
  
 +BLOCK LAYER DEVICE DRIVER API [RUST]
 +M:    Andreas Hindborg <[email protected]>
 +R:    Boqun Feng <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Supported
 +W:    https://rust-for-linux.com
 +B:    https://github.com/Rust-for-Linux/linux/issues
 +C:    https://rust-for-linux.zulipchat.com/#narrow/stream/Block
 +T:    git https://github.com/Rust-for-Linux/linux.git rust-block-next
 +F:    drivers/block/rnull.rs
 +F:    rust/kernel/block.rs
 +F:    rust/kernel/block/
 +
  BLOCK2MTD DRIVER
  M:    Joern Engel <[email protected]>
  L:    [email protected]
@@@ -3981,7 -3980,7 +3981,7 @@@ R:      Song Liu <[email protected]
  R:    Yonghong Song <[email protected]>
  R:    John Fastabend <[email protected]>
  R:    KP Singh <[email protected]>
 -R:    Stanislav Fomichev <sdf@google.com>
 +R:    Stanislav Fomichev <sdf@fomichev.me>
  R:    Hao Luo <[email protected]>
  R:    Jiri Olsa <[email protected]>
  L:    [email protected]
@@@ -4084,13 -4083,12 +4084,13 @@@ F:   kernel/bpf/ringbuf.
  
  BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF)
  M:    KP Singh <[email protected]>
 -R:    Matt Bobrowski <[email protected]>
 +M:    Matt Bobrowski <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    Documentation/bpf/prog_lsm.rst
  F:    include/linux/bpf_lsm.h
  F:    kernel/bpf/bpf_lsm.c
 +F:    kernel/trace/bpf_trace.c
  F:    security/bpf/
  
  BPF [SELFTESTS] (Test Runners & Infrastructure)
@@@ -5137,25 -5135,11 +5137,25 @@@ S:   Maintaine
  F:    Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
  F:    sound/soc/codecs/cros_ec_codec.*
  
 +CHROMEOS EC CHARGE CONTROL
 +M:    Thomas Weißschuh <[email protected]>
 +S:    Maintained
 +F:    drivers/power/supply/cros_charge-control.c
 +
 +CHROMEOS EC HARDWARE MONITORING
 +M:    Thomas Weißschuh <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hwmon/cros_ec_hwmon.rst
 +F:    drivers/hwmon/cros_ec_hwmon.c
 +
  CHROMEOS EC SUBDRIVERS
  M:    Benson Leung <[email protected]>
  R:    Guenter Roeck <[email protected]>
  L:    [email protected]
  S:    Maintained
 +F:    drivers/power/supply/cros_charge-control.c
  F:    drivers/power/supply/cros_usbpd-charger.c
  N:    cros_ec
  N:    cros-ec
@@@ -5311,7 -5295,7 +5311,7 @@@ F:      drivers/infiniband/hw/usnic
  
  CLANG CONTROL FLOW INTEGRITY SUPPORT
  M:    Sami Tolvanen <[email protected]>
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  R:    Nathan Chancellor <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -5551,7 -5535,6 +5551,7 @@@ CONTROL GROUP (CGROUP
  M:    Tejun Heo <[email protected]>
  M:    Zefan Li <[email protected]>
  M:    Johannes Weiner <[email protected]>
 +M:    Michal Koutný <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git
@@@ -6255,8 -6238,9 +6255,8 @@@ S:      Maintaine
  F:    drivers/usb/dwc3/
  
  DESIGNWARE XDATA IP DRIVER
 -M:    Gustavo Pimentel <[email protected]>
  L:    [email protected]
 -S:    Maintained
 +S:    Orphan
  F:    Documentation/misc-devices/dw-xdata-pcie.rst
  F:    drivers/misc/dw-xdata-pcie.c
  
@@@ -8227,7 -8211,7 +8227,7 @@@ F:      rust/kernel/net/phy.r
  
  EXEC & BINFMT API, ELF
  R:    Eric Biederman <[email protected]>
 -R:    Kees Cook <keescook@chromium.org>
 +R:    Kees Cook <kees@kernel.org>
  L:    [email protected]
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
@@@ -8498,7 -8482,6 +8498,7 @@@ R:      Darrick J. Wong <[email protected]
  L:    [email protected]
  L:    [email protected]
  S:    Supported
 +F:    Documentation/filesystems/iomap/*
  F:    fs/iomap/
  F:    include/linux/iomap.h
  
@@@ -8629,7 -8612,7 +8629,7 @@@ S:      Maintaine
  F:    drivers/net/ethernet/nvidia/*
  
  FORTIFY_SOURCE
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  L:    [email protected]
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@@ -8725,7 -8708,7 +8725,7 @@@ FREESCALE DSPI DRIVE
  M:    Vladimir Oltean <[email protected]>
  L:    [email protected]
  S:    Maintained
- F:    Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
+ F:    Documentation/devicetree/bindings/spi/fsl,dspi*.yaml
  F:    drivers/spi/spi-fsl-dspi.c
  F:    include/linux/spi/spi-fsl-dspi.h
  
@@@ -8850,7 -8833,6 +8850,7 @@@ F:      drivers/spi/spi-fsl-qspi.
  
  FREESCALE QUICC ENGINE LIBRARY
  M:    Qiang Zhao <[email protected]>
 +M:    Christophe Leroy <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    drivers/soc/fsl/qe/
@@@ -8900,10 -8882,9 +8900,10 @@@ S:    Maintaine
  F:    drivers/tty/serial/ucc_uart.c
  
  FREESCALE SOC DRIVERS
 +M:    Christophe Leroy <[email protected]>
  L:    [email protected]
  L:    [email protected] (moderated for non-subscribers)
 -S:    Orphan
 +S:    Maintained
  F:    Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml
  F:    Documentation/devicetree/bindings/soc/fsl/
  F:    drivers/soc/fsl/
@@@ -9121,7 -9102,7 +9121,7 @@@ F:      include/linux/mfd/gsc.
  F:    include/linux/platform_data/gsc_hwmon.h
  
  GCC PLUGINS
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@@ -9255,7 -9236,7 +9255,7 @@@ S:      Maintaine
  F:    drivers/input/touchscreen/resistive-adc-touch.c
  
  GENERIC STRING LIBRARY
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  R:    Andy Shevchenko <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -11175,7 -11156,7 +11175,7 @@@ M:   David Woodhouse <[email protected]
  M:    Lu Baolu <[email protected]>
  L:    [email protected]
  S:    Supported
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
  F:    drivers/iommu/intel/
  
  INTEL IPU3 CSI-2 CIO2 DRIVER
@@@ -11548,7 -11529,7 +11548,7 @@@ IOMMU DMA-API LAYE
  M:    Robin Murphy <[email protected]>
  L:    [email protected]
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
  F:    drivers/iommu/dma-iommu.c
  F:    drivers/iommu/dma-iommu.h
  F:    drivers/iommu/iova.c
@@@ -11560,7 -11541,7 +11560,7 @@@ M:   Will Deacon <[email protected]
  R:    Robin Murphy <[email protected]>
  L:    [email protected]
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
  F:    Documentation/devicetree/bindings/iommu/
  F:    Documentation/userspace-api/iommu.rst
  F:    drivers/iommu/
@@@ -11589,7 -11570,7 +11589,7 @@@ F:   include/linux/iosys-map.
  
  IO_URING
  M:    Jens Axboe <[email protected]>
 -R:    Pavel Begunkov <[email protected]>
 +M:    Pavel Begunkov <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.dk/linux-block
@@@ -11969,7 -11950,7 +11969,7 @@@ F:   scripts/package
  F:    usr/
  
  KERNEL HARDENING (not covered by other areas)
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  R:    Gustavo A. R. Silva <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -12401,6 -12382,7 +12401,6 @@@ F:   drivers/video/backlight/ktz8866.
  
  KVM PARAVIRT (KVM/paravirt)
  M:    Paolo Bonzini <[email protected]>
 -R:    Wanpeng Li <[email protected]>
  R:    Vitaly Kuznetsov <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -12496,7 -12478,7 +12496,7 @@@ F:   drivers/scsi/53c700
  
  LEAKING_ADDRESSES
  M:    Tycho Andersen <[email protected]>
 -R:    Kees Cook <keescook@chromium.org>
 +R:    Kees Cook <kees@kernel.org>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
@@@ -12792,7 -12774,7 +12792,7 @@@ F:   arch/powerpc/platforms/8xx
  F:    arch/powerpc/platforms/83xx/
  
  LINUX KERNEL DUMP TEST MODULE (LKDTM)
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  S:    Maintained
  F:    drivers/misc/lkdtm/*
  F:    tools/testing/selftests/lkdtm/*
@@@ -12922,7 -12904,7 +12922,7 @@@ Q:   http://patchwork.linuxtv.org/project
  F:    drivers/media/usb/dvb-usb-v2/lmedm04*
  
  LOADPIN SECURITY MODULE
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
  F:    Documentation/admin-guide/LSM/LoadPin.rst
@@@ -14492,7 -14474,7 +14492,7 @@@ MEMORY MAPPIN
  M:    Andrew Morton <[email protected]>
  R:    Liam R. Howlett <[email protected]>
  R:    Vlastimil Babka <[email protected]>
 -R:    Lorenzo Stoakes <lstoakes@gmail.com>
 +R:    Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
  L:    [email protected]
  S:    Maintained
  W:    http://www.linux-mm.org
@@@ -15274,27 -15256,6 +15274,27 @@@ S: Maintaine
  F:    Documentation/devicetree/bindings/leds/backlight/mps,mp3309c.yaml
  F:    drivers/video/backlight/mp3309c.c
  
 +MPS MP2891 DRIVER
 +M:    Noah Wang <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hwmon/mp2891.rst
 +F:    drivers/hwmon/pmbus/mp2891.c
 +
 +MPS MP2993 DRIVER
 +M:    Noah Wang <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hwmon/mp2993.rst
 +F:    drivers/hwmon/pmbus/mp2993.c
 +
 +MPS MP9941 DRIVER
 +M:    Noah Wang <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/hwmon/mp9941.rst
 +F:    drivers/hwmon/pmbus/mp9941.c
 +
  MR800 AVERMEDIA USB FM RADIO DRIVER
  M:    Alexey Klimov <[email protected]>
  L:    [email protected]
@@@ -16486,7 -16447,7 +16486,7 @@@ F:   arch/arm/boot/dts/ti/omap/am335x-nan
  OMAP1 SUPPORT
  M:    Aaro Koskinen <[email protected]>
  M:    Janusz Krzysztofik <[email protected]>
 -M:    Tony Lindgren <[email protected]>
 +R:    Tony Lindgren <[email protected]>
  L:    [email protected]
  S:    Maintained
  Q:    http://patchwork.kernel.org/project/linux-omap/list/
@@@ -16498,13 -16459,10 +16498,13 @@@ F:        include/linux/platform_data/ams-delt
  F:    include/linux/platform_data/i2c-omap.h
  
  OMAP2+ SUPPORT
 +M:    Aaro Koskinen <[email protected]>
 +M:    Andreas Kemnade <[email protected]>
 +M:    Kevin Hilman <[email protected]>
 +M:    Roger Quadros <[email protected]>
  M:    Tony Lindgren <[email protected]>
  L:    [email protected]
  S:    Maintained
 -W:    http://www.muru.com/linux/omap/
  W:    http://linux.omap.com/
  Q:    http://patchwork.kernel.org/project/linux-omap/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
@@@ -17391,14 -17349,6 +17391,14 @@@ F: Documentation/driver-api/pci/p2pdma.
  F:    drivers/pci/p2pdma.c
  F:    include/linux/pci-p2pdma.h
  
 +PCI POWER CONTROL
 +M:    Bartosz Golaszewski <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
 +F:    drivers/pci/pwrctl/*
 +F:    include/linux/pci-pwrctl.h
 +
  PCI SUBSYSTEM
  M:    Bjorn Helgaas <[email protected]>
  L:    [email protected]
@@@ -17582,6 -17532,7 +17582,6 @@@ F:   include/linux/peci.
  PENSANDO ETHERNET DRIVERS
  M:    Shannon Nelson <[email protected]>
  M:    Brett Creeley <[email protected]>
 -M:    [email protected]
  L:    [email protected]
  S:    Supported
  F:    Documentation/networking/device_drivers/ethernet/pensando/ionic.rst
@@@ -17939,14 -17890,6 +17939,14 @@@ F: include/linux/pm_
  F:    include/linux/powercap.h
  F:    kernel/configs/nopm.config
  
 +POWER SEQUENCING
 +M:    Bartosz Golaszewski <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
 +F:    drivers/power/sequencing/
 +F:    include/linux/pwrseq/
 +
  POWER STATE COORDINATION INTERFACE (PSCI)
  M:    Mark Rutland <[email protected]>
  M:    Lorenzo Pieralisi <[email protected]>
@@@ -18053,7 -17996,7 +18053,7 @@@ F:   tools/testing/selftests/proc
  
  PROC SYSCTL
  M:    Luis Chamberlain <[email protected]>
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  M:    Joel Granados <[email protected]>
  L:    [email protected]
  L:    [email protected]
@@@ -18109,7 -18052,7 +18109,7 @@@ F:   Documentation/devicetree/bindings/ne
  F:    drivers/net/pse-pd/
  
  PSTORE FILESYSTEM
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  R:    Tony Luck <[email protected]>
  R:    Guilherme G. Piccoli <[email protected]>
  L:    [email protected]
@@@ -18267,7 -18210,6 +18267,7 @@@ QCOM AUDIO (ASoC) DRIVER
  M:    Srinivas Kandagatla <[email protected]>
  M:    Banajit Goswami <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected]
  S:    Supported
  F:    Documentation/devicetree/bindings/soc/qcom/qcom,apr*
  F:    Documentation/devicetree/bindings/sound/qcom,*
@@@ -18432,7 -18374,7 +18432,7 @@@ M:   Jeff Johnson <[email protected]
  L:    [email protected]
  S:    Supported
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/ath12k
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git
  F:    drivers/net/wireless/ath/ath12k/
  N:    ath12k
  
@@@ -18442,7 -18384,7 +18442,7 @@@ M:   Jeff Johnson <[email protected]
  L:    [email protected]
  S:    Supported
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git
  F:    drivers/net/wireless/ath/ath10k/
  N:    ath10k
  
  S:    Supported
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/ath11k
  B:    https://wireless.wiki.kernel.org/en/users/Drivers/ath11k/bugreport
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git
  F:    drivers/net/wireless/ath/ath11k/
  N:    ath11k
  
@@@ -18462,7 -18404,7 +18462,7 @@@ M:   Toke Høiland-Jørgensen <toke@toke.
  L:    [email protected]
  S:    Maintained
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git
  F:    Documentation/devicetree/bindings/net/wireless/qca,ath9k.yaml
  F:    drivers/net/wireless/ath/ath9k/
  
@@@ -18924,7 -18866,6 +18924,7 @@@ M:   Neeraj Upadhyay <neeraj.upadhyay@ker
  M:    Joel Fernandes <[email protected]>
  M:    Josh Triplett <[email protected]>
  M:    Boqun Feng <[email protected]>
 +M:    Uladzislau Rezki <[email protected]>
  R:    Steven Rostedt <[email protected]>
  R:    Mathieu Desnoyers <[email protected]>
  R:    Lai Jiangshan <[email protected]>
@@@ -19374,7 -19315,7 +19374,7 @@@ F:   drivers/perf/riscv_pmu_legacy.
  F:    drivers/perf/riscv_pmu_sbi.c
  
  RISC-V THEAD SoC SUPPORT
 -M:    Jisheng Zhang <[email protected]>
 +M:    Drew Fustini <[email protected]>
  M:    Guo Ren <[email protected]>
  M:    Fu Wei <[email protected]>
  L:    [email protected]
@@@ -19568,6 -19509,7 +19568,6 @@@ F:   drivers/net/wireless/realtek/rtl818x
  
  RTL8187 WIRELESS DRIVER
  M:    Hin-Tak Leung <[email protected]>
 -M:    Larry Finger <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git https://github.com/pkshih/rtw.git
@@@ -20116,7 -20058,7 +20116,7 @@@ F:   drivers/media/cec/platform/seco/seco
  F:    drivers/media/cec/platform/seco/seco-cec.h
  
  SECURE COMPUTING
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  R:    Andy Lutomirski <[email protected]>
  R:    Will Drewry <[email protected]>
  S:    Supported
@@@ -20156,7 -20098,6 +20156,7 @@@ SECURE DIGITAL HOST CONTROLLER INTERFAC
  M:    Haibo Chen <[email protected]>
  L:    [email protected]
  L:    [email protected]
 +L:    [email protected]
  S:    Maintained
  F:    drivers/mmc/host/sdhci-esdhc-imx.c
  
@@@ -21306,6 -21247,7 +21306,6 @@@ W:   http://wiki.laptop.org/go/DCO
  F:    drivers/staging/olpc_dcon/
  
  STAGING - REALTEK RTL8712U DRIVERS
 -M:    Larry Finger <[email protected]>
  M:    Florian Schilhabel <[email protected]>.
  S:    Odd Fixes
  F:    drivers/staging/rtl8712/
@@@ -22804,7 -22746,7 +22804,7 @@@ M:   Jarkko Sakkinen <[email protected]
  R:    Jason Gunthorpe <[email protected]>
  L:    [email protected]
  S:    Maintained
 -W:    https://gitlab.com/jarkkojs/linux-tpmdd-test
 +W:    https://codeberg.org/jarkko/linux-tpmdd-test
  Q:    https://patchwork.kernel.org/project/linux-integrity/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
  F:    Documentation/devicetree/bindings/tpm/
@@@ -23030,7 -22972,7 +23030,7 @@@ F:   drivers/block/ublk_drv.
  F:    include/uapi/linux/ublk_cmd.h
  
  UBSAN
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  R:    Marco Elver <[email protected]>
  R:    Andrey Konovalov <[email protected]>
  R:    Andrey Ryabinin <[email protected]>
@@@ -23703,6 -23645,12 +23703,6 @@@ M:  Kevin Brace <kevinbrace@bracecompute
  S:    Maintained
  F:    drivers/net/ethernet/via/via-rhine.c
  
 -VIA SD/MMC CARD CONTROLLER DRIVER
 -M:    Bruce Chang <[email protected]>
 -M:    Harald Welte <[email protected]>
 -S:    Maintained
 -F:    drivers/mmc/host/via-sdmmc.c
 -
  VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
  M:    Florian Tobias Schandinat <[email protected]>
  L:    [email protected]
@@@ -23915,8 -23863,8 +23915,8 @@@ S:   Maintaine
  F:    drivers/vhost/scsi.c
  
  VIRTIO I2C DRIVER
 -M:    Conghui Chen <[email protected]>
  M:    Viresh Kumar <[email protected]>
 +R:    "Chen, Jian Jun" <[email protected]>
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
@@@ -24026,6 -23974,7 +24026,6 @@@ VMALLO
  M:    Andrew Morton <[email protected]>
  R:    Uladzislau Rezki <[email protected]>
  R:    Christoph Hellwig <[email protected]>
 -R:    Lorenzo Stoakes <[email protected]>
  L:    [email protected]
  S:    Maintained
  W:    http://www.linux-mm.org
@@@ -24861,7 -24810,7 +24861,7 @@@ F:   drivers/net/hamradio/yam
  F:    include/linux/yam.h
  
  YAMA SECURITY MODULE
 -M:    Kees Cook <keescook@chromium.org>
 +M:    Kees Cook <kees@kernel.org>
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
  F:    Documentation/admin-guide/LSM/Yama.rst
index 96a524772549ee8d9a4b9f936dd83b52f87c4169,03588fac9215ce40f238720fc8e2ecfbe6b278d5..447e5a962dee86ce2ebb774e5412b41659ce1afa
@@@ -46,6 -46,7 +46,7 @@@
  #define SPI_ENGINE_INST_ASSERT                        0x1
  #define SPI_ENGINE_INST_WRITE                 0x2
  #define SPI_ENGINE_INST_MISC                  0x3
+ #define SPI_ENGINE_INST_CS_INV                        0x4
  
  #define SPI_ENGINE_CMD_REG_CLK_DIV            0x0
  #define SPI_ENGINE_CMD_REG_CONFIG             0x1
@@@ -73,6 -74,8 +74,8 @@@
        SPI_ENGINE_CMD(SPI_ENGINE_INST_MISC, SPI_ENGINE_MISC_SLEEP, (delay))
  #define SPI_ENGINE_CMD_SYNC(id) \
        SPI_ENGINE_CMD(SPI_ENGINE_INST_MISC, SPI_ENGINE_MISC_SYNC, (id))
+ #define SPI_ENGINE_CMD_CS_INV(flags) \
+       SPI_ENGINE_CMD(SPI_ENGINE_INST_CS_INV, 0, (flags))
  
  struct spi_engine_program {
        unsigned int length;
@@@ -111,6 -114,8 +114,8 @@@ struct spi_engine 
        struct spi_engine_message_state msg_state;
        struct completion msg_complete;
        unsigned int int_enable;
+       /* shadows hardware CS inversion flag state */
+       u8 cs_inv;
  };
  
  static void spi_engine_program_add_cmd(struct spi_engine_program *p,
@@@ -164,20 -169,16 +169,20 @@@ static void spi_engine_gen_xfer(struct 
  }
  
  static void spi_engine_gen_sleep(struct spi_engine_program *p, bool dry,
 -                               int delay_ns, u32 sclk_hz)
 +                               int delay_ns, int inst_ns, u32 sclk_hz)
  {
        unsigned int t;
  
 -      /* negative delay indicates error, e.g. from spi_delay_to_ns() */
 -      if (delay_ns <= 0)
 +      /*
 +       * Negative delay indicates error, e.g. from spi_delay_to_ns(). And if
 +       * delay is less that the instruction execution time, there is no need
 +       * for an extra sleep instruction since the instruction execution time
 +       * will already cover the required delay.
 +       */
 +      if (delay_ns < 0 || delay_ns <= inst_ns)
                return;
  
 -      /* rounding down since executing the instruction adds a couple of ticks delay */
 -      t = DIV_ROUND_DOWN_ULL((u64)delay_ns * sclk_hz, NSEC_PER_SEC);
 +      t = DIV_ROUND_UP_ULL((u64)(delay_ns - inst_ns) * sclk_hz, NSEC_PER_SEC);
        while (t) {
                unsigned int n = min(t, 256U);
  
@@@ -224,16 -225,10 +229,16 @@@ static void spi_engine_compile_message(
        struct spi_device *spi = msg->spi;
        struct spi_controller *host = spi->controller;
        struct spi_transfer *xfer;
 -      int clk_div, new_clk_div;
 +      int clk_div, new_clk_div, inst_ns;
        bool keep_cs = false;
        u8 bits_per_word = 0;
  
 +      /*
 +       * Take into account instruction execution time for more accurate sleep
 +       * times, especially when the delay is small.
 +       */
 +      inst_ns = DIV_ROUND_UP(NSEC_PER_SEC, host->max_speed_hz);
 +
        clk_div = 1;
  
        spi_engine_program_add_cmd(p, dry,
  
                spi_engine_gen_xfer(p, dry, xfer);
                spi_engine_gen_sleep(p, dry, spi_delay_to_ns(&xfer->delay, xfer),
 -                                   xfer->effective_speed_hz);
 +                                   inst_ns, xfer->effective_speed_hz);
  
                if (xfer->cs_change) {
                        if (list_is_last(&xfer->transfer_list, &msg->transfers)) {
                                        spi_engine_gen_cs(p, dry, spi, false);
  
                                spi_engine_gen_sleep(p, dry, spi_delay_to_ns(
 -                                      &xfer->cs_change_delay, xfer),
 +                                      &xfer->cs_change_delay, xfer), inst_ns,
                                        xfer->effective_speed_hz);
  
                                if (!list_next_entry(xfer, transfer_list)->cs_off)
@@@ -540,6 -535,29 +545,29 @@@ static int spi_engine_unoptimize_messag
        return 0;
  }
  
+ static int spi_engine_setup(struct spi_device *device)
+ {
+       struct spi_controller *host = device->controller;
+       struct spi_engine *spi_engine = spi_controller_get_devdata(host);
+       if (device->mode & SPI_CS_HIGH)
+               spi_engine->cs_inv |= BIT(spi_get_chipselect(device, 0));
+       else
+               spi_engine->cs_inv &= ~BIT(spi_get_chipselect(device, 0));
+       writel_relaxed(SPI_ENGINE_CMD_CS_INV(spi_engine->cs_inv),
+                      spi_engine->base + SPI_ENGINE_REG_CMD_FIFO);
+       /*
+        * In addition to setting the flags, we have to do a CS assert command
+        * to make the new setting actually take effect.
+        */
+       writel_relaxed(SPI_ENGINE_CMD_ASSERT(0, 0xff),
+                      spi_engine->base + SPI_ENGINE_REG_CMD_FIFO);
+       return 0;
+ }
  static int spi_engine_transfer_one_message(struct spi_controller *host,
        struct spi_message *msg)
  {
@@@ -663,16 -681,16 +691,16 @@@ static int spi_engine_probe(struct plat
        host->unoptimize_message = spi_engine_unoptimize_message;
        host->num_chipselect = 8;
  
+       /* Some features depend of the IP core version. */
+       if (ADI_AXI_PCORE_VER_MINOR(version) >= 2) {
+               host->mode_bits |= SPI_CS_HIGH;
+               host->setup = spi_engine_setup;
+       }
        if (host->max_speed_hz == 0)
                return dev_err_probe(&pdev->dev, -EINVAL, "spi_clk rate is 0");
  
-       ret = devm_spi_register_controller(&pdev->dev, host);
-       if (ret)
-               return ret;
-       platform_set_drvdata(pdev, host);
-       return 0;
+       return devm_spi_register_controller(&pdev->dev, host);
  }
  
  static const struct of_device_id spi_engine_match_table[] = {
index 002f29dbcea6e72ce6224f3f89f32fca46c43542,cc0c704019a4348019c87ca2295fea10751226c3..2c043817c66a88ff556710362a9e596ba54a143d
@@@ -27,6 -27,8 +27,8 @@@
  
  #include <linux/spi/spi.h>
  
+ #include "internals.h"
  #include <linux/platform_data/spi-omap2-mcspi.h>
  
  #define OMAP2_MCSPI_MAX_FREQ          48000000
@@@ -1208,8 -1210,7 +1210,7 @@@ static int omap2_mcspi_transfer_one(str
                unsigned        count;
  
                if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) &&
-                   ctlr->cur_msg_mapped &&
-                   ctlr->can_dma(ctlr, spi, t))
+                   spi_xfer_is_dma_mapped(ctlr, spi, t))
                        omap2_mcspi_set_fifo(spi, t, 1);
  
                omap2_mcspi_set_enable(spi, 1);
                                        + OMAP2_MCSPI_TX0);
  
                if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) &&
-                   ctlr->cur_msg_mapped &&
-                   ctlr->can_dma(ctlr, spi, t))
+                   spi_xfer_is_dma_mapped(ctlr, spi, t))
                        count = omap2_mcspi_txrx_dma(spi, t);
                else
                        count = omap2_mcspi_txrx_pio(spi, t);
@@@ -1277,11 -1277,24 +1277,11 @@@ static int omap2_mcspi_prepare_message(
  
                /*
                 * Check if this transfer contains only one word;
 -               * OR contains 1 to 4 words, with bits_per_word == 8 and no delay between each word
 -               * OR contains 1 to 2 words, with bits_per_word == 16 and no delay between each word
 -               *
 -               * If one of the two last case is true, this also change the bits_per_word of this
 -               * transfer to make it a bit faster.
 -               * It's not an issue to change the bits_per_word here even if the multi-mode is not
 -               * applicable for this message, the signal on the wire will be the same.
                 */
                if (bits_per_word < 8 && tr->len == 1) {
                        /* multi-mode is applicable, only one word (1..7 bits) */
 -              } else if (tr->word_delay.value == 0 && bits_per_word == 8 && tr->len <= 4) {
 -                      /* multi-mode is applicable, only one "bigger" word (8,16,24,32 bits) */
 -                      tr->bits_per_word = tr->len * bits_per_word;
 -              } else if (tr->word_delay.value == 0 && bits_per_word == 16 && tr->len <= 2) {
 -                      /* multi-mode is applicable, only one "bigger" word (16,32 bits) */
 -                      tr->bits_per_word = tr->len * bits_per_word / 2;
                } else if (bits_per_word >= 8 && tr->len == bits_per_word / 8) {
 -                      /* multi-mode is applicable, only one word (9..15,17..32 bits) */
 +                      /* multi-mode is applicable, only one word (8..32 bits) */
                } else {
                        /* multi-mode is not applicable: more than one word in the transfer */
                        mcspi->use_multi_mode = false;
@@@ -1658,4 -1671,5 +1658,5 @@@ static struct platform_driver omap2_mcs
  };
  
  module_platform_driver(omap2_mcspi_driver);
+ MODULE_DESCRIPTION("OMAP2 McSPI controller driver");
  MODULE_LICENSE("GPL");
diff --combined drivers/spi/spi.c
index 0f04e832f9ec2349a1dc074dbeb25706a908d553,5e715a6402372896f5f479b61cf79a9b760b3f28..d4da5464dbd056c038290babce05c29d8124bb23
@@@ -1222,11 -1222,6 +1222,6 @@@ void spi_unmap_buf(struct spi_controlle
        spi_unmap_buf_attrs(ctlr, dev, sgt, dir, 0);
  }
  
- /* Dummy SG for unidirect transfers */
- static struct scatterlist dummy_sg = {
-       .page_link = SG_END,
- };
  static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)
  {
        struct device *tx_dev, *rx_dev;
                                                attrs);
                        if (ret != 0)
                                return ret;
-               } else {
-                       xfer->tx_sg.sgl = &dummy_sg;
+                       xfer->tx_sg_mapped = true;
                }
  
                if (xfer->rx_buf != NULL) {
  
                                return ret;
                        }
-               } else {
-                       xfer->rx_sg.sgl = &dummy_sg;
+                       xfer->rx_sg_mapped = true;
                }
        }
        /* No transfer has been mapped, bail out with success */
  
        ctlr->cur_rx_dma_dev = rx_dev;
        ctlr->cur_tx_dma_dev = tx_dev;
-       ctlr->cur_msg_mapped = true;
  
        return 0;
  }
@@@ -1301,57 -1295,46 +1295,46 @@@ static int __spi_unmap_msg(struct spi_c
        struct device *tx_dev = ctlr->cur_tx_dma_dev;
        struct spi_transfer *xfer;
  
-       if (!ctlr->cur_msg_mapped || !ctlr->can_dma)
-               return 0;
        list_for_each_entry(xfer, &msg->transfers, transfer_list) {
                /* The sync has already been done after each transfer. */
                unsigned long attrs = DMA_ATTR_SKIP_CPU_SYNC;
  
-               if (!ctlr->can_dma(ctlr, msg->spi, xfer))
-                       continue;
+               if (xfer->rx_sg_mapped)
+                       spi_unmap_buf_attrs(ctlr, rx_dev, &xfer->rx_sg,
+                                           DMA_FROM_DEVICE, attrs);
+               xfer->rx_sg_mapped = false;
  
-               spi_unmap_buf_attrs(ctlr, rx_dev, &xfer->rx_sg,
-                                   DMA_FROM_DEVICE, attrs);
-               spi_unmap_buf_attrs(ctlr, tx_dev, &xfer->tx_sg,
-                                   DMA_TO_DEVICE, attrs);
+               if (xfer->tx_sg_mapped)
+                       spi_unmap_buf_attrs(ctlr, tx_dev, &xfer->tx_sg,
+                                           DMA_TO_DEVICE, attrs);
+               xfer->tx_sg_mapped = false;
        }
  
-       ctlr->cur_msg_mapped = false;
        return 0;
  }
  
- static void spi_dma_sync_for_device(struct spi_controller *ctlr, struct spi_message *msg,
+ static void spi_dma_sync_for_device(struct spi_controller *ctlr,
                                    struct spi_transfer *xfer)
  {
        struct device *rx_dev = ctlr->cur_rx_dma_dev;
        struct device *tx_dev = ctlr->cur_tx_dma_dev;
  
-       if (!ctlr->cur_msg_mapped)
-               return;
-       if (!ctlr->can_dma(ctlr, msg->spi, xfer))
-               return;
-       dma_sync_sgtable_for_device(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE);
-       dma_sync_sgtable_for_device(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE);
+       if (xfer->tx_sg_mapped)
+               dma_sync_sgtable_for_device(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE);
+       if (xfer->rx_sg_mapped)
+               dma_sync_sgtable_for_device(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE);
  }
  
- static void spi_dma_sync_for_cpu(struct spi_controller *ctlr, struct spi_message *msg,
+ static void spi_dma_sync_for_cpu(struct spi_controller *ctlr,
                                 struct spi_transfer *xfer)
  {
        struct device *rx_dev = ctlr->cur_rx_dma_dev;
        struct device *tx_dev = ctlr->cur_tx_dma_dev;
  
-       if (!ctlr->cur_msg_mapped)
-               return;
-       if (!ctlr->can_dma(ctlr, msg->spi, xfer))
-               return;
-       dma_sync_sgtable_for_cpu(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE);
-       dma_sync_sgtable_for_cpu(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE);
+       if (xfer->rx_sg_mapped)
+               dma_sync_sgtable_for_cpu(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE);
+       if (xfer->tx_sg_mapped)
+               dma_sync_sgtable_for_cpu(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE);
  }
  #else /* !CONFIG_HAS_DMA */
  static inline int __spi_map_msg(struct spi_controller *ctlr,
@@@ -1367,13 -1350,11 +1350,11 @@@ static inline int __spi_unmap_msg(struc
  }
  
  static void spi_dma_sync_for_device(struct spi_controller *ctrl,
-                                   struct spi_message *msg,
                                    struct spi_transfer *xfer)
  {
  }
  
  static void spi_dma_sync_for_cpu(struct spi_controller *ctrl,
-                                struct spi_message *msg,
                                 struct spi_transfer *xfer)
  {
  }
@@@ -1645,13 -1626,13 +1626,13 @@@ static int spi_transfer_one_message(str
                        reinit_completion(&ctlr->xfer_completion);
  
  fallback_pio:
-                       spi_dma_sync_for_device(ctlr, msg, xfer);
+                       spi_dma_sync_for_device(ctlr, xfer);
                        ret = ctlr->transfer_one(ctlr, msg->spi, xfer);
                        if (ret < 0) {
-                               spi_dma_sync_for_cpu(ctlr, msg, xfer);
+                               spi_dma_sync_for_cpu(ctlr, xfer);
  
-                               if (ctlr->cur_msg_mapped &&
-                                  (xfer->error & SPI_TRANS_FAIL_NO_START)) {
+                               if ((xfer->tx_sg_mapped || xfer->rx_sg_mapped) &&
+                                   (xfer->error & SPI_TRANS_FAIL_NO_START)) {
                                        __spi_unmap_msg(ctlr, msg);
                                        ctlr->fallback = true;
                                        xfer->error &= ~SPI_TRANS_FAIL_NO_START;
                                        msg->status = ret;
                        }
  
-                       spi_dma_sync_for_cpu(ctlr, msg, xfer);
+                       spi_dma_sync_for_cpu(ctlr, xfer);
                } else {
                        if (xfer->len)
                                dev_err(&msg->spi->dev,
@@@ -2151,8 -2132,7 +2132,8 @@@ static void __spi_unoptimize_message(st
   */
  static void spi_maybe_unoptimize_message(struct spi_message *msg)
  {
 -      if (!msg->pre_optimized && msg->optimized)
 +      if (!msg->pre_optimized && msg->optimized &&
 +          !msg->spi->controller->defer_optimize_message)
                __spi_unoptimize_message(msg);
  }
  
@@@ -2231,11 -2211,8 +2212,8 @@@ static int spi_start_queue(struct spi_c
  
  static int spi_stop_queue(struct spi_controller *ctlr)
  {
+       unsigned int limit = 500;
        unsigned long flags;
-       unsigned limit = 500;
-       int ret = 0;
-       spin_lock_irqsave(&ctlr->queue_lock, flags);
  
        /*
         * This is a bit lame, but is optimized for the common execution path.
         * execution path (pump_messages) would be required to call wake_up or
         * friends on every SPI message. Do this instead.
         */
-       while ((!list_empty(&ctlr->queue) || ctlr->busy) && limit--) {
+       do {
+               spin_lock_irqsave(&ctlr->queue_lock, flags);
+               if (list_empty(&ctlr->queue) && !ctlr->busy) {
+                       ctlr->running = false;
+                       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
+                       return 0;
+               }
                spin_unlock_irqrestore(&ctlr->queue_lock, flags);
                usleep_range(10000, 11000);
-               spin_lock_irqsave(&ctlr->queue_lock, flags);
-       }
-       if (!list_empty(&ctlr->queue) || ctlr->busy)
-               ret = -EBUSY;
-       else
-               ctlr->running = false;
+       } while (--limit);
  
-       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
-       return ret;
+       return -EBUSY;
  }
  
  static int spi_destroy_queue(struct spi_controller *ctlr)
@@@ -2595,7 -2570,7 +2571,7 @@@ struct spi_device *spi_new_ancillary_de
  {
        struct spi_controller *ctlr = spi->controller;
        struct spi_device *ancillary;
-       int rc = 0;
+       int rc;
  
        /* Alloc an spi_device */
        ancillary = spi_alloc_device(ctlr);
@@@ -2741,7 -2716,7 +2717,7 @@@ static int acpi_spi_add_resource(struc
                                return -ENODEV;
  
                        if (ctlr) {
-                               if (ACPI_HANDLE(ctlr->dev.parent) != parent_handle)
+                               if (!device_match_acpi_handle(ctlr->dev.parent, parent_handle))
                                        return -ENODEV;
                        } else {
                                struct acpi_device *adev;
@@@ -2840,7 -2815,7 +2816,7 @@@ struct spi_device *acpi_spi_device_allo
  
        if (!lookup.max_speed_hz &&
            ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
-           ACPI_HANDLE(lookup.ctlr->dev.parent) == parent_handle) {
+           device_match_acpi_handle(lookup.ctlr->dev.parent, parent_handle)) {
                /* Apple does not use _CRS but nested devices for SPI slaves */
                acpi_spi_parse_apple_properties(adev, &lookup);
        }
@@@ -3926,7 -3901,7 +3902,7 @@@ static int spi_set_cs_timing(struct spi
  int spi_setup(struct spi_device *spi)
  {
        unsigned        bad_bits, ugly_bits;
-       int             status = 0;
+       int             status;
  
        /*
         * Check mode to prevent that any two of DUAL, QUAD and NO_MOSI/MISO
@@@ -4295,11 -4270,6 +4271,11 @@@ static int __spi_optimize_message(struc
  static int spi_maybe_optimize_message(struct spi_device *spi,
                                      struct spi_message *msg)
  {
 +      if (spi->controller->defer_optimize_message) {
 +              msg->spi = spi;
 +              return 0;
 +      }
 +
        if (msg->pre_optimized)
                return 0;
  
@@@ -4330,13 -4300,6 +4306,13 @@@ int spi_optimize_message(struct spi_dev
  {
        int ret;
  
 +      /*
 +       * Pre-optimization is not supported and optimization is deferred e.g.
 +       * when using spi-mux.
 +       */
 +      if (spi->controller->defer_optimize_message)
 +              return 0;
 +
        ret = __spi_optimize_message(spi, msg);
        if (ret)
                return ret;
@@@ -4363,9 -4326,6 +4339,9 @@@ EXPORT_SYMBOL_GPL(spi_optimize_message)
   */
  void spi_unoptimize_message(struct spi_message *msg)
  {
 +      if (msg->spi->controller->defer_optimize_message)
 +              return;
 +
        __spi_unoptimize_message(msg);
        msg->pre_optimized = false;
  }
@@@ -4398,6 -4358,34 +4374,34 @@@ static int __spi_async(struct spi_devic
        return ctlr->transfer(spi, message);
  }
  
+ static void devm_spi_unoptimize_message(void *msg)
+ {
+       spi_unoptimize_message(msg);
+ }
+ /**
+  * devm_spi_optimize_message - managed version of spi_optimize_message()
+  * @dev: the device that manages @msg (usually @spi->dev)
+  * @spi: the device that will be used for the message
+  * @msg: the message to optimize
+  * Return: zero on success, else a negative error code
+  *
+  * spi_unoptimize_message() will automatically be called when the device is
+  * removed.
+  */
+ int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
+                             struct spi_message *msg)
+ {
+       int ret;
+       ret = spi_optimize_message(spi, msg);
+       if (ret)
+               return ret;
+       return devm_add_action_or_reset(dev, devm_spi_unoptimize_message, msg);
+ }
+ EXPORT_SYMBOL_GPL(devm_spi_optimize_message);
  /**
   * spi_async - asynchronous SPI transfer
   * @spi: device with which data will be exchanged
@@@ -4448,6 -4436,8 +4452,6 @@@ int spi_async(struct spi_device *spi, s
  
        spin_unlock_irqrestore(&ctlr->bus_lock_spinlock, flags);
  
 -      spi_maybe_unoptimize_message(message);
 -
        return ret;
  }
  EXPORT_SYMBOL_GPL(spi_async);
diff --combined include/linux/spi/spi.h
index 67b9a15a5330f8767451913f36d51a52e082bbbb,a9388714e7e7fc17fe71a0615f5c856d513b0db1..d7a16e0adf446d9677a689c11caa7295a31392ca
@@@ -447,7 -447,6 +447,6 @@@ extern struct spi_device *spi_new_ancil
   * @cur_msg_need_completion: Flag used internally to opportunistically skip
   *    the @cur_msg_completion. This flag is used to signal the context that
   *    is running spi_finalize_current_message() that it needs to complete()
-  * @cur_msg_mapped: message has been mapped for DMA
   * @fallback: fallback to PIO if DMA transfer return failure with
   *    SPI_TRANS_FAIL_NO_START.
   * @last_cs_mode_high: was (mode & SPI_CS_HIGH) true on the last call to set_cs.
   * @queue_empty: signal green light for opportunistically skipping the queue
   *    for spi_sync transfers.
   * @must_async: disable all fast paths in the core
 + * @defer_optimize_message: set to true if controller cannot pre-optimize messages
 + *    and needs to defer the optimization step until the message is actually
 + *    being transferred
   *
   * Each SPI controller can communicate with one or more @spi_device
   * children.  These make a small bus, sharing MOSI, MISO and SCK signals
@@@ -711,7 -707,6 +710,6 @@@ struct spi_controller 
        bool                            running;
        bool                            rt;
        bool                            auto_runtime_pm;
-       bool                            cur_msg_mapped;
        bool                            fallback;
        bool                            last_cs_mode_high;
        s8                              last_cs[SPI_CS_CNT_MAX];
        /* Flag for enabling opportunistic skipping of the queue in spi_sync */
        bool                    queue_empty;
        bool                    must_async;
 +      bool                    defer_optimize_message;
  };
  
  static inline void *spi_controller_get_devdata(struct spi_controller *ctlr)
@@@ -985,6 -979,8 +983,8 @@@ struct spi_res 
   *      transfer this transfer. Set to 0 if the SPI bus driver does
   *      not support it.
   * @transfer_list: transfers are sequenced through @spi_message.transfers
+  * @tx_sg_mapped: If true, the @tx_sg is mapped for DMA
+  * @rx_sg_mapped: If true, the @rx_sg is mapped for DMA
   * @tx_sg: Scatterlist for transmit, currently not for client use
   * @rx_sg: Scatterlist for receive, currently not for client use
   * @ptp_sts_word_pre: The word (subject to bits_per_word semantics) offset
@@@ -1081,10 -1077,13 +1081,13 @@@ struct spi_transfer 
  #define SPI_TRANS_FAIL_IO     BIT(1)
        u16             error;
  
-       dma_addr_t      tx_dma;
-       dma_addr_t      rx_dma;
+       bool            tx_sg_mapped;
+       bool            rx_sg_mapped;
        struct sg_table tx_sg;
        struct sg_table rx_sg;
+       dma_addr_t      tx_dma;
+       dma_addr_t      rx_dma;
  
        unsigned        dummy_data:1;
        unsigned        cs_off:1;
@@@ -1273,6 -1272,8 +1276,8 @@@ static inline void spi_message_free(str
  
  extern int spi_optimize_message(struct spi_device *spi, struct spi_message *msg);
  extern void spi_unoptimize_message(struct spi_message *msg);
+ extern int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
+                                    struct spi_message *msg);
  
  extern int spi_setup(struct spi_device *spi);
  extern int spi_async(struct spi_device *spi, struct spi_message *message);
This page took 0.192347 seconds and 4 git commands to generate.