Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Feb 2023 21:41:41 +0000 (13:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Feb 2023 21:41:41 +0000 (13:41 -0800)
Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (ufs, lpfc, qla2xxx, libsas).

  The major core change is a rework to remove the two helpers around
  scsi_execute_cmd and use it as the only submission interface along
  with other minor fixes and updates"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (142 commits)
  scsi: ufs: core: Fix an error handling path in ufshcd_read_desc_param()
  scsi: ufs: core: Fix device management cmd timeout flow
  scsi: aic94xx: Add missing check for dma_map_single()
  scsi: smartpqi: Replace one-element array with flexible-array member
  scsi: mpt3sas: Fix a memory leak
  scsi: qla2xxx: Remove the unused variable wwn
  scsi: ufs: core: Fix kernel-doc syntax
  scsi: ufs: core: Add hibernation callbacks
  scsi: snic: Fix memory leak with using debugfs_lookup()
  scsi: ufs: core: Limit DMA alignment check
  scsi: Documentation: Correct spelling
  scsi: Documentation: Correct spelling
  scsi: target: Documentation: Correct spelling
  scsi: aacraid: Allocate cmd_priv with scsicmd
  scsi: ufs: qcom: dt-bindings: Add SM8550 compatible string
  scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5
  scsi: ufs: qcom: fix platform_msi_domain_free_irqs() reference
  scsi: ufs: core: Enable DMA clustering
  scsi: ufs: exynos: Fix the maximum segment size
  scsi: ufs: exynos: Fix DMA alignment for PAGE_SIZE != 4096
  ...

12 files changed:
1  2 
MAINTAINERS
drivers/ata/libata-scsi.c
drivers/scsi/device_handler/scsi_dh_alua.c
drivers/scsi/ipr.c
drivers/scsi/libsas/sas_ata.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/scsi.c
drivers/scsi/scsi_scan.c
drivers/scsi/sd.c
drivers/ufs/core/ufshcd.c
include/ufs/ufshcd.h

diff --combined MAINTAINERS
index ac4b759937ebe1231869ece5b213587efe56d6e0,bf4768a66775f2a023b7f991edb28e6559d95f0d..6a0723b7abc27622bf20922228ffcc1045a194ff
@@@ -361,8 -361,6 +361,8 @@@ T: git git://git.kernel.org/pub/scm/lin
  F:    Documentation/ABI/testing/configfs-acpi
  F:    Documentation/ABI/testing/sysfs-bus-acpi
  F:    Documentation/firmware-guide/acpi/
 +F:    arch/x86/kernel/acpi/
 +F:    arch/x86/pci/acpi.c
  F:    drivers/acpi/
  F:    drivers/pci/*/*acpi*
  F:    drivers/pci/*acpi*
@@@ -385,7 -383,7 +385,7 @@@ ACPI COMPONENT ARCHITECTURE (ACPICA
  M:    Robert Moore <robert.moore@intel.com>
  M:    "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
  L:    linux-acpi@vger.kernel.org
 -L:    devel@acpica.org
 +L:    acpica-devel@lists.linuxfoundation.org
  S:    Supported
  W:    https://acpica.org/
  W:    https://github.com/acpica/acpica/
@@@ -1099,12 -1097,14 +1099,12 @@@ S:   Maintaine
  F:    drivers/dma/ptdma/
  
  AMD SEATTLE DEVICE TREE SUPPORT
 -M:    Brijesh Singh <brijeshkumar.singh@amd.com>
  M:    Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
  M:    Tom Lendacky <thomas.lendacky@amd.com>
  S:    Supported
  F:    arch/arm64/boot/dts/amd/
  
  AMD XGBE DRIVER
 -M:    Tom Lendacky <thomas.lendacky@amd.com>
  M:    "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -1853,6 -1853,21 +1853,6 @@@ F:     include/dt-bindings/reset/actions,
  F:    include/linux/soc/actions/
  N:    owl
  
 -ARM/ADS SPHERE MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
 -ARM/AFEB9260 MACHINE SUPPORT
 -M:    Sergey Lapin <slapin@ossfans.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
 -ARM/AJECO 1ARM MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/Allwinner SoC Clock Support
  M:    Emilio López <emilio@elopez.com.ar>
  S:    Maintained
@@@ -1873,7 -1888,7 +1873,7 @@@ F:      drivers/pinctrl/sunxi
  F:    drivers/soc/sunxi/
  N:    allwinner
  N:    sun[x456789]i
 -N:    sun50i
 +N:    sun[25]0i
  
  ARM/Amlogic Meson SoC CLOCK FRAMEWORK
  M:    Neil Armstrong <neil.armstrong@linaro.org>
@@@ -2043,6 -2058,11 +2043,6 @@@ F:     arch/arm/boot/dts/ecx-*.dts
  F:    arch/arm/boot/dts/highbank.dts
  F:    arch/arm/mach-highbank/
  
 -ARM/CAVIUM NETWORKS CNS3XXX MACHINE SUPPORT
 -M:    Krzysztof Halasa <khalasa@piap.pl>
 -S:    Maintained
 -F:    arch/arm/mach-cns3xxx/
 -
  ARM/CAVIUM THUNDER NETWORK DRIVER
  M:    Sunil Goutham <sgoutham@marvell.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2071,8 -2091,8 +2071,8 @@@ M:      Hartley Sweeten <hsweeten@visionengr
  M:    Alexander Sverdlin <alexander.sverdlin@gmail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 +F:    arch/arm/boot/compressed/misc-ep93xx.h
  F:    arch/arm/mach-ep93xx/
 -F:    arch/arm/mach-ep93xx/include/mach/
  
  ARM/CLKDEV SUPPORT
  M:    Russell King <linux@armlinux.org.uk>
@@@ -2088,6 -2108,11 +2088,6 @@@ S:     Maintaine
  F:    arch/arm/boot/dts/cx92755*
  N:    digicolor
  
 -ARM/CONTEC MICRO9 MACHINE SUPPORT
 -M:    Hubert Feurstein <hubert.feurstein@contec.at>
 -S:    Maintained
 -F:    arch/arm/mach-ep93xx/micro9.c
 -
  ARM/CORESIGHT FRAMEWORK AND DRIVERS
  M:    Mathieu Poirier <mathieu.poirier@linaro.org>
  M:    Suzuki K Poulose <suzuki.poulose@arm.com>
@@@ -2114,6 -2139,10 +2114,6 @@@ F:     tools/perf/arch/arm/util/pmu.
  F:    tools/perf/util/cs-etm-decoder/*
  F:    tools/perf/util/cs-etm.*
  
 -ARM/CORGI MACHINE SUPPORT
 -M:    Richard Purdie <rpurdie@rpsys.net>
 -S:    Maintained
 -
  ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE
  M:    Hans Ulli Kroll <ulli.kroll@googlemail.com>
  M:    Linus Walleij <linus.walleij@linaro.org>
@@@ -2153,6 -2182,12 +2153,6 @@@ F:     include/dt-bindings/bus/moxtet.
  F:    include/linux/armada-37xx-rwtm-mailbox.h
  F:    include/linux/moxtet.h
  
 -ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6)
 -M:    Robert Jarzmik <robert.jarzmik@free.fr>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-pxa/ezx.c
 -
  ARM/FARADAY FA526 PORT
  M:    Hans Ulli Kroll <ulli.kroll@googlemail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2178,9 -2213,6 +2178,9 @@@ L:      linux-arm-kernel@lists.infradead.or
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git
  X:    drivers/media/i2c/
 +F:    arch/arm64/boot/dts/freescale/
 +X:    arch/arm64/boot/dts/freescale/fsl-*
 +X:    arch/arm64/boot/dts/freescale/qoriq-*
  N:    imx
  N:    mxs
  
@@@ -2205,11 -2237,25 +2205,11 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    arch/arm/boot/dts/vf*
  F:    arch/arm/mach-imx/*vf610*
  
 -ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/GUMSTIX MACHINE SUPPORT
  M:    Steve Sakoman <sakoman@gmail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  
 -ARM/H4700 (HP IPAQ HX4700) MACHINE SUPPORT
 -M:    Philipp Zabel <philipp.zabel@gmail.com>
 -M:    Paul Parsons <lost.distance@yahoo.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-pxa/hx4700.c
 -F:    arch/arm/mach-pxa/include/mach/hx4700.h
 -F:    sound/soc/pxa/hx4700.c
 -
  ARM/HISILICON SOC SUPPORT
  M:    Wei Xu <xuwei5@hisilicon.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2234,16 -2280,13 +2234,16 @@@ ARM/HPE GXP ARCHITECTUR
  M:    Jean-Marie Verdun <verdun@hpe.com>
  M:    Nick Hawkins <nick.hawkins@hpe.com>
  S:    Maintained
 +F:    Documentation/hwmon/gxp-fan-ctrl.rst
  F:    Documentation/devicetree/bindings/arm/hpe,gxp.yaml
 +F:    Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
  F:    Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml
  F:    Documentation/devicetree/bindings/timer/hpe,gxp-timer.yaml
  F:    arch/arm/boot/dts/hpe-bmc*
  F:    arch/arm/boot/dts/hpe-gxp*
  F:    arch/arm/mach-hpe/
  F:    drivers/clocksource/timer-gxp.c
 +F:    drivers/hwmon/gxp-fan-ctrl.c
  F:    drivers/spi/spi-gxp.c
  F:    drivers/watchdog/gxp-wdt.c
  
@@@ -2255,6 -2298,27 +2255,6 @@@ L:     linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    arch/arm/boot/dts/omap3-igep*
  
 -ARM/INCOME PXA270 SUPPORT
 -M:    Marek Vasut <marek.vasut@gmail.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-pxa/colibri-pxa270-income.c
 -
 -ARM/INTEL IOP32X ARM ARCHITECTURE
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
 -ARM/INTEL IQ81342EX MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
 -ARM/INTEL IXDP2850 MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/INTEL IXP4XX ARM ARCHITECTURE
  M:    Linus Walleij <linusw@kernel.org>
  M:    Imre Kaloz <kaloz@openwrt.org>
@@@ -2287,12 -2351,22 +2287,12 @@@ M:   Lennert Buytenhek <kernel@wantstofly
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  
 -ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/LG1K ARCHITECTURE
  M:    Chanho Min <chanho.min@lge.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm64/boot/dts/lg/
  
 -ARM/LOGICPD PXA270 MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/LPC18XX ARCHITECTURE
  M:    Vladimir Zapolskiy <vz@mleia.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2319,6 -2393,10 +2319,6 @@@ F:     drivers/usb/host/ohci-nxp.
  F:    drivers/watchdog/pnx4008_wdt.c
  N:    lpc32xx
  
 -ARM/MAGICIAN MACHINE SUPPORT
 -M:    Philipp Zabel <philipp.zabel@gmail.com>
 -S:    Maintained
 -
  ARM/Marvell Dove/MV78xx0/Orion SOC support
  M:    Andrew Lunn <andrew@lunn.ch>
  M:    Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
@@@ -2373,14 -2451,11 +2373,14 @@@ F:   drivers/rtc/rtc-mt7622.
  
  ARM/Mediatek SoC support
  M:    Matthias Brugger <matthias.bgg@gmail.com>
 +R:    AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
 +L:    linux-kernel@vger.kernel.org
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-mediatek@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  W:    https://mtk.wiki.kernel.org/
 -C:    irc://chat.freenode.net/linux-mediatek
 +C:    irc://irc.libera.chat/linux-mediatek
 +F:    arch/arm/boot/dts/mt2*
  F:    arch/arm/boot/dts/mt6*
  F:    arch/arm/boot/dts/mt7*
  F:    arch/arm/boot/dts/mt8*
@@@ -2388,7 -2463,7 +2388,7 @@@ F:      arch/arm/mach-mediatek
  F:    arch/arm64/boot/dts/mediatek/
  F:    drivers/soc/mediatek/
  N:    mtk
 -N:    mt[678]
 +N:    mt[2678]
  K:    mediatek
  
  ARM/Mediatek USB3 PHY DRIVER
@@@ -2450,6 -2525,12 +2450,6 @@@ F:     arch/arm/boot/dts/milbeaut
  F:    arch/arm/mach-milbeaut/
  N:    milbeaut
  
 -ARM/MIOA701 MACHINE SUPPORT
 -M:    Robert Jarzmik <robert.jarzmik@free.fr>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-pxa/mioa701.c
 -
  ARM/MStar/Sigmastar Armv7 SoC support
  M:    Daniel Palmer <daniel@thingy.jp>
  M:    Romain Perier <romain.perier@gmail.com>
@@@ -2470,6 -2551,10 +2470,6 @@@ F:     drivers/watchdog/msc313e_wdt.
  F:    include/dt-bindings/clock/mstar-*
  F:    include/dt-bindings/gpio/msc313-gpio.h
  
 -ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT
 -M:    Michael Petchkovsky <mkpetch@internode.on.net>
 -S:    Maintained
 -
  ARM/NOMADIK/Ux500 ARCHITECTURES
  M:    Linus Walleij <linus.walleij@linaro.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2525,7 -2610,6 +2525,7 @@@ S:      Maintaine
  W:    https://github.com/neuschaefer/wpcm450/wiki
  F:    Documentation/devicetree/bindings/*/*wpcm*
  F:    arch/arm/boot/dts/nuvoton-wpcm450*
 +F:    arch/arm/configs/wpcm450_defconfig
  F:    arch/arm/mach-npcm/wpcm450.c
  F:    drivers/*/*/*wpcm*
  F:    drivers/*/*wpcm*
@@@ -2539,6 -2623,13 +2539,6 @@@ L:     linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    arch/arm64/boot/dts/freescale/s32g*.dts*
  
 -ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
 -L:    openmoko-kernel@lists.openmoko.org (subscribers-only)
 -S:    Orphan
 -W:    http://wiki.openmoko.org/wiki/Neo_FreeRunner
 -F:    arch/arm/mach-s3c/gta02.h
 -F:    arch/arm/mach-s3c/mach-gta02.c
 -
  ARM/Orion SoC/Technologic Systems TS-78xx platform support
  M:    Alexander Clouter <alex@digriz.org.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2556,6 -2647,43 +2556,6 @@@ F:     arch/arm/mach-oxnas
  F:    drivers/power/reset/oxnas-restart.c
  N:    oxnas
  
 -ARM/PALM TREO SUPPORT
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Orphan
 -F:    arch/arm/mach-pxa/palmtreo.*
 -
 -ARM/PALMTX,PALMT5,PALMLD,PALMTE2,PALMTC SUPPORT
 -M:    Marek Vasut <marek.vasut@gmail.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -W:    http://hackndev.com
 -F:    arch/arm/mach-pxa/include/mach/palmld.h
 -F:    arch/arm/mach-pxa/include/mach/palmtc.h
 -F:    arch/arm/mach-pxa/include/mach/palmtx.h
 -F:    arch/arm/mach-pxa/palmld.c
 -F:    arch/arm/mach-pxa/palmt5.*
 -F:    arch/arm/mach-pxa/palmtc.c
 -F:    arch/arm/mach-pxa/palmte2.*
 -F:    arch/arm/mach-pxa/palmtx.c
 -
 -ARM/PALMZ72 SUPPORT
 -M:    Sergey Lapin <slapin@ossfans.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -W:    http://hackndev.com
 -F:    arch/arm/mach-pxa/palmz72.*
 -
 -ARM/PLEB SUPPORT
 -M:    Peter Chubb <pleb@gelato.unsw.edu.au>
 -S:    Maintained
 -W:    http://www.disy.cse.unsw.edu.au/Hardware/PLEB
 -
 -ARM/PT DIGITAL BOARD PORT
 -M:    Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -W:    http://www.armlinux.org.uk/
 -
  ARM/QUALCOMM SUPPORT
  M:    Andy Gross <agross@kernel.org>
  M:    Bjorn Andersson <andersson@kernel.org>
@@@ -2599,6 -2727,11 +2599,6 @@@ F:     include/dt-bindings/*/qcom
  F:    include/linux/*/qcom*
  F:    include/linux/soc/qcom/
  
 -ARM/RADISYS ENP2611 MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/RDA MICRO ARCHITECTURE
  M:    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2674,7 -2807,7 +2674,7 @@@ F:      Documentation/devicetree/bindings/i2
  F:    Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
  F:    Documentation/devicetree/bindings/spi/spi-rockchip.yaml
  F:    arch/arm/boot/dts/rk3*
 -F:    arch/arm/boot/dts/rv1108*
 +F:    arch/arm/boot/dts/rv11*
  F:    arch/arm/mach-rockchip/
  F:    drivers/*/*/*rockchip*
  F:    drivers/*/*rockchip*
@@@ -2719,6 -2852,7 +2719,6 @@@ F:      include/linux/platform_data/*s3c
  F:    include/linux/serial_s3c.h
  F:    include/linux/soc/samsung/
  N:    exynos
 -N:    s3c2410
  N:    s3c64xx
  N:    s5pv210
  
@@@ -2791,7 -2925,6 +2791,7 @@@ M:      Patrice Chotard <patrice.chotard@fos
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  W:    http://www.stlinux.com
 +F:    Documentation/devicetree/bindings/spi/st,ssc-spi.yaml
  F:    Documentation/devicetree/bindings/i2c/i2c-st.txt
  F:    arch/arm/boot/dts/sti*
  F:    arch/arm/mach-sti/
@@@ -2877,7 -3010,7 +2877,7 @@@ M:      linux-fsd@tesla.co
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-samsung-soc@vger.kernel.org
  S:    Maintained
 -F:    arch/arm64/boot/dts/tesla*
 +F:    arch/arm64/boot/dts/tesla/
  
  ARM/TETON BGA MACHINE SUPPORT
  M:    "Mark F. Brown" <mark.brown314@gmail.com>
@@@ -2930,6 -3063,16 +2930,6 @@@ F:     arch/arm64/boot/dts/ti/Makefil
  F:    arch/arm64/boot/dts/ti/k3-*
  F:    include/dt-bindings/pinctrl/k3.h
  
 -ARM/THECUS N2100 MACHINE SUPPORT
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
 -ARM/TOSA MACHINE SUPPORT
 -M:    Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 -M:    Dirk Opfer <dirk@opfer-online.de>
 -S:    Maintained
 -
  ARM/TOSHIBA VISCONTI ARCHITECTURE
  M:    Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2986,7 -3129,7 +2986,7 @@@ S:      Maintaine
  F:    */*/*/vexpress*
  F:    */*/vexpress*
  F:    arch/arm/boot/dts/vexpress*
 -F:    arch/arm/mach-vexpress/
 +F:    arch/arm/mach-versatile/
  F:    arch/arm64/boot/dts/arm/
  F:    drivers/clk/versatile/clk-vexpress-osc.c
  F:    drivers/clocksource/timer-versatile.c
@@@ -2999,6 -3142,13 +2999,6 @@@ S:     Maintaine
  W:    http://www.armlinux.org.uk/
  F:    arch/arm/vfp/
  
 -ARM/VOIPAC PXA270 SUPPORT
 -M:    Marek Vasut <marek.vasut@gmail.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-pxa/include/mach/vpac270.h
 -F:    arch/arm/mach-pxa/vpac270.c
 -
  ARM/VT8500 ARM ARCHITECTURE
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Orphan
@@@ -3016,6 -3166,13 +3016,6 @@@ F:     drivers/video/fbdev/vt8500lcdfb.
  F:    drivers/video/fbdev/wm8505fb*
  F:    drivers/video/fbdev/wmt_ge_rops.*
  
 -ARM/ZIPIT Z2 SUPPORT
 -M:    Marek Vasut <marek.vasut@gmail.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-pxa/include/mach/z2.h
 -F:    arch/arm/mach-pxa/z2.c
 -
  ARM/ZYNQ ARCHITECTURE
  M:    Michal Simek <michal.simek@xilinx.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -3153,7 -3310,7 +3153,7 @@@ ASPEED CRYPTO DRIVE
  M:    Neal Liu <neal_liu@aspeedtech.com>
  L:    linux-aspeed@lists.ozlabs.org (moderated for non-subscribers)
  S:    Maintained
 -F:    Documentation/devicetree/bindings/crypto/aspeed,ast2500-hace.yaml
 +F:    Documentation/devicetree/bindings/crypto/aspeed,*
  F:    drivers/crypto/aspeed/
  
  ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
@@@ -3354,7 -3511,7 +3354,7 @@@ F:      drivers/net/ieee802154/atusb.
  AUDIT SUBSYSTEM
  M:    Paul Moore <paul@paul-moore.com>
  M:    Eric Paris <eparis@redhat.com>
 -L:    linux-audit@redhat.com (moderated for non-subscribers)
 +L:    audit@vger.kernel.org
  S:    Supported
  W:    https://github.com/linux-audit
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git
@@@ -3610,6 -3767,7 +3610,6 @@@ F:      net/bluetooth
  
  BONDING DRIVER
  M:    Jay Vosburgh <j.vosburgh@gmail.com>
 -M:    Veaceslav Falico <vfalico@gmail.com>
  M:    Andy Gospodarek <andy@greyhouse.net>
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -3862,13 -4020,6 +3862,13 @@@ L:    bpf@vger.kernel.or
  S:    Maintained
  F:    tools/testing/selftests/bpf/
  
 +BPF [DOCUMENTATION] (Related to Standardization)
 +R:    David Vernet <void@manifault.com>
 +L:    bpf@vger.kernel.org
 +L:    bpf@ietf.org
 +S:    Maintained
 +F:    Documentation/bpf/instruction-set.rst
 +
  BPF [MISC]
  L:    bpf@vger.kernel.org
  S:    Odd Fixes
@@@ -4148,17 -4299,6 +4148,17 @@@ L:    linux-kernel@vger.kernel.or
  S:    Maintained
  F:    drivers/phy/broadcom/phy-brcm-usb*
  
 +BROADCOM Broadband SoC High Speed SPI Controller DRIVER
 +M:    William Zhang <william.zhang@broadcom.com>
 +M:    Kursad Oney <kursad.oney@broadcom.com>
 +M:    Jonas Gorski <jonas.gorski@gmail.com>
 +R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
 +L:    linux-spi@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/spi/brcm,bcm63xx-hsspi.yaml
 +F:    drivers/spi/spi-bcm63xx-hsspi.c
 +F:    drivers/spi/spi-bcmbca-hsspi.c
 +
  BROADCOM ETHERNET PHY DRIVERS
  M:    Florian Fainelli <f.fainelli@gmail.com>
  R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
@@@ -4664,11 -4804,12 +4664,11 @@@ F:   net/sched/sch_etf.
  F:    net/sched/sch_taprio.c
  
  CC2520 IEEE-802.15.4 RADIO DRIVER
 -M:    Varka Bhadram <varkabhadram@gmail.com>
 +M:    Stefan Schmidt <stefan@datenfreihafen.org>
  L:    linux-wpan@vger.kernel.org
 -S:    Maintained
 +S:    Odd Fixes
  F:    Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
  F:    drivers/net/ieee802154/cc2520.c
 -F:    include/linux/spi/cc2520.h
  
  CCREE ARM TRUSTZONE CRYPTOCELL REE DRIVER
  M:    Gilad Ben-Yossef <gilad@benyossef.com>
@@@ -4844,13 -4985,6 +4844,13 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
  F:    sound/soc/codecs/cros_ec_codec.*
  
 +CHROMEOS EC UART DRIVER
 +M:    Bhanu Prakash Maiya <bhanumaiya@chromium.org>
 +R:    Benson Leung <bleung@chromium.org>
 +R:    Tzung-Bi Shih <tzungbi@kernel.org>
 +S:    Maintained
 +F:    drivers/platform/chrome/cros_ec_uart.c
 +
  CHROMEOS EC SUBDRIVERS
  M:    Benson Leung <bleung@chromium.org>
  R:    Guenter Roeck <groeck@chromium.org>
@@@ -4864,9 -4998,8 +4864,9 @@@ CHROMEOS EC USB TYPE-C DRIVE
  M:    Prashant Malani <pmalani@chromium.org>
  L:    chrome-platform@lists.linux.dev
  S:    Maintained
 -F:    drivers/platform/chrome/cros_ec_typec.c
 +F:    drivers/platform/chrome/cros_ec_typec.*
  F:    drivers/platform/chrome/cros_typec_switch.c
 +F:    drivers/platform/chrome/cros_typec_vdm.*
  
  CHROMEOS EC USB PD NOTIFY DRIVER
  M:    Prashant Malani <pmalani@chromium.org>
@@@ -5794,6 -5927,7 +5794,6 @@@ F:      Documentation/ABI/testing/sysfs-plat
  F:    drivers/platform/x86/dell/dell-wmi-ddv.c
  
  DELL WMI SYSMAN DRIVER
 -M:    Divya Bharathi <divya.bharathi@dell.com>
  M:    Prasanth Ksr <prasanth.ksr@dell.com>
  L:    Dell.Client.Kernel@dell.com
  L:    platform-driver-x86@vger.kernel.org
@@@ -5965,7 -6099,7 +5965,7 @@@ S:      Supporte
  F:    Documentation/networking/devlink
  F:    include/net/devlink.h
  F:    include/uapi/linux/devlink.h
 -F:    net/core/devlink.c
 +F:    net/devlink/
  
  DH ELECTRONICS IMX6 DHCOM/DHCOR BOARD SUPPORT
  M:    Christoph Niedermaier <cniedermaier@dh-electronics.com>
@@@ -6288,7 -6422,6 +6288,7 @@@ T:      git git://git.linbit.com/linux-drbd.
  T:    git git://git.linbit.com/drbd-8.4.git
  F:    Documentation/admin-guide/blockdev/
  F:    drivers/block/drbd/
 +F:    include/linux/drbd*
  F:    lib/lru_cache.c
  
  DRIVER COMPONENT FRAMEWORK
@@@ -6815,7 -6948,7 +6815,7 @@@ F:      drivers/gpu/drm/atmel-hlcdc
  DRM DRIVERS FOR BRIDGE CHIPS
  M:    Andrzej Hajda <andrzej.hajda@intel.com>
  M:    Neil Armstrong <neil.armstrong@linaro.org>
 -M:    Robert Foss <robert.foss@linaro.org>
 +M:    Robert Foss <rfoss@kernel.org>
  R:    Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
  R:    Jonas Karlman <jonas@kwiboo.se>
  R:    Jernej Skrabec <jernej.skrabec@gmail.com>
@@@ -7483,6 -7616,7 +7483,6 @@@ S:      Maintaine
  F:    drivers/firmware/efi/test/
  
  EFI VARIABLE FILESYSTEM
 -M:    Matthew Garrett <matthew.garrett@nebula.com>
  M:    Jeremy Kerr <jk@ozlabs.org>
  M:    Ard Biesheuvel <ardb@kernel.org>
  L:    linux-efi@vger.kernel.org
@@@ -7611,7 -7745,6 +7611,7 @@@ R:      Jeffle Xu <jefflexu@linux.alibaba.co
  L:    linux-erofs@lists.ozlabs.org
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
 +F:    Documentation/ABI/testing/sysfs-fs-erofs
  F:    Documentation/filesystems/erofs.rst
  F:    fs/erofs/
  F:    include/trace/events/erofs.h
@@@ -7762,11 -7895,7 +7762,11 @@@ F:    include/linux/extcon
  
  EXTRA BOOT CONFIG
  M:    Masami Hiramatsu <mhiramat@kernel.org>
 +L:    linux-kernel@vger.kernel.org
 +L:    linux-trace-kernel@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-trace-kernel/list/
  S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
  F:    Documentation/admin-guide/bootconfig.rst
  F:    fs/proc/bootconfig.c
  F:    include/linux/bootconfig.h
@@@ -8067,7 -8196,7 +8067,7 @@@ F:      drivers/fpga/microchip-spi.
  FPU EMULATOR
  M:    Bill Metzenthen <billm@melbpc.org.au>
  S:    Maintained
 -W:    http://floatingpoint.sourceforge.net/emulator/index.html
 +W:    https://floatingpoint.billm.au/
  F:    arch/x86/math-emu/
  
  FRAMEBUFFER CORE
@@@ -8339,16 -8468,16 +8339,16 @@@ F:   fs/fscache
  F:    include/linux/fscache*.h
  
  FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT
 +M:    Eric Biggers <ebiggers@kernel.org>
  M:    Theodore Y. Ts'o <tytso@mit.edu>
  M:    Jaegeuk Kim <jaegeuk@kernel.org>
 -M:    Eric Biggers <ebiggers@kernel.org>
  L:    linux-fscrypt@vger.kernel.org
  S:    Supported
  Q:    https://patchwork.kernel.org/project/linux-fscrypt/list/
 -T:    git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git
 +T:    git https://git.kernel.org/pub/scm/fs/fscrypt/linux.git
  F:    Documentation/filesystems/fscrypt.rst
  F:    fs/crypto/
 -F:    include/linux/fscrypt*.h
 +F:    include/linux/fscrypt.h
  F:    include/uapi/linux/fscrypt.h
  
  FSI SUBSYSTEM
@@@ -8391,10 -8520,10 +8391,10 @@@ F:   include/linux/fsnotify*.
  FSVERITY: READ-ONLY FILE-BASED AUTHENTICITY PROTECTION
  M:    Eric Biggers <ebiggers@kernel.org>
  M:    Theodore Y. Ts'o <tytso@mit.edu>
 -L:    linux-fscrypt@vger.kernel.org
 +L:    fsverity@lists.linux.dev
  S:    Supported
 -Q:    https://patchwork.kernel.org/project/linux-fscrypt/list/
 -T:    git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git fsverity
 +Q:    https://patchwork.kernel.org/project/fsverity/list/
 +T:    git https://git.kernel.org/pub/scm/fs/fsverity/linux.git
  F:    Documentation/filesystems/fsverity.rst
  F:    fs/verity/
  F:    include/linux/fsverity.h
@@@ -8442,7 -8571,6 +8442,7 @@@ F:      kernel/trace/fgraph.
  F:    arch/*/*/*/*ftrace*
  F:    arch/*/*/*ftrace*
  F:    include/*/ftrace.h
 +F:    samples/ftrace
  
  FUNGIBLE ETHERNET DRIVERS
  M:    Dimitris Michailidis <dmichail@fungible.com>
@@@ -9072,12 -9200,9 +9072,12 @@@ M:    Benjamin Tissoires <benjamin.tissoir
  L:    linux-input@vger.kernel.org
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git
 +F:    Documentation/hid/
  F:    drivers/hid/
  F:    include/linux/hid*
  F:    include/uapi/linux/hid*
 +F:    samples/hid/
 +F:    tools/testing/selftests/hid/
  
  HID LOGITECH DRIVERS
  R:    Filipe Laíns <lains@riseup.net>
@@@ -9085,13 -9210,6 +9085,13 @@@ L:    linux-input@vger.kernel.or
  S:    Maintained
  F:    drivers/hid/hid-logitech-*
  
 +HID++ LOGITECH DRIVERS
 +R:    Filipe Laíns <lains@riseup.net>
 +R:    Bastien Nocera <hadess@hadess.net>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    drivers/hid/hid-logitech-hidpp.c
 +
  HID PLAYSTATION DRIVER
  M:    Roderick Colenbrander <roderick.colenbrander@sony.com>
  L:    linux-input@vger.kernel.org
@@@ -9181,7 -9299,7 +9181,7 @@@ F:      net/dsa/tag_hellcreek.
  
  HISILICON DMA DRIVER
  M:    Zhou Wang <wangzhou1@hisilicon.com>
 -M:    Jie Hai <haijie1@hisilicon.com>
 +M:    Jie Hai <haijie1@huawei.com>
  L:    dmaengine@vger.kernel.org
  S:    Maintained
  F:    drivers/dma/hisi_dma.c
@@@ -9871,7 -9989,7 +9871,7 @@@ S:      Maintaine
  T:    git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping.git
  F:    Documentation/filesystems/idmappings.rst
  F:    tools/testing/selftests/mount_setattr/
 -F:    include/linux/mnt_idmapping.h
 +F:    include/linux/mnt_idmapping.*
  
  IDT VersaClock 5 CLOCK DRIVER
  M:    Luca Ceresoli <luca@lucaceresoli.net>
@@@ -9882,7 -10000,6 +9882,7 @@@ F:     drivers/clk/clk-versaclock5.
  IEEE 802.15.4 SUBSYSTEM
  M:    Alexander Aring <alex.aring@gmail.com>
  M:    Stefan Schmidt <stefan@datenfreihafen.org>
 +M:    Miquel Raynal <miquel.raynal@bootlin.com>
  L:    linux-wpan@vger.kernel.org
  S:    Maintained
  W:    https://linux-wpan.org/
@@@ -10042,13 -10159,6 +10042,13 @@@ L: linux-iio@vger.kernel.or
  S:    Maintained
  F:    drivers/iio/pressure/dps310.c
  
 +INFINEON PEB2466 ASoC CODEC
 +M:    Herve Codina <herve.codina@bootlin.com>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/sound/infineon,peb2466.yaml
 +F:    sound/soc/codecs/peb2466.c
 +
  INFINIBAND SUBSYSTEM
  M:    Jason Gunthorpe <jgg@nvidia.com>
  M:    Leon Romanovsky <leonro@nvidia.com>
@@@ -10573,13 -10683,6 +10573,13 @@@ S: Maintaine
  F:    arch/x86/include/asm/intel_telemetry.h
  F:    drivers/platform/x86/intel/telemetry/
  
 +INTEL TPMI DRIVER
 +M:    Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
 +L:    platform-driver-x86@vger.kernel.org
 +S:    Maintained
 +F:    drivers/platform/x86/intel/tpmi.c
 +F:    include/linux/intel_tpmi.h
 +
  INTEL UNCORE FREQUENCY CONTROL
  M:    Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
  L:    platform-driver-x86@vger.kernel.org
@@@ -10817,13 -10920,6 +10817,13 @@@ M: David Sterba <dsterba@suse.com
  S:    Odd Fixes
  F:    drivers/tty/ipwireless/
  
 +IRON DEVICE AUDIO CODEC DRIVERS
 +M:    Kiseok Jo <kiseok.jo@irondevice.com>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/sound/irondevice,*
 +F:    sound/soc/codecs/sma*
 +
  IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
  M:    Marc Zyngier <maz@kernel.org>
  S:    Maintained
@@@ -10839,8 -10935,6 +10839,8 @@@ L:   linux-kernel@vger.kernel.or
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
  F:    kernel/irq/
 +F:    include/linux/group_cpus.h
 +F:    lib/group_cpus.c
  
  IRQCHIP DRIVERS
  M:    Thomas Gleixner <tglx@linutronix.de>
@@@ -11262,9 -11356,9 +11262,9 @@@ F:   virt/kvm/
  KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
  M:    Marc Zyngier <maz@kernel.org>
  R:    James Morse <james.morse@arm.com>
 -R:    Alexandru Elisei <alexandru.elisei@arm.com>
  R:    Suzuki K Poulose <suzuki.poulose@arm.com>
  R:    Oliver Upton <oliver.upton@linux.dev>
 +R:    Zenghui Yu <yuzenghui@huawei.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    kvmarm@lists.linux.dev
  L:    kvmarm@lists.cs.columbia.edu (deprecated, moderated for non-subscribers)
@@@ -11374,7 -11468,7 +11374,7 @@@ F:   arch/x86/kvm/hyperv.
  F:    arch/x86/kvm/kvm_onhyperv.*
  F:    arch/x86/kvm/svm/hyperv.*
  F:    arch/x86/kvm/svm/svm_onhyperv.*
 -F:    arch/x86/kvm/vmx/evmcs.*
 +F:    arch/x86/kvm/vmx/hyperv.*
  
  KVM X86 Xen (KVM/Xen)
  M:    David Woodhouse <dwmw2@infradead.org>
@@@ -11592,7 -11686,7 +11592,7 @@@ M:   Mickaël Salaün <mic@digikod.net
  L:    linux-security-module@vger.kernel.org
  S:    Supported
  W:    https://landlock.io
 -T:    git https://github.com/landlock-lsm/linux.git
 +T:    git https://git.kernel.org/pub/scm/linux/kernel/git/mic/linux.git
  F:    Documentation/security/landlock.rst
  F:    Documentation/userspace-api/landlock.rst
  F:    include/uapi/linux/landlock.h
@@@ -12721,9 -12815,9 +12721,9 @@@ F:   drivers/iio/potentiometer/mcp4018.
  F:    drivers/iio/potentiometer/mcp4531.c
  
  MCR20A IEEE-802.15.4 RADIO DRIVER
 -M:    Xue Liu <liuxuenetmail@gmail.com>
 +M:    Stefan Schmidt <stefan@datenfreihafen.org>
  L:    linux-wpan@vger.kernel.org
 -S:    Maintained
 +S:    Odd Fixes
  W:    https://github.com/xueliu/mcr20a-linux
  F:    Documentation/devicetree/bindings/net/ieee802154/mcr20a.txt
  F:    drivers/net/ieee802154/mcr20a.c
@@@ -13526,7 -13620,7 +13526,7 @@@ F:   arch/microblaze
  
  MICROCHIP AT91 DMA DRIVERS
  M:    Ludovic Desroches <ludovic.desroches@microchip.com>
 -M:    Tudor Ambarus <tudor.ambarus@microchip.com>
 +M:    Tudor Ambarus <tudor.ambarus@linaro.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    dmaengine@vger.kernel.org
  S:    Supported
@@@ -13571,7 -13665,7 +13571,7 @@@ F:   Documentation/devicetree/bindings/me
  F:    drivers/media/platform/microchip/microchip-csi2dc.c
  
  MICROCHIP ECC DRIVER
 -M:    Tudor Ambarus <tudor.ambarus@microchip.com>
 +M:    Tudor Ambarus <tudor.ambarus@linaro.org>
  L:    linux-crypto@vger.kernel.org
  S:    Maintained
  F:    drivers/crypto/atmel-ecc.*
@@@ -13616,7 -13710,6 +13616,7 @@@ S:   Maintaine
  F:    Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
  F:    Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
  F:    drivers/net/dsa/microchip/*
 +F:    include/linux/dsa/ksz_common.h
  F:    include/linux/platform_data/microchip-ksz.h
  F:    net/dsa/tag_ksz.c
  
@@@ -13669,7 -13762,7 +13669,7 @@@ S:   Maintaine
  F:    drivers/mmc/host/atmel-mci.c
  
  MICROCHIP NAND DRIVER
 -M:    Tudor Ambarus <tudor.ambarus@microchip.com>
 +M:    Tudor Ambarus <tudor.ambarus@linaro.org>
  L:    linux-mtd@lists.infradead.org
  S:    Supported
  F:    Documentation/devicetree/bindings/mtd/atmel-nand.txt
@@@ -13721,7 -13814,7 +13721,7 @@@ S:   Supporte
  F:    drivers/power/reset/at91-sama5d2_shdwc.c
  
  MICROCHIP SPI DRIVER
 -M:    Tudor Ambarus <tudor.ambarus@microchip.com>
 +M:    Tudor Ambarus <tudor.ambarus@linaro.org>
  S:    Supported
  F:    drivers/spi/spi-atmel.*
  
@@@ -14049,7 -14142,6 +14049,7 @@@ M:   Saravanan Sekar <sravanhome@gmail.co
  S:    Maintained
  F:    Documentation/devicetree/bindings/mfd/mps,mp2629.yaml
  F:    Documentation/devicetree/bindings/regulator/mps,mp*.yaml
 +F:    drivers/hwmon/pmbus/mpq7932.c
  F:    drivers/iio/adc/mp2629_adc.c
  F:    drivers/mfd/mp2629.c
  F:    drivers/power/supply/mp2629_charger.c
@@@ -14070,7 -14162,6 +14070,7 @@@ M:   Peter Geis <pgwipeout@gmail.com
  M:    Frank <Frank.Sae@motor-comm.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
  F:    drivers/net/phy/motorcomm.c
  
  MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
@@@ -14087,9 -14178,9 +14087,9 @@@ T:   git git://linuxtv.org/media_tree.gi
  F:    drivers/media/radio/radio-mr800.c
  
  MRF24J40 IEEE 802.15.4 RADIO DRIVER
 -M:    Alan Ott <alan@signal11.us>
 +M:    Stefan Schmidt <stefan@datenfreihafen.org>
  L:    linux-wpan@vger.kernel.org
 -S:    Maintained
 +S:    Odd Fixes
  F:    Documentation/devicetree/bindings/net/ieee802154/mrf24j40.txt
  F:    drivers/net/ieee802154/mrf24j40.c
  
@@@ -14451,8 -14542,6 +14451,8 @@@ M:   Florian Fainelli <f.fainelli@gmail.c
  M:    Vladimir Oltean <olteanv@gmail.com>
  S:    Maintained
  F:    Documentation/devicetree/bindings/net/dsa/
 +F:    Documentation/devicetree/bindings/net/ethernet-switch-port.yaml
 +F:    Documentation/devicetree/bindings/net/ethernet-switch.yaml
  F:    drivers/net/dsa/
  F:    include/linux/dsa/
  F:    include/linux/platform_data/dsa.h
@@@ -14471,10 -14560,8 +14471,10 @@@ Q: https://patchwork.kernel.org/project
  B:    mailto:netdev@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
 +F:    Documentation/core-api/netlink.rst
  F:    Documentation/networking/
  F:    Documentation/process/maintainer-netdev.rst
 +F:    Documentation/userspace-api/netlink/
  F:    include/linux/in.h
  F:    include/linux/net.h
  F:    include/linux/netdevice.h
@@@ -14486,7 -14573,6 +14486,7 @@@ F:   include/uapi/linux/netdevice.
  F:    lib/net_utils.c
  F:    lib/random32.c
  F:    net/
 +F:    tools/net/
  F:    tools/testing/selftests/net/
  
  NETWORKING [IPSEC]
@@@ -14515,6 -14601,7 +14515,6 @@@ F:   tools/testing/selftests/net/ipsec.
  
  NETWORKING [IPv4/IPv6]
  M:    "David S. Miller" <davem@davemloft.net>
 -M:    Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
  M:    David Ahern <dsahern@kernel.org>
  L:    netdev@vger.kernel.org
  S:    Maintained
@@@ -14547,6 -14634,7 +14547,6 @@@ F:   net/netfilter/xt_SECMARK.
  F:    net/netlabel/
  
  NETWORKING [MPTCP]
 -M:    Mat Martineau <mathew.j.martineau@linux.intel.com>
  M:    Matthieu Baerts <matthieu.baerts@tessares.net>
  L:    netdev@vger.kernel.org
  L:    mptcp@lists.linux.dev
@@@ -14828,11 -14916,9 +14828,11 @@@ L: linux-nvme@lists.infradead.or
  S:    Supported
  W:    http://git.infradead.org/nvme.git
  T:    git://git.infradead.org/nvme.git
 +F:    Documentation/nvme/
  F:    drivers/nvme/host/
  F:    drivers/nvme/common/
 -F:    include/linux/nvme*
 +F:    include/linux/nvme.h
 +F:    include/linux/nvme-*.h
  F:    include/uapi/linux/nvme_ioctl.h
  
  NVM EXPRESS FABRICS AUTHENTICATION
@@@ -15064,7 -15150,6 +15064,7 @@@ M:   Colin Foster <colin.foster@in-advant
  S:    Supported
  F:    Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
  F:    drivers/mfd/ocelot*
 +F:    drivers/net/dsa/ocelot/ocelot_ext.c
  F:    include/linux/mfd/ocelot.h
  
  OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER
@@@ -15228,6 -15313,7 +15228,6 @@@ Q:   http://patchwork.kernel.org/project/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
  F:    arch/arm/configs/omap1_defconfig
  F:    arch/arm/mach-omap1/
 -F:    arch/arm/plat-omap/
  F:    drivers/i2c/busses/i2c-omap.c
  F:    include/linux/platform_data/ams-delta-fiq.h
  F:    include/linux/platform_data/i2c-omap.h
@@@ -15242,6 -15328,7 +15242,6 @@@ Q:   http://patchwork.kernel.org/project/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
  F:    arch/arm/configs/omap2plus_defconfig
  F:    arch/arm/mach-omap2/
 -F:    arch/arm/plat-omap/
  F:    drivers/bus/ti-sysc.c
  F:    drivers/i2c/busses/i2c-omap.c
  F:    drivers/irqchip/irq-omap-intc.c
@@@ -15485,7 -15572,6 +15485,7 @@@ F:   drivers/mtd/nand/onenand
  F:    include/linux/mtd/onenand*.h
  
  ONEXPLAYER FAN DRIVER
 +M:    Derek John Clark <derekjohn.clark@gmail.com>
  M:    Joaquín Ignacio Aramendía <samsagax@gmail.com>
  L:    linux-hwmon@vger.kernel.org
  S:    Maintained
@@@ -15497,13 -15583,6 +15497,13 @@@ L: linux-mips@vger.kernel.or
  S:    Maintained
  F:    arch/mips/boot/dts/ralink/omega2p.dts
  
 +ONSEMI ETHERNET PHY DRIVERS
 +M:    Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +W:    http://www.onsemi.com
 +F:    drivers/net/phy/ncn*
 +
  OP-TEE DRIVER
  M:    Jens Wiklander <jens.wiklander@linaro.org>
  L:    op-tee@lists.trustedfirmware.org
@@@ -15578,7 -15657,7 +15578,7 @@@ OPENRISC ARCHITECTUR
  M:    Jonas Bonn <jonas@southpole.se>
  M:    Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
  M:    Stafford Horne <shorne@gmail.com>
 -L:    openrisc@lists.librecores.org
 +L:    linux-openrisc@vger.kernel.org
  S:    Maintained
  W:    http://openrisc.io
  T:    git https://github.com/openrisc/linux.git
@@@ -15669,12 -15748,6 +15669,12 @@@ S: Maintaine
  W:    https://wireless.wiki.kernel.org/en/users/Drivers/p54
  F:    drivers/net/wireless/intersil/p54/
  
 +PACKET SOCKETS
 +M:    Willem de Bruijn <willemdebruijn.kernel@gmail.com>
 +S:    Maintained
 +F:    include/uapi/linux/if_packet.h
 +F:    net/packet/af_packet.c
 +
  PACKING
  M:    Vladimir Oltean <olteanv@gmail.com>
  L:    netdev@vger.kernel.org
@@@ -15770,6 -15843,13 +15770,6 @@@ F:  arch/*/include/asm/paravirt*.
  F:    arch/*/kernel/paravirt*
  F:    include/linux/hypervisor.h
  
 -PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
 -M:    Tim Waugh <tim@cyberelk.net>
 -L:    linux-parport@lists.infradead.org (subscribers-only)
 -S:    Maintained
 -F:    Documentation/admin-guide/blockdev/paride.rst
 -F:    drivers/block/paride/
 -
  PARISC ARCHITECTURE
  M:    "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
  M:    Helge Deller <deller@gmx.de>
@@@ -16027,7 -16107,7 +16027,7 @@@ F:   drivers/pci/controller/pci-v3-semi.
  
  PCI ENDPOINT SUBSYSTEM
  M:    Lorenzo Pieralisi <lpieralisi@kernel.org>
 -R:    Krzysztof Wilczyński <kw@linux.com>
 +M:    Krzysztof Wilczyński <kw@linux.com>
  R:    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  R:    Kishon Vijay Abraham I <kishon@kernel.org>
  L:    linux-pci@vger.kernel.org
@@@ -16035,7 -16115,7 +16035,7 @@@ S:   Supporte
  Q:    https://patchwork.kernel.org/project/linux-pci/list/
  B:    https://bugzilla.kernel.org
  C:    irc://irc.oftc.net/linux-pci
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
  F:    Documentation/PCI/endpoint/*
  F:    Documentation/misc-devices/pci-endpoint-test.rst
  F:    drivers/misc/pci_endpoint_test.c
@@@ -16070,7 -16150,7 +16070,7 @@@ S:   Supporte
  Q:    https://patchwork.kernel.org/project/linux-pci/list/
  B:    https://bugzilla.kernel.org
  C:    irc://irc.oftc.net/linux-pci
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
  F:    Documentation/driver-api/pci/p2pdma.rst
  F:    drivers/pci/p2pdma.c
  F:    include/linux/pci-p2pdma.h
@@@ -16092,14 -16172,14 +16092,14 @@@ F:        drivers/pci/controller/pci-xgene-msi
  
  PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
  M:    Lorenzo Pieralisi <lpieralisi@kernel.org>
 +M:    Krzysztof Wilczyński <kw@linux.com>
  R:    Rob Herring <robh@kernel.org>
 -R:    Krzysztof Wilczyński <kw@linux.com>
  L:    linux-pci@vger.kernel.org
  S:    Supported
  Q:    https://patchwork.kernel.org/project/linux-pci/list/
  B:    https://bugzilla.kernel.org
  C:    irc://irc.oftc.net/linux-pci
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
  F:    Documentation/devicetree/bindings/pci/
  F:    drivers/pci/controller/
  F:    drivers/pci/pci-bridge-emul.c
@@@ -16112,7 -16192,7 +16112,7 @@@ S:   Supporte
  Q:    https://patchwork.kernel.org/project/linux-pci/list/
  B:    https://bugzilla.kernel.org
  C:    irc://irc.oftc.net/linux-pci
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
  F:    Documentation/PCI/
  F:    Documentation/devicetree/bindings/pci/
  F:    arch/x86/kernel/early-quirks.c
@@@ -16529,26 -16609,12 +16529,26 @@@ S:        Supporte
  F:    Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml
  F:    drivers/input/keyboard/pinephone-keyboard.c
  
 +PKTCDVD DRIVER
 +M:    linux-block@vger.kernel.org
 +S:    Orphan
 +F:    drivers/block/pktcdvd.c
 +F:    include/linux/pktcdvd.h
 +F:    include/uapi/linux/pktcdvd.h
 +
  PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
  M:    Tomasz Duszynski <tduszyns@gmail.com>
  S:    Maintained
  F:    Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.yaml
  F:    drivers/iio/chemical/pms7003.c
  
 +PLCA RECONCILIATION SUBLAYER (IEEE802.3 Clause 148)
 +M:    Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    drivers/net/phy/mdio-open-alliance.h
 +F:    net/ethtool/plca.c
 +
  PLDMFW LIBRARY
  M:    Jacob Keller <jacob.e.keller@intel.com>
  S:    Maintained
@@@ -17146,13 -17212,6 +17146,13 @@@ T: git git://git.kernel.org/pub/scm/lin
  F:    Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
  F:    drivers/net/wireless/ath/ath11k/
  
 +QUALCOMM ATH12K WIRELESS DRIVER
 +M:    Kalle Valo <kvalo@kernel.org>
 +L:    ath12k@lists.infradead.org
 +S:    Supported
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
 +F:    drivers/net/wireless/ath/ath12k/
 +
  QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
  M:    Toke Høiland-Jørgensen <toke@toke.dk>
  L:    linux-wireless@vger.kernel.org
@@@ -17170,7 -17229,7 +17170,7 @@@ F:   Documentation/devicetree/bindings/ne
  F:    drivers/net/wwan/qcom_bam_dmux.c
  
  QUALCOMM CAMERA SUBSYSTEM DRIVER
 -M:    Robert Foss <robert.foss@linaro.org>
 +M:    Robert Foss <rfoss@kernel.org>
  M:    Todor Tomov <todor.too@gmail.com>
  L:    linux-media@vger.kernel.org
  S:    Maintained
@@@ -17250,7 -17309,7 +17250,7 @@@ F:   drivers/dma/qcom/hidma
  
  QUALCOMM I2C CCI DRIVER
  M:    Loic Poulain <loic.poulain@linaro.org>
 -M:    Robert Foss <robert.foss@linaro.org>
 +M:    Robert Foss <rfoss@kernel.org>
  L:    linux-i2c@vger.kernel.org
  L:    linux-arm-msm@vger.kernel.org
  S:    Maintained
@@@ -17724,13 -17783,6 +17724,13 @@@ F: Documentation/devicetree/bindings/ne
  F:    drivers/net/ethernet/renesas/
  F:    include/linux/sh_eth.h
  
 +RENESAS IDT821034 ASoC CODEC
 +M:    Herve Codina <herve.codina@bootlin.com>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/sound/renesas,idt821034.yaml
 +F:    sound/soc/codecs/idt821034.c
 +
  RENESAS R-CAR GYROADC DRIVER
  M:    Marek Vasut <marek.vasut@gmail.com>
  L:    linux-iio@vger.kernel.org
@@@ -17896,7 -17948,6 +17896,7 @@@ M:   Albert Ou <aou@eecs.berkeley.edu
  L:    linux-riscv@lists.infradead.org
  S:    Supported
  Q:    https://patchwork.kernel.org/project/linux-riscv/list/
 +C:    irc://irc.libera.chat/riscv
  P:    Documentation/riscv/patch-acceptance.rst
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
  F:    arch/riscv/
@@@ -18162,7 -18213,6 +18162,7 @@@ L:   rust-for-linux@vger.kernel.or
  S:    Supported
  W:    https://github.com/Rust-for-Linux/linux
  B:    https://github.com/Rust-for-Linux/linux/issues
 +C:    zulip://rust-for-linux.zulipchat.com
  T:    git https://github.com/Rust-for-Linux/linux.git rust-next
  F:    Documentation/rust/
  F:    rust/
@@@ -18202,7 -18252,6 +18202,7 @@@ F:   Documentation/driver-api/s390-driver
  F:    Documentation/s390/
  F:    arch/s390/
  F:    drivers/s390/
 +F:    drivers/watchdog/diag288_wdt.c
  
  S390 COMMON I/O LAYER
  M:    Vineeth Vijayan <vneethv@linux.ibm.com>
@@@ -18263,13 -18312,6 +18263,13 @@@ F: arch/s390/pci
  F:    drivers/pci/hotplug/s390_pci_hpc.c
  F:    Documentation/s390/pci.rst
  
 +S390 SCM DRIVER
 +M:    Vineeth Vijayan <vneethv@linux.ibm.com>
 +L:    linux-s390@vger.kernel.org
 +S:    Supported
 +F:    drivers/s390/block/scm*
 +F:    drivers/s390/cio/scm.c
 +
  S390 VFIO AP DRIVER
  M:    Tony Krowiak <akrowiak@linux.ibm.com>
  M:    Halil Pasic <pasic@linux.ibm.com>
@@@ -18313,6 -18355,19 +18313,6 @@@ L:  linux-s390@vger.kernel.or
  S:    Supported
  F:    drivers/s390/scsi/zfcp_*
  
 -S3C ADC BATTERY DRIVER
 -M:    Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
 -L:    linux-samsung-soc@vger.kernel.org
 -S:    Odd Fixes
 -F:    drivers/power/supply/s3c_adc_battery.c
 -F:    include/linux/s3c_adc_battery.h
 -
 -S3C24XX SD/MMC Driver
 -M:    Ben Dooks <ben-linux@fluff.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Supported
 -F:    drivers/mmc/host/s3cmci.*
 -
  SAA6588 RDS RECEIVER DRIVER
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -18465,9 -18520,11 +18465,9 @@@ F:  Documentation/devicetree/bindings/cl
  F:    Documentation/devicetree/bindings/clock/samsung,s3c*
  F:    drivers/clk/samsung/
  F:    include/dt-bindings/clock/exynos*.h
 -F:    include/dt-bindings/clock/s3c*.h
  F:    include/dt-bindings/clock/s5p*.h
  F:    include/dt-bindings/clock/samsung,*.h
  F:    include/linux/clk/samsung.h
 -F:    include/linux/platform_data/clk-s3c2410.h
  
  SAMSUNG SPI DRIVERS
  M:    Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
@@@ -18478,6 -18535,7 +18478,6 @@@ S:   Maintaine
  F:    Documentation/devicetree/bindings/spi/samsung,spi*.yaml
  F:    drivers/spi/spi-s3c*
  F:    include/linux/platform_data/spi-s3c64xx.h
 -F:    include/linux/spi/s3c24xx-fiq.h
  
  SAMSUNG SXGBE DRIVERS
  M:    Byungho An <bh74.an@samsung.com>
@@@ -18611,9 -18669,9 +18611,9 @@@ F:   drivers/target
  F:    include/target/
  
  SCTP PROTOCOL
 -M:    Vlad Yasevich <vyasevich@gmail.com>
  M:    Neil Horman <nhorman@tuxdriver.com>
  M:    Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
 +M:    Xin Long <lucien.xin@gmail.com>
  L:    linux-sctp@vger.kernel.org
  S:    Maintained
  W:    http://lksctp.sourceforge.net
@@@ -18836,7 -18894,6 +18836,7 @@@ M:   Edward Cree <ecree.xilinx@gmail.com
  M:    Martin Habets <habetsm.xilinx@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 +F:    Documentation/networking/devlink/sfc.rst
  F:    drivers/net/ethernet/sfc/
  
  SFF/SFP/SFP+ MODULE SUPPORT
@@@ -19048,6 -19105,14 +19048,6 @@@ M:  Simtec Linux Team <linux@simtec.co.u
  S:    Supported
  W:    http://www.simtec.co.uk/products/EB110ATX/
  
 -SIMTEC EB2410ITX (BAST)
 -M:    Simtec Linux Team <linux@simtec.co.uk>
 -S:    Supported
 -W:    http://www.simtec.co.uk/products/EB2410ITX/
 -F:    arch/arm/mach-s3c/bast-ide.c
 -F:    arch/arm/mach-s3c/bast-irq.c
 -F:    arch/arm/mach-s3c/mach-bast.c
 -
  SIOX
  M:    Thorsten Scherer <t.scherer@eckelmann.de>
  M:    Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
@@@ -19252,13 -19317,6 +19252,13 @@@ L: alsa-devel@alsa-project.org (moderat
  S:    Orphan
  F:    sound/soc/uniphier/
  
 +SOCKET TIMESTAMPING
 +M:    Willem de Bruijn <willemdebruijn.kernel@gmail.com>
 +S:    Maintained
 +F:    Documentation/networking/timestamping.rst
 +F:    include/uapi/linux/net_tstamp.h
 +F:    tools/testing/selftests/net/so_txtime.c
 +
  SOEKRIS NET48XX LED SUPPORT
  M:    Chris Boot <bootc@bootc.net>
  S:    Maintained
@@@ -19606,7 -19664,7 +19606,7 @@@ F:   drivers/clk/spear
  F:    drivers/pinctrl/spear/
  
  SPI NOR SUBSYSTEM
 -M:    Tudor Ambarus <tudor.ambarus@microchip.com>
 +M:    Tudor Ambarus <tudor.ambarus@linaro.org>
  M:    Pratyush Yadav <pratyush@kernel.org>
  R:    Michael Walle <michael@walle.cc>
  L:    linux-mtd@lists.infradead.org
@@@ -19832,15 -19890,13 +19832,15 @@@ F:        Documentation/devicetree/bindings/cl
  F:    drivers/clk/starfive/clk-starfive-jh7100*
  F:    include/dt-bindings/clock/starfive-jh7100*.h
  
 -STARFIVE JH7100 PINCTRL DRIVER
 +STARFIVE JH71X0 PINCTRL DRIVERS
  M:    Emil Renner Berthing <kernel@esmil.dk>
 +M:    Jianlong Huang <jianlong.huang@starfivetech.com>
  L:    linux-gpio@vger.kernel.org
  S:    Maintained
 -F:    Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
 -F:    drivers/pinctrl/starfive/
 +F:    Documentation/devicetree/bindings/pinctrl/starfive,jh71*.yaml
 +F:    drivers/pinctrl/starfive/pinctrl-starfive-jh71*
  F:    include/dt-bindings/pinctrl/pinctrl-starfive-jh7100.h
 +F:    include/dt-bindings/pinctrl/starfive,jh7110-pinctrl.h
  
  STARFIVE JH7100 RESET CONTROLLER DRIVER
  M:    Emil Renner Berthing <kernel@esmil.dk>
@@@ -19849,12 -19905,6 +19849,12 @@@ F: Documentation/devicetree/bindings/re
  F:    drivers/reset/reset-starfive-jh7100.c
  F:    include/dt-bindings/reset/starfive-jh7100.h
  
 +STARFIVE TRNG DRIVER
 +M:    Jia Jie Ho <jiajie.ho@starfivetech.com>
 +S:    Supported
 +F:    Documentation/devicetree/bindings/rng/starfive*
 +F:    drivers/char/hw_random/jh7110-trng.c
 +
  STATIC BRANCH/CALL
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Josh Poimboeuf <jpoimboe@kernel.org>
@@@ -20012,7 -20062,6 +20012,7 @@@ F:   drivers/watchdog/sunplus_wdt.
  SUPERH
  M:    Yoshinori Sato <ysato@users.sourceforge.jp>
  M:    Rich Felker <dalias@libc.org>
 +M:    John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
  L:    linux-sh@vger.kernel.org
  S:    Maintained
  Q:    http://patchwork.kernel.org/project/linux-sh/list/
@@@ -20028,8 -20077,7 +20028,8 @@@ L:   linux-pm@vger.kernel.or
  S:    Supported
  B:    https://bugzilla.kernel.org
  F:    Documentation/power/
 -F:    arch/x86/kernel/acpi/
 +F:    arch/x86/kernel/acpi/sleep*
 +F:    arch/x86/kernel/acpi/wakeup*
  F:    drivers/base/power/
  F:    include/linux/freezer.h
  F:    include/linux/pm.h
@@@ -20246,7 -20294,8 +20246,7 @@@ S:   Maintaine
  F:    drivers/platform/x86/system76_acpi.c
  
  SYSV FILESYSTEM
 -M:    Christoph Hellwig <hch@infradead.org>
 -S:    Maintained
 +S:    Orphan
  F:    Documentation/filesystems/sysv-fs.rst
  F:    fs/sysv/
  F:    include/linux/sysv_fs.h
@@@ -20637,7 -20686,6 +20637,7 @@@ S:   Supporte
  Q:    https://patchwork.kernel.org/project/linux-pm/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
  F:    Documentation/ABI/testing/sysfs-class-thermal
 +F:    Documentation/admin-guide/thermal/
  F:    Documentation/devicetree/bindings/thermal/
  F:    Documentation/driver-api/thermal/
  F:    drivers/thermal/
@@@ -20719,7 -20767,7 +20719,7 @@@ M:   Mika Westerberg <mika.westerberg@lin
  M:    Yehezkel Bernat <YehezkelShB@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
 -F:    drivers/net/thunderbolt.c
 +F:    drivers/net/thunderbolt/
  
  THUNDERX GPIO DRIVER
  M:    Robert Richter <rric@kernel.org>
@@@ -20794,6 -20842,7 +20794,6 @@@ W:   https://linuxtv.or
  Q:    http://patchwork.linuxtv.org/project/linux-media/list/
  T:    git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
  F:    drivers/media/platform/ti/davinci/
 -F:    drivers/staging/media/deprecated/vpfe_capture/
  F:    include/media/davinci/
  
  TI ENHANCED CAPTURE (eCAP) DRIVER
@@@ -21337,6 -21386,12 +21337,12 @@@ L: linux-scsi@vger.kernel.or
  S:    Supported
  F:    drivers/ufs/host/*dwc*
  
+ UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER EXYNOS HOOKS
+ M:    Alim Akhtar <alim.akhtar@samsung.com>
+ L:    linux-scsi@vger.kernel.org
+ S:    Maintained
+ F:    drivers/ufs/host/ufs-exynos*
  UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER MEDIATEK HOOKS
  M:    Stanley Chu <stanley.chu@mediatek.com>
  L:    linux-scsi@vger.kernel.org
@@@ -21344,6 -21399,14 +21350,14 @@@ L: linux-mediatek@lists.infradead.org (
  S:    Maintained
  F:    drivers/ufs/host/ufs-mediatek*
  
+ UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER QUALCOMM HOOKS
+ M:    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+ L:    linux-arm-msm@vger.kernel.org
+ L:    linux-scsi@vger.kernel.org
+ S:    Maintained
+ F:    Documentation/devicetree/bindings/ufs/qcom,ufs.yaml
+ F:    drivers/ufs/host/ufs-qcom*
  UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER RENESAS HOOKS
  M:    Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
  L:    linux-renesas-soc@vger.kernel.org
@@@ -21653,7 -21716,6 +21667,7 @@@ F:   include/uapi/linux/uvcvideo.
  
  USB WEBCAM GADGET
  M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 +M:    Daniel Scally <dan.scally@ideasonboard.com>
  L:    linux-usb@vger.kernel.org
  S:    Maintained
  F:    drivers/usb/gadget/function/*uvc*
@@@ -21689,13 -21751,6 +21703,13 @@@ T: git git://linuxtv.org/media_tree.gi
  F:    Documentation/admin-guide/media/zr364xx*
  F:    drivers/staging/media/deprecated/zr364xx/
  
 +USER DATAGRAM PROTOCOL (UDP)
 +M:    Willem de Bruijn <willemdebruijn.kernel@gmail.com>
 +S:    Maintained
 +F:    include/linux/udp.h
 +F:    net/ipv4/udp.c
 +F:    net/ipv6/udp.c
 +
  USER-MODE LINUX (UML)
  M:    Richard Weinberger <richard@nod.at>
  M:    Anton Ivanov <anton.ivanov@cambridgegreys.com>
@@@ -21741,9 -21796,11 +21755,9 @@@ W:  http://en.wikipedia.org/wiki/Util-li
  T:    git git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
  
  UUID HELPERS
 -M:    Christoph Hellwig <hch@lst.de>
  R:    Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
 -T:    git git://git.infradead.org/users/hch/uuid.git
  F:    include/linux/uuid.h
  F:    include/uapi/linux/uuid.h
  F:    lib/test_uuid.c
@@@ -22202,9 -22259,7 +22216,9 @@@ F:   drivers/scsi/vmw_pvscsi.
  F:    drivers/scsi/vmw_pvscsi.h
  
  VMWARE VIRTUAL PTP CLOCK DRIVER
 -M:    Vivek Thampi <vithampi@vmware.com>
 +M:    Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
 +M:    Deep Shah <sdeep@vmware.com>
 +R:    Alexey Makhalov <amakhalov@vmware.com>
  R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -22572,7 -22627,6 +22586,7 @@@ S:   Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
  F:    drivers/platform/olpc/
  F:    drivers/platform/x86/
 +F:    include/linux/platform_data/x86/
  
  X86 PLATFORM DRIVERS - ARCH
  R:    Darren Hart <dvhart@infradead.org>
@@@ -22858,13 -22912,6 +22872,13 @@@ F: Documentation/devicetree/bindings/dm
  F:    drivers/dma/xilinx/xilinx_dpdma.c
  F:    include/dt-bindings/dma/xlnx-zynqmp-dpdma.h
  
 +XILINX ZYNQMP OCM EDAC DRIVER
 +M:    Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
 +M:    Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/memory-controllers/xlnx,zynqmp-ocmc-1.0.yaml
 +F:    drivers/edac/zynqmp_edac.c
 +
  XILINX ZYNQMP PSGTR PHY DRIVER
  M:    Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
  M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
index aa338f10cef2ea151d95a1465565ba391365001c,0cc1e6d660adb87705e446d01593e5d15dfadfc6..e093c7a7deebd6493b3089a7c879c10726c40f6b
@@@ -383,8 -383,12 +383,12 @@@ int ata_cmd_ioctl(struct scsi_device *s
        u8 scsi_cmd[MAX_COMMAND_SIZE];
        u8 args[4], *argbuf = NULL;
        int argsize = 0;
-       enum dma_data_direction data_dir;
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+               .sense = sensebuf,
+               .sense_len = sizeof(sensebuf),
+       };
        int cmd_result;
  
        if (arg == NULL)
                scsi_cmd[1]  = (4 << 1); /* PIO Data-in */
                scsi_cmd[2]  = 0x0e;     /* no off.line or cc, read from dev,
                                            block count in sector count field */
-               data_dir = DMA_FROM_DEVICE;
        } else {
                scsi_cmd[1]  = (3 << 1); /* Non-data */
                scsi_cmd[2]  = 0x20;     /* cc but no off.line or data xfer */
-               data_dir = DMA_NONE;
        }
  
        scsi_cmd[0] = ATA_16;
  
        /* Good values for timeout and retries?  Values below
           from scsi_ioctl_send_command() for default case... */
-       cmd_result = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize,
-                                 sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL);
+       cmd_result = scsi_execute_cmd(scsidev, scsi_cmd, REQ_OP_DRV_IN, argbuf,
+                                     argsize, 10 * HZ, 5, &exec_args);
        if (cmd_result < 0) {
                rc = cmd_result;
                goto error;
@@@ -491,6 -492,11 +492,11 @@@ int ata_task_ioctl(struct scsi_device *
        u8 args[7];
        struct scsi_sense_hdr sshdr;
        int cmd_result;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+               .sense = sensebuf,
+               .sense_len = sizeof(sensebuf),
+       };
  
        if (arg == NULL)
                return -EINVAL;
  
        /* Good values for timeout and retries?  Values below
           from scsi_ioctl_send_command() for default case... */
-       cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0,
-                               sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL);
+       cmd_result = scsi_execute_cmd(scsidev, scsi_cmd, REQ_OP_DRV_IN, NULL,
+                                     0, 10 * HZ, 5, &exec_args);
        if (cmd_result < 0) {
                rc = cmd_result;
                goto error;
@@@ -1654,8 -1659,7 +1659,8 @@@ static void ata_scsi_qc_complete(struc
        struct ata_port *ap = qc->ap;
        struct scsi_cmnd *cmd = qc->scsicmd;
        u8 *cdb = cmd->cmnd;
 -      int need_sense = (qc->err_mask != 0);
 +      int need_sense = (qc->err_mask != 0) &&
 +              !(qc->flags & ATA_QCFLAG_SENSE_VALID);
  
        /* For ATA pass thru (SAT) commands, generate a sense block if
         * user mandated it or if there's an error.  Note that if we
        if (((cdb[0] == ATA_16) || (cdb[0] == ATA_12)) &&
            ((cdb[2] & 0x20) || need_sense))
                ata_gen_passthru_sense(qc);
 -      else if (qc->flags & ATA_QCFLAG_SENSE_VALID)
 -              cmd->result = SAM_STAT_CHECK_CONDITION;
        else if (need_sense)
                ata_gen_ata_sense(qc);
        else
 -              cmd->result = SAM_STAT_GOOD;
 +              /* Keep the SCSI ML and status byte, clear host byte. */
 +              cmd->result &= 0x0000ffff;
  
        if (need_sense && !ap->ops->error_handler)
                ata_dump_status(ap, &qc->result_tf);
@@@ -2240,6 -2245,30 +2245,6 @@@ static unsigned int ata_msense_rw_recov
        return sizeof(def_rw_recovery_mpage);
  }
  
 -/*
 - * We can turn this into a real blacklist if it's needed, for now just
 - * blacklist any Maxtor BANC1G10 revision firmware
 - */
 -static int ata_dev_supports_fua(u16 *id)
 -{
 -      unsigned char model[ATA_ID_PROD_LEN + 1], fw[ATA_ID_FW_REV_LEN + 1];
 -
 -      if (!libata_fua)
 -              return 0;
 -      if (!ata_id_has_fua(id))
 -              return 0;
 -
 -      ata_id_c_string(id, model, ATA_ID_PROD, sizeof(model));
 -      ata_id_c_string(id, fw, ATA_ID_FW_REV, sizeof(fw));
 -
 -      if (strcmp(model, "Maxtor"))
 -              return 1;
 -      if (strcmp(fw, "BANC1G10"))
 -              return 1;
 -
 -      return 0; /* blacklisted */
 -}
 -
  /**
   *    ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands
   *    @args: device IDENTIFY data / SCSI command of interest.
@@@ -2263,7 -2292,7 +2268,7 @@@ static unsigned int ata_scsiop_mode_sen
        };
        u8 pg, spg;
        unsigned int ebd, page_control, six_byte;
 -      u8 dpofua, bp = 0xff;
 +      u8 dpofua = 0, bp = 0xff;
        u16 fp;
  
        six_byte = (scsicmd[0] == MODE_SENSE);
                goto invalid_fld;
        }
  
 -      dpofua = 0;
 -      if (ata_dev_supports_fua(args->id) && (dev->flags & ATA_DFLAG_LBA48) &&
 -          (!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count))
 +      if (dev->flags & ATA_DFLAG_FUA)
                dpofua = 1 << 4;
  
        if (six_byte) {
@@@ -3240,12 -3271,11 +3245,12 @@@ static unsigned int ata_scsiop_maint_in
        u8 supported = 0;
        unsigned int err = 0;
  
 -      if (cdb[2] != 1) {
 +      if (cdb[2] != 1 && cdb[2] != 3) {
                ata_dev_warn(dev, "invalid command format %d\n", cdb[2]);
                err = 2;
                goto out;
        }
 +
        switch (cdb[3]) {
        case INQUIRY:
        case MODE_SENSE:
index 29a2865b8e2e1453ac8629cb2de307dc3687efbb,55a5073248f84d2969235b0e8c9f0882927157a0..362fa631f39b2654ee051209826fad0ff3648c36
@@@ -127,8 -127,11 +127,11 @@@ static int submit_rtpg(struct scsi_devi
                       int bufflen, struct scsi_sense_hdr *sshdr, int flags)
  {
        u8 cdb[MAX_COMMAND_SIZE];
-       blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
-               REQ_FAILFAST_DRIVER;
+       blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV |
+                               REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = sshdr,
+       };
  
        /* Prepare the command. */
        memset(cdb, 0x0, MAX_COMMAND_SIZE);
                cdb[1] = MI_REPORT_TARGET_PGS;
        put_unaligned_be32(bufflen, &cdb[6]);
  
-       return scsi_execute(sdev, cdb, DMA_FROM_DEVICE, buff, bufflen, NULL,
-                       sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
-                       ALUA_FAILOVER_RETRIES, req_flags, 0, NULL);
+       return scsi_execute_cmd(sdev, cdb, opf, buff, bufflen,
+                               ALUA_FAILOVER_TIMEOUT * HZ,
+                               ALUA_FAILOVER_RETRIES, &exec_args);
  }
  
  /*
@@@ -157,8 -160,11 +160,11 @@@ static int submit_stpg(struct scsi_devi
        u8 cdb[MAX_COMMAND_SIZE];
        unsigned char stpg_data[8];
        int stpg_len = 8;
-       blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
-               REQ_FAILFAST_DRIVER;
+       blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV |
+                               REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = sshdr,
+       };
  
        /* Prepare the data buffer */
        memset(stpg_data, 0, stpg_len);
        cdb[1] = MO_SET_TARGET_PGS;
        put_unaligned_be32(stpg_len, &cdb[6]);
  
-       return scsi_execute(sdev, cdb, DMA_TO_DEVICE, stpg_data, stpg_len, NULL,
-                       sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
-                       ALUA_FAILOVER_RETRIES, req_flags, 0, NULL);
+       return scsi_execute_cmd(sdev, cdb, opf, stpg_data,
+                               stpg_len, ALUA_FAILOVER_TIMEOUT * HZ,
+                               ALUA_FAILOVER_RETRIES, &exec_args);
  }
  
  static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size,
@@@ -981,9 -987,6 +987,9 @@@ queue_rtpg
   *
   * Returns true if and only if alua_rtpg_work() will be called asynchronously.
   * That function is responsible for calling @qdata->fn().
 + *
 + * Context: may be called from atomic context (alua_check()) only if the caller
 + *    holds an sdev reference.
   */
  static bool alua_rtpg_queue(struct alua_port_group *pg,
                            struct scsi_device *sdev,
        int start_queue = 0;
        unsigned long flags;
  
 -      might_sleep();
 -
        if (WARN_ON_ONCE(!pg) || scsi_device_get(sdev))
                return false;
  
diff --combined drivers/scsi/ipr.c
index 1c8040d250ea0549c84721f0ca262e9cfb91391b,7dff517a08586fd7357d85aecda19c21ce6e03ab..198d3f20d682887cf550b2d6bfadcc95b4db7cb1
@@@ -3912,7 -3912,6 +3912,6 @@@ static int ipr_copy_ucode_buffer(struc
  {
        int bsize_elem, i, result = 0;
        struct scatterlist *sg;
-       void *kaddr;
  
        /* Determine the actual number of bytes per element */
        bsize_elem = PAGE_SIZE * (1 << sglist->order);
                        buffer += bsize_elem) {
                struct page *page = sg_page(sg);
  
-               kaddr = kmap(page);
-               memcpy(kaddr, buffer, bsize_elem);
-               kunmap(page);
+               memcpy_to_page(page, 0, buffer, bsize_elem);
  
                sg->length = bsize_elem;
  
        if (len % bsize_elem) {
                struct page *page = sg_page(sg);
  
-               kaddr = kmap(page);
-               memcpy(kaddr, buffer, len % bsize_elem);
-               kunmap(page);
+               memcpy_to_page(page, 0, buffer, len % bsize_elem);
  
                sg->length = len % bsize_elem;
        }
@@@ -5370,9 -5365,9 +5365,9 @@@ static int __ipr_eh_dev_reset(struct sc
                                        continue;
  
                                ipr_cmd->done = ipr_sata_eh_done;
 -                              if (!(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) {
 +                              if (!(ipr_cmd->qc->flags & ATA_QCFLAG_EH)) {
                                        ipr_cmd->qc->err_mask |= AC_ERR_TIMEOUT;
 -                                      ipr_cmd->qc->flags |= ATA_QCFLAG_FAILED;
 +                                      ipr_cmd->qc->flags |= ATA_QCFLAG_EH;
                                }
                        }
                }
@@@ -7142,8 -7137,11 +7137,8 @@@ static unsigned int ipr_qc_issue(struc
  /**
   * ipr_qc_fill_rtf - Read result TF
   * @qc: ATA queued command
 - *
 - * Return value:
 - *    true
   **/
 -static bool ipr_qc_fill_rtf(struct ata_queued_cmd *qc)
 +static void ipr_qc_fill_rtf(struct ata_queued_cmd *qc)
  {
        struct ipr_sata_port *sata_port = qc->ap->private_data;
        struct ipr_ioasa_gata *g = &sata_port->ioasa;
        tf->hob_lbal = g->hob_lbal;
        tf->hob_lbam = g->hob_lbam;
        tf->hob_lbah = g->hob_lbah;
 -
 -      return true;
  }
  
  static struct ata_port_operations ipr_sata_ops = {
index 12d9bdd11a4c3200622a7ccc6c276a8e05e665bd,4a7e835c24cde4cecb1183aff459f924a29877b4..77714a495cbbae2c18068befaa157ff6bb2eb9fa
@@@ -125,7 -125,7 +125,7 @@@ static void sas_ata_task_done(struct sa
                } else {
                        link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.fis[2]);
                        if (unlikely(link->eh_info.err_mask))
 -                              qc->flags |= ATA_QCFLAG_FAILED;
 +                              qc->flags |= ATA_QCFLAG_EH;
                }
        } else {
                ac = sas_to_ata_err(stat);
                                qc->err_mask = ac;
                        } else {
                                link->eh_info.err_mask |= AC_ERR_DEV;
 -                              qc->flags |= ATA_QCFLAG_FAILED;
 +                              qc->flags |= ATA_QCFLAG_EH;
                        }
  
                        dev->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */
@@@ -226,11 -226,12 +226,11 @@@ static unsigned int sas_ata_qc_issue(st
        return ret;
  }
  
 -static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)
 +static void sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)
  {
        struct domain_device *dev = qc->ap->private_data;
  
        ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf);
 -      return true;
  }
  
  static struct sas_internal *dev_to_sas_internal(struct domain_device *dev)
        return to_sas_internal(dev->port->ha->core.shost->transportt);
  }
  
- static int sas_get_ata_command_set(struct domain_device *dev);
+ static int sas_get_ata_command_set(struct domain_device *dev)
+ {
+       struct ata_taskfile tf;
+       if (dev->dev_type == SAS_SATA_PENDING)
+               return ATA_DEV_UNKNOWN;
+       ata_tf_from_fis(dev->frame_rcvd, &tf);
+       return ata_dev_classify(&tf);
+ }
  
  int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
  {
@@@ -475,7 -486,7 +485,7 @@@ static void sas_ata_internal_abort(stru
  
  static void sas_ata_post_internal(struct ata_queued_cmd *qc)
  {
 -      if (qc->flags & ATA_QCFLAG_FAILED)
 +      if (qc->flags & ATA_QCFLAG_EH)
                qc->err_mask |= AC_ERR_OTHER;
  
        if (qc->err_mask) {
@@@ -630,26 -641,12 +640,12 @@@ void sas_ata_task_abort(struct sas_tas
  
        /* Internal command, fake a timeout and complete. */
        qc->flags &= ~ATA_QCFLAG_ACTIVE;
 -      qc->flags |= ATA_QCFLAG_FAILED;
 +      qc->flags |= ATA_QCFLAG_EH;
        qc->err_mask |= AC_ERR_TIMEOUT;
        waiting = qc->private_data;
        complete(waiting);
  }
  
- static int sas_get_ata_command_set(struct domain_device *dev)
- {
-       struct dev_to_host_fis *fis =
-               (struct dev_to_host_fis *) dev->frame_rcvd;
-       struct ata_taskfile tf;
-       if (dev->dev_type == SAS_SATA_PENDING)
-               return ATA_DEV_UNKNOWN;
-       ata_tf_from_fis((const u8 *)fis, &tf);
-       return ata_dev_classify(&tf);
- }
  void sas_probe_sata(struct asd_sas_port *port)
  {
        struct domain_device *dev, *n;
  
  }
  
+ int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
+                   struct domain_device *child, int phy_id)
+ {
+       struct sas_rphy *rphy;
+       int ret;
+       if (child->linkrate > parent->min_linkrate) {
+               struct sas_phy *cphy = child->phy;
+               enum sas_linkrate min_prate = cphy->minimum_linkrate,
+                       parent_min_lrate = parent->min_linkrate,
+                       min_linkrate = (min_prate > parent_min_lrate) ?
+                                       parent_min_lrate : 0;
+               struct sas_phy_linkrates rates = {
+                       .maximum_linkrate = parent->min_linkrate,
+                       .minimum_linkrate = min_linkrate,
+               };
+               pr_notice("ex %016llx phy%02d SATA device linkrate > min pathway connection rate, attempting to lower device linkrate\n",
+                         SAS_ADDR(child->sas_addr), phy_id);
+               ret = sas_smp_phy_control(parent, phy_id,
+                                         PHY_FUNC_LINK_RESET, &rates);
+               if (ret) {
+                       pr_err("ex %016llx phy%02d SATA device could not set linkrate (%d)\n",
+                              SAS_ADDR(child->sas_addr), phy_id, ret);
+                       return ret;
+               }
+               pr_notice("ex %016llx phy%02d SATA device set linkrate successfully\n",
+                         SAS_ADDR(child->sas_addr), phy_id);
+               child->linkrate = child->min_linkrate;
+       }
+       ret = sas_get_ata_info(child, phy);
+       if (ret)
+               return ret;
+       sas_init_dev(child);
+       ret = sas_ata_init(child);
+       if (ret)
+               return ret;
+       rphy = sas_end_device_alloc(phy->port);
+       if (!rphy)
+               return -ENOMEM;
+       rphy->identify.phy_identifier = phy_id;
+       child->rphy = rphy;
+       get_device(&rphy->dev);
+       list_add_tail(&child->disco_list_node, &parent->port->disco_list);
+       ret = sas_discover_sata(child);
+       if (ret) {
+               pr_notice("sas_discover_sata() for device %16llx at %016llx:%02d returned 0x%x\n",
+                         SAS_ADDR(child->sas_addr),
+                         SAS_ADDR(parent->sas_addr), phy_id, ret);
+               sas_rphy_free(child->rphy);
+               list_del(&child->disco_list_node);
+               return ret;
+       }
+       return 0;
+ }
  static void sas_ata_flush_pm_eh(struct asd_sas_port *port, const char *func)
  {
        struct domain_device *dev, *n;
@@@ -888,9 -947,7 +946,9 @@@ void sas_ata_device_link_abort(struct d
  {
        struct ata_port *ap = device->sata_dev.ap;
        struct ata_link *link = &ap->link;
 +      unsigned long flags;
  
 +      spin_lock_irqsave(ap->lock, flags);
        device->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */
        device->sata_dev.fis[3] = ATA_ABORTED; /* tf error */
  
        if (force_reset)
                link->eh_info.action |= ATA_EH_RESET;
        ata_link_abort(link);
 +      spin_unlock_irqrestore(ap->lock, flags);
  }
  EXPORT_SYMBOL_GPL(sas_ata_device_link_abort);
  
index 389a35308be3f11effe21392b6a874433ba75d20,faaaeae25d4475b4b6a53c9c706ebfbafb829ea3..6eb4085a3a222d9b295f0311fc4dd658cc11561f
@@@ -1,7 -1,7 +1,7 @@@
  /*******************************************************************
   * This file is part of the Emulex Linux Device Driver for         *
   * Fibre Channel Host Bus Adapters.                                *
-  * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
+  * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
   * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.  *
   * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
   * EMULEX and SLI are trademarks of Emulex.                        *
@@@ -30,7 -30,6 +30,7 @@@
  #include <linux/kthread.h>
  #include <linux/pci.h>
  #include <linux/spinlock.h>
 +#include <linux/sched/clock.h>
  #include <linux/ctype.h>
  #include <linux/aer.h>
  #include <linux/slab.h>
@@@ -5190,16 -5189,25 +5190,25 @@@ static voi
  lpfc_sli4_parse_latt_fault(struct lpfc_hba *phba,
                           struct lpfc_acqe_link *acqe_link)
  {
-       switch (bf_get(lpfc_acqe_link_fault, acqe_link)) {
-       case LPFC_ASYNC_LINK_FAULT_NONE:
-       case LPFC_ASYNC_LINK_FAULT_LOCAL:
-       case LPFC_ASYNC_LINK_FAULT_REMOTE:
-       case LPFC_ASYNC_LINK_FAULT_LR_LRR:
+       switch (bf_get(lpfc_acqe_fc_la_att_type, acqe_link)) {
+       case LPFC_FC_LA_TYPE_LINK_DOWN:
+       case LPFC_FC_LA_TYPE_TRUNKING_EVENT:
+       case LPFC_FC_LA_TYPE_ACTIVATE_FAIL:
+       case LPFC_FC_LA_TYPE_LINK_RESET_PRTCL_EVT:
                break;
        default:
-               lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
-                               "0398 Unknown link fault code: x%x\n",
-                               bf_get(lpfc_acqe_link_fault, acqe_link));
+               switch (bf_get(lpfc_acqe_link_fault, acqe_link)) {
+               case LPFC_ASYNC_LINK_FAULT_NONE:
+               case LPFC_ASYNC_LINK_FAULT_LOCAL:
+               case LPFC_ASYNC_LINK_FAULT_REMOTE:
+               case LPFC_ASYNC_LINK_FAULT_LR_LRR:
+                       break;
+               default:
+                       lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
+                                       "0398 Unknown link fault code: x%x\n",
+                                       bf_get(lpfc_acqe_link_fault, acqe_link));
+                       break;
+               }
                break;
        }
  }
@@@ -6282,6 -6290,7 +6291,7 @@@ lpfc_sli4_async_fc_evt(struct lpfc_hba 
        LPFC_MBOXQ_t *pmb;
        MAILBOX_t *mb;
        struct lpfc_mbx_read_top *la;
+       char *log_level;
        int rc;
  
        if (bf_get(lpfc_trailer_type, acqe_fc) !=
                                bf_get(lpfc_acqe_fc_la_port_number, acqe_fc);
        phba->sli4_hba.link_state.fault =
                                bf_get(lpfc_acqe_link_fault, acqe_fc);
+       phba->sli4_hba.link_state.link_status =
+                               bf_get(lpfc_acqe_fc_la_link_status, acqe_fc);
  
-       if (bf_get(lpfc_acqe_fc_la_att_type, acqe_fc) ==
-           LPFC_FC_LA_TYPE_LINK_DOWN)
-               phba->sli4_hba.link_state.logical_speed = 0;
-       else if (!phba->sli4_hba.conf_trunk)
-               phba->sli4_hba.link_state.logical_speed =
+       /*
+        * Only select attention types need logical speed modification to what
+        * was previously set.
+        */
+       if (phba->sli4_hba.link_state.status >= LPFC_FC_LA_TYPE_LINK_UP &&
+           phba->sli4_hba.link_state.status < LPFC_FC_LA_TYPE_ACTIVATE_FAIL) {
+               if (bf_get(lpfc_acqe_fc_la_att_type, acqe_fc) ==
+                   LPFC_FC_LA_TYPE_LINK_DOWN)
+                       phba->sli4_hba.link_state.logical_speed = 0;
+               else if (!phba->sli4_hba.conf_trunk)
+                       phba->sli4_hba.link_state.logical_speed =
                                bf_get(lpfc_acqe_fc_la_llink_spd, acqe_fc) * 10;
+       }
  
        lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
                        "2896 Async FC event - Speed:%dGBaud Topology:x%x "
                        "LA Type:x%x Port Type:%d Port Number:%d Logical speed:"
-                       "%dMbps Fault:%d\n",
+                       "%dMbps Fault:x%x Link Status:x%x\n",
                        phba->sli4_hba.link_state.speed,
                        phba->sli4_hba.link_state.topology,
                        phba->sli4_hba.link_state.status,
                        phba->sli4_hba.link_state.type,
                        phba->sli4_hba.link_state.number,
                        phba->sli4_hba.link_state.logical_speed,
-                       phba->sli4_hba.link_state.fault);
+                       phba->sli4_hba.link_state.fault,
+                       phba->sli4_hba.link_state.link_status);
+       /*
+        * The following attention types are informational only, providing
+        * further details about link status.  Overwrite the value of
+        * link_state.status appropriately.  No further action is required.
+        */
+       if (phba->sli4_hba.link_state.status >= LPFC_FC_LA_TYPE_ACTIVATE_FAIL) {
+               switch (phba->sli4_hba.link_state.status) {
+               case LPFC_FC_LA_TYPE_ACTIVATE_FAIL:
+                       log_level = KERN_WARNING;
+                       phba->sli4_hba.link_state.status =
+                                       LPFC_FC_LA_TYPE_LINK_DOWN;
+                       break;
+               case LPFC_FC_LA_TYPE_LINK_RESET_PRTCL_EVT:
+                       /*
+                        * During bb credit recovery establishment, receiving
+                        * this attention type is normal.  Link Up attention
+                        * type is expected to occur before this informational
+                        * attention type so keep the Link Up status.
+                        */
+                       log_level = KERN_INFO;
+                       phba->sli4_hba.link_state.status =
+                                       LPFC_FC_LA_TYPE_LINK_UP;
+                       break;
+               default:
+                       log_level = KERN_INFO;
+                       break;
+               }
+               lpfc_log_msg(phba, log_level, LOG_SLI,
+                            "2992 Async FC event - Informational Link "
+                            "Attention Type x%x\n",
+                            bf_get(lpfc_acqe_fc_la_att_type, acqe_fc));
+               return;
+       }
        pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
        if (!pmb) {
                lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
@@@ -13918,6 -13972,13 +13973,13 @@@ fcponly
        if (sli4_params->sge_supp_len > LPFC_MAX_SGE_SIZE)
                sli4_params->sge_supp_len = LPFC_MAX_SGE_SIZE;
  
+       rc = dma_set_max_seg_size(&phba->pcidev->dev, sli4_params->sge_supp_len);
+       if (unlikely(rc)) {
+               lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
+                               "6400 Can't set dma maximum segment size\n");
+               return rc;
+       }
        /*
         * Check whether the adapter supports an embedded copy of the
         * FCP CMD IU within the WQE for FCP_Ixxx commands. In order
index 69061545d9d2f1ec234cf059b1e3c4bd2ed1f40b,f4083ff7489566542732c57cd3c4cc7974a9dc84..2ee9ea57554d70a1b04f65962052d87c9eaf920b
@@@ -2992,7 -2992,8 +2992,7 @@@ _base_config_dma_addressing(struct MPT3
        struct sysinfo s;
        u64 coherent_dma_mask, dma_mask;
  
 -      if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4 ||
 -          dma_get_required_mask(&pdev->dev) <= DMA_BIT_MASK(32)) {
 +      if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4) {
                ioc->dma_mask = 32;
                coherent_dma_mask = dma_mask = DMA_BIT_MASK(32);
        /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */
@@@ -5849,6 -5850,9 +5849,9 @@@ _base_release_memory_pools(struct MPT3S
                }
                dma_pool_destroy(ioc->pcie_sgl_dma_pool);
        }
+       kfree(ioc->pcie_sg_lookup);
+       ioc->pcie_sg_lookup = NULL;
        if (ioc->config_page) {
                dexitprintk(ioc,
                            ioc_info(ioc, "config_page(0x%p): free\n",
diff --combined drivers/scsi/scsi.c
index 9feb0323bc44a536703faa5801ccd587bcc1e5ab,00ee47a04403fdedf24566338f17e99e4e5915c2..7d2210a006f0d44b1c71233e0bc8d684ec4f77ae
@@@ -309,8 -309,8 +309,8 @@@ static int scsi_vpd_inquiry(struct scsi
         * I'm not convinced we need to try quite this hard to get VPD, but
         * all the existing users tried this hard.
         */
-       result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer,
-                                 len, NULL, 30 * HZ, 3, NULL);
+       result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, len,
+                                 30 * HZ, 3, NULL);
        if (result)
                return -EIO;
  
@@@ -510,6 -510,9 +510,9 @@@ int scsi_report_opcode(struct scsi_devi
        unsigned char cmd[16];
        struct scsi_sense_hdr sshdr;
        int result, request_len;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+       };
  
        if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3)
                return -EINVAL;
        put_unaligned_be32(request_len, &cmd[6]);
        memset(buffer, 0, len);
  
-       result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer,
-                                 request_len, &sshdr, 30 * HZ, 3, NULL);
+       result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer,
+                                 request_len, 30 * HZ, 3, &exec_args);
        if (result < 0)
                return result;
        if (result && scsi_sense_valid(&sshdr) &&
@@@ -588,6 -590,8 +590,6 @@@ void scsi_device_put(struct scsi_devic
  {
        struct module *mod = sdev->host->hostt->module;
  
 -      might_sleep();
 -
        put_device(&sdev->sdev_gendev);
        module_put(mod);
  }
diff --combined drivers/scsi/scsi_scan.c
index f9b18fdc7b3c8ea3c3b552e49c7ee943ca8f61f0,a62925355c2cbbcdbd5157b7a5b13a5491584062..4e842d79de317c2e7ed5a54e45f1fd32aa07b908
@@@ -210,7 -210,7 +210,7 @@@ static void scsi_unlock_floptical(struc
        scsi_cmd[3] = 0;
        scsi_cmd[4] = 0x2a;     /* size */
        scsi_cmd[5] = 0;
-       scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL,
+       scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, result, 0x2a,
                         SCSI_TIMEOUT, 3, NULL);
  }
  
@@@ -646,8 -646,12 +646,12 @@@ static int scsi_probe_lun(struct scsi_d
        unsigned char scsi_cmd[MAX_COMMAND_SIZE];
        int first_inquiry_len, try_inquiry_len, next_inquiry_len;
        int response_len = 0;
-       int pass, count, result;
+       int pass, count, result, resid;
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+               .resid = &resid,
+       };
  
        *bflags = 0;
  
  
        /* Each pass gets up to three chances to ignore Unit Attention */
        for (count = 0; count < 3; ++count) {
-               int resid;
                memset(scsi_cmd, 0, 6);
                scsi_cmd[0] = INQUIRY;
                scsi_cmd[4] = (unsigned char) try_inquiry_len;
  
                memset(inq_result, 0, try_inquiry_len);
  
-               result = scsi_execute_req(sdev,  scsi_cmd, DMA_FROM_DEVICE,
-                                         inq_result, try_inquiry_len, &sshdr,
+               result = scsi_execute_cmd(sdev,  scsi_cmd, REQ_OP_DRV_IN,
+                                         inq_result, try_inquiry_len,
                                          HZ / 2 + HZ * scsi_inq_timeout, 3,
-                                         &resid);
+                                         &exec_args);
  
                SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
                                "scsi scan: INQUIRY %s with code 0x%x\n",
@@@ -1232,7 -1234,8 +1234,7 @@@ static int scsi_probe_and_add_lun(struc
         * that no LUN is present, so don't add sdev in these cases.
         * Two specific examples are:
         * 1) NetApp targets: return PQ=1, PDT=0x1f
 -       * 2) IBM/2145 targets: return PQ=1, PDT=0
 -       * 3) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
 +       * 2) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
         *    in the UFI 1.0 spec (we cannot rely on reserved bits).
         *
         * References:
         * PDT=00h Direct-access device (floppy)
         * PDT=1Fh none (no FDD connected to the requested logical unit)
         */
 -      if (((result[0] >> 5) == 1 ||
 -          (starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f)) &&
 +      if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) &&
 +          (result[0] & 0x1f) == 0x1f &&
            !scsi_is_wlun(lun)) {
                SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
                                        "scsi scan: peripheral device type"
@@@ -1401,6 -1404,9 +1403,9 @@@ static int scsi_report_lun_scan(struct 
        struct scsi_sense_hdr sshdr;
        struct scsi_device *sdev;
        struct Scsi_Host *shost = dev_to_shost(&starget->dev);
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+       };
        int ret = 0;
  
        /*
@@@ -1475,9 -1481,10 +1480,10 @@@ retry
                                "scsi scan: Sending REPORT LUNS to (try %d)\n",
                                retries));
  
-               result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE,
-                                         lun_data, length, &sshdr,
-                                         SCSI_REPORT_LUNS_TIMEOUT, 3, NULL);
+               result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN,
+                                         lun_data, length,
+                                         SCSI_REPORT_LUNS_TIMEOUT, 3,
+                                         &exec_args);
  
                SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
                                "scsi scan: REPORT LUNS"
diff --combined drivers/scsi/sd.c
index 277960decc104bad2d74bc9caf222d1b4e7e216e,2aa3b0393b96a6ac937d2404629154e44a4db712..a38c71511bc94b7a8637eb4a2d81471edc3b2ce3
@@@ -664,6 -664,9 +664,9 @@@ static int sd_sec_submit(void *data, u1
        struct scsi_disk *sdkp = data;
        struct scsi_device *sdev = sdkp->device;
        u8 cdb[12] = { 0, };
+       const struct scsi_exec_args exec_args = {
+               .req_flags = BLK_MQ_REQ_PM,
+       };
        int ret;
  
        cdb[0] = send ? SECURITY_PROTOCOL_OUT : SECURITY_PROTOCOL_IN;
        put_unaligned_be16(spsp, &cdb[2]);
        put_unaligned_be32(len, &cdb[6]);
  
-       ret = scsi_execute(sdev, cdb, send ? DMA_TO_DEVICE : DMA_FROM_DEVICE,
-               buffer, len, NULL, NULL, SD_TIMEOUT, sdkp->max_retries, 0,
-               RQF_PM, NULL);
+       ret = scsi_execute_cmd(sdev, cdb, send ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
+                              buffer, len, SD_TIMEOUT, sdkp->max_retries,
+                              &exec_args);
        return ret <= 0 ? ret : -EIO;
  }
  #endif /* CONFIG_BLK_SED_OPAL */
@@@ -831,19 -834,6 +834,19 @@@ static void sd_config_discard(struct sc
        blk_queue_max_discard_sectors(q, max_blocks * (logical_block_size >> 9));
  }
  
 +static void *sd_set_special_bvec(struct request *rq, unsigned int data_len)
 +{
 +      struct page *page;
 +
 +      page = mempool_alloc(sd_page_pool, GFP_ATOMIC);
 +      if (!page)
 +              return NULL;
 +      clear_highpage(page);
 +      bvec_set_page(&rq->special_vec, page, data_len, 0);
 +      rq->rq_flags |= RQF_SPECIAL_PAYLOAD;
 +      return bvec_virt(&rq->special_vec);
 +}
 +
  static blk_status_t sd_setup_unmap_cmnd(struct scsi_cmnd *cmd)
  {
        struct scsi_device *sdp = cmd->device;
        unsigned int data_len = 24;
        char *buf;
  
 -      rq->special_vec.bv_page = mempool_alloc(sd_page_pool, GFP_ATOMIC);
 -      if (!rq->special_vec.bv_page)
 +      buf = sd_set_special_bvec(rq, data_len);
 +      if (!buf)
                return BLK_STS_RESOURCE;
 -      clear_highpage(rq->special_vec.bv_page);
 -      rq->special_vec.bv_offset = 0;
 -      rq->special_vec.bv_len = data_len;
 -      rq->rq_flags |= RQF_SPECIAL_PAYLOAD;
  
        cmd->cmd_len = 10;
        cmd->cmnd[0] = UNMAP;
        cmd->cmnd[8] = 24;
  
 -      buf = bvec_virt(&rq->special_vec);
        put_unaligned_be16(6 + 16, &buf[0]);
        put_unaligned_be16(16, &buf[2]);
        put_unaligned_be64(lba, &buf[8]);
@@@ -884,8 -879,13 +887,8 @@@ static blk_status_t sd_setup_write_same
        u32 nr_blocks = sectors_to_logical(sdp, blk_rq_sectors(rq));
        u32 data_len = sdp->sector_size;
  
 -      rq->special_vec.bv_page = mempool_alloc(sd_page_pool, GFP_ATOMIC);
 -      if (!rq->special_vec.bv_page)
 +      if (!sd_set_special_bvec(rq, data_len))
                return BLK_STS_RESOURCE;
 -      clear_highpage(rq->special_vec.bv_page);
 -      rq->special_vec.bv_offset = 0;
 -      rq->special_vec.bv_len = data_len;
 -      rq->rq_flags |= RQF_SPECIAL_PAYLOAD;
  
        cmd->cmd_len = 16;
        cmd->cmnd[0] = WRITE_SAME_16;
@@@ -911,8 -911,13 +914,8 @@@ static blk_status_t sd_setup_write_same
        u32 nr_blocks = sectors_to_logical(sdp, blk_rq_sectors(rq));
        u32 data_len = sdp->sector_size;
  
 -      rq->special_vec.bv_page = mempool_alloc(sd_page_pool, GFP_ATOMIC);
 -      if (!rq->special_vec.bv_page)
 +      if (!sd_set_special_bvec(rq, data_len))
                return BLK_STS_RESOURCE;
 -      clear_highpage(rq->special_vec.bv_page);
 -      rq->special_vec.bv_offset = 0;
 -      rq->special_vec.bv_len = data_len;
 -      rq->rq_flags |= RQF_SPECIAL_PAYLOAD;
  
        cmd->cmd_len = 10;
        cmd->cmnd[0] = WRITE_SAME;
@@@ -1581,13 -1586,16 +1584,16 @@@ static int sd_sync_cache(struct scsi_di
        const int timeout = sdp->request_queue->rq_timeout
                * SD_FLUSH_TIMEOUT_MULTIPLIER;
        struct scsi_sense_hdr my_sshdr;
+       const struct scsi_exec_args exec_args = {
+               .req_flags = BLK_MQ_REQ_PM,
+               /* caller might not be interested in sense, but we need it */
+               .sshdr = sshdr ? : &my_sshdr,
+       };
  
        if (!scsi_device_online(sdp))
                return -ENODEV;
  
-       /* caller might not be interested in sense, but we need it */
-       if (!sshdr)
-               sshdr = &my_sshdr;
+       sshdr = exec_args.sshdr;
  
        for (retries = 3; retries > 0; --retries) {
                unsigned char cmd[16] = { 0 };
                 * Leave the rest of the command zero to indicate
                 * flush everything.
                 */
-               res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, sshdr,
-                               timeout, sdkp->max_retries, 0, RQF_PM, NULL);
+               res = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, NULL, 0,
+                                      timeout, sdkp->max_retries, &exec_args);
                if (res == 0)
                        break;
        }
@@@ -1743,6 -1751,9 +1749,9 @@@ static int sd_pr_command(struct block_d
        struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk);
        struct scsi_device *sdev = sdkp->device;
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+       };
        int result;
        u8 cmd[16] = { 0, };
        u8 data[24] = { 0, };
        put_unaligned_be64(sa_key, &data[8]);
        data[20] = flags;
  
-       result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, &data, sizeof(data),
-                       &sshdr, SD_TIMEOUT, sdkp->max_retries, NULL);
+       result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_OUT, &data,
+                                 sizeof(data), SD_TIMEOUT, sdkp->max_retries,
+                                 &exec_args);
  
        if (scsi_status_is_check_condition(result) &&
            scsi_sense_valid(&sshdr)) {
@@@ -2086,6 -2098,9 +2096,9 @@@ sd_spinup_disk(struct scsi_disk *sdkp
        int retries, spintime;
        unsigned int the_result;
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+       };
        int sense_valid = 0;
  
        spintime = 0;
                        cmd[0] = TEST_UNIT_READY;
                        memset((void *) &cmd[1], 0, 9);
  
-                       the_result = scsi_execute_req(sdkp->device, cmd,
-                                                     DMA_NONE, NULL, 0,
-                                                     &sshdr, SD_TIMEOUT,
-                                                     sdkp->max_retries, NULL);
+                       the_result = scsi_execute_cmd(sdkp->device, cmd,
+                                                     REQ_OP_DRV_IN, NULL, 0,
+                                                     SD_TIMEOUT,
+                                                     sdkp->max_retries,
+                                                     &exec_args);
  
                        /*
                         * If the drive has indicated to us that it
                                cmd[4] = 1;     /* Start spin cycle */
                                if (sdkp->device->start_stop_pwr_cond)
                                        cmd[4] |= 1 << 4;
-                               scsi_execute_req(sdkp->device, cmd, DMA_NONE,
-                                                NULL, 0, &sshdr,
+                               scsi_execute_cmd(sdkp->device, cmd,
+                                                REQ_OP_DRV_IN, NULL, 0,
                                                 SD_TIMEOUT, sdkp->max_retries,
-                                                NULL);
+                                                &exec_args);
                                spintime_expire = jiffies + 100 * HZ;
                                spintime = 1;
                        }
@@@ -2294,6 -2310,9 +2308,9 @@@ static int read_capacity_16(struct scsi
  {
        unsigned char cmd[16];
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+       };
        int sense_valid = 0;
        int the_result;
        int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET;
                cmd[13] = RC16_LEN;
                memset(buffer, 0, RC16_LEN);
  
-               the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE,
-                                       buffer, RC16_LEN, &sshdr,
-                                       SD_TIMEOUT, sdkp->max_retries, NULL);
+               the_result = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN,
+                                             buffer, RC16_LEN, SD_TIMEOUT,
+                                             sdkp->max_retries, &exec_args);
  
                if (media_not_present(sdkp, &sshdr))
                        return -ENODEV;
@@@ -2385,6 -2404,9 +2402,9 @@@ static int read_capacity_10(struct scsi
  {
        unsigned char cmd[16];
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+       };
        int sense_valid = 0;
        int the_result;
        int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET;
                memset(&cmd[1], 0, 9);
                memset(buffer, 0, 8);
  
-               the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE,
-                                       buffer, 8, &sshdr,
-                                       SD_TIMEOUT, sdkp->max_retries, NULL);
+               the_result = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, buffer,
+                                             8, SD_TIMEOUT, sdkp->max_retries,
+                                             &exec_args);
  
                if (media_not_present(sdkp, &sshdr))
                        return -ENODEV;
@@@ -3635,6 -3657,10 +3655,10 @@@ static int sd_start_stop_device(struct 
  {
        unsigned char cmd[6] = { START_STOP };  /* START_VALID */
        struct scsi_sense_hdr sshdr;
+       const struct scsi_exec_args exec_args = {
+               .sshdr = &sshdr,
+               .req_flags = BLK_MQ_REQ_PM,
+       };
        struct scsi_device *sdp = sdkp->device;
        int res;
  
        if (!scsi_device_online(sdp))
                return -ENODEV;
  
-       res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
-                       SD_TIMEOUT, sdkp->max_retries, 0, RQF_PM, NULL);
+       res = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, SD_TIMEOUT,
+                              sdkp->max_retries, &exec_args);
        if (res) {
                sd_print_result(sdkp, "Start/Stop Unit failed", res);
                if (res > 0 && scsi_sense_valid(&sshdr)) {
@@@ -3788,10 -3814,13 +3812,13 @@@ static int sd_resume_runtime(struct dev
        if (sdp->ignore_media_change) {
                /* clear the device's sense data */
                static const u8 cmd[10] = { REQUEST_SENSE };
+               const struct scsi_exec_args exec_args = {
+                       .req_flags = BLK_MQ_REQ_PM,
+               };
  
-               if (scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL,
-                                NULL, sdp->request_queue->rq_timeout, 1, 0,
-                                RQF_PM, NULL))
+               if (scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, NULL, 0,
+                                    sdp->request_queue->rq_timeout, 1,
+                                    &exec_args))
                        sd_printk(KERN_NOTICE, sdkp,
                                  "Failed to clear sense data\n");
        }
index 3a1c4d31e010dadf0644bf27a4d4b2c1de587468,3b3cf78d3b100d23561e7c4f5765c089f0469b61..276a82b2e5ee3e691bbf0c327ab5f49387824ae6
  #define UFSHCD_ENABLE_INTRS   (UTP_TRANSFER_REQ_COMPL |\
                                 UTP_TASK_REQ_COMPL |\
                                 UFSHCD_ERROR_MASK)
+ #define UFSHCD_ENABLE_MCQ_INTRS       (UTP_TASK_REQ_COMPL |\
+                                UFSHCD_ERROR_MASK |\
+                                MCQ_CQ_EVENT_STATUS)
  /* UIC command timeout, unit: ms */
  #define UIC_CMD_TIMEOUT       500
  
@@@ -56,6 -62,9 +62,9 @@@
  /* Query request timeout */
  #define QUERY_REQ_TIMEOUT 1500 /* 1.5 seconds */
  
+ /* Advanced RPMB request timeout */
+ #define ADVANCED_RPMB_REQ_TIMEOUT  3000 /* 3 seconds */
  /* Task management command timeout */
  #define TM_CMD_TIMEOUT        100 /* msecs */
  
  /* Polling time to wait for fDeviceInit */
  #define FDEVICEINIT_COMPL_TIMEOUT 1500 /* millisecs */
  
+ /* UFSHC 4.0 compliant HC support this mode, refer param_set_mcq_mode() */
+ static bool use_mcq_mode = true;
+ static bool is_mcq_supported(struct ufs_hba *hba)
+ {
+       return hba->mcq_sup && use_mcq_mode;
+ }
+ static int param_set_mcq_mode(const char *val, const struct kernel_param *kp)
+ {
+       int ret;
+       ret = param_set_bool(val, kp);
+       if (ret)
+               return ret;
+       return 0;
+ }
+ static const struct kernel_param_ops mcq_mode_ops = {
+       .set = param_set_mcq_mode,
+       .get = param_get_bool,
+ };
+ module_param_cb(use_mcq_mode, &mcq_mode_ops, &use_mcq_mode, 0644);
+ MODULE_PARM_DESC(use_mcq_mode, "Control MCQ mode for controllers starting from UFSHCI 4.0. 1 - enable MCQ, 0 - disable MCQ. MCQ is enabled by default");
  #define ufshcd_toggle_vreg(_dev, _vreg, _on)                          \
        ({                                                              \
                int _ret;                                               \
@@@ -528,7 -564,7 +564,7 @@@ void ufshcd_print_trs(struct ufs_hba *h
                prdt_length = le16_to_cpu(
                        lrbp->utr_descriptor_ptr->prd_table_length);
                if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN)
-                       prdt_length /= sizeof(struct ufshcd_sg_entry);
+                       prdt_length /= ufshcd_sg_entry_size(hba);
  
                dev_err(hba->dev,
                        "UPIU[%d] - PRDT - %d entries  phys@0x%llx\n",
  
                if (pr_prdt)
                        ufshcd_hex_dump("UPIU PRDT: ", lrbp->ucd_prdt_ptr,
-                               sizeof(struct ufshcd_sg_entry) * prdt_length);
+                               ufshcd_sg_entry_size(hba) * prdt_length);
        }
  }
  
@@@ -740,12 -776,17 +776,17 @@@ static inline bool ufshcd_is_device_pre
  /**
   * ufshcd_get_tr_ocs - Get the UTRD Overall Command Status
   * @lrbp: pointer to local command reference block
+  * @cqe: pointer to the completion queue entry
   *
   * This function is used to get the OCS field from UTRD
   * Returns the OCS field in the UTRD
   */
- static enum utp_ocs ufshcd_get_tr_ocs(struct ufshcd_lrb *lrbp)
+ static enum utp_ocs ufshcd_get_tr_ocs(struct ufshcd_lrb *lrbp,
+                                     struct cq_entry *cqe)
  {
+       if (cqe)
+               return le32_to_cpu(cqe->status) & MASK_OCS;
        return le32_to_cpu(lrbp->utr_descriptor_ptr->header.dword_2) & MASK_OCS;
  }
  
@@@ -1121,6 -1162,12 +1162,12 @@@ static u32 ufshcd_pending_cmds(struct u
        return pending;
  }
  
+ /*
+  * Wait until all pending SCSI commands and TMFs have finished or the timeout
+  * has expired.
+  *
+  * Return: 0 upon success; -EBUSY upon timeout.
+  */
  static int ufshcd_wait_for_doorbell_clr(struct ufs_hba *hba,
                                        u64 wait_timeout_us)
  {
                }
  
                spin_unlock_irqrestore(hba->host->host_lock, flags);
-               schedule();
+               io_schedule_timeout(msecs_to_jiffies(20));
                if (ktime_to_us(ktime_sub(ktime_get(), start)) >
                    wait_timeout_us) {
                        timeout = true;
@@@ -1225,23 -1272,26 +1272,28 @@@ static int ufshcd_scale_gear(struct ufs
        return ret;
  }
  
- static int ufshcd_clock_scaling_prepare(struct ufs_hba *hba)
+ /*
+  * Wait until all pending SCSI commands and TMFs have finished or the timeout
+  * has expired.
+  *
+  * Return: 0 upon success; -EBUSY upon timeout.
+  */
+ static int ufshcd_clock_scaling_prepare(struct ufs_hba *hba, u64 timeout_us)
  {
-       #define DOORBELL_CLR_TOUT_US            (1000 * 1000) /* 1 sec */
        int ret = 0;
        /*
         * make sure that there are no outstanding requests when
         * clock scaling is in progress
         */
        ufshcd_scsi_block_requests(hba);
 +      mutex_lock(&hba->wb_mutex);
        down_write(&hba->clk_scaling_lock);
  
        if (!hba->clk_scaling.is_allowed ||
-           ufshcd_wait_for_doorbell_clr(hba, DOORBELL_CLR_TOUT_US)) {
+           ufshcd_wait_for_doorbell_clr(hba, timeout_us)) {
                ret = -EBUSY;
                up_write(&hba->clk_scaling_lock);
 +              mutex_unlock(&hba->wb_mutex);
                ufshcd_scsi_unblock_requests(hba);
                goto out;
        }
        return ret;
  }
  
 -static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, bool writelock)
 +static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, int err, bool scale_up)
  {
 -      if (writelock)
 -              up_write(&hba->clk_scaling_lock);
 -      else
 -              up_read(&hba->clk_scaling_lock);
 +      up_write(&hba->clk_scaling_lock);
 +
 +      /* Enable Write Booster if we have scaled up else disable it */
 +      if (ufshcd_enable_wb_if_scaling_up(hba) && !err)
 +              ufshcd_wb_toggle(hba, scale_up);
 +
 +      mutex_unlock(&hba->wb_mutex);
 +
        ufshcd_scsi_unblock_requests(hba);
        ufshcd_release(hba);
  }
  static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up)
  {
        int ret = 0;
 -      bool is_writelock = true;
  
-       ret = ufshcd_clock_scaling_prepare(hba);
+       ret = ufshcd_clock_scaling_prepare(hba, 1 * USEC_PER_SEC);
        if (ret)
                return ret;
  
                }
        }
  
 -      /* Enable Write Booster if we have scaled up else disable it */
 -      if (ufshcd_enable_wb_if_scaling_up(hba)) {
 -              downgrade_write(&hba->clk_scaling_lock);
 -              is_writelock = false;
 -              ufshcd_wb_toggle(hba, scale_up);
 -      }
 -
  out_unprepare:
 -      ufshcd_clock_scaling_unprepare(hba, is_writelock);
 +      ufshcd_clock_scaling_unprepare(hba, ret, scale_up);
        return ret;
  }
  
@@@ -2136,9 -2190,11 +2188,11 @@@ static void ufshcd_update_monitor(struc
   * ufshcd_send_command - Send SCSI or device management commands
   * @hba: per adapter instance
   * @task_tag: Task tag of the command
+  * @hwq: pointer to hardware queue instance
   */
  static inline
- void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag)
+ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag,
+                        struct ufs_hw_queue *hwq)
  {
        struct ufshcd_lrb *lrbp = &hba->lrb[task_tag];
        unsigned long flags;
        if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))
                ufshcd_start_monitor(hba, lrbp);
  
-       spin_lock_irqsave(&hba->outstanding_lock, flags);
-       if (hba->vops && hba->vops->setup_xfer_req)
-               hba->vops->setup_xfer_req(hba, task_tag, !!lrbp->cmd);
-       __set_bit(task_tag, &hba->outstanding_reqs);
-       ufshcd_writel(hba, 1 << task_tag, REG_UTP_TRANSFER_REQ_DOOR_BELL);
-       spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+       if (is_mcq_enabled(hba)) {
+               int utrd_size = sizeof(struct utp_transfer_req_desc);
+               spin_lock(&hwq->sq_lock);
+               memcpy(hwq->sqe_base_addr + (hwq->sq_tail_slot * utrd_size),
+                      lrbp->utr_descriptor_ptr, utrd_size);
+               ufshcd_inc_sq_tail(hwq);
+               spin_unlock(&hwq->sq_lock);
+       } else {
+               spin_lock_irqsave(&hba->outstanding_lock, flags);
+               if (hba->vops && hba->vops->setup_xfer_req)
+                       hba->vops->setup_xfer_req(hba, lrbp->task_tag,
+                                                 !!lrbp->cmd);
+               __set_bit(lrbp->task_tag, &hba->outstanding_reqs);
+               ufshcd_writel(hba, 1 << lrbp->task_tag,
+                             REG_UTP_TRANSFER_REQ_DOOR_BELL);
+               spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+       }
  }
  
  /**
@@@ -2245,6 -2313,14 +2311,14 @@@ static inline int ufshcd_hba_capabiliti
        if (err)
                dev_err(hba->dev, "crypto setup failed\n");
  
+       hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities);
+       if (!hba->mcq_sup)
+               return err;
+       hba->mcq_capabilities = ufshcd_readl(hba, REG_MCQCAP);
+       hba->ext_iid_sup = FIELD_GET(MASK_EXT_IID_SUPPORT,
+                                    hba->mcq_capabilities);
        return err;
  }
  
@@@ -2397,38 -2473,30 +2471,30 @@@ int ufshcd_send_uic_cmd(struct ufs_hba 
  }
  
  /**
-  * ufshcd_map_sg - Map scatter-gather list to prdt
-  * @hba: per adapter instance
-  * @lrbp: pointer to local reference block
-  *
-  * Returns 0 in case of success, non-zero value in case of failure
+  * ufshcd_sgl_to_prdt - SG list to PRTD (Physical Region Description Table, 4DW format)
+  * @hba:      per-adapter instance
+  * @lrbp:     pointer to local reference block
+  * @sg_entries:       The number of sg lists actually used
+  * @sg_list:  Pointer to SG list
   */
- static int ufshcd_map_sg(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
+ static void ufshcd_sgl_to_prdt(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, int sg_entries,
+                              struct scatterlist *sg_list)
  {
-       struct ufshcd_sg_entry *prd_table;
+       struct ufshcd_sg_entry *prd;
        struct scatterlist *sg;
-       struct scsi_cmnd *cmd;
-       int sg_segments;
        int i;
  
-       cmd = lrbp->cmd;
-       sg_segments = scsi_dma_map(cmd);
-       if (sg_segments < 0)
-               return sg_segments;
-       if (sg_segments) {
+       if (sg_entries) {
  
                if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN)
                        lrbp->utr_descriptor_ptr->prd_table_length =
-                               cpu_to_le16((sg_segments *
-                                       sizeof(struct ufshcd_sg_entry)));
+                               cpu_to_le16(sg_entries * ufshcd_sg_entry_size(hba));
                else
-                       lrbp->utr_descriptor_ptr->prd_table_length =
-                               cpu_to_le16(sg_segments);
+                       lrbp->utr_descriptor_ptr->prd_table_length = cpu_to_le16(sg_entries);
  
-               prd_table = lrbp->ucd_prdt_ptr;
+               prd = lrbp->ucd_prdt_ptr;
  
-               scsi_for_each_sg(cmd, sg, sg_segments, i) {
+               for_each_sg(sg_list, sg, sg_entries, i) {
                        const unsigned int len = sg_dma_len(sg);
  
                        /*
                         * indicates 4 bytes, '7' indicates 8 bytes, etc."
                         */
                        WARN_ONCE(len > 256 * 1024, "len = %#x\n", len);
-                       prd_table[i].size = cpu_to_le32(len - 1);
-                       prd_table[i].addr = cpu_to_le64(sg->dma_address);
-                       prd_table[i].reserved = 0;
+                       prd->size = cpu_to_le32(len - 1);
+                       prd->addr = cpu_to_le64(sg->dma_address);
+                       prd->reserved = 0;
+                       prd = (void *)prd + ufshcd_sg_entry_size(hba);
                }
        } else {
                lrbp->utr_descriptor_ptr->prd_table_length = 0;
        }
+ }
+ /**
+  * ufshcd_map_sg - Map scatter-gather list to prdt
+  * @hba: per adapter instance
+  * @lrbp: pointer to local reference block
+  *
+  * Returns 0 in case of success, non-zero value in case of failure
+  */
+ static int ufshcd_map_sg(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
+ {
+       struct scsi_cmnd *cmd = lrbp->cmd;
+       int sg_segments = scsi_dma_map(cmd);
+       if (sg_segments < 0)
+               return sg_segments;
+       ufshcd_sgl_to_prdt(hba, lrbp, sg_segments, scsi_sglist(cmd));
  
        return 0;
  }
@@@ -2494,14 -2581,15 +2579,15 @@@ static void ufshcd_disable_intr(struct 
  }
  
  /**
-  * ufshcd_prepare_req_desc_hdr() - Fills the requests header
+  * ufshcd_prepare_req_desc_hdr - Fill UTP Transfer request descriptor header according to request
   * descriptor according to request
   * @lrbp: pointer to local reference block
   * @upiu_flags: flags required in the header
   * @cmd_dir: requests data direction
+  * @ehs_length: Total EHS Length (in 32‐bytes units of all Extra Header Segments)
   */
- static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp,
-                       u8 *upiu_flags, enum dma_data_direction cmd_dir)
+ static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp, u8 *upiu_flags,
+                                       enum dma_data_direction cmd_dir, int ehs_length)
  {
        struct utp_transfer_req_desc *req_desc = lrbp->utr_descriptor_ptr;
        u32 data_direction;
                *upiu_flags = UPIU_CMD_FLAGS_NONE;
        }
  
-       dword_0 = data_direction | (lrbp->command_type
-                               << UPIU_COMMAND_TYPE_OFFSET);
+       dword_0 = data_direction | (lrbp->command_type << UPIU_COMMAND_TYPE_OFFSET) |
+               ehs_length << 8;
        if (lrbp->intr_cmd)
                dword_0 |= UTP_REQ_DESC_INT_CMD;
  
@@@ -2576,8 -2664,7 +2662,7 @@@ void ufshcd_prepare_utp_scsi_cmd_upiu(s
  }
  
  /**
-  * ufshcd_prepare_utp_query_req_upiu() - fills the utp_transfer_req_desc,
-  * for query requsts
+  * ufshcd_prepare_utp_query_req_upiu() - fill the utp_transfer_req_desc for query request
   * @hba: UFS hba
   * @lrbp: local reference block pointer
   * @upiu_flags: flags
@@@ -2648,7 -2735,7 +2733,7 @@@ static int ufshcd_compose_devman_upiu(s
        else
                lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
  
-       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE);
+       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE, 0);
        if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY)
                ufshcd_prepare_utp_query_req_upiu(hba, lrbp, upiu_flags);
        else if (hba->dev_cmd.type == DEV_CMD_TYPE_NOP)
@@@ -2676,8 -2763,7 +2761,7 @@@ static int ufshcd_comp_scsi_upiu(struc
                lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
  
        if (likely(lrbp->cmd)) {
-               ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
-                                               lrbp->cmd->sc_data_direction);
+               ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, lrbp->cmd->sc_data_direction, 0);
                ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
        } else {
                ret = -EINVAL;
@@@ -2709,33 -2795,38 +2793,38 @@@ static inline bool is_device_wlun(struc
   */
  static void ufshcd_map_queues(struct Scsi_Host *shost)
  {
-       int i;
+       struct ufs_hba *hba = shost_priv(shost);
+       int i, queue_offset = 0;
+       if (!is_mcq_supported(hba)) {
+               hba->nr_queues[HCTX_TYPE_DEFAULT] = 1;
+               hba->nr_queues[HCTX_TYPE_READ] = 0;
+               hba->nr_queues[HCTX_TYPE_POLL] = 1;
+               hba->nr_hw_queues = 1;
+       }
  
        for (i = 0; i < shost->nr_maps; i++) {
                struct blk_mq_queue_map *map = &shost->tag_set.map[i];
  
-               switch (i) {
-               case HCTX_TYPE_DEFAULT:
-               case HCTX_TYPE_POLL:
-                       map->nr_queues = 1;
-                       break;
-               case HCTX_TYPE_READ:
-                       map->nr_queues = 0;
+               map->nr_queues = hba->nr_queues[i];
+               if (!map->nr_queues)
                        continue;
-               default:
-                       WARN_ON_ONCE(true);
-               }
-               map->queue_offset = 0;
+               map->queue_offset = queue_offset;
+               if (i == HCTX_TYPE_POLL && !is_mcq_supported(hba))
+                       map->queue_offset = 0;
                blk_mq_map_queues(map);
+               queue_offset += map->nr_queues;
        }
  }
  
  static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
  {
-       struct utp_transfer_cmd_desc *cmd_descp = hba->ucdl_base_addr;
+       struct utp_transfer_cmd_desc *cmd_descp = (void *)hba->ucdl_base_addr +
+               i * sizeof_utp_transfer_cmd_desc(hba);
        struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr;
        dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr +
-               i * sizeof(struct utp_transfer_cmd_desc);
+               i * sizeof_utp_transfer_cmd_desc(hba);
        u16 response_offset = offsetof(struct utp_transfer_cmd_desc,
                                       response_upiu);
        u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table);
        lrb->utr_descriptor_ptr = utrdlp + i;
        lrb->utrd_dma_addr = hba->utrdl_dma_addr +
                i * sizeof(struct utp_transfer_req_desc);
-       lrb->ucd_req_ptr = (struct utp_upiu_req *)(cmd_descp + i);
+       lrb->ucd_req_ptr = (struct utp_upiu_req *)cmd_descp->command_upiu;
        lrb->ucd_req_dma_addr = cmd_desc_element_addr;
-       lrb->ucd_rsp_ptr = (struct utp_upiu_rsp *)cmd_descp[i].response_upiu;
+       lrb->ucd_rsp_ptr = (struct utp_upiu_rsp *)cmd_descp->response_upiu;
        lrb->ucd_rsp_dma_addr = cmd_desc_element_addr + response_offset;
-       lrb->ucd_prdt_ptr = cmd_descp[i].prd_table;
+       lrb->ucd_prdt_ptr = (struct ufshcd_sg_entry *)cmd_descp->prd_table;
        lrb->ucd_prdt_dma_addr = cmd_desc_element_addr + prdt_offset;
  }
  
@@@ -2764,6 -2855,7 +2853,7 @@@ static int ufshcd_queuecommand(struct S
        int tag = scsi_cmd_to_rq(cmd)->tag;
        struct ufshcd_lrb *lrbp;
        int err = 0;
+       struct ufs_hw_queue *hwq = NULL;
  
        WARN_ONCE(tag < 0 || tag >= hba->nutrs, "Invalid tag %d\n", tag);
  
                goto out;
        }
  
-       ufshcd_send_command(hba, tag);
+       if (is_mcq_enabled(hba))
+               hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd));
+       ufshcd_send_command(hba, tag, hwq);
  
  out:
        rcu_read_unlock();
@@@ -2943,6 -3038,12 +3036,12 @@@ ufshcd_dev_cmd_completion(struct ufs_hb
                dev_err(hba->dev, "%s: Reject UPIU not fully implemented\n",
                                __func__);
                break;
+       case UPIU_TRANSACTION_RESPONSE:
+               if (hba->dev_cmd.type != DEV_CMD_TYPE_RPMB) {
+                       err = -EINVAL;
+                       dev_err(hba->dev, "%s: unexpected response %x\n", __func__, resp);
+               }
+               break;
        default:
                err = -EINVAL;
                dev_err(hba->dev, "%s: Invalid device management cmd response: %x\n",
@@@ -2972,7 -3073,7 +3071,7 @@@ retry
                 * not trigger any race conditions.
                 */
                hba->dev_cmd.complete = NULL;
-               err = ufshcd_get_tr_ocs(lrbp);
+               err = ufshcd_get_tr_ocs(lrbp, hba->dev_cmd.cqe);
                if (!err)
                        err = ufshcd_dev_cmd_completion(hba, lrbp);
        } else {
                } else {
                        dev_err(hba->dev, "%s: failed to clear tag %d\n",
                                __func__, lrbp->task_tag);
+                       spin_lock_irqsave(&hba->outstanding_lock, flags);
+                       pending = test_bit(lrbp->task_tag,
+                                          &hba->outstanding_reqs);
+                       if (pending)
+                               hba->dev_cmd.complete = NULL;
+                       spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+                       if (!pending) {
+                               /*
+                                * The completion handler ran while we tried to
+                                * clear the command.
+                                */
+                               time_left = 1;
+                               goto retry;
+                       }
                }
        }
  
@@@ -3043,10 -3160,11 +3158,11 @@@ static int ufshcd_exec_dev_cmd(struct u
                goto out;
  
        hba->dev_cmd.complete = &wait;
+       hba->dev_cmd.cqe = NULL;
  
        ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr);
  
-       ufshcd_send_command(hba, tag);
+       ufshcd_send_command(hba, tag, hba->dev_cmd_queue);
        err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout);
        ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,
                                    (struct utp_upiu_req *)lrbp->ucd_rsp_ptr);
@@@ -3366,37 -3484,6 +3482,6 @@@ int ufshcd_query_descriptor_retry(struc
        return err;
  }
  
- /**
-  * ufshcd_map_desc_id_to_length - map descriptor IDN to its length
-  * @hba: Pointer to adapter instance
-  * @desc_id: descriptor idn value
-  * @desc_len: mapped desc length (out)
-  */
- void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
-                                 int *desc_len)
- {
-       if (desc_id >= QUERY_DESC_IDN_MAX || desc_id == QUERY_DESC_IDN_RFU_0 ||
-           desc_id == QUERY_DESC_IDN_RFU_1)
-               *desc_len = 0;
-       else
-               *desc_len = hba->desc_size[desc_id];
- }
- EXPORT_SYMBOL(ufshcd_map_desc_id_to_length);
- static void ufshcd_update_desc_length(struct ufs_hba *hba,
-                                     enum desc_idn desc_id, int desc_index,
-                                     unsigned char desc_len)
- {
-       if (hba->desc_size[desc_id] == QUERY_DESC_MAX_SIZE &&
-           desc_id != QUERY_DESC_IDN_STRING && desc_index != UFS_RPMB_UNIT)
-               /* For UFS 3.1, the normal unit descriptor is 10 bytes larger
-                * than the RPMB unit, however, both descriptors share the same
-                * desc_idn, to cover both unit descriptors with one length, we
-                * choose the normal unit descriptor length by desc_index.
-                */
-               hba->desc_size[desc_id] = desc_len;
- }
  /**
   * ufshcd_read_desc_param - read the specified descriptor parameter
   * @hba: Pointer to adapter instance
@@@ -3417,26 -3504,13 +3502,13 @@@ int ufshcd_read_desc_param(struct ufs_h
  {
        int ret;
        u8 *desc_buf;
-       int buff_len;
+       int buff_len = QUERY_DESC_MAX_SIZE;
        bool is_kmalloc = true;
  
        /* Safety check */
        if (desc_id >= QUERY_DESC_IDN_MAX || !param_size)
                return -EINVAL;
  
-       /* Get the length of descriptor */
-       ufshcd_map_desc_id_to_length(hba, desc_id, &buff_len);
-       if (!buff_len) {
-               dev_err(hba->dev, "%s: Failed to get desc length\n", __func__);
-               return -EINVAL;
-       }
-       if (param_offset >= buff_len) {
-               dev_err(hba->dev, "%s: Invalid offset 0x%x in descriptor IDN 0x%x, length 0x%x\n",
-                       __func__, param_offset, desc_id, buff_len);
-               return -EINVAL;
-       }
        /* Check whether we need temp memory */
        if (param_offset != 0 || param_size < buff_len) {
                desc_buf = kzalloc(buff_len, GFP_KERNEL);
  
        /* Request for full descriptor */
        ret = ufshcd_query_descriptor_retry(hba, UPIU_QUERY_OPCODE_READ_DESC,
-                                       desc_id, desc_index, 0,
-                                       desc_buf, &buff_len);
+                                           desc_id, desc_index, 0,
+                                           desc_buf, &buff_len);
        if (ret) {
                dev_err(hba->dev, "%s: Failed reading descriptor. desc_id %d, desc_index %d, param_offset %d, ret %d\n",
                        __func__, desc_id, desc_index, param_offset, ret);
                goto out;
        }
  
+       /* Update descriptor length */
+       buff_len = desc_buf[QUERY_DESC_LENGTH_OFFSET];
+       if (param_offset >= buff_len) {
+               dev_err(hba->dev, "%s: Invalid offset 0x%x in descriptor IDN 0x%x, length 0x%x\n",
+                       __func__, param_offset, desc_id, buff_len);
+               ret = -EINVAL;
+               goto out;
+       }
        /* Sanity check */
        if (desc_buf[QUERY_DESC_DESC_TYPE_OFFSET] != desc_id) {
                dev_err(hba->dev, "%s: invalid desc_id %d in descriptor header\n",
                goto out;
        }
  
-       /* Update descriptor length */
-       buff_len = desc_buf[QUERY_DESC_LENGTH_OFFSET];
-       ufshcd_update_desc_length(hba, desc_id, desc_index, buff_len);
        if (is_kmalloc) {
                /* Make sure we don't copy more data than available */
                if (param_offset >= buff_len)
@@@ -3656,7 -3735,7 +3733,7 @@@ static int ufshcd_memory_alloc(struct u
        size_t utmrdl_size, utrdl_size, ucdl_size;
  
        /* Allocate memory for UTP command descriptors */
-       ucdl_size = (sizeof(struct utp_transfer_cmd_desc) * hba->nutrs);
+       ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * hba->nutrs;
        hba->ucdl_base_addr = dmam_alloc_coherent(hba->dev,
                                                  ucdl_size,
                                                  &hba->ucdl_dma_addr,
  
        /*
         * UFSHCI requires UTP command descriptor to be 128 byte aligned.
-        * make sure hba->ucdl_dma_addr is aligned to PAGE_SIZE
-        * if hba->ucdl_dma_addr is aligned to PAGE_SIZE, then it will
-        * be aligned to 128 bytes as well
         */
        if (!hba->ucdl_base_addr ||
-           WARN_ON(hba->ucdl_dma_addr & (PAGE_SIZE - 1))) {
+           WARN_ON(hba->ucdl_dma_addr & (128 - 1))) {
                dev_err(hba->dev,
                        "Command Descriptor Memory allocation failed\n");
                goto out;
                                                   &hba->utrdl_dma_addr,
                                                   GFP_KERNEL);
        if (!hba->utrdl_base_addr ||
-           WARN_ON(hba->utrdl_dma_addr & (PAGE_SIZE - 1))) {
+           WARN_ON(hba->utrdl_dma_addr & (1024 - 1))) {
                dev_err(hba->dev,
                        "Transfer Descriptor Memory allocation failed\n");
                goto out;
        }
  
+       /*
+        * Skip utmrdl allocation; it may have been
+        * allocated during first pass and not released during
+        * MCQ memory allocation.
+        * See ufshcd_release_sdb_queue() and ufshcd_config_mcq()
+        */
+       if (hba->utmrdl_base_addr)
+               goto skip_utmrdl;
        /*
         * Allocate memory for UTP Task Management descriptors
         * UFSHCI requires 1024 byte alignment of UTMRD
                                                    &hba->utmrdl_dma_addr,
                                                    GFP_KERNEL);
        if (!hba->utmrdl_base_addr ||
-           WARN_ON(hba->utmrdl_dma_addr & (PAGE_SIZE - 1))) {
+           WARN_ON(hba->utmrdl_dma_addr & (1024 - 1))) {
                dev_err(hba->dev,
                "Task Management Descriptor Memory allocation failed\n");
                goto out;
        }
  
+ skip_utmrdl:
        /* Allocate memory for local reference block */
        hba->lrb = devm_kcalloc(hba->dev,
                                hba->nutrs, sizeof(struct ufshcd_lrb),
@@@ -3750,7 -3835,7 +3833,7 @@@ static void ufshcd_host_memory_configur
        prdt_offset =
                offsetof(struct utp_transfer_cmd_desc, prd_table);
  
-       cmd_desc_size = sizeof(struct utp_transfer_cmd_desc);
+       cmd_desc_size = sizeof_utp_transfer_cmd_desc(hba);
        cmd_desc_dma_addr = hba->ucdl_dma_addr;
  
        for (i = 0; i < hba->nutrs; i++) {
@@@ -4907,7 -4992,7 +4990,7 @@@ static void ufshcd_setup_links(struct u
   */
  static void ufshcd_lu_init(struct ufs_hba *hba, struct scsi_device *sdev)
  {
-       int len = hba->desc_size[QUERY_DESC_IDN_UNIT];
+       int len = QUERY_DESC_MAX_SIZE;
        u8 lun = ufshcd_scsi_to_upiu_lun(sdev->lun);
        u8 lun_qdepth = hba->nutrs;
        u8 *desc_buf;
            desc_buf[UNIT_DESC_PARAM_LU_WR_PROTECT] == UFS_LU_POWER_ON_WP)
                hba->dev_info.is_lu_power_on_wp = true;
  
+       /* In case of RPMB LU, check if advanced RPMB mode is enabled */
+       if (desc_buf[UNIT_DESC_PARAM_UNIT_INDEX] == UFS_UPIU_RPMB_WLUN &&
+           desc_buf[RPMB_UNIT_DESC_PARAM_REGION_EN] & BIT(4))
+               hba->dev_info.b_advanced_rpmb_en = true;
        kfree(desc_buf);
  set_qdepth:
        /*
@@@ -5030,8 -5121,8 +5119,8 @@@ static int ufshcd_slave_configure(struc
        ufshcd_hpb_configure(hba, sdev);
  
        blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
-       if (hba->quirks & UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE)
-               blk_queue_update_dma_alignment(q, PAGE_SIZE - 1);
+       if (hba->quirks & UFSHCD_QUIRK_4KB_DMA_ALIGNMENT)
+               blk_queue_update_dma_alignment(q, 4096 - 1);
        /*
         * Block runtime-pm until all consumers are added.
         * Refer ufshcd_setup_links().
@@@ -5130,18 -5221,20 +5219,20 @@@ ufshcd_scsi_cmd_status(struct ufshcd_lr
   * ufshcd_transfer_rsp_status - Get overall status of the response
   * @hba: per adapter instance
   * @lrbp: pointer to local reference block of completed command
+  * @cqe: pointer to the completion queue entry
   *
   * Returns result of the command to notify SCSI midlayer
   */
  static inline int
- ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
+ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
+                          struct cq_entry *cqe)
  {
        int result = 0;
        int scsi_status;
        enum utp_ocs ocs;
  
        /* overall command status of utrd */
-       ocs = ufshcd_get_tr_ocs(lrbp);
+       ocs = ufshcd_get_tr_ocs(lrbp, cqe);
  
        if (hba->quirks & UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR) {
                if (be32_to_cpu(lrbp->ucd_rsp_ptr->header.dword_1) &
@@@ -5306,42 -5399,53 +5397,53 @@@ static void ufshcd_release_scsi_cmd(str
  }
  
  /**
-  * __ufshcd_transfer_req_compl - handle SCSI and query command completion
+  * ufshcd_compl_one_cqe - handle a completion queue entry
   * @hba: per adapter instance
-  * @completed_reqs: bitmask that indicates which requests to complete
+  * @task_tag: the task tag of the request to be completed
+  * @cqe: pointer to the completion queue entry
   */
static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
-                                       unsigned long completed_reqs)
void ufshcd_compl_one_cqe(struct ufs_hba *hba, int task_tag,
+                         struct cq_entry *cqe)
  {
        struct ufshcd_lrb *lrbp;
        struct scsi_cmnd *cmd;
-       int index;
-       for_each_set_bit(index, &completed_reqs, hba->nutrs) {
-               lrbp = &hba->lrb[index];
-               lrbp->compl_time_stamp = ktime_get();
-               lrbp->compl_time_stamp_local_clock = local_clock();
-               cmd = lrbp->cmd;
-               if (cmd) {
-                       if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))
-                               ufshcd_update_monitor(hba, lrbp);
-                       ufshcd_add_command_trace(hba, index, UFS_CMD_COMP);
-                       cmd->result = ufshcd_transfer_rsp_status(hba, lrbp);
-                       ufshcd_release_scsi_cmd(hba, lrbp);
-                       /* Do not touch lrbp after scsi done */
-                       scsi_done(cmd);
-               } else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE ||
-                       lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) {
-                       if (hba->dev_cmd.complete) {
-                               ufshcd_add_command_trace(hba, index,
-                                                        UFS_DEV_COMP);
-                               complete(hba->dev_cmd.complete);
-                               ufshcd_clk_scaling_update_busy(hba);
-                       }
+       lrbp = &hba->lrb[task_tag];
+       lrbp->compl_time_stamp = ktime_get();
+       cmd = lrbp->cmd;
+       if (cmd) {
+               if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))
+                       ufshcd_update_monitor(hba, lrbp);
+               ufshcd_add_command_trace(hba, task_tag, UFS_CMD_COMP);
+               cmd->result = ufshcd_transfer_rsp_status(hba, lrbp, cqe);
+               ufshcd_release_scsi_cmd(hba, lrbp);
+               /* Do not touch lrbp after scsi done */
+               scsi_done(cmd);
+       } else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE ||
+                  lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) {
+               if (hba->dev_cmd.complete) {
+                       hba->dev_cmd.cqe = cqe;
+                       ufshcd_add_command_trace(hba, task_tag, UFS_DEV_COMP);
+                       complete(hba->dev_cmd.complete);
+                       ufshcd_clk_scaling_update_busy(hba);
                }
        }
  }
  
+ /**
+  * __ufshcd_transfer_req_compl - handle SCSI and query command completion
+  * @hba: per adapter instance
+  * @completed_reqs: bitmask that indicates which requests to complete
+  */
+ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
+                                       unsigned long completed_reqs)
+ {
+       int tag;
+       for_each_set_bit(tag, &completed_reqs, hba->nutrs)
+               ufshcd_compl_one_cqe(hba, tag, NULL);
+ }
  /* Any value that is not an existing queue number is fine for this constant. */
  enum {
        UFSHCD_POLL_FROM_INTERRUPT_CONTEXT = -1
@@@ -5371,6 -5475,13 +5473,13 @@@ static int ufshcd_poll(struct Scsi_Hos
        struct ufs_hba *hba = shost_priv(shost);
        unsigned long completed_reqs, flags;
        u32 tr_doorbell;
+       struct ufs_hw_queue *hwq;
+       if (is_mcq_enabled(hba)) {
+               hwq = &hba->uhq[queue_num + UFSHCD_MCQ_IO_QUEUE_OFFSET];
+               return ufshcd_mcq_poll_cqe_lock(hba, hwq);
+       }
  
        spin_lock_irqsave(&hba->outstanding_lock, flags);
        tr_doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
@@@ -6054,21 -6165,11 +6163,21 @@@ void ufshcd_schedule_eh_work(struct ufs
        }
  }
  
 +static void ufshcd_force_error_recovery(struct ufs_hba *hba)
 +{
 +      spin_lock_irq(hba->host->host_lock);
 +      hba->force_reset = true;
 +      ufshcd_schedule_eh_work(hba);
 +      spin_unlock_irq(hba->host->host_lock);
 +}
 +
  static void ufshcd_clk_scaling_allow(struct ufs_hba *hba, bool allow)
  {
 +      mutex_lock(&hba->wb_mutex);
        down_write(&hba->clk_scaling_lock);
        hba->clk_scaling.is_allowed = allow;
        up_write(&hba->clk_scaling_lock);
 +      mutex_unlock(&hba->wb_mutex);
  }
  
  static void ufshcd_clk_scaling_suspend(struct ufs_hba *hba, bool suspend)
@@@ -6603,6 -6704,40 +6712,40 @@@ static irqreturn_t ufshcd_tmc_handler(s
        return ret;
  }
  
+ /**
+  * ufshcd_handle_mcq_cq_events - handle MCQ completion queue events
+  * @hba: per adapter instance
+  *
+  * Returns IRQ_HANDLED if interrupt is handled
+  */
+ static irqreturn_t ufshcd_handle_mcq_cq_events(struct ufs_hba *hba)
+ {
+       struct ufs_hw_queue *hwq;
+       unsigned long outstanding_cqs;
+       unsigned int nr_queues;
+       int i, ret;
+       u32 events;
+       ret = ufshcd_vops_get_outstanding_cqs(hba, &outstanding_cqs);
+       if (ret)
+               outstanding_cqs = (1U << hba->nr_hw_queues) - 1;
+       /* Exclude the poll queues */
+       nr_queues = hba->nr_hw_queues - hba->nr_queues[HCTX_TYPE_POLL];
+       for_each_set_bit(i, &outstanding_cqs, nr_queues) {
+               hwq = &hba->uhq[i];
+               events = ufshcd_mcq_read_cqis(hba, i);
+               if (events)
+                       ufshcd_mcq_write_cqis(hba, events, i);
+               if (events & UFSHCD_MCQ_CQIS_TAIL_ENT_PUSH_STS)
+                       ufshcd_mcq_poll_cqe_nolock(hba, hwq);
+       }
+       return IRQ_HANDLED;
+ }
  /**
   * ufshcd_sl_intr - Interrupt service routine
   * @hba: per adapter instance
@@@ -6628,6 -6763,9 +6771,9 @@@ static irqreturn_t ufshcd_sl_intr(struc
        if (intr_status & UTP_TRANSFER_REQ_COMPL)
                retval |= ufshcd_transfer_req_compl(hba);
  
+       if (intr_status & MCQ_CQ_EVENT_STATUS)
+               retval |= ufshcd_handle_mcq_cq_events(hba);
        return retval;
  }
  
@@@ -6876,7 -7014,7 +7022,7 @@@ static int ufshcd_issue_devman_upiu_cmd
        /* update the task tag in the request upiu */
        req_upiu->header.dword_0 |= cpu_to_be32(tag);
  
-       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE);
+       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE, 0);
  
        /* just copy the upiu request as it is */
        memcpy(lrbp->ucd_req_ptr, req_upiu, sizeof(*lrbp->ucd_req_ptr));
  
        ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr);
  
-       ufshcd_send_command(hba, tag);
+       ufshcd_send_command(hba, tag, hba->dev_cmd_queue);
        /*
         * ignore the returning value here - ufshcd_check_query_response is
         * bound to fail since dev_cmd.query and dev_cmd.type were left empty.
@@@ -6999,6 -7137,100 +7145,100 @@@ int ufshcd_exec_raw_upiu_cmd(struct ufs
        return err;
  }
  
+ /**
+  * ufshcd_advanced_rpmb_req_handler - handle advanced RPMB request
+  * @hba:      per adapter instance
+  * @req_upiu: upiu request
+  * @rsp_upiu: upiu reply
+  * @req_ehs:  EHS field which contains Advanced RPMB Request Message
+  * @rsp_ehs:  EHS field which returns Advanced RPMB Response Message
+  * @sg_cnt:   The number of sg lists actually used
+  * @sg_list:  Pointer to SG list when DATA IN/OUT UPIU is required in ARPMB operation
+  * @dir:      DMA direction
+  *
+  * Returns zero on success, non-zero on failure
+  */
+ int ufshcd_advanced_rpmb_req_handler(struct ufs_hba *hba, struct utp_upiu_req *req_upiu,
+                        struct utp_upiu_req *rsp_upiu, struct ufs_ehs *req_ehs,
+                        struct ufs_ehs *rsp_ehs, int sg_cnt, struct scatterlist *sg_list,
+                        enum dma_data_direction dir)
+ {
+       DECLARE_COMPLETION_ONSTACK(wait);
+       const u32 tag = hba->reserved_slot;
+       struct ufshcd_lrb *lrbp;
+       int err = 0;
+       int result;
+       u8 upiu_flags;
+       u8 *ehs_data;
+       u16 ehs_len;
+       /* Protects use of hba->reserved_slot. */
+       ufshcd_hold(hba, false);
+       mutex_lock(&hba->dev_cmd.lock);
+       down_read(&hba->clk_scaling_lock);
+       lrbp = &hba->lrb[tag];
+       WARN_ON(lrbp->cmd);
+       lrbp->cmd = NULL;
+       lrbp->task_tag = tag;
+       lrbp->lun = UFS_UPIU_RPMB_WLUN;
+       lrbp->intr_cmd = true;
+       ufshcd_prepare_lrbp_crypto(NULL, lrbp);
+       hba->dev_cmd.type = DEV_CMD_TYPE_RPMB;
+       /* Advanced RPMB starts from UFS 4.0, so its command type is UTP_CMD_TYPE_UFS_STORAGE */
+       lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, dir, 2);
+       /* update the task tag and LUN in the request upiu */
+       req_upiu->header.dword_0 |= cpu_to_be32(upiu_flags << 16 | UFS_UPIU_RPMB_WLUN << 8 | tag);
+       /* copy the UPIU(contains CDB) request as it is */
+       memcpy(lrbp->ucd_req_ptr, req_upiu, sizeof(*lrbp->ucd_req_ptr));
+       /* Copy EHS, starting with byte32, immediately after the CDB package */
+       memcpy(lrbp->ucd_req_ptr + 1, req_ehs, sizeof(*req_ehs));
+       if (dir != DMA_NONE && sg_list)
+               ufshcd_sgl_to_prdt(hba, lrbp, sg_cnt, sg_list);
+       memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
+       hba->dev_cmd.complete = &wait;
+       ufshcd_send_command(hba, tag, hba->dev_cmd_queue);
+       err = ufshcd_wait_for_dev_cmd(hba, lrbp, ADVANCED_RPMB_REQ_TIMEOUT);
+       if (!err) {
+               /* Just copy the upiu response as it is */
+               memcpy(rsp_upiu, lrbp->ucd_rsp_ptr, sizeof(*rsp_upiu));
+               /* Get the response UPIU result */
+               result = ufshcd_get_rsp_upiu_result(lrbp->ucd_rsp_ptr);
+               ehs_len = be32_to_cpu(lrbp->ucd_rsp_ptr->header.dword_2) >> 24;
+               /*
+                * Since the bLength in EHS indicates the total size of the EHS Header and EHS Data
+                * in 32 Byte units, the value of the bLength Request/Response for Advanced RPMB
+                * Message is 02h
+                */
+               if (ehs_len == 2 && rsp_ehs) {
+                       /*
+                        * ucd_rsp_ptr points to a buffer with a length of 512 bytes
+                        * (ALIGNED_UPIU_SIZE = 512), and the EHS data just starts from byte32
+                        */
+                       ehs_data = (u8 *)lrbp->ucd_rsp_ptr + EHS_OFFSET_IN_RESPONSE;
+                       memcpy(rsp_ehs, ehs_data, ehs_len * 32);
+               }
+       }
+       up_read(&hba->clk_scaling_lock);
+       mutex_unlock(&hba->dev_cmd.lock);
+       ufshcd_release(hba);
+       return err ? : result;
+ }
  /**
   * ufshcd_eh_device_reset_handler() - Reset a single logical unit.
   * @cmd: SCSI command pointer
@@@ -7441,12 -7673,11 +7681,11 @@@ static u32 ufshcd_get_max_icc_level(in
   * In case regulators are not initialized we'll return 0
   * @hba: per-adapter instance
   * @desc_buf: power descriptor buffer to extract ICC levels from.
-  * @len: length of desc_buff
   *
   * Returns calculated ICC level
   */
  static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba,
-                                               const u8 *desc_buf, int len)
+                                               const u8 *desc_buf)
  {
        u32 icc_level = 0;
  
  static void ufshcd_set_active_icc_lvl(struct ufs_hba *hba)
  {
        int ret;
-       int buff_len = hba->desc_size[QUERY_DESC_IDN_POWER];
        u8 *desc_buf;
        u32 icc_level;
  
-       desc_buf = kmalloc(buff_len, GFP_KERNEL);
+       desc_buf = kzalloc(QUERY_DESC_MAX_SIZE, GFP_KERNEL);
        if (!desc_buf)
                return;
  
        ret = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_POWER, 0, 0,
-                                    desc_buf, buff_len);
+                                    desc_buf, QUERY_DESC_MAX_SIZE);
        if (ret) {
                dev_err(hba->dev,
-                       "%s: Failed reading power descriptor.len = %d ret = %d",
-                       __func__, buff_len, ret);
+                       "%s: Failed reading power descriptor ret = %d",
+                       __func__, ret);
                goto out;
        }
  
-       icc_level = ufshcd_find_max_sup_active_icc_level(hba, desc_buf,
-                                                        buff_len);
+       icc_level = ufshcd_find_max_sup_active_icc_level(hba, desc_buf);
        dev_dbg(hba->dev, "%s: setting icc_level 0x%x", __func__, icc_level);
  
        ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
@@@ -7616,10 -7845,6 +7853,6 @@@ static void ufshcd_wb_probe(struct ufs_
             (hba->dev_quirks & UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES)))
                goto wb_disabled;
  
-       if (hba->desc_size[QUERY_DESC_IDN_DEVICE] <
-           DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 4)
-               goto wb_disabled;
        ext_ufs_feature = get_unaligned_be32(desc_buf +
                                        DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP);
  
@@@ -7690,6 -7915,31 +7923,31 @@@ static void ufshcd_temp_notif_probe(str
        }
  }
  
+ static void ufshcd_ext_iid_probe(struct ufs_hba *hba, u8 *desc_buf)
+ {
+       struct ufs_dev_info *dev_info = &hba->dev_info;
+       u32 ext_ufs_feature;
+       u32 ext_iid_en = 0;
+       int err;
+       /* Only UFS-4.0 and above may support EXT_IID */
+       if (dev_info->wspecversion < 0x400)
+               goto out;
+       ext_ufs_feature = get_unaligned_be32(desc_buf +
+                                    DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP);
+       if (!(ext_ufs_feature & UFS_DEV_EXT_IID_SUP))
+               goto out;
+       err = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_READ_ATTR,
+                                     QUERY_ATTR_IDN_EXT_IID_EN, 0, 0, &ext_iid_en);
+       if (err)
+               dev_err(hba->dev, "failed reading bEXTIIDEn. err = %d\n", err);
+ out:
+       dev_info->b_ext_iid_en = ext_iid_en;
+ }
  void ufshcd_fixup_dev_quirks(struct ufs_hba *hba,
                             const struct ufs_dev_quirk *fixups)
  {
@@@ -7727,14 -7977,14 +7985,14 @@@ static int ufs_get_device_desc(struct u
        u8 *desc_buf;
        struct ufs_dev_info *dev_info = &hba->dev_info;
  
-       desc_buf = kmalloc(QUERY_DESC_MAX_SIZE, GFP_KERNEL);
+       desc_buf = kzalloc(QUERY_DESC_MAX_SIZE, GFP_KERNEL);
        if (!desc_buf) {
                err = -ENOMEM;
                goto out;
        }
  
        err = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_DEVICE, 0, 0, desc_buf,
-                                    hba->desc_size[QUERY_DESC_IDN_DEVICE]);
+                                    QUERY_DESC_MAX_SIZE);
        if (err) {
                dev_err(hba->dev, "%s: Failed reading Device Desc. err = %d\n",
                        __func__, err);
        /* getting Specification Version in big endian format */
        dev_info->wspecversion = desc_buf[DEVICE_DESC_PARAM_SPEC_VER] << 8 |
                                      desc_buf[DEVICE_DESC_PARAM_SPEC_VER + 1];
+       dev_info->bqueuedepth = desc_buf[DEVICE_DESC_PARAM_Q_DPTH];
        b_ufs_feature_sup = desc_buf[DEVICE_DESC_PARAM_UFS_FEAT];
  
        model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
  
        ufshcd_temp_notif_probe(hba, desc_buf);
  
+       if (hba->ext_iid_sup)
+               ufshcd_ext_iid_probe(hba, desc_buf);
        /*
         * ufshcd_read_string_desc returns size of the string
         * reset the error value
@@@ -7981,18 -8235,16 +8243,16 @@@ static void ufshcd_clear_dbg_ufs_stats(
  static int ufshcd_device_geo_params_init(struct ufs_hba *hba)
  {
        int err;
-       size_t buff_len;
        u8 *desc_buf;
  
-       buff_len = hba->desc_size[QUERY_DESC_IDN_GEOMETRY];
-       desc_buf = kmalloc(buff_len, GFP_KERNEL);
+       desc_buf = kzalloc(QUERY_DESC_MAX_SIZE, GFP_KERNEL);
        if (!desc_buf) {
                err = -ENOMEM;
                goto out;
        }
  
        err = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_GEOMETRY, 0, 0,
-                                    desc_buf, buff_len);
+                                    desc_buf, QUERY_DESC_MAX_SIZE);
        if (err) {
                dev_err(hba->dev, "%s: Failed reading Geometry Desc. err = %d\n",
                                __func__, err);
        else if (desc_buf[GEOMETRY_DESC_PARAM_MAX_NUM_LUN] == 0)
                hba->dev_info.max_lu_supported = 8;
  
-       if (hba->desc_size[QUERY_DESC_IDN_GEOMETRY] >=
+       if (desc_buf[QUERY_DESC_LENGTH_OFFSET] >=
                GEOMETRY_DESC_PARAM_HPB_MAX_ACTIVE_REGS)
                ufshpb_get_geo_info(hba, desc_buf);
  
@@@ -8089,11 -8341,7 +8349,7 @@@ out
  static int ufshcd_device_params_init(struct ufs_hba *hba)
  {
        bool flag;
-       int ret, i;
-        /* Init device descriptor sizes */
-       for (i = 0; i < QUERY_DESC_IDN_MAX; i++)
-               hba->desc_size[i] = QUERY_DESC_MAX_SIZE;
+       int ret;
  
        /* Init UFS geometry descriptor related parameters */
        ret = ufshcd_device_geo_params_init(hba);
        return ret;
  }
  
- /**
-  * ufshcd_probe_hba - probe hba to detect device and initialize it
-  * @hba: per-adapter instance
-  * @init_dev_params: whether or not to call ufshcd_device_params_init().
-  *
-  * Execute link-startup and verify device initialization
-  */
- static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params)
+ /* SDB - Single Doorbell */
+ static void ufshcd_release_sdb_queue(struct ufs_hba *hba, int nutrs)
+ {
+       size_t ucdl_size, utrdl_size;
+       ucdl_size = sizeof(struct utp_transfer_cmd_desc) * nutrs;
+       dmam_free_coherent(hba->dev, ucdl_size, hba->ucdl_base_addr,
+                          hba->ucdl_dma_addr);
+       utrdl_size = sizeof(struct utp_transfer_req_desc) * nutrs;
+       dmam_free_coherent(hba->dev, utrdl_size, hba->utrdl_base_addr,
+                          hba->utrdl_dma_addr);
+       devm_kfree(hba->dev, hba->lrb);
+ }
+ static int ufshcd_alloc_mcq(struct ufs_hba *hba)
  {
        int ret;
-       unsigned long flags;
-       ktime_t start = ktime_get();
+       int old_nutrs = hba->nutrs;
+       ret = ufshcd_mcq_decide_queue_depth(hba);
+       if (ret < 0)
+               return ret;
+       hba->nutrs = ret;
+       ret = ufshcd_mcq_init(hba);
+       if (ret)
+               goto err;
+       /*
+        * Previously allocated memory for nutrs may not be enough in MCQ mode.
+        * Number of supported tags in MCQ mode may be larger than SDB mode.
+        */
+       if (hba->nutrs != old_nutrs) {
+               ufshcd_release_sdb_queue(hba, old_nutrs);
+               ret = ufshcd_memory_alloc(hba);
+               if (ret)
+                       goto err;
+               ufshcd_host_memory_configure(hba);
+       }
+       ret = ufshcd_mcq_memory_alloc(hba);
+       if (ret)
+               goto err;
+       return 0;
+ err:
+       hba->nutrs = old_nutrs;
+       return ret;
+ }
+ static void ufshcd_config_mcq(struct ufs_hba *hba)
+ {
+       int ret;
+       ret = ufshcd_mcq_vops_config_esi(hba);
+       dev_info(hba->dev, "ESI %sconfigured\n", ret ? "is not " : "");
+       ufshcd_enable_intr(hba, UFSHCD_ENABLE_MCQ_INTRS);
+       ufshcd_mcq_make_queues_operational(hba);
+       ufshcd_mcq_config_mac(hba, hba->nutrs);
+       hba->host->can_queue = hba->nutrs - UFSHCD_NUM_RESERVED;
+       hba->reserved_slot = hba->nutrs - UFSHCD_NUM_RESERVED;
+       /* Select MCQ mode */
+       ufshcd_writel(hba, ufshcd_readl(hba, REG_UFS_MEM_CFG) | 0x1,
+                     REG_UFS_MEM_CFG);
+       hba->mcq_enabled = true;
+       dev_info(hba->dev, "MCQ configured, nr_queues=%d, io_queues=%d, read_queue=%d, poll_queues=%d, queue_depth=%d\n",
+                hba->nr_hw_queues, hba->nr_queues[HCTX_TYPE_DEFAULT],
+                hba->nr_queues[HCTX_TYPE_READ], hba->nr_queues[HCTX_TYPE_POLL],
+                hba->nutrs);
+ }
+ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
+ {
+       int ret;
+       struct Scsi_Host *host = hba->host;
  
        hba->ufshcd_state = UFSHCD_STATE_RESET;
  
        ret = ufshcd_link_startup(hba);
        if (ret)
-               goto out;
+               return ret;
  
        if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION)
-               goto out;
+               return ret;
  
        /* Debug counters initialization */
        ufshcd_clear_dbg_ufs_stats(hba);
        /* UniPro link is active now */
        ufshcd_set_link_active(hba);
  
+       /* Reconfigure MCQ upon reset */
+       if (is_mcq_enabled(hba) && !init_dev_params)
+               ufshcd_config_mcq(hba);
        /* Verify device initialization by sending NOP OUT UPIU */
        ret = ufshcd_verify_dev_init(hba);
        if (ret)
-               goto out;
+               return ret;
  
        /* Initiate UFS initialization, and waiting until completion */
        ret = ufshcd_complete_dev_init(hba);
        if (ret)
-               goto out;
+               return ret;
  
        /*
         * Initialize UFS device parameters used by driver, these
        if (init_dev_params) {
                ret = ufshcd_device_params_init(hba);
                if (ret)
-                       goto out;
+                       return ret;
+               if (is_mcq_supported(hba) && !hba->scsi_host_added) {
+                       ret = ufshcd_alloc_mcq(hba);
+                       if (ret) {
+                               /* Continue with SDB mode */
+                               use_mcq_mode = false;
+                               dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
+                                        ret);
+                       }
+                       ret = scsi_add_host(host, hba->dev);
+                       if (ret) {
+                               dev_err(hba->dev, "scsi_add_host failed\n");
+                               return ret;
+                       }
+                       hba->scsi_host_added = true;
+               }
+               /* MCQ may be disabled if ufshcd_alloc_mcq() fails */
+               if (is_mcq_supported(hba) && use_mcq_mode)
+                       ufshcd_config_mcq(hba);
        }
  
        ufshcd_tune_unipro_params(hba);
                if (ret) {
                        dev_err(hba->dev, "%s: Failed setting power mode, err = %d\n",
                                        __func__, ret);
+                       return ret;
+               }
+       }
+       return 0;
+ }
+ /**
+  * ufshcd_probe_hba - probe hba to detect device and initialize it
+  * @hba: per-adapter instance
+  * @init_dev_params: whether or not to call ufshcd_device_params_init().
+  *
+  * Execute link-startup and verify device initialization
+  */
+ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params)
+ {
+       ktime_t start = ktime_get();
+       unsigned long flags;
+       int ret;
+       ret = ufshcd_device_init(hba, init_dev_params);
+       if (ret)
+               goto out;
+       if (hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) {
+               /* Reset the device and controller before doing reinit */
+               ufshcd_device_reset(hba);
+               ufshcd_hba_stop(hba);
+               ufshcd_vops_reinit_notify(hba);
+               ret = ufshcd_hba_enable(hba);
+               if (ret) {
+                       dev_err(hba->dev, "Host controller enable failed\n");
+                       ufshcd_print_evt_hist(hba);
+                       ufshcd_print_host_state(hba);
                        goto out;
                }
-               ufshcd_print_pwr_info(hba);
+               /* Reinit the device */
+               ret = ufshcd_device_init(hba, init_dev_params);
+               if (ret)
+                       goto out;
        }
  
+       ufshcd_print_pwr_info(hba);
        /*
         * bActiveICCLevel is volatile for UFS device (as per latest v2.1 spec)
         * and for removable UFS card as well, hence always set the parameter.
@@@ -8359,7 -8738,6 +8746,6 @@@ static struct scsi_host_template ufshcd
        .max_host_blocked       = 1,
        .track_queue_depth      = 1,
        .sdev_groups            = ufshcd_driver_groups,
-       .dma_boundary           = PAGE_SIZE - 1,
        .rpm_autosuspend_delay  = RPM_AUTOSUSPEND_DELAY_MS,
  };
  
@@@ -9091,15 -9469,6 +9477,15 @@@ static int __ufshcd_wl_suspend(struct u
  
                if (!hba->dev_info.b_rpm_dev_flush_capable) {
                        ret = ufshcd_set_dev_pwr_mode(hba, req_dev_pwr_mode);
 +                      if (ret && pm_op != UFS_SHUTDOWN_PM) {
 +                              /*
 +                               * If return err in suspend flow, IO will hang.
 +                               * Trigger error handler and break suspend for
 +                               * error recovery.
 +                               */
 +                              ufshcd_force_error_recovery(hba);
 +                              ret = -EBUSY;
 +                      }
                        if (ret)
                                goto enable_scaling;
                }
         */
        check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba);
        ret = ufshcd_link_state_transition(hba, req_link_state, check_for_bkops);
 +      if (ret && pm_op != UFS_SHUTDOWN_PM) {
 +              /*
 +               * If return err in suspend flow, IO will hang.
 +               * Trigger error handler and break suspend for
 +               * error recovery.
 +               */
 +              ufshcd_force_error_recovery(hba);
 +              ret = -EBUSY;
 +      }
        if (ret)
                goto set_dev_active;
  
@@@ -9453,6 -9813,7 +9839,7 @@@ static int ufshcd_resume(struct ufs_hb
  
        /* enable the host irq as host controller would be active soon */
        ufshcd_enable_irq(hba);
        goto out;
  
  disable_vreg:
@@@ -9616,6 -9977,56 +10003,56 @@@ void ufshcd_remove(struct ufs_hba *hba
  }
  EXPORT_SYMBOL_GPL(ufshcd_remove);
  
+ #ifdef CONFIG_PM_SLEEP
+ int ufshcd_system_freeze(struct device *dev)
+ {
+       return ufshcd_system_suspend(dev);
+ }
+ EXPORT_SYMBOL_GPL(ufshcd_system_freeze);
+ int ufshcd_system_restore(struct device *dev)
+ {
+       struct ufs_hba *hba = dev_get_drvdata(dev);
+       int ret;
+       ret = ufshcd_system_resume(dev);
+       if (ret)
+               return ret;
+       /* Configure UTRL and UTMRL base address registers */
+       ufshcd_writel(hba, lower_32_bits(hba->utrdl_dma_addr),
+                       REG_UTP_TRANSFER_REQ_LIST_BASE_L);
+       ufshcd_writel(hba, upper_32_bits(hba->utrdl_dma_addr),
+                       REG_UTP_TRANSFER_REQ_LIST_BASE_H);
+       ufshcd_writel(hba, lower_32_bits(hba->utmrdl_dma_addr),
+                       REG_UTP_TASK_REQ_LIST_BASE_L);
+       ufshcd_writel(hba, upper_32_bits(hba->utmrdl_dma_addr),
+                       REG_UTP_TASK_REQ_LIST_BASE_H);
+       /*
+        * Make sure that UTRL and UTMRL base address registers
+        * are updated with the latest queue addresses. Only after
+        * updating these addresses, we can queue the new commands.
+        */
+       mb();
+       /* Resuming from hibernate, assume that link was OFF */
+       ufshcd_set_link_off(hba);
+       return 0;
+ }
+ EXPORT_SYMBOL_GPL(ufshcd_system_restore);
+ int ufshcd_system_thaw(struct device *dev)
+ {
+       return ufshcd_system_resume(dev);
+ }
+ EXPORT_SYMBOL_GPL(ufshcd_system_thaw);
+ #endif /* CONFIG_PM_SLEEP  */
  /**
   * ufshcd_dealloc_host - deallocate Host Bus Adapter (HBA)
   * @hba: pointer to Host Bus Adapter (HBA)
@@@ -9674,6 -10085,7 +10111,7 @@@ int ufshcd_alloc_host(struct device *de
        hba->dev = dev;
        hba->dev_ref_clk_freq = REF_CLK_FREQ_INVAL;
        hba->nop_out_timeout = NOP_OUT_TIMEOUT;
+       ufshcd_set_sg_entry_size(hba, sizeof(struct ufshcd_sg_entry));
        INIT_LIST_HEAD(&hba->clk_list_head);
        spin_lock_init(&hba->outstanding_lock);
  
@@@ -9793,7 -10205,6 +10231,7 @@@ int ufshcd_init(struct ufs_hba *hba, vo
        /* Initialize mutex for exception event control */
        mutex_init(&hba->ee_ctrl_mutex);
  
 +      mutex_init(&hba->wb_mutex);
        init_rwsem(&hba->clk_scaling_lock);
  
        ufshcd_init_clk_gating(hba);
                hba->is_irq_enabled = true;
        }
  
-       err = scsi_add_host(host, hba->dev);
-       if (err) {
-               dev_err(hba->dev, "scsi_add_host failed\n");
-               goto out_disable;
+       if (!is_mcq_supported(hba)) {
+               err = scsi_add_host(host, hba->dev);
+               if (err) {
+                       dev_err(hba->dev, "scsi_add_host failed\n");
+                       goto out_disable;
+               }
        }
  
        hba->tmf_tag_set = (struct blk_mq_tag_set) {
@@@ -10054,11 -10467,6 +10494,6 @@@ static int __init ufshcd_core_init(void
  {
        int ret;
  
-       /* Verify that there are no gaps in struct utp_transfer_cmd_desc. */
-       static_assert(sizeof(struct utp_transfer_cmd_desc) ==
-                     2 * ALIGNED_UPIU_SIZE +
-                             SG_ALL * sizeof(struct ufshcd_sg_entry));
        ufs_debugfs_init();
  
        ret = scsi_register_driver(&ufs_dev_wlun_template.gendrv);
diff --combined include/ufs/ufshcd.h
index 727084cd79be42a9a73731864f5b15f54943de1c,ed9e3d5addb3a0d74bafb5d787b3e1d4118ed2f3..431c3afb2ce0f2048d6a50e77d90121ad8557239
@@@ -16,7 -16,9 +16,9 @@@
  #include <linux/blk-crypto-profile.h>
  #include <linux/blk-mq.h>
  #include <linux/devfreq.h>
+ #include <linux/msi.h>
  #include <linux/pm_runtime.h>
+ #include <linux/dma-direction.h>
  #include <scsi/scsi_device.h>
  #include <ufs/unipro.h>
  #include <ufs/ufs.h>
@@@ -30,6 -32,7 +32,7 @@@ struct ufs_hba
  enum dev_cmd_type {
        DEV_CMD_TYPE_NOP                = 0x0,
        DEV_CMD_TYPE_QUERY              = 0x1,
+       DEV_CMD_TYPE_RPMB               = 0x2,
  };
  
  enum ufs_event_type {
@@@ -222,6 -225,7 +225,7 @@@ struct ufs_dev_cmd 
        struct mutex lock;
        struct completion *complete;
        struct ufs_query query;
+       struct cq_entry *cqe;
  };
  
  /**
@@@ -297,6 -301,12 +301,12 @@@ struct ufs_pwr_mode_info 
   * @config_scaling_param: called to configure clock scaling parameters
   * @program_key: program or evict an inline encryption key
   * @event_notify: called to notify important events
+  * @reinit_notify: called to notify reinit of UFSHCD during max gear switch
+  * @mcq_config_resource: called to configure MCQ platform resources
+  * @get_hba_mac: called to get vendor specific mac value, mandatory for mcq mode
+  * @op_runtime_config: called to config Operation and runtime regs Pointers
+  * @get_outstanding_cqs: called to get outstanding completion queues
+  * @config_esi: called to config Event Specific Interrupt
   */
  struct ufs_hba_variant_ops {
        const char *name;
                               const union ufs_crypto_cfg_entry *cfg, int slot);
        void    (*event_notify)(struct ufs_hba *hba,
                                enum ufs_event_type evt, void *data);
+       void    (*reinit_notify)(struct ufs_hba *);
+       int     (*mcq_config_resource)(struct ufs_hba *hba);
+       int     (*get_hba_mac)(struct ufs_hba *hba);
+       int     (*op_runtime_config)(struct ufs_hba *hba);
+       int     (*get_outstanding_cqs)(struct ufs_hba *hba,
+                                      unsigned long *ocqs);
+       int     (*config_esi)(struct ufs_hba *hba);
  };
  
  /* clock gating state  */
@@@ -566,9 -583,9 +583,9 @@@ enum ufshcd_quirks 
        UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13,
  
        /*
-        * This quirk allows only sg entries aligned with page size.
+        * Align DMA SG entries on a 4 KiB boundary.
         */
-       UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE            = 1 << 14,
+       UFSHCD_QUIRK_4KB_DMA_ALIGNMENT                  = 1 << 14,
  
        /*
         * This quirk needs to be enabled if the host controller does not
         * auto-hibernate capability but it's FASTAUTO only.
         */
        UFSHCD_QUIRK_HIBERN_FASTAUTO                    = 1 << 18,
+       /*
+        * This quirk needs to be enabled if the host controller needs
+        * to reinit the device after switching to maximum gear.
+        */
+       UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH       = 1 << 19,
  };
  
  enum ufshcd_caps {
@@@ -723,6 -746,51 +746,51 @@@ struct ufs_hba_monitor 
        bool enabled;
  };
  
+ /**
+  * struct ufshcd_res_info_t - MCQ related resource regions
+  *
+  * @name: resource name
+  * @resource: pointer to resource region
+  * @base: register base address
+  */
+ struct ufshcd_res_info {
+       const char *name;
+       struct resource *resource;
+       void __iomem *base;
+ };
+ enum ufshcd_res {
+       RES_UFS,
+       RES_MCQ,
+       RES_MCQ_SQD,
+       RES_MCQ_SQIS,
+       RES_MCQ_CQD,
+       RES_MCQ_CQIS,
+       RES_MCQ_VS,
+       RES_MAX,
+ };
+ /**
+  * struct ufshcd_mcq_opr_info_t - Operation and Runtime registers
+  *
+  * @offset: Doorbell Address Offset
+  * @stride: Steps proportional to queue [0...31]
+  * @base: base address
+  */
+ struct ufshcd_mcq_opr_info_t {
+       unsigned long offset;
+       unsigned long stride;
+       void __iomem *base;
+ };
+ enum ufshcd_mcq_opr {
+       OPR_SQD,
+       OPR_SQIS,
+       OPR_CQD,
+       OPR_CQIS,
+       OPR_MAX,
+ };
  /**
   * struct ufs_hba - per adapter private structure
   * @mmio_base: UFSHCI base register address
   * @outstanding_lock: Protects @outstanding_reqs.
   * @outstanding_reqs: Bits representing outstanding transfer requests
   * @capabilities: UFS Controller Capabilities
+  * @mcq_capabilities: UFS Multi Circular Queue capabilities
   * @nutrs: Transfer Request Queue depth supported by controller
   * @nutmrs: Task Management Queue depth supported by controller
   * @reserved_slot: Used to submit device commands. Protected by @dev_cmd.lock.
   * @vops: pointer to variant specific operations
   * @vps: pointer to variant specific parameters
   * @priv: pointer to variant specific private data
+  * @sg_entry_size: size of struct ufshcd_sg_entry (may include variant fields)
   * @irq: Irq number of the controller
   * @is_irq_enabled: whether or not the UFS controller interrupt is enabled.
   * @dev_ref_clk_freq: reference clock frequency
   * @urgent_bkops_lvl: keeps track of urgent bkops level for device
   * @is_urgent_bkops_lvl_checked: keeps track if the urgent bkops level for
   *  device is known or not.
 + * @wb_mutex: used to serialize devfreq and sysfs write booster toggling
   * @clk_scaling_lock: used to serialize device commands and clock scaling
   * @desc_size: descriptor sizes reported by device
   * @scsi_block_reqs_cnt: reference counting for scsi block requests
   *    ee_ctrl_mask
   * @luns_avail: number of regular and well known LUNs supported by the UFS
   *    device
+  * @nr_hw_queues: number of hardware queues configured
+  * @nr_queues: number of Queues of different queue types
   * @complete_put: whether or not to call ufshcd_rpm_put() from inside
   *    ufshcd_resume_complete()
+  * @ext_iid_sup: is EXT_IID is supported by UFSHC
+  * @mcq_sup: is mcq supported by UFSHC
+  * @mcq_enabled: is mcq ready to accept requests
+  * @res: array of resource info of MCQ registers
+  * @mcq_base: Multi circular queue registers base address
+  * @uhq: array of supported hardware queues
+  * @dev_cmd_queue: Queue for issuing device management commands
   */
  struct ufs_hba {
        void __iomem *mmio_base;
  
        u32 capabilities;
        int nutrs;
+       u32 mcq_capabilities;
        int nutmrs;
        u32 reserved_slot;
        u32 ufs_version;
        const struct ufs_hba_variant_ops *vops;
        struct ufs_hba_variant_params *vps;
        void *priv;
+ #ifdef CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE
+       size_t sg_entry_size;
+ #endif
        unsigned int irq;
        bool is_irq_enabled;
        enum ufs_ref_clk_freq dev_ref_clk_freq;
        enum bkops_status urgent_bkops_lvl;
        bool is_urgent_bkops_lvl_checked;
  
 +      struct mutex wb_mutex;
        struct rw_semaphore clk_scaling_lock;
-       unsigned char desc_size[QUERY_DESC_IDN_MAX];
        atomic_t scsi_block_reqs_cnt;
  
        struct device           bsg_dev;
        u32 debugfs_ee_rate_limit_ms;
  #endif
        u32 luns_avail;
+       unsigned int nr_hw_queues;
+       unsigned int nr_queues[HCTX_MAX_TYPES];
        bool complete_put;
+       bool ext_iid_sup;
+       bool scsi_host_added;
+       bool mcq_sup;
+       bool mcq_enabled;
+       struct ufshcd_res_info res[RES_MAX];
+       void __iomem *mcq_base;
+       struct ufs_hw_queue *uhq;
+       struct ufs_hw_queue *dev_cmd_queue;
+       struct ufshcd_mcq_opr_info_t mcq_opr[OPR_MAX];
+ };
+ /**
+  * struct ufs_hw_queue - per hardware queue structure
+  * @mcq_sq_head: base address of submission queue head pointer
+  * @mcq_sq_tail: base address of submission queue tail pointer
+  * @mcq_cq_head: base address of completion queue head pointer
+  * @mcq_cq_tail: base address of completion queue tail pointer
+  * @sqe_base_addr: submission queue entry base address
+  * @sqe_dma_addr: submission queue dma address
+  * @cqe_base_addr: completion queue base address
+  * @cqe_dma_addr: completion queue dma address
+  * @max_entries: max number of slots in this hardware queue
+  * @id: hardware queue ID
+  * @sq_tp_slot: current slot to which SQ tail pointer is pointing
+  * @sq_lock: serialize submission queue access
+  * @cq_tail_slot: current slot to which CQ tail pointer is pointing
+  * @cq_head_slot: current slot to which CQ head pointer is pointing
+  * @cq_lock: Synchronize between multiple polling instances
+  */
+ struct ufs_hw_queue {
+       void __iomem *mcq_sq_head;
+       void __iomem *mcq_sq_tail;
+       void __iomem *mcq_cq_head;
+       void __iomem *mcq_cq_tail;
+       void *sqe_base_addr;
+       dma_addr_t sqe_dma_addr;
+       struct cq_entry *cqe_base_addr;
+       dma_addr_t cqe_dma_addr;
+       u32 max_entries;
+       u32 id;
+       u32 sq_tail_slot;
+       spinlock_t sq_lock;
+       u32 cq_tail_slot;
+       u32 cq_head_slot;
+       spinlock_t cq_lock;
  };
  
+ static inline bool is_mcq_enabled(struct ufs_hba *hba)
+ {
+       return hba->mcq_enabled;
+ }
+ #ifdef CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE
+ static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba)
+ {
+       return hba->sg_entry_size;
+ }
+ static inline void ufshcd_set_sg_entry_size(struct ufs_hba *hba, size_t sg_entry_size)
+ {
+       WARN_ON_ONCE(sg_entry_size < sizeof(struct ufshcd_sg_entry));
+       hba->sg_entry_size = sg_entry_size;
+ }
+ #else
+ static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba)
+ {
+       return sizeof(struct ufshcd_sg_entry);
+ }
+ #define ufshcd_set_sg_entry_size(hba, sg_entry_size)                   \
+       ({ (void)(hba); BUILD_BUG_ON(sg_entry_size != sizeof(struct ufshcd_sg_entry)); })
+ #endif
+ static inline size_t sizeof_utp_transfer_cmd_desc(const struct ufs_hba *hba)
+ {
+       return sizeof(struct utp_transfer_cmd_desc) + SG_ALL * ufshcd_sg_entry_size(hba);
+ }
  /* Returns true if clocks can be gated. Otherwise false */
  static inline bool ufshcd_is_clkgating_allowed(struct ufs_hba *hba)
  {
@@@ -1037,6 -1196,16 +1198,16 @@@ static inline bool ufshcd_enable_wb_if_
        return hba->caps & UFSHCD_CAP_WB_WITH_CLK_SCALING;
  }
  
+ #define ufsmcq_writel(hba, val, reg)  \
+       writel((val), (hba)->mcq_base + (reg))
+ #define ufsmcq_readl(hba, reg)        \
+       readl((hba)->mcq_base + (reg))
+ #define ufsmcq_writelx(hba, val, reg) \
+       writel_relaxed((val), (hba)->mcq_base + (reg))
+ #define ufsmcq_readlx(hba, reg)       \
+       readl_relaxed((hba)->mcq_base + (reg))
  #define ufshcd_writel(hba, val, reg)  \
        writel((val), (hba)->mmio_base + (reg))
  #define ufshcd_readl(hba, reg)        \
@@@ -1073,6 -1242,11 +1244,11 @@@ void ufshcd_parse_dev_ref_clk_freq(stru
  void ufshcd_update_evt_hist(struct ufs_hba *hba, u32 id, u32 val);
  void ufshcd_hba_stop(struct ufs_hba *hba);
  void ufshcd_schedule_eh_work(struct ufs_hba *hba);
+ void ufshcd_mcq_write_cqis(struct ufs_hba *hba, u32 val, int i);
+ unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba,
+                                        struct ufs_hw_queue *hwq);
+ void ufshcd_mcq_enable_esi(struct ufs_hba *hba);
+ void ufshcd_mcq_config_esi(struct ufs_hba *hba, struct msi_msg *msg);
  
  /**
   * ufshcd_set_variant - set variant specific data to the hba
@@@ -1102,8 -1276,12 +1278,12 @@@ extern int ufshcd_runtime_resume(struc
  #ifdef CONFIG_PM_SLEEP
  extern int ufshcd_system_suspend(struct device *dev);
  extern int ufshcd_system_resume(struct device *dev);
+ extern int ufshcd_system_freeze(struct device *dev);
+ extern int ufshcd_system_thaw(struct device *dev);
+ extern int ufshcd_system_restore(struct device *dev);
  #endif
  extern int ufshcd_shutdown(struct ufs_hba *hba);
  extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
                                      int agreed_gear,
                                      int adapt_val);
@@@ -1188,9 -1366,6 +1368,6 @@@ void ufshcd_release(struct ufs_hba *hba
  
  void ufshcd_clkgate_delay_set(struct device *dev, unsigned long value);
  
- void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id,
-                                 int *desc_length);
  u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba);
  
  int ufshcd_get_vreg(struct device *dev, struct ufs_vreg *vreg);
@@@ -1203,7 -1378,10 +1380,10 @@@ int ufshcd_exec_raw_upiu_cmd(struct ufs
                             int msgcode,
                             u8 *desc_buff, int *buff_len,
                             enum query_opcode desc_op);
+ int ufshcd_advanced_rpmb_req_handler(struct ufs_hba *hba, struct utp_upiu_req *req_upiu,
+                                    struct utp_upiu_req *rsp_upiu, struct ufs_ehs *ehs_req,
+                                    struct ufs_ehs *ehs_rsp, int sg_cnt,
+                                    struct scatterlist *sg_list, enum dma_data_direction dir);
  int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable);
  int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable);
  int ufshcd_suspend_prepare(struct device *dev);