Commit graph

1122786 commits

Author SHA1 Message Date
Arnd Bergmann
12f09234bd Renesas fixes for v6.0
- Fix the serial console on the Renesas White Hawk development board.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCYxHJ8AAKCRCKwlD9ZEnx
 cN/8AP9XA09pTjmkn+PbDAy42t7tReRJ94zeQxyMZ2zDK3gLpAD7Bgk5rxtcCVj7
 W2rVYSt84SJ9iVjBnwOIwrLk0Jo0Mg8=
 =YXXk
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMR1WgACgkQmmx57+YA
 GNk7GRAAlxxGZ+1/LeYSvnEikDvNCJJp6miRmakL89yZ2uJfVS+vTF9VdE5QRVf8
 RfcrKNpF+91nKWGRV7tECU8/PkCxQ66PydqETvPid0pqjcEE16AWzrcJjUzBxeq9
 D4aSe/vgdR4Liar1orbWakMN+g0JhSr8a0XI4zlYsghgWuloJkLnDGmVsWX3fCrM
 fijDhtzlB54vE9XsUte0V9A+D/7meREtz8VG9jJ5v/DwKP74ABKk+PPncw7IH77i
 cPKkALCYOzpLuPw7BIg9oFhizJQhHbyUceQJRDmWVAyXYrDlOwB+x+2j8cTX96L+
 9KabkLNd4xLg4vgB/VhilShzbdnLdQelCD/8x/ZoxRkonTTDanlDBUgGrJ5b9rvC
 GFrnndOQ++1JZU06tqAetc0AdZy+Z9+kRyslRR2dXFUKBRn5dyBkqc7p4mjlyV+z
 aUX5aO6GZKLGnE1N+kd01IDapWyzOQz/iiTLW4Qe4p0DKH+4oudNtN3mS+MvLN07
 yRYpxmArxg/0HxTWUCxBga8qfmzF7KwxyVxyWErx32OeEiBcLaFDUaGuZNR2jgF9
 fsCmMtRc87GEqg8NcRDCLkzql5zQVtXzsG4eo7SKfYYbye/KGptMHZr/+vGxn1Mg
 XLfFw/Qe/5nEWbshPYztlEs4a2KpHVmmOO9YiA9KWrAglJFq+KA=
 =zJ5P
 -----END PGP SIGNATURE-----

Merge tag 'renesas-fixes-for-v6.0-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/fixes

Renesas fixes for v6.0

  - Fix the serial console on the Renesas White Hawk development board.

* tag 'renesas-fixes-for-v6.0-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  arm64: dts: renesas: r8a779g0: Fix HSCIF0 interrupt number

Link: https://lore.kernel.org/r/ab2866f12ca18747413ba41409231d44e0c6149b.1662111547.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-02 12:05:28 +02:00
Arnd Bergmann
194bebfea5 AT91 fixes for 6.0
It contains:
 - fixes for self-refresh on SAMA7G5 while in AT91 power management modes:
   one disabling a DDR PHY controller DLL which has been proved to be buggy
   and can introduce glitches that can cause unexpected behavior; one
   fixing the DDR PHY recalibration which cannot work for all possible
   cases (due to hardware bug) while using backup and self-refresh AT91
   power management mode;
 - one defconfig fix to remove CONFIG_MICROCHIP_PIT64B from all AT91
   defconfigs;
 - multiple device tree fixes for regulators to avoid having some of them
   enabled all the time and to describe min and max output ranges
   according to board capabilities.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTsZ8eserC1pmhwqDmejrg/N2X7/QUCYxG/lwAKCRCejrg/N2X7
 /bQpAQCEfcz8ockiRHT3dkJcoI0yHbEiZIHSbPjwFLlu54IVBgEAjZPhSIbtYTjM
 7MDRFXYF6BeaNga99JXjItz1IlwkvA8=
 =5Kwl
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMRzOAACgkQmmx57+YA
 GNkVsxAArs1HJ4R8p2H54szlzrLGkgPrXuAIZNnV13jiRi5FL6p5doFLb2Ldhrro
 OoSP/9Z8GaEu6B3YP+5QP5gAXtKXntLdsFZA3XididLsZCSJtazuSv4uUUxPg86K
 DagY+Yhlb05vZH4JMjC7MJztbaq2rbP/tzYPvdR8I6aN8OIORchzu/36kwp8TVGk
 2FiYJSxk3ccYcVTqZjORjQadUn2Hx+rCKgC8lQLZTSnQ+/ZBmPC6vwiHCDVrgVBx
 mJeUBnbBFpQMyO3hzOKvLu2hHcHfJrBb7DnpVEUsenfl9O4XPu1LVmuCN7Osh9jT
 x+k7PNx1yrTzZpnICz8z92U13zgkaxqkaYAqzQZqEFae8Z2/SWitIls9pM5ZZTbX
 nZfWWP1qQ8cN27/fTNz6Igg1Lk3NS0zRsw2kSuRBCUejiQQscByOpEkxveJDb64u
 jEVCM9HqYZccKq+j77A1WJez5B7twDSAxl6pbtE0gD+++TqfOfCWxLjbVzx4l89X
 /Osr2keeB4tLnna2ltqtvlfH5rL0/A9OmkpXhlwW+VML73rP3fB0y1HCoEzmMyYQ
 XQVGwS0d8MMfXyXylpQn767Xxc3qhGdhutugHQgagOe8F74FgZOH5AZQTxBf4e8R
 g1uotqy/Fwxojtf9aJf4voeD2QuXg25E+qgDoQf6QW3EFCtaBDQ=
 =KEYR
 -----END PGP SIGNATURE-----

Merge tag 'at91-fixes-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes

AT91 fixes for 6.0

It contains:
- fixes for self-refresh on SAMA7G5 while in AT91 power management modes:
  one disabling a DDR PHY controller DLL which has been proved to be buggy
  and can introduce glitches that can cause unexpected behavior; one
  fixing the DDR PHY recalibration which cannot work for all possible
  cases (due to hardware bug) while using backup and self-refresh AT91
  power management mode;
- one defconfig fix to remove CONFIG_MICROCHIP_PIT64B from all AT91
  defconfigs;
- multiple device tree fixes for regulators to avoid having some of them
  enabled all the time and to describe min and max output ranges
  according to board capabilities.

* tag 'at91-fixes-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  ARM: dts: at91: sama5d2_icp: don't keep vdd_other enabled all the time
  ARM: dts: at91: sama5d27_wlsom1: don't keep ldo2 enabled all the time
  ARM: dts: at91: sama7g5ek: specify proper regulator output ranges
  ARM: dts: at91: sama5d2_icp: specify proper regulator output ranges
  ARM: dts: at91: sama5d27_wlsom1: specify proper regulator output ranges
  ARM: at91: pm: fix DDR recalibration when resuming from backup and self-refresh
  ARM: at91: pm: fix self-refresh for sama7g5
  ARM: configs: at91: remove CONFIG_MICROCHIP_PIT64B

Link: https://lore.kernel.org/r/20220902085744.4193554-1-claudiu.beznea@microchip.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-02 11:29:03 +02:00
Mathew McBride
9a472613f5
soc: fsl: select FSL_GUTS driver for DPIO
The soc/fsl/dpio driver will perform a soc_device_match()
to determine the optimal cache settings for a given CPU core.

If FSL_GUTS is not enabled, this search will fail and
the driver will not configure cache stashing for the given
DPIO, and a string of "unknown SoC" messages will appear:

fsl_mc_dpio dpio.7: unknown SoC version
fsl_mc_dpio dpio.6: unknown SoC version
fsl_mc_dpio dpio.5: unknown SoC version

Fixes: 51da14e96e ("soc: fsl: dpio: configure cache stashing destination")
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220901052149.23873-2-matt@traverse.com.au'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-02 11:28:40 +02:00
Arnd Bergmann
49f6d09bd0 This pull request contains Broadcom SoCs driver fixes for 6.0, please
pull the following:
 
 - Liang fixes the legacy Broadcom STB ARM system suspend/resume code
 error paths that were leaking ioremap() and other of_* operations
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEm+Rq3+YGJdiR9yuFh9CWnEQHBwQFAmMNQmsACgkQh9CWnEQH
 BwTjKxAAqAvlmkOjVnJxrxEv53bXxPU+lHqTacMm5O8OmP5+EpxbSSFXLtICAnaL
 8VFAPKhwrX6xkJr0asv6oUaxf2oSWMXixjSIW8uxlZQl+R9cU9FWq7piyaxytpBQ
 aRHRSKQBTi3IHW5+ZcohRdKwhNzBqtcbeSPdQF2A/vSEp7Na9Aite5iW2Sd4o9Wz
 oP/uxZFKZGvKB7Zcn9Yq57G6wUVoAHw3Ny5hfmbVOC8UMNr3XJdpK+2jtJZV2YmR
 l8Y6olU0/bz6dLQgJoASpM8EW4dtVvD+TDF9EjdQgICG6h0RDaO6uRAAGAHqifzo
 6BH151L22F6YC2DQn3TXgRse0bFaXxRo07UYNx8S8xKnw4/iG36aoEU2o/WAKshF
 FMrx9Kmh//ih6oFaTnWa8/R4f7zQXWuPNFdUpMltGwhIPRV6HIzloYFRx7ekPc4q
 gNgcc48cTDKLmzd8eMworX2TK1s2oKCMKW0KTZv1PTrTgHoUOE088QUDDjtXuKK5
 VXSxsmhr2CUG+EBsH5rInHi9KszNfE0FpHfKQ9iaao6OhMSPeUq7StLh80ZctxFu
 ufTwDX0SEc9ipPow4T2f6jOTy7x0E2gHj7zKfc5kjx0vME3E9/bUsROzDN5vmlb2
 TV+qSa0q0jkZezATB+m1x1rO5Hw9d46X39R2Ew94W4vlr/M5ebk=
 =ORKq
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMRzH8ACgkQmmx57+YA
 GNn6uhAAjh/j+zAZzqYPCWtd0zR6GaFodCwYxLJFH+Z6r/vy2PIdY6+BHZPA7E6L
 2j9i2YYMCz79PhO24DpMIWfEBVaZ0Y6/Fg+ip15OpOeuVSCX0sAEtE7cevapuqeu
 sqyNLQQ8quWltjyLfIfaAYh7yDrTr3DjxUkS43nhaLplfWvB/N4uxFeGZ3X2aRI1
 bWh2bCJvkrsd9+FQn9UDP0QA2YGnCWrkE66SkZsxh2o86x7VC5f/XBfns8rZNnoc
 bx32nO2YQ5Rahbz8j+it+pYGpO5JZT/Hy0wOeMimJt0L76HI4WoB589a7urW4+y4
 NXTizlfkBJ3HlnD9WhlRCydWVDQz3xQ/TkaerM5IGyfS9QmlOITFz/BxoVL4DmgZ
 pL/zPJjffsZEt0f5om5767Fk267kgrvgmlHsRA9gRAqNNgHkpNYNEinqzUkIhCtx
 1QTr9KNRBFu43/eIx+t50nHoc/Jg1SL9YLD0VKfTsItn1LM4eMfV92F+WGP9wL6b
 OSJuicRoIXQ6X+8rdXE7/ZXc9aVuA6SNNgRHwdY+4MtyZgRGWC3sbAJ1tb1RITbr
 XoJVlG6vDg0XzFlWYeNCbufgePY2yXhVVP8QwojNt+926pGNvL07fpUl2pGBxV7M
 FQumq1l/QVJeYDL728/YX2Bk2/kXWZrO/HEYttJypg81xQ/Y7iw=
 =YiX2
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc/for-6.0/drivers-fixes' of https://github.com/Broadcom/stblinux into arm/fixes

This pull request contains Broadcom SoCs driver fixes for 6.0, please
pull the following:

- Liang fixes the legacy Broadcom STB ARM system suspend/resume code
error paths that were leaking ioremap() and other of_* operations

* tag 'arm-soc/for-6.0/drivers-fixes' of https://github.com/Broadcom/stblinux:
  soc: brcmstb: pm-arm: Fix refcount leak and __iomem leak bugs

Link: https://lore.kernel.org/r/20220829225103.753223-2-f.fainelli@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-02 11:27:27 +02:00
Arnd Bergmann
06f0696444 This pull request contains Broadcom ARM-based SoCs Device Tree fixes for
6.0, please pull the following:
 
 - William fixes a number of the recently submitted DTS files for 63178,
 6846, 6878 to have correct PSCI node propertie as well as correct timer
 CPU masks
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEm+Rq3+YGJdiR9yuFh9CWnEQHBwQFAmMM9OUACgkQh9CWnEQH
 BwSzDA//WZyMEI1AGo+Y5pQQXQIR7MvIr50IwGPPUDa3DzTAGF/td3/mLI4g2cnf
 vOKAtgUtAHRNhFzOUbw+IMmGeUJ9SOJIyK2c3kjdcb1Fihuz+wJLcz54ljiwzJmt
 ekL/HqHA6Q5l4BJHq+4AMPvgiSZBFlD+iNhAUY6OJ/VIXuXbt7PTrQp1KRImvely
 JRyGjoagOlSMbS/WNenuFKRPoe3cnrABHjhAm6zOjPYCvyDmN7N6jwimW0UhLVsd
 ievzfg+/3Xux4aKZj82Csj5Y+63Tu7vh2MHQgdHq8Vg6rU0Mvs3S+sThdv5L8XOD
 6e80jHVIad8KifgEVxNfu4OvRJJxx/g7rwJPFJJ+ugUUgwXyRU7nH2FdCUqFz+q0
 UnDNC+KkBKfsypp8s3kzZHktDdvwkNYBqX/CnRNqh2MeRBUiyLTBZdC1NtkUwAzs
 eUrEpMBdrcnDAu0JM7pGaLp1/OdrintDzguqcKwjOQ7prpb61/w3W6CyMRVXJKAT
 IF6mP0Tiiww/8p/JH/MJWxCMoA9QRBmUt9ARDEd7nYU/5vAkezZKtz+cjn8E5AEs
 j/ScT0ZJ4KkjBuyvONKU2gED82Z2GWysEXZjQgFJPI2AnL0FN9VqdFvipoQo86sl
 nH2aWKo7nzC8x8LiTIirQCqDvflNWdSYqvsfMvUsHkrWx4lu1CM=
 =hjVE
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMRzFoACgkQmmx57+YA
 GNkTxhAAqLZDQX+B3AlpOIIDz8vqtjnuvN1Mz9/zif9btUP3gkX8HWNXQUDY+xhg
 1QhRKjrRhKj+Xq7OKXXwGIZL+g7iT5wPh9ORzaY8zUQfoGAHI8B2mHsef90PCl5z
 Z7g+11twIu21i+t7JiNLxr9stl2qcjXeuHh+TTF3yuGxgkgxx/A81lyxskjfVpSV
 r3hjPwwiNK8o8d5iKPZ3yJeoZEkWrVyUNmla1J+yi2xJ2OZnEQfZFxd6Avg+DFsW
 J8Zv+fqgkH0+uKE9PUcV8KUBb1ITl7WOANWN3qZ7ARITbZkW3n+pfP2HUCGEmv/o
 nTGtf/wn102snk0e+sxLPsBrStH1zlHC1/2Z/kW+VQivSMH3UQNdynvG/KOKuVtA
 14fF0V2DuNvcJTHCaomoROJImCaKxI/mQf0uXmqxndk9sgnkLOcrDKwbdY8aQQNu
 ciR7LY+rK+5hHEhsgdhZ7mcqkcI8hcLBGclfUOrIIlmZTXSl/rLDirS+7T/5P0AC
 N3qQfiiiyK0G7zfHrhiusBg1bpC75k0FR7rZUa2BvvnqFmILMhCfLGtlfIexu1Nx
 xjpRkQDLpbPbcZhQDlfJMEFGBVelHun7kl6v5Z30SKXM1ArbcAAOeyGx5XkhdVyN
 b0kcJDyWzHluk9SjyZcn8vZs5h/xNuJ/z75ummXiXh2Q6z0PJ24=
 =SM9p
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc/for-6.0/devicetree' of https://github.com/Broadcom/stblinux into arm/fixes

This pull request contains Broadcom ARM-based SoCs Device Tree fixes for
6.0, please pull the following:

- William fixes a number of the recently submitted DTS files for 63178,
6846, 6878 to have correct PSCI node propertie as well as correct timer
CPU masks

* tag 'arm-soc/for-6.0/devicetree' of https://github.com/Broadcom/stblinux:
  ARM: dts: bcmbca: bcm6878: cosmetic change
  ARM: dts: bcmbca: bcm6878: fix timer node cpu mask flag
  ARM: dts: bcmbca: bcm6846: fix interrupt controller node
  ARM: dts: bcmbca: bcm6846: clean up psci node
  ARM: dts: bcmbca: bcm6846: fix timer node cpu mask flag
  ARM: dts: bcmbca: bcm63178: cosmetic change
  ARM: dts: bcmbca: bcm63178: fix interrupt controller node
  ARM: dts: bcmbca: bcm63178: clean up psci node
  ARM: dts: bcmbca: bcm63178: fix timer node cpu mask flag

Link: https://lore.kernel.org/r/20220829225103.753223-1-f.fainelli@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-02 11:26:50 +02:00
Arnd Bergmann
92c7c5b0f9 Armv8 Juno fixes for v6.0
Couple of fixes to add missing MHU secure-irq and remove the legacy
 coresight 'slave-mode' property.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmMHX/IACgkQAEG6vDF+
 4ph90g//c5plifI3pE+1r8BS0huvbFUp1PaYWTeS1kvetSvvgT7HVSxTfpCyW58a
 UR27pH2Ox3fOgoErp63kP7Hfvk46fKBICjrTjzgYmrR1uz9rLaHPU3zRs/srdb0u
 SwSFhegTzBis05YkKPxXJXsq5dlgn1ihuQ/vLXbT0ShYulDlp3mN+zHm1xw+s2WS
 Poc3Jp1G8sQeuEZpDOeAgJxpBtEsZiAz8xXsP2WuQysSeu0ZVZwa4O4LhY/bBhQN
 xFpFoArbJcXiNFCbvcwDq8ak6/iAF5y1oeWBtss11VlBJyg+old4bNdMdAirLQX1
 DoxMIDHUMgVm1k8V6vH33pHf22PBpSz4FPlUIidHUPDs5fHBGQOQq+2t90Lwexet
 jNdVZdCrdvyvNu8rotujBRDb9LJZxTIBxaLzirO15zeFwuysq/i98OrbRb6LkMGM
 0UrD6S3ywf1b6PNLetkfjuUmN0nM82+ntHBw/iZt46QU9OzXP+P+H/CEGc/rRpz/
 1r2jD50Xo8s8l4fTsJ9FnQE9C1sk0HfyhAHAaN5F1V1G98yMeHdZfXa3UmzGOy9H
 duXt0k5g73W/P/ho25X1Gsqz/DX7nK6PHRYhYvB9rCJrC5qSbkGL4gcwXTVLXz0R
 rd7az6PUzcfS37Hk86j0N4SFl//3OFYl/jmaAwghYcwiyrszZRI=
 =SuC2
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMRyqEACgkQmmx57+YA
 GNlRWhAAvgWK35djY7dYUdWvCy5Ci3TFhrAQFEjnlDUddT2bpZdMO6KD9Wkbf2oc
 qQ4naKqlNP1XUaeTE53cakGatQTraQsugJtvDXItjNLfdLcSLTLvzH/lRs6S5FEa
 sadpndqddRHwxLCfNkYti7dXMBgeb6Ch2B9bL0SWnLh9zT/IVf+z/UQlImh68Ds8
 Md/+IN8ZKjASE047PM+xNKN+i39IBfb2Kq1uPuLNVwFniFb0AZBlk3OaFTCq2DuR
 OfMscDGQOLEZ2xLUropPEWXr8jPkNLp2xuClVHIJ8brBXYIrp22rfZGVIqGTOWKo
 DhpES9P5jdQrbP502YDMNUf+b0dVjpEuCdp5Ajtf6FMGsQrtqjxTLvwb93ODLPe9
 pk2W7JUyeWKvBjOnMFFH2Gc2ckseJ5QxG5P2fN5FHZaO42iToYeW0u632n6I5H9w
 HudSceVKhmHr7A1vL0jnMq8zW7dWMcKeh7Q2mehJ8GUbRYT9BpJqe8P/wAf3A4Fr
 6b3z/Z2bdO5CIG4ooggPicd/qPo+0RR74768fBnBnDXhoY360ieKZ9hG9pEBNRAy
 xHqKJpwBFETZ+lfyALXxgtkGalhkyodcsLNUcwt7ob3jB0pf9nj1V5SH3h2t4pDA
 aMx2+jU9j1c1IeYQaChHC0qLUgplxkdS/xUtdEU7yawIu541DZk=
 =YVft
 -----END PGP SIGNATURE-----

Merge tag 'juno-fixes-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes

Armv8 Juno fixes for v6.0

Couple of fixes to add missing MHU secure-irq and remove the legacy
coresight 'slave-mode' property.

* tag 'juno-fixes-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  arm64: dts: juno: Add missing MHU secure-irq
  arm64: dts: arm: juno: Remove legacy Coresight 'slave-mode' property

Link: https://lore.kernel.org/r/20220829174420.207880-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-02 11:19:29 +02:00
Dan Carpenter
e9ea0b30ad xen/grants: prevent integer overflow in gnttab_dma_alloc_pages()
The change from kcalloc() to kvmalloc() means that arg->nr_pages
might now be large enough that the "args->nr_pages << PAGE_SHIFT" can
result in an integer overflow.

Fixes: b3f7931f5c ("xen/gntdev: switch from kcalloc() to kvcalloc()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/YxDROJqu/RPvR0bi@kili
Signed-off-by: Juergen Gross <jgross@suse.com>
2022-09-02 11:05:19 +02:00
SeongJae Park
fe8f65b018 xen-blkfront: Cache feature_persistent value before advertisement
Xen blkfront advertises its support of the persistent grants feature
when it first setting up and when resuming in 'talk_to_blkback()'.
Then, blkback reads the advertised value when it connects with blkfront
and decides if it will use the persistent grants feature or not, and
advertises its decision to blkfront.  Blkfront reads the blkback's
decision and it also makes the decision for the use of the feature.

Commit 402c43ea6b ("xen-blkfront: Apply 'feature_persistent' parameter
when connect"), however, made the blkfront's read of the parameter for
disabling the advertisement, namely 'feature_persistent', to be done
when it negotiate, not when advertise.  Therefore blkfront advertises
without reading the parameter.  As the field for caching the parameter
value is zero-initialized, it always advertises as the feature is
disabled, so that the persistent grants feature becomes always disabled.

This commit fixes the issue by making the blkfront does parmeter caching
just before the advertisement.

Fixes: 402c43ea6b ("xen-blkfront: Apply 'feature_persistent' parameter when connect")
Cc: <stable@vger.kernel.org> # 5.10.x
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220831165824.94815-4-sj@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2022-09-02 11:05:15 +02:00
SeongJae Park
9f5e0fe5d0 xen-blkfront: Advertise feature-persistent as user requested
The advertisement of the persistent grants feature (writing
'feature-persistent' to xenbus) should mean not the decision for using
the feature but only the availability of the feature.  However, commit
74a852479c ("xen-blkfront: add a parameter for disabling of persistent
grants") made a field of blkfront, which was a place for saving only the
negotiation result, to be used for yet another purpose: caching of the
'feature_persistent' parameter value.  As a result, the advertisement,
which should follow only the parameter value, becomes inconsistent.

This commit fixes the misuse of the semantic by making blkfront saves
the parameter value in a separate place and advertises the support based
on only the saved value.

Fixes: 74a852479c ("xen-blkfront: add a parameter for disabling of persistent grants")
Cc: <stable@vger.kernel.org> # 5.10.x
Suggested-by: Juergen Gross <jgross@suse.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220831165824.94815-3-sj@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2022-09-02 11:05:12 +02:00
SeongJae Park
06ba5d2e94 xen-blkback: Advertise feature-persistent as user requested
The advertisement of the persistent grants feature (writing
'feature-persistent' to xenbus) should mean not the decision for using
the feature but only the availability of the feature.  However, commit
aac8a70db2 ("xen-blkback: add a parameter for disabling of persistent
grants") made a field of blkback, which was a place for saving only the
negotiation result, to be used for yet another purpose: caching of the
'feature_persistent' parameter value.  As a result, the advertisement,
which should follow only the parameter value, becomes inconsistent.

This commit fixes the misuse of the semantic by making blkback saves the
parameter value in a separate place and advertises the support based on
only the saved value.

Fixes: aac8a70db2 ("xen-blkback: add a parameter for disabling of persistent grants")
Cc: <stable@vger.kernel.org> # 5.10.x
Suggested-by: Juergen Gross <jgross@suse.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220831165824.94815-2-sj@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2022-09-02 11:05:06 +02:00
Nathan Chancellor
6cf07810e9 powerpc/papr_scm: Ensure rc is always initialized in papr_scm_pmu_register()
Clang warns:

  arch/powerpc/platforms/pseries/papr_scm.c:492:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
          if (!p->stat_buffer_len)
              ^~~~~~~~~~~~~~~~~~~
  arch/powerpc/platforms/pseries/papr_scm.c:523:64: note: uninitialized use occurs here
          dev_info(&p->pdev->dev, "nvdimm pmu didn't register rc=%d\n", rc);
                                                                        ^~
  include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
          dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                          ^~~~~~~~~~~
  include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                  _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                      ^~~~~~~~~~~
  arch/powerpc/platforms/pseries/papr_scm.c:492:2: note: remove the 'if' if its condition is always false
          if (!p->stat_buffer_len)
          ^~~~~~~~~~~~~~~~~~~~~~~~
  arch/powerpc/platforms/pseries/papr_scm.c:484:8: note: initialize the variable 'rc' to silence this warning
          int rc, nodeid;
                ^
                = 0
  1 warning generated.

The call to papr_scm_pmu_check_events() was eliminated but a return code
was not added to the if statement. Add the same return code from
papr_scm_pmu_check_events() for this condition so there is no more
warning.

Fixes: 9b1ac04698 ("powerpc/papr_scm: Fix nvdimm event mappings")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://github.com/ClangBuiltLinux/linux/issues/1701
Link: https://lore.kernel.org/r/20220830151256.1473169-1-nathan@kernel.org
2022-09-02 18:55:11 +10:00
Michael Ellerman
684c68d92e Revert "powerpc/irq: Don't open code irq_soft_mask helpers"
This reverts commit ef5b570d37.

Zhouyi reported that commit is causing crashes when running rcutorture
with KASAN enabled:

  BUG: using smp_processor_id() in preemptible [00000000] code: rcu_torture_rea/100
  caller is rcu_preempt_deferred_qs_irqrestore+0x74/0xed0
  CPU: 4 PID: 100 Comm: rcu_torture_rea Tainted: G        W          5.19.0-rc5-next-20220708-dirty #253
  Call Trace:
    dump_stack_lvl+0xbc/0x108 (unreliable)
    check_preemption_disabled+0x154/0x160
    rcu_preempt_deferred_qs_irqrestore+0x74/0xed0
    __rcu_read_unlock+0x290/0x3b0
    rcu_torture_read_unlock+0x30/0xb0
    rcutorture_one_extend+0x198/0x810
    rcu_torture_one_read+0x58c/0xc90
    rcu_torture_reader+0x12c/0x360
    kthread+0x1e8/0x220
    ret_from_kernel_thread+0x5c/0x64

KASAN will generate instrumentation instructions around the
WRITE_ONCE(local_paca->irq_soft_mask, mask):

   0xc000000000295cb0 <+0>:	addis   r2,r12,774
   0xc000000000295cb4 <+4>:	addi    r2,r2,16464
   0xc000000000295cb8 <+8>:	mflr    r0
   0xc000000000295cbc <+12>:	bl      0xc00000000008bb4c <mcount>
   0xc000000000295cc0 <+16>:	mflr    r0
   0xc000000000295cc4 <+20>:	std     r31,-8(r1)
   0xc000000000295cc8 <+24>:	addi    r3,r13,2354
   0xc000000000295ccc <+28>:	mr      r31,r13
   0xc000000000295cd0 <+32>:	std     r0,16(r1)
   0xc000000000295cd4 <+36>:	stdu    r1,-48(r1)
   0xc000000000295cd8 <+40>:	bl      0xc000000000609b98 <__asan_store1+8>
   0xc000000000295cdc <+44>:	nop
   0xc000000000295ce0 <+48>:	li      r9,1
   0xc000000000295ce4 <+52>:	stb     r9,2354(r31)
   0xc000000000295ce8 <+56>:	addi    r1,r1,48
   0xc000000000295cec <+60>:	ld      r0,16(r1)
   0xc000000000295cf0 <+64>:	ld      r31,-8(r1)
   0xc000000000295cf4 <+68>:	mtlr    r0

If there is a context switch before "stb     r9,2354(r31)", r31 may
not equal to r13, in such case, irq soft mask will not work.

The usual solution of marking the code ineligible for instrumentation
forces the code out-of-line, which we would prefer to avoid. Christophe
proposed a partial revert, but Nick raised some concerns with that. So
for now do a full revert.

Reported-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
[mpe: Construct change log based on Zhouyi's original report]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220831131052.42250-1-mpe@ellerman.id.au
2022-09-02 18:54:53 +10:00
Greg Kroah-Hartman
fe0a2ac7c6 Revert "usb: gadget: udc-xilinx: replace memcpy with memcpy_toio"
This reverts commit 8cb339f1c1 as it
throws up a bunch of sparse warnings as reported by the kernel test
robot.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/202209020044.CX2PfZzM-lkp@intel.com
Fixes: 8cb339f1c1 ("usb: gadget: udc-xilinx: replace memcpy with memcpy_toio")
Cc: stable@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Piyush Mehta <piyush.mehta@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-02 09:10:08 +02:00
Greg Kroah-Hartman
0f022aaac9 soundwire fixes for v6.0
This contains two fixes to qcom sdw driver which resolve duplicate reset
 control get and second one fixes device array indices.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmMRm1sACgkQfBQHDyUj
 g0egohAArytbLHUQbSFbZwozmcKI6+OyRbyFjA+vr2dHY1wk8Yzp6cTiA8JN4EIx
 VfPhkCbU7z1dgwyOhsl+Qif82AibVQ3Wol066qqhpzqYpB4u0p2skaSwUi/6JuSA
 kJBoSXVC3LcedjoGClbBRDx1Cr/t6YX47mNL4lXdMg9A9dIRWfpPPt2dRSjbATHq
 2Du1zSMuUBj6qWHqw4aUM4FneVyP1JD4FF8AjzpQZAIGLUQfiaeVPYTsi5MchC7d
 3exTwMsFTfK1jFowjmjT8cbbIGZf/IoMkniiCjNTbK2rd2Djdr9KVR5vJvS+BNNP
 Aq8vR3tACL82LHxHR2SXspzmhj+uuwQAHklzvRQ5fkXIi/XuHzJW/Eo0gWL44F/y
 3ue22XeuEBx4Tjhp40VXwwRZM1iNnSk7DUIt7X+4DN6rcdM5qOL6anO5Tqe8kzYZ
 Q5HwVyvu7lbEdARsKsMMMd+R9bCZJUqDLo/eZsMPlZIkisROtyVRBZYtQX82/dDG
 K6ZmgvTmXMPQUSzyLkZXEboI4OB8DhdNHBZCk58ehwf6PkG1ZqPeOMcPwSKwdKyo
 3sgYI2kQ4jqHzjq9JvcunFgLP9Cw1Wx3aYT+5TJkc0SbuW3TnvWoKDhLvw1h8BD5
 vOeaCo6m1JrEzMNtAJJM++/fBmPVBPpUlu++8gN+C4HJjQ4CmHU=
 =dJt1
 -----END PGP SIGNATURE-----

Merge tag 'soundwire-6.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-linus

Vinod writes:
  "soundwire fixes for v6.0

   This contains two fixes to qcom sdw driver which resolve duplicate reset
   control get and second one fixes device array indices."

* tag 'soundwire-6.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: qcom: fix device status array range
  soundwire: qcom: remove duplicate reset control get
2022-09-02 08:59:45 +02:00
Heiner Kallweit
7fdc77665f Revert "net: phy: meson-gxl: improve link-up behavior"
This reverts commit 2c87c6f9fb.
Meanwhile it turned out that the following commit is the proper
workaround for the issue that 2c87c6f9fb tries to address.
a3a57bf07d ("net: stmmac: work around sporadic tx issue on link-up")
It's nor clear why the to be reverted commit helped for one user,
for others it didn't make a difference.

Fixes: 2c87c6f9fb ("net: phy: meson-gxl: improve link-up behavior")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/8deeeddc-6b71-129b-1918-495a12dc11e3@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-09-01 20:55:12 -07:00
Dave Airlie
bfe632f6d0 - GVT fixes including fix for a CommetLake regression in mmio table
and misc doc and typo fixes (Julia, Jiapeng, Colin, Alex)
 - Fix CCS handling (Matt)
 - Fix for guc requests after reset (Daniele)
 - Display DSI related fixes (Jani)
 - Display backlight related fixes (Arun, Jouni)
 - Fix for a null pointer dereference (Lukasz)
 - HDMI related quirk for ECS Liva Q2 with GLK graphics (Diego)
 - Skip wm/ddb readout for disabled pipes (Ville)
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmMQtvEACgkQ+mJfZA7r
 E8ovLggAkF9v9TvyboB0khLyvow98/r6JoC8zf+y7/bGwdnC7q8vfy7JQajAOwwN
 UxzVNQngP9CI8iC/bGgwSLqrESp5Bnf+UMYtAYAub0cmEOVN8TwTrWO6hrBamkhb
 xm8UV3dtvdKuqg8LQDi3CL+3j1YDoqc/mpqLDgJZq4VhxBW777ngKNzMX6HsgzSr
 PHu95gtFgCGciVgVJMNYugxCihnsWn9poGUo6NotLoCFrNPL6nMlVIOMLv9ypxEw
 R07Vf9EUvPty/xoMVAh5IyvBSjON/b7PpPruK2zEVizA+Zl8VUs2jxZFS4aw38J7
 +gduw4iJo1mxi0goLaDPzc+miWVoJQ==
 =w8KF
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-fixes-2022-09-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

- Fix for a null pointer dereference (Lukasz)
- HDMI related quirk for ECS Liva Q2 with GLK graphics (Diego)
- Skip wm/ddb readout for disabled pipes (Ville)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YxC3GmSOpDiZTdIJ@intel.com
2022-09-02 11:26:50 +10:00
Paolo Bonzini
29250ba51b PCI interpretation compile fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEwGNS88vfc9+v45Yq41TmuOI4ufgFAmMMpCYACgkQ41TmuOI4
 ufirVA/+NpbDVgiGehgV9ngukDFWNNBOvPeKFIjnIWmhcTvRtQ/YWIALKJSinaVl
 jyPOTM0cEcrxhIPM2kHmnkZhwECRwM32Ox2N6ftmOPEJk8xrP6glfCuwJ6Yl/pNU
 EBLWzgZGRZyDGmCNo0jvaycPIh/WkeNKGwe/3FlI8gHx7iALvihE/0IFoPlCEWky
 dbetAAx5W0fRCoKscbMh0q2mDXuz4KBu3yij9wMGlhSzLcrSr9qejCmjEdERruYM
 c9hrLtIcy8cS9Epa5kOnz0PekK4EUlecB66BjnvsXabjTVNlF8MJwEG5EZfGxP+a
 jdthEjXaO5u7z4Y5NKxDwTFslmzX3PPbdBka9VGmhLkkV1/jGZ5RKKVY7+MljV74
 ZhhVkwUB0D3c7Wbpo+S1mVY6EHi/RO4TkaPCORsmCvwYXFZyhNsteKnWdRbcu3Iu
 aIjKamGeEfe8Mqojmzaksql9ScNnW9/INUyObz5UruGXFg2uFd0Vae20ZBpn7DYh
 gBYKZAFArNzHUUpP5zMBPnwpTGt8MuurI7rnVEvVRqsy4SofbYZYuFdxpn2obzui
 zPQY/lg6eXUWZkbfqJNrA1JN3cTSxVQCO96z8yYp/RazYiKMGUgZ7Ps7WlZkxRNE
 OSMkssXz6cIL1QPbu75iu6FMQGcVAywH2EN8jJh6E0ceUcVhsB0=
 =ENc3
 -----END PGP SIGNATURE-----

Merge tag 'kvm-s390-master-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD

PCI interpretation compile fixes
2022-09-01 19:21:27 -04:00
Paolo Bonzini
35906d23cf KVM/riscv fixes for 6.0, take #1
- Fix unused variable warnings in vcpu_timer.c
 - Move extern sbi_ext declarations to a header
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEZdn75s5e6LHDQ+f/rUjsVaLHLAcFAmMAk18ACgkQrUjsVaLH
 LAdRtw/+O4FEhvrpeTxJQvj1tltI6r8TfxRR1WoFfXuutgmgXt2dc04qYcUrqd3B
 lYa+xCIjSX6LmNwvJHROtICLy4UXAcu63p604vj3mMuNVivWCJg9cZ++hAbuoy1o
 vNJTuiZCdx4ax3Zk0sXPeNH5E+oes9uHRf6WvZ7Fyv7gTQ7i/1MgPAjHSdPghbGJ
 i8IaZPx8NjtyAWjLLbaZeoSUH3OvZ/YWA4sOeUxWXyKOPmfYdh5/UesQILY8MB68
 KfGPOE2NakqU4qfkzYTqdiE41xhXxyWVXFAgZz0E0qlRQDwOQVSX5dKu3Gk9pDxt
 FksKkTUbh4xdYukBruIwMiEQ/tpJyq+w5NPtHTbCVpa1k1Hkj9+RhxaAJibjk6c6
 jxkQ8lPOTauqhSVKLvRU/0r1991YRAhQvbp9batUumkzjTXD3W/ifRmrixGygLRP
 OzGE93wFhqdqFx+tK2MAqupRhryGV9GaL0WwLNQ49gVHsYyoic2uc2lF8zf6K9Vx
 oogl+U1joC0PlGGlBtFNJOUuLsEswNflIqN1SdQS4jQb4+wx8NA/Vqmy/AP6o0gl
 eRoCfEeGR4dE6IcufaWnHYP5fTUEdnTogynL2TONWvJWo0/ip4WP+5uVwcE5goF9
 imcrgIEG2QVk1a9/9PtDpXkuKa6gXxj9TpSRg2fBku+ovSHE+C0=
 =NC+j
 -----END PGP SIGNATURE-----

Merge tag 'kvm-riscv-fixes-6.0-1' of https://github.com/kvm-riscv/linux into HEAD

KVM/riscv fixes for 6.0, take #1

- Fix unused variable warnings in vcpu_timer.c
- Move extern sbi_ext declarations to a header
2022-09-01 19:21:09 -04:00
Paolo Bonzini
22c6a0ef6b KVM: x86: check validity of argument to KVM_SET_MP_STATE
An invalid argument to KVM_SET_MP_STATE has no effect other than making the
vCPU fail to run at the next KVM_RUN.  Since it is extremely unlikely that
any userspace is relying on it, fail with -EINVAL just like for other
architectures.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-09-01 19:20:59 -04:00
Like Xu
87693645ae perf/x86/core: Completely disable guest PEBS via guest's global_ctrl
When a guest PEBS counter is cross-mapped by a host counter, software
will remove the corresponding bit in the arr[global_ctrl].guest and
expect hardware to perform a change of state "from enable to disable"
via the msr_slot[] switch during the vmx transaction.

The real world is that if user adjust the counter overflow value small
enough, it still opens a tiny race window for the previously PEBS-enabled
counter to write cross-mapped PEBS records into the guest's PEBS buffer,
when arr[global_ctrl].guest has been prioritised (switch_msr_special stuff)
to switch into the enabled state, while the arr[pebs_enable].guest has not.

Close this window by clearing invalid bits in the arr[global_ctrl].guest.

Cc: linux-perf-users@vger.kernel.org
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sean Christopherson <seanjc@google.com>
Fixes: 854250329c ("KVM: x86/pmu: Disable guest PEBS temporarily in two rare situations")
Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20220831033524.58561-1-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-09-01 19:20:59 -04:00
Miaohe Lin
3c0ba05ce9 KVM: x86: fix memoryleak in kvm_arch_vcpu_create()
When allocating memory for mci_ctl2_banks fails, KVM doesn't release
mce_banks leading to memoryleak. Fix this issue by calling kfree()
for it when kcalloc() fails.

Fixes: 281b52780b ("KVM: x86: Add emulation for MSR_IA32_MCx_CTL2 MSRs.")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Message-Id: <20220901122300.22298-1-linmiaohe@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-09-01 19:20:58 -04:00
Jim Mattson
0204750bd4 KVM: x86: Mask off unsupported and unknown bits of IA32_ARCH_CAPABILITIES
KVM should not claim to virtualize unknown IA32_ARCH_CAPABILITIES
bits. When kvm_get_arch_capabilities() was originally written, there
were only a few bits defined in this MSR, and KVM could virtualize all
of them. However, over the years, several bits have been defined that
KVM cannot just blindly pass through to the guest without additional
work (such as virtualizing an MSR promised by the
IA32_ARCH_CAPABILITES feature bit).

Define a mask of supported IA32_ARCH_CAPABILITIES bits, and mask off
any other bits that are set in the hardware MSR.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Fixes: 5b76a3cff0 ("KVM: VMX: Tell the nested hypervisor to skip L1D flush on vmentry")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-Id: <20220830174947.2182144-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-09-01 19:20:58 -04:00
Dave Airlie
d7df5e2834 Merge tag 'drm-msm-fixes-2022-08-27' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
Fixes for v6.0

- Fix for inconsistent indenting in function msm_dsi_dphy_timing_calc_v3.
  This fixes a smatch warning reported by kbot
- Fix to make eDP the first connector in the connected list. This was
  mainly done to address a screen corruption issue we were seeing on
  sc7280 boards which have eDP as the primary display. The corruption
  itself is from usermode but we decided to fix it this way because
  things work correct with the primary display as the first one for
  usermode
- Fix to populate intf_cfg correctly before calling reset_intf_cfg().
  Without this, the display pipeline is not torn down correctly for
  writeback
- Specify the correct number of DSI regulators for SDM660. It should
  have been 1 but 2 was mentioned
- Specify the correct number of DSI regulators for MSM8996. It should
  have been 3 but 2 was mentioned
- Fix for removing DP_RECOVERED_CLOCK_OUT_EN bit for tps4 link training
  for DP. This was causing link training failures and hence no display
  for a specific DP to HDMI cable on chromebooks
- Fix probe-deferral crash in gpu devfreq
- Fix gpu debugfs deadlock

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGtuY=jd44itwTkLXVqhnoKgY0BswPTrxDTxCiPG3WbmLA@mail.gmail.com
2022-09-02 05:58:52 +10:00
Dave Airlie
c1dd5d29ac Merge tag 'amd-drm-fixes-6.0-2022-08-31' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.0-2022-08-31:

amdgpu:
- FRU error message fix
- MES 11 updates
- DCN 3.2.x fixes
- DCN 3.1.4 fixes
- Fix possible use after free in CS IOCTL
- SMU 13.0.x fixes
- Fix iolink reporting on devices with direct connections to CPU
- GFX10 tap delay firmware fixes

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220831212312.5921-1-alexander.deucher@amd.com
2022-09-02 05:56:25 +10:00
Dave Airlie
a71f3950c8 Short summary of fixes pull:
* dma-buf/dma-resv: Fence-handling fix
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAmMPqTEACgkQaA3BHVML
 eiNY6Af/SXFeBXjycGQ8aB8rKw7IHB3RazHZrjEugnMhuR2y34M8BlDQkzeR1SL6
 jOrCQ0fJBY4z/OszRDs+4aAke2XICt80PfneqllsDuPT50udrbOsLrMQBh778mDb
 +NI3H5Rl7LBQDen7068+/qXdkH2qNCuyybpvH2f/NS85axVROw9ZwkUn1kkkfsR/
 xmK69lhhZZChdaxgJHU1bQAmthoh1AwqdYaGLnjKUqk/peGNaB5tS1hmgWifst4L
 A1MH0L31mPaHlW7xj7YYp1ZFtve85JhuDflgaMG/sXgwFnLRBdxHZt5xlPnitPXG
 wYoMiE0McQqky45ho9unIBeXNm0xkQ==
 =nJTR
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2022-08-31' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

Short summary of fixes pull:

 * dma-buf/dma-resv: Fence-handling fix

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/Yw+pZnEbPxkJ1nHa@linux-uq9g.fritz.box
2022-09-02 05:55:51 +10:00
Linus Torvalds
42e66b1cc3 Networking fixes for 6.0-rc4, including fixes from bluetooth, bpf
and wireless.
 
 Current release - regressions:
   - bpf:
     - fix wrong last sg check in sk_msg_recvmsg()
     - fix kernel BUG in purge_effective_progs()
 
   - mac80211:
     - fix possible leak in ieee80211_tx_control_port()
     - potential NULL dereference in ieee80211_tx_control_port()
 
 Current release - new code bugs:
   - nfp: fix the access to management firmware hanging
 
 Previous releases - regressions:
   - ip: fix triggering of 'icmp redirect'
 
   - sched: tbf: don't call qdisc_put() while holding tree lock
 
   - bpf: fix corrupted packets for XDP_SHARED_UMEM
 
   - bluetooth: hci_sync: fix suspend performance regression
 
   - micrel: fix probe failure
 
 Previous releases - always broken:
   - tcp: make global challenge ack rate limitation per net-ns and default disabled
 
   - tg3: fix potential hang-up on system reboot
 
   - mac802154: fix reception for no-daddr packets
 
 Misc:
   - r8152: add PID for the lenovo onelink+ dock
 
 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEg1AjqC77wbdLX2LbKSR5jcyPE6QFAmMQda0SHHBhYmVuaUBy
 ZWRoYXQuY29tAAoJECkkeY3MjxOk2eAQAJHZNo2CiN8dmVrT/e3Fc3GMMPhVIAHO
 lOjIUHIrV5BtsedhSrzAVTviMxVxC4CXAE8pJcE+5Y8MMygQYxZ3QF/93SSLFDKn
 zvhA1KizjmS7k2m7DNlS61aTwwPFBwc7dv388LrSUFdH0ZZfot+UXfzq4O8RSBUe
 mlYYLsiSRW5lUvu6j9hMSWn8D/A2k+BboA6Q1Q+PgK1tIpuEuv1gGg8IeV23xkfa
 hKLpZjtbrYPdGMKLMzmI5Ww4bqctZtCbPedSqBqydpmCyRsO/07G4fJLRffYsbSy
 nSREYF1QNSry/caR9KYHj602IwNywneIHV3cAO3B/ETFzThPkOmJbu2Em621G7+Z
 1HpWmser7eiHDz0rDYLQlFr/ZYcSF4TwoNH4ha9hiKRpnHTZgD0USudLG+vvTNs5
 DgGCAzJpdxI8Erks8Em9pYGEtKczZRp5MT+pZR+AAYkkryYANV6043+Xxbadal73
 CsVXODmHmmCSG346juOubujDLADUyS+RWf2eMIFy289CRUHpGbZQ8Ai2UM3dqaX1
 mgFpEAhJ78rmNBv8pVrKSJjE4Bx2s3hzgEe8tk9DHWCrODAAL490wzpMsVGvW+lz
 jTs2XNJ7MRDqV3KqMnZKlw0ESc0nSHz7BCztCbRQXfg6PxsIOTGD6ZB5kPQOHjU5
 XP3Y5g3775az
 =doxx
 -----END PGP SIGNATURE-----

Merge tag 'net-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Paolo Abeni:
 "Including fixes from bluetooth, bpf and wireless.

  Current release - regressions:

   - bpf:
      - fix wrong last sg check in sk_msg_recvmsg()
      - fix kernel BUG in purge_effective_progs()

   - mac80211:
      - fix possible leak in ieee80211_tx_control_port()
      - potential NULL dereference in ieee80211_tx_control_port()

  Current release - new code bugs:

   - nfp: fix the access to management firmware hanging

  Previous releases - regressions:

   - ip: fix triggering of 'icmp redirect'

   - sched: tbf: don't call qdisc_put() while holding tree lock

   - bpf: fix corrupted packets for XDP_SHARED_UMEM

   - bluetooth: hci_sync: fix suspend performance regression

   - micrel: fix probe failure

  Previous releases - always broken:

   - tcp: make global challenge ack rate limitation per net-ns and
     default disabled

   - tg3: fix potential hang-up on system reboot

   - mac802154: fix reception for no-daddr packets

  Misc:

   - r8152: add PID for the lenovo onelink+ dock"

* tag 'net-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (56 commits)
  net/smc: Remove redundant refcount increase
  Revert "sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb"
  tcp: make global challenge ack rate limitation per net-ns and default disabled
  tcp: annotate data-race around challenge_timestamp
  net: dsa: hellcreek: Print warning only once
  ip: fix triggering of 'icmp redirect'
  sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb
  selftests: net: sort .gitignore file
  Documentation: networking: correct possessive "its"
  kcm: fix strp_init() order and cleanup
  mlxbf_gige: compute MDIO period based on i1clk
  ethernet: rocker: fix sleep in atomic context bug in neigh_timer_handler
  net: lan966x: improve error handle in lan966x_fdma_rx_get_frame()
  nfp: fix the access to management firmware hanging
  net: phy: micrel: Make the GPIO to be non-exclusive
  net: virtio_net: fix notification coalescing comments
  net/sched: fix netdevice reference leaks in attach_default_qdiscs()
  net: sched: tbf: don't call qdisc_put() while holding tree lock
  net: Use u64_stats_fetch_begin_irq() for stats fetch.
  net: dsa: xrs700x: Use irqsave variant for u64 stats update
  ...
2022-09-01 09:20:42 -07:00
Linus Torvalds
d330076e1d slab fixes for 6.0-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEjUuTAak14xi+SF7M4CHKc/GJqRAFAmMQhqcACgkQ4CHKc/GJ
 qRC1ywf+JPE12TvdYL5s3V6OySv4Qx2lSXe2Ka/FcQIM0nCYH+dunKgBDK4+/cyf
 4Jh9gNZhA8OMBlbRKA+hvOab7qgk+iGCLmVv+5JjBalUPufp1IWTEGAY0NP4CIjy
 6b8okqIMPnZnJq3QpBgONfnv7ymILQevw8g1rmvw2/0hxjxWN3eAWVQgfYyawh7p
 mDubKcqqYV5b5hxgJbY9/STgb6VzWuAp6nm5YCPrlSzQPRuOxE5IgCAJ0mWOFoLN
 qhzc4JAh/Pt4jr+bKzeMgPhA3oqrEMvHctT/PMzbV8oAesr97Das/csTQEhba7Vj
 3P9HOyMFs/lPT5+hmMam7hdrslrzGQ==
 =jIKX
 -----END PGP SIGNATURE-----

Merge tag 'slab-for-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab

Pull slab fix from Vlastimil Babka:

 - A fix from Waiman Long to avoid a theoretical deadlock reported by
   lockdep.

* tag 'slab-for-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
  mm/slab_common: Deleting kobject in kmem_cache_destroy() without holding slab_mutex/cpu_hotplug_lock
2022-09-01 09:14:56 -07:00
Linus Torvalds
2880e1a175 sound fixes for 6.0-rc4
Just handful changes at this time.  The only major change is the
 regression fix about the x86 WC-page buffer allocation.
 The rest are trivial data-race fixes for ALSA sequencer core,
 the possible out-of-bounds access fixes in the new ALSA control
 hash code, and a few device-specific workarounds and fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmMQaOQOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/5tBAAipTHkfJP7PBEmg4xYkrOP5CPH6epfsA5Pcxw
 Uyf6PX6ylvYK9SR2CyPLFXXWtyKrFXhhMp9J+36tO4tx5bH5lQ6HvkYfkRUNnq2S
 2iHHctork6UmCmKYk6ChxngXoGqRWivFISqeEaU0kM2P1ke56y75gpDZfxstRVOD
 6UIUavjAlosUh8QfxMMPaRIZG4KTKLLGraQ8EcZHAkyi2jnQevKY3VcGO8SkjBX0
 nTLMcD5YaTURY8ZwaJcsd5hhbvmKehu2oMpDPyQR4ln+QcbYrYV2U9tWFGA065fa
 JK9z+wRC7h1iHgt7HjDZlnsVm+egNZ1cxs5KmJphC71YcceHKZm7fJYpQ3fnNvPB
 FJc4Esumx2CsAtj8NnDT82u+6GgQVrLqpNo+Cif1Pyu0Ek2wE8M6jZ4FM7xQaU1v
 +bFX91hqJbHc80hkK1oR/Pz+Op+OONA55kskKtCE3SZLvZm3EXD0ZXXeCGtj0ECw
 GxLRUqBd4KE3wOjHvwl2AZ4XZVedUIO2ddnyanPOKjH+lMFrW3uMvxOa0znd59Ym
 YGdlWVubJ4wEwnT3s1kZd0sOAykHTjrB4IBhCPysGpa0exaY5ZTE+rZ7VTu0Stav
 JXn3WtzYim7U5uUjQK8wqfe+gg42nHZ37KzQeJrUpv/Ybnh7SVEkuIwzLuFKKiyI
 RBZGGLs=
 =Ksu8
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Just handful changes at this time. The only major change is the
  regression fix about the x86 WC-page buffer allocation.

  The rest are trivial data-race fixes for ALSA sequencer core, the
  possible out-of-bounds access fixes in the new ALSA control hash code,
  and a few device-specific workarounds and fixes"

* tag 'sound-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Add quirk for LH Labs Geek Out HD Audio 1V5
  ALSA: hda/realtek: Add speaker AMP init for Samsung laptops with ALC298
  ALSA: control: Re-order bounds checking in get_ctl_id_hash()
  ALSA: control: Fix an out-of-bounds bug in get_ctl_id_hash()
  ALSA: hda: intel-nhlt: Correct the handling of fmt_config flexible array
  ALSA: seq: Fix data-race at module auto-loading
  ALSA: seq: oss: Fix data-race for max_midi_devs access
  ALSA: memalloc: Revive x86-specific WC page allocations again
2022-09-01 09:05:25 -07:00
Andy Shevchenko
647e82dbf8 platform/x86: p2sb: Fix UAF when caller uses resource name
We have to copy only selected fields from the original resource.
Because a PCI device will be removed immediately after getting
its resources, we may not use any allocated data, hence we may
not copy any pointers.

Consider the following scenario:

  1/ a caller of p2sb_bar() gets the resource;

  2/ the resource has been copied by platform_device_add_data()
     in order to create a platform device;

  3/ the platform device creation will call for the device driver's
     ->probe() as soon as a match found;

  4/ the ->probe() takes given resources (see 2/) and tries to
     access one of its field, i.e. 'name', in the
     __devm_ioremap_resource() to create a pretty looking output;

  5/ but the 'name' is a dangling pointer because p2sb_bar()
     removed a PCI device, which 'name' had been copied to
     the caller's memory.

  6/ UAF (Use-After-Free) as a result.

Kudos to Mika for the initial analisys of the issue.

Fixes: 9745fb0747 ("platform/x86/intel: Add Primary to Sideband (P2SB) bridge support")
Reported-by: kernel test robot <oliver.sang@intel.com>
Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/linux-i2c/YvPCbnKqDiL2XEKp@xsang-OptiPlex-9020/
Link: https://lore.kernel.org/linux-i2c/YtjAswDKfiuDfWYs@xsang-OptiPlex-9020/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220901113406.65876-1-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-01 17:51:34 +02:00
Luke D. Jones
5542dfc582 platform/x86: asus-wmi: Increase FAN_CURVE_BUF_LEN to 32
Fix for TUF laptops returning with an -ENOSPC on calling
asus_wmi_evaluate_method_buf() when fetching default curves. The TUF method
requires at least 32 bytes space.

This also moves and changes the pr_debug() in fan_curve_check_present() to
pr_warn() in fan_curve_get_factory_default() so that there is at least some
indication in logs of why it fails.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20220828074638.5473-1-luke@ljones.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-01 17:51:34 +02:00
Russ Weight
789bba82f6 firmware_loader: Fix memory leak in firmware upload
In the case of firmware-upload, an instance of struct fw_upload is
allocated in firmware_upload_register(). This data needs to be freed
in fw_dev_release(). Create a new fw_upload_free() function in
sysfs_upload.c to handle the firmware-upload specific memory frees
and incorporate the missing kfree call for the fw_upload structure.

Fixes: 97730bbb24 ("firmware_loader: Add firmware-upload support")
Cc: stable <stable@kernel.org>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220831002518.465274-1-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 17:47:27 +02:00
Russ Weight
8b40c38e37 firmware_loader: Fix use-after-free during unregister
In the following code within firmware_upload_unregister(), the call to
device_unregister() could result in the dev_release function freeing the
fw_upload_priv structure before it is dereferenced for the call to
module_put(). This bug was found by the kernel test robot using
CONFIG_KASAN while running the firmware selftests.

  device_unregister(&fw_sysfs->dev);
  module_put(fw_upload_priv->module);

The problem is fixed by copying fw_upload_priv->module to a local variable
for use when calling device_unregister().

Fixes: 97730bbb24 ("firmware_loader: Add firmware-upload support")
Cc: stable <stable@kernel.org>
Reported-by: kernel test robot <oliver.sang@intel.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220829174557.437047-1-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 17:46:54 +02:00
Pavel Begunkov
916d72c10a selftests/net: return back io_uring zc send tests
Enable io_uring zerocopy send tests back and fix them up to follow the
new inteface.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/c8e5018c516093bdad0b6e19f2f9847dea17e4d2.1662027856.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-09-01 09:13:33 -06:00
Pavel Begunkov
b48c312be0 io_uring/net: simplify zerocopy send user API
Following user feedback, this patch simplifies zerocopy send API. One of
the main complaints is that the current API is difficult with the
userspace managing notification slots, and then send retries with error
handling make it even worse.

Instead of keeping notification slots change it to the per-request
notifications model, which posts both completion and notification CQEs
for each request when any data has been sent, and only one CQE if it
fails. All notification CQEs will have IORING_CQE_F_NOTIF set and
IORING_CQE_F_MORE in completion CQEs indicates whether to wait a
notification or not.

IOSQE_CQE_SKIP_SUCCESS is disallowed with zerocopy sends for now.

This is less flexible, but greatly simplifies the user API and also the
kernel implementation. We reuse notif helpers in this patch, but in the
future there won't be need for keeping two requests.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/95287640ab98fc9417370afb16e310677c63e6ce.1662027856.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-09-01 09:13:33 -06:00
Pavel Begunkov
57f332246a io_uring/notif: remove notif registration
We're going to remove the userspace exposed zerocopy notification API,
remove notification registration.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/6ff00b97be99869c386958a990593c9c31cf105b.1662027856.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-09-01 09:13:33 -06:00
Pavel Begunkov
d9808ceb31 Revert "io_uring: rename IORING_OP_FILES_UPDATE"
This reverts commit 4379d5f15b.

We removed notification flushing, also cleanup uapi preparation changes
to not pollute it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/89edc3905350f91e1b6e26d9dbf42ee44fd451a2.1662027856.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-09-01 09:13:33 -06:00
Pavel Begunkov
23c12d5fc0 Revert "io_uring: add zc notification flush requests"
This reverts commit 492dddb4f6.

Soon we won't have the very notion of notification flushing, so remove
notification flushing requests.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/8850334ca56e65b413cb34fd158db81d7b2865a3.1662027856.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-09-01 09:13:33 -06:00
Pavel Begunkov
75847100c3 selftests/net: temporarily disable io_uring zc test
We're going to change API, to avoid build problems with a couple of
following commits, disable io_uring testing.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/12b7507223df04fbd12aa05fc0cb544b51d7ed79.1662027856.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-09-01 09:13:33 -06:00
Florian Fainelli
9b03e79300 arch_topology: Silence early cacheinfo errors when non-existent
Architectures which do not have cacheinfo such as ARM 32-bit would spit
out the following during boot:

 Early cacheinfo failed, ret = -2

Treat -ENOENT specifically to silence this error since it means that the
platform does not support reporting its cache information.

Fixes: 3fcbf1c77d ("arch_topology: Fix cache attributes detection in the CPU hotplug path")
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Michael Walle <michael@walle.cc>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220805230736.1562801-1-f.fainelli@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 16:31:09 +02:00
Carlos Llamas
1da52815d5 binder: fix alloc->vma_vm_mm null-ptr dereference
Syzbot reported a couple issues introduced by commit 44e602b4e5
("binder_alloc: add missing mmap_lock calls when using the VMA"), in
which we attempt to acquire the mmap_lock when alloc->vma_vm_mm has not
been initialized yet.

This can happen if a binder_proc receives a transaction without having
previously called mmap() to setup the binder_proc->alloc space in [1].
Also, a similar issue occurs via binder_alloc_print_pages() when we try
to dump the debugfs binder stats file in [2].

Sample of syzbot's crash report:
  ==================================================================
  KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f]
  CPU: 0 PID: 3755 Comm: syz-executor229 Not tainted 6.0.0-rc1-next-20220819-syzkaller #0
  syz-executor229[3755] cmdline: ./syz-executor2294415195
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
  RIP: 0010:__lock_acquire+0xd83/0x56d0 kernel/locking/lockdep.c:4923
  [...]
  Call Trace:
   <TASK>
   lock_acquire kernel/locking/lockdep.c:5666 [inline]
   lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
   down_read+0x98/0x450 kernel/locking/rwsem.c:1499
   mmap_read_lock include/linux/mmap_lock.h:117 [inline]
   binder_alloc_new_buf_locked drivers/android/binder_alloc.c:405 [inline]
   binder_alloc_new_buf+0xa5/0x19e0 drivers/android/binder_alloc.c:593
   binder_transaction+0x242e/0x9a80 drivers/android/binder.c:3199
   binder_thread_write+0x664/0x3220 drivers/android/binder.c:3986
   binder_ioctl_write_read drivers/android/binder.c:5036 [inline]
   binder_ioctl+0x3470/0x6d00 drivers/android/binder.c:5323
   vfs_ioctl fs/ioctl.c:51 [inline]
   __do_sys_ioctl fs/ioctl.c:870 [inline]
   __se_sys_ioctl fs/ioctl.c:856 [inline]
   __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
   do_syscall_x64 arch/x86/entry/common.c:50 [inline]
   do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
   entry_SYSCALL_64_after_hwframe+0x63/0xcd
   [...]
  ==================================================================

Fix these issues by setting up alloc->vma_vm_mm pointer during open()
and caching directly from current->mm. This guarantees we have a valid
reference to take the mmap_lock during scenarios described above.

[1] https://syzkaller.appspot.com/bug?extid=f7dc54e5be28950ac459
[2] https://syzkaller.appspot.com/bug?extid=a75ebe0452711c9e56d9

Fixes: 44e602b4e5 ("binder_alloc: add missing mmap_lock calls when using the VMA")
Cc: <stable@vger.kernel.org> # v5.15+
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: syzbot+f7dc54e5be28950ac459@syzkaller.appspotmail.com
Reported-by: syzbot+a75ebe0452711c9e56d9@syzkaller.appspotmail.com
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20220829201254.1814484-2-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 16:16:05 +02:00
Johan Hovold
689a2d9f93 misc: fastrpc: increase maximum session count
The SC8280XP platform uses 14 sessions for the compute DSP so increment
the maximum session count.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220829080531.29681-4-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 16:13:07 +02:00
Johan Hovold
d245f43aab misc: fastrpc: fix memory corruption on open
The probe session-duplication overflow check incremented the session
count also when there were no more available sessions so that memory
beyond the fixed-size slab-allocated session array could be corrupted in
fastrpc_session_alloc() on open().

Fixes: f6f9279f2b ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
Cc: stable@vger.kernel.org      # 5.1
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220829080531.29681-3-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 16:13:07 +02:00
Johan Hovold
9baa1415d9 misc: fastrpc: fix memory corruption on probe
Add the missing sanity check on the probed-session count to avoid
corrupting memory beyond the fixed-size slab-allocated session array
when there are more than FASTRPC_MAX_SESSIONS sessions defined in the
devicetree.

Fixes: f6f9279f2b ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
Cc: stable@vger.kernel.org      # 5.1
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220829080531.29681-2-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 16:13:07 +02:00
Jens Axboe
2565779837 nvme fixes for Linux 6.0
- error handling fix for the new auth code (Hannes Reinecke)
  - fix unhandled tcp states in nvmet_tcp_state_change (Maurizio Lombardi)
  - add NVME_QUIRK_BOGUS_NID for Lexar NM610 (Shyamin Ayesh)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmMQXuALHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYO/Zg/8Ch+RmrWtnObzfOZJ8vRdnFP+pK9gl+JRDVBoRNOF
 2hmGw5VlVVtFcbn9iUwwU6sfk04T92uiDzD7MPj+uIPL5b6QXKy6+t2ujyRQPJhY
 b5ydSDQMIte2YkppYqEsj0p+odmaHZzL9i8+rEiiZbVAZjk9Ss3TjdNVhJajLAdB
 ZSpg8KdS4Z5ftVVnFDpEl+iMc1ZasxFfxAHhxLTvk82cJBUxZNfOJ5iniSo8Mojc
 rkyp0vtOuhiGtnNqmLBsZiMZBeveg1Qg41OKyfdUI1BZ9Y+2k4YFzAHuf/esEL9y
 vs4O2bOJaZMQJR9ZkjWhSCMY9hwjDmUZDn7osqCWmSwhlTQ3niQrHX5LWU2zWuDm
 zrsPvwlPLgqfthyoLN6o7BnQ2n5Sr3dSwsU5xS/FX8v7ijMPkUQWqC2xJxcoVwHW
 7EeoX1l1oiVK7hldrIKsN4qC950KrOqP5B1V9Tu+0R5xgbaKooVko0vEBaMa/mv3
 s7c6FTGbEA2O34sxVQF6PqjWDgbdc4Ezi+ogg4hxOYHTgBcw5lsrrP36EQxaSDkU
 gpdplYZzWNEZkLf0FCFvbjRyAUu23YyhXlynj0p2JTZ7XOsXGu803Hf5L1IUcRrM
 NqjiX+0mQaLQ6VsXM+W7KLqv5h/B+jIcxZ7eZWQcO7LiqTEM8ZbxIPorsF+wdjZS
 icQ=
 =839a
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.0-2022-09-01' of git://git.infradead.org/nvme into block-6.0

Pull NVMe fixes from Christoph:

"nvme fixes for Linux 6.0

 - error handling fix for the new auth code (Hannes Reinecke)
 - fix unhandled tcp states in nvmet_tcp_state_change (Maurizio Lombardi)
 - add NVME_QUIRK_BOGUS_NID for Lexar NM610 (Shyamin Ayesh)"

* tag 'nvme-6.0-2022-09-01' of git://git.infradead.org/nvme:
  nvmet-tcp: fix unhandled tcp states in nvmet_tcp_state_change()
  nvmet-auth: add missing goto in nvmet_setup_auth()
  nvme-pci: add NVME_QUIRK_BOGUS_NID for Lexar NM610
2022-09-01 08:11:11 -06:00
Hu Xiaoying
c61feaee68 usb: storage: Add ASUS <0x0b05:0x1932> to IGNORE_UAS
USB external storage device(0x0b05:1932), use gnome-disk-utility tools
to test usb write  < 30MB/s.
if does not to load module of uas for this device, can increase the
write speed from 20MB/s to >40MB/s.

Suggested-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hu Xiaoying <huxiaoying@kylinos.cn>
Link: https://lore.kernel.org/r/20220901045737.3438046-1-huxiaoying@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 16:06:52 +02:00
Isaac J. Manjarres
25e9fbf0fd driver core: Don't probe devices after bus_type.match() probe deferral
Both __device_attach_driver() and __driver_attach() check the return
code of the bus_type.match() function to see if the device needs to be
added to the deferred probe list. After adding the device to the list,
the logic attempts to bind the device to the driver anyway, as if the
device had matched with the driver, which is not correct.

If __device_attach_driver() detects that the device in question is not
ready to match with a driver on the bus, then it doesn't make sense for
the device to attempt to bind with the current driver or continue
attempting to match with any of the other drivers on the bus. So, update
the logic in __device_attach_driver() to reflect this.

If __driver_attach() detects that a driver tried to match with a device
that is not ready to match yet, then the driver should not attempt to bind
with the device. However, the driver can still attempt to match and bind
with other devices on the bus, as drivers can be bound to multiple
devices. So, update the logic in __driver_attach() to reflect this.

Fixes: 656b8035b0 ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()")
Cc: stable@vger.kernel.org
Cc: Saravana Kannan <saravanak@google.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Link: https://lore.kernel.org/r/20220817184026.3468620-1-isaacmanjarres@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-01 15:57:13 +02:00
Vadim Pasternak
791ae8e896 platform/mellanox: Remove redundant 'NULL' check
Remove 'NULL' check for 'data->hpdev.client' in error flow of
mlxreg_lc_probe(). It cannot be 'NULL' at this point.

Fixes: b4b830a34d  ("platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-5-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-01 14:22:48 +02:00
Vadim Pasternak
2f92fdd043 platform/mellanox: Remove unnecessary code
Remove redundant 'NULL' check for of if 'data->notifier'.

Replace 'return err' by 'return 0' in mlxreg_lc_probe().

Fixes: 62f9529b8d ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-4-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-01 14:22:48 +02:00
Vadim Pasternak
1e092b7faa platform/mellanox: mlxreg-lc: Fix locking issue
Fix locking issues:
- mlxreg_lc_state_update() takes a lock when set or clear
  "MLXREG_LC_POWERED".
- All the devices can be deleted before MLXREG_LC_POWERED flag is cleared.

To fix it:
- Add lock() / unlock() at the beginning / end of
  mlxreg_lc_event_handler() and remove locking from
  mlxreg_lc_power_on_off() and mlxreg_lc_enable_disable()
- Add locked version of mlxreg_lc_state_update() -
  mlxreg_lc_state_update_locked() for using outside
  mlxreg_lc_event_handler().

(2) Remove redundant NULL check for of if 'data->notifier'.

Fixes: 62f9529b8d ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-3-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-01 14:22:48 +02:00
Vadim Pasternak
17c2bd6bea platform/mellanox: mlxreg-lc: Fix coverity warning
Fix smatch warning:
drivers/platform/mellanox/mlxreg-lc.c:866 mlxreg_lc_probe() warn: passing zero to 'PTR_ERR'
by removing 'err = PTR_ERR(regmap)'.

Fixes: b4b830a34d ("platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-2-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-09-01 14:22:48 +02:00