Commit graph

1,234,844 commits

Author SHA1 Message Date
Romain Perier
cfb67623ce dt-bindings: rtc: Add Mstar SSD202D RTC
Add YAML bindings for Mstar SSD202D RTC.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Link: https://lore.kernel.org/r/20230913151606.69494-3-romain.perier@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-10-16 16:54:26 +02:00
Romain Perier
ebf6255868 rtc: Add support for the SSD202D RTC
Newer SigmaStar SSD202D SoCs contain a Real Time Clock, capable of
running while the system is sleeping (battery powered), this is not the
case with the other RTC on older SoCs. This adds basic support for this
RTC block.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Co-developed-by: Daniel Palmer <daniel@0x0f.com>
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Link: https://lore.kernel.org/r/20230913151606.69494-2-romain.perier@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-10-16 16:54:15 +02:00
Mark Brown
85045a9e44
ASoC: SOF: misc updates for 6.7
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

New PCI ID, one fix for a delayed IRQ thread causing issues, one
update for debug and one follow-up cleanup for the .remove callback.
2023-10-16 15:41:55 +01:00
Mark Brown
93a83b76b8
ASoC: codecs: rt715*: update misleading error log
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Improve two errors logs which report bad information.
2023-10-16 15:41:47 +01:00
Mark Brown
2e1a4596dc
ASoC: Intel: boards: updates for 6.7
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

A couple of new boards, one DMI quirk fix and a nice cleanup from
Brent Lu to make all HDMI stuff common across drivers.
2023-10-16 15:41:40 +01:00
Konrad Dybcio
b998684618 drm/msm/a6xx: Fix up QMP handling
The commit referenced in the Fixes tag had a couple problems (as
pointed out by Dan):

- qmp_put was never called, resulting in refcnt leaks
- failling to acquire the QMP mailbox on A7xx would not undo the probe
  function properly
- the qmp_put call present in the code was unreachable

Fix all of these issues.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 88a0997f2f ("drm/msm/a6xx: Send ACD state to QMP at GMU resume")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/562761/
Signed-off-by: Rob Clark <robdclark@chromium.org>
2023-10-16 07:29:42 -07:00
Dmitry Baryshkov
5e05be7826 drm/msm/dsi: free TX buffer in unbind
If the drm/msm init code gets an error during output modeset
initialisation, the kernel will report an error regarding DRM memory
manager not being clean during shutdown. This is because
msm_dsi_modeset_init() allocates a piece of GEM memory for the TX
buffer, but destruction of the buffer happens only at
msm_dsi_host_destroy(), which is called during DSI driver's remove()
time, much later than the DRM MM shutdown.

To solve this issue, move the TX buffer destruction to dsi_unbind(), so
that the buffer is destructed at the correct time. Note, we also have to
store a reference to the address space, because priv->kms->aspace is
cleared before components are unbound.

Reported-by: Bjorn Andersson <andersson@kernel.org>
Fixes: 8f59ee9a57 ("drm/msm/dsi: Adjust probe order")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/562238/
Signed-off-by: Rob Clark <robdclark@chromium.org>
2023-10-16 07:27:33 -07:00
Dmitry Baryshkov
69b321b2c3 drm/msm/dsi: use msm_gem_kernel_put to free TX buffer
Use exiting function to free the allocated GEM object instead of
open-coding it. This has a bonus of internally calling
msm_gem_put_vaddr() to compensate for msm_gem_get_vaddr() in
msm_get_kernel_new().

Fixes: 1e29dff004 ("drm/msm: Add a common function to free kernel buffer objects")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/562239/
Signed-off-by: Rob Clark <robdclark@chromium.org>
2023-10-16 07:27:33 -07:00
Arnd Bergmann
5e24617f66 Qualcomm ARM64 DeviceTree fixes for v6.6
This fixes an error with an incorrect gpio-ranges preventing the PMIC
 GPIO instances from being registered on SA877P, and fixes a regression
 from a refactoring of the top-level clocks node that caused divclocks to
 no longer probe on a few of the MSM8996 devices.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmUsKLQVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FXC8P/1myl64TT+FCvlKbE9qwiFQYd30J
 zFRSH38P3XLGZ15QEg8raJdMrGLO319fISh30mepYfAdJLfxaP4qY2okT9vOLbsC
 SlG9QwJScE87t88lJMb/3m7l/Vo9yy1PNjcE4AUPKwdOqMR3x6nzjqKAMVJIGwkh
 T20LSqnZh2hpvSV2dtCgSvs3CTqCdKusY5EC7zQhsPds0DCjeujhBMiQOmjiS2MZ
 TWY8pX7mqZX9gV5UYYPmCbql+v8TLPgrQ3E3MCRWCpsqIcIEClGG9vPfA7JrmUOo
 aHL1lcxDvhxrjn5Bxutny5sDQAKuSzOoCSRJ8m5Xw7IbVlR8PeP9ESBLhw/LaFuP
 Ej5atetgpqwARueeZgn6CpwVVXFlD/ruuhq8QRCjrRtpv9NeUN84jVv2eBd6Nzvf
 j0KVUdeem1dXmzbFZ+iPkQuwW9fuiElp2vg8Anlz14trVVYpbOVQbSkhQVxxHhw2
 MRymdfBuwUt/IfRtO4w0llqww3W2oPRLHYkmmkgZQJmaRipuCeAXklnuKOzNde+I
 BTENX32wgj1+U7CBWeFzryXfB+iKSuu/03py815zAHiTksKKmgU11qT7V9pVp5Bw
 LSPncRSseJO3NczZenTVwkX6aQf2zaonEBlL/EVJGi5B9ye4jRKO+gfMjU00fVAs
 LrjkGB7bDUyRloiN
 =EGy8
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtRiEACgkQYKtH/8kJ
 UicIEg//cbTJuU0JlL5AOsjxY9mai74oDeGh59a4et3L7BDh/pqfNySwHmIl3F0s
 5Lk+k1cJ+xoMFRGfOpGNYVjR1jhB+UtyiiXA+o6jQFGI+jVHuGczF62W555Z8wAI
 IYnjL4N8Ey1w8nO9nsuvj6anMZ1s6G+pjbhVFK3LZBr0RTra6n5yw5FnWZb3VWdg
 s9C3msyp/do+eJK+nmy4+RE/+DdLEJxyPXADSKRN83RI3obvhVDj1VnjjV8ewHbE
 cwPLmi9rFIeuAx4GPR2SM+pZVk6BZu4Yhpz3xtclTvek3geg44JtEUhruVmJOa0K
 3w7M5CHg1BNWSQssKJTprFJ54s6Ss75L5vfpLtS9MaqcGcWA8TYy+aUOMQ5Ql1Ie
 ZGJUD2vMYvafrTyACYyZN1nZo5cZFofTKdu4Ty7XlmVs+7n+k9k4TlOidc4hOXSG
 djOMxG27tkMmut+Y9VLqobbRu1WB1PcOvrnh6e/s7L+m3Z6NyJO9eeyKAbgbX2+n
 MnHQ0rAWJEi+r5+5IWRwyJogN2x9zBzYlnaDJeOT9TarTvlWaLd+tX0Ubw6tfHQP
 FHPzb2Nl4OTOmwV8lZgxQTIc2bOpBq7OPxvGV1AXcOXUK7iwmQPOsHbWd0DAvrUZ
 Dv4+x0DKAXH3EpbGAI3dzQlbiwjfo31nglS6uNc3hKZX5gDaynk=
 =O/dR
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-fixes-for-6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes

Qualcomm ARM64 DeviceTree fixes for v6.6

This fixes an error with an incorrect gpio-ranges preventing the PMIC
GPIO instances from being registered on SA877P, and fixes a regression
from a refactoring of the top-level clocks node that caused divclocks to
no longer probe on a few of the MSM8996 devices.

* tag 'qcom-arm64-fixes-for-6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  arm64: dts: qcom: msm8996-xiaomi: fix missing clock populate
  arm64: dts: qcom: apq8096-db820c: fix missing clock populate
  arm64: dts: qcom: sa8775p: correct PMIC GPIO label in gpio-ranges

Link: https://lore.kernel.org/r/20231015180112.853805-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 16:18:09 +02:00
Arnd Bergmann
36fb6a3ccf i.MX fixes for 6.6, round 2:
- Fix an use_after_free bug in imx_dsp_setup_channels() that is
   introduced by commit e527adfb9b ("firmware: imx-dsp: Fix an error
   handling path in imx_dsp_setup_channels()")
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmUrqhMUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7a/Af+Pdn3GR+/DPFAI2/YmntzdAYy4N+w
 7OY7TildeYe70k876BKd2HECk6bdb77USEBbvBi52UAZxVVeYIGKPXLXbDtaLp9s
 y86ITH4HAMZl4NB3MD552fCe+HNXVZAif4MDWzbScUKVm55oJ7pnNd3kgxI3D3VJ
 U7lKhAtaKsd0ezNM09Z1DQCaj2C5YFmpUu0mewiUlyRK9Hhnu5q6jISxIRBNo5uV
 YhKdT1U6LsfYtJm3GVuLl1LrjgpGWArjK1dyUN8NmSB4n1Ip2H2a34xKPbw9DMgn
 oJnwyRhQRibNf6/eLd21AW5WQoeY5IVDT61p8J0H0uHDb5hxOM39rqilUQ==
 =2M5c
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtRfkACgkQYKtH/8kJ
 Uidfyw/7BS/vdANa1cPf+qHg4Q7Bp4Vi8RDrklp8ZGl4ZCvCEOdA7tryUEUNVj66
 wnd83KNuYlxPhzLxM/Ct52PD+Uuamz+NBBYDIhlp1NQ+Ezibr7NO7bYGCqtZHki+
 QXWdTNcSp8rIU3tDhznc3PVZur17jDm4yiPPRQkoZrJOYe7PY1F/0WwCaBMvBv5W
 v9SGHpSqXjAR3/rJHuLmiQcaWlScrzSBLM8ygoLLb7YYeIEqwHMKkHeddTMQfWJu
 o9mUvqzTT3A509oUseo1lpnIATJcwX9s2o6GYqyTC+uUSe8PU3AhObTOdXQp5m6Q
 mhuKB5q/4/vr/3Y3slIZWWmosT6ld8czpwxDAtiv5II3ipmf1lgaWJSY+n6DDcRA
 HIISHEcruP1Lly06xFumaoMC6R9OyagoxxNHw8zECUqx7PrGarn0iiMT9fhAL6W2
 vC/23Da37tYQsFJWCNdhnxYIEevS4mPdGrhH4clJb1NI9R/eIfbSAKvqrNqOBy4W
 HJPMP7ZPwaT/jM4tRMF5VDDbndi6fj9gKE7HXhR1CiGGeH7epAyIm7gr69pyrb+6
 J+vvKWUZJKxHmfSKrqIJ1XSAv02jRt0E1z+wPcyDr+WKzNgMNn6b5ZNrSUUkLajB
 ryzVZ9CH1ZjOL6dRZFPiqtbvarNCwA5wHbkyo132RWOBAohK5xg=
 =Lvfj
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 6.6, round 2:

- Fix an use_after_free bug in imx_dsp_setup_channels() that is
  introduced by commit e527adfb9b ("firmware: imx-dsp: Fix an error
  handling path in imx_dsp_setup_channels()")

* tag 'imx-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels()

Link: https://lore.kernel.org/r/20231015090202.GW819755@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 16:17:29 +02:00
Arnd Bergmann
606c577f75 Renesas fixes for v6.6 (take two)
- Fix build failures due to missing RZ/Five dependencies.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZSkq3QAKCRCKwlD9ZEnx
 cKyFAP9nhWLE1ow2pYIX66+X9P0pQjJCODIwDXVXlmNPv0vHEQEA8Zk0X8Y7aaeh
 Sf1acQ7FOsreUH5QaExZyKkcQLQOVQw=
 =fU+0
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtRccACgkQYKtH/8kJ
 UicpfQ//Y+C/3anI6HhGyJrwshG5VMvrNnrbhRwKwkyWm6hAaNYbUyutk2zKunpj
 CvNVBofgwmQ6I91PaYXpy392K0FkZkdm6jFM4bu+hdwuGN1zC64mmjAbNy5Ay+Eh
 c0Tax7WBp9e73b6FkTg8PHYJJIWXhExCGOd3Vz/87Gm3FKS82Ei+TQRu/yazUIZe
 EaOL+IJueASj8GrEzJMVoWdyY3+Ez5ww3NjMn0hkmP4FBeUO27XcRqse8tD/Rppp
 aliBCSxl6XhOFSCpHSmUu/S0gAwsrxe4MgzMNUu+s+6gJfwz0XCAOHKDq3FUOF8j
 jtQ6Xs+4Pda3VAGfwzshT9ovZYMNhFTcHkvLUevQdGpVT9u3njZS/sj+IUcU8TWd
 zJExSqN/ImXywIr/5v5bHZ6b3jxCvslk9Girp06UeMIipCrFtDeVqQw5i1nIvCml
 GYpTE5ZYxhEz/pLzeJ75JD5n5VR+SQVKC/60d3An7+VklOYviviRLd8msEE4i4dw
 O1QJwJlR8/LMBUuv/Ja0D2SwFh0+4PZULo6njR9Iwzh52cYWnKwr7P5iTF5gkVCy
 IGlOJaB6R3t0+cRBQpZhoyeNLxTmnm6+ui/HA8GL1R32+S6pWQ2lDrxgaXYPzINT
 c7G3aPWJbA2t4/MmqugnuDD+VchUeaQSMe/WSgeDFIzpEbN1u+4=
 =g+Ws
 -----END PGP SIGNATURE-----

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

Renesas fixes for v6.6 (take two)

  - Fix build failures due to missing RZ/Five dependencies.

* tag 'renesas-fixes-for-v6.6-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  soc: renesas: Make ARCH_R9A07G043 depend on required options

Link: https://lore.kernel.org/r/cover.1697199963.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 16:16:39 +02:00
Arnd Bergmann
0e70ecbb2b STM32 DT for v6.7, round 1
Highlights:
 ----------
 
 - MCU:
   - Add SDIO  sleep pins for F7 boards.
 
 - MPU:
   - STM32MP13:
     - Add HASH and RNG support.
 
   - STMP32MP15:
     - OCTAVO:
       - Fix regulators (LDO1/2/6 and 3v3_hdmi) by removing "always-on"
         property on OSD32 common file.
       - Add new OS32MP1-RED board. It embeds a STM32157C SoC,
         512 MB of DDR3, CAN-FD, HDMI, USB-C OTG.
 
   - STM32MP25:
     - Add and enable SDCARD support.
     - Add and enable ARM watchdog support and set it to 32 seconds.
 -----BEGIN PGP SIGNATURE-----
 
 iQJRBAABCgA7FiEEctl9+nxzUSUqdELdf5rJavIecIUFAmUs+kAdHGFsZXhhbmRy
 ZS50b3JndWVAZm9zcy5zdC5jb20ACgkQf5rJavIecIUUfA//XYZhH8GOafGcOBfq
 8kuQLbb+vy5J3Dxa67kXwvpeMKMGpOKyhn0f26jG/8BMGVmVtj7W0NF9qt72RKgq
 lP+OwSsfJdOtIUm1b6yEixqgWxh8jcS+Q0OXrTWnjmBRAx82d/cdl4CJuBunR63b
 ZELa12unUCViZl/2+J0b83jLjLElhlwSf8hmeUlkLbKc3OxBm1CsJLzOoosxV+eT
 e7ij1B/PPFn9h4KWDuX2hVPRHDNrUb0QTOv0KhuhF67RET0JfzwpPnHDmu4X6ub5
 tzqRj1QAK6OF9aBXrponTvXOvruw9we4sppjppTusacdWR5kELO1jfmKToC8FYz3
 B5HQwJvEz7YsUFzOk5f1vhR1x7wqzIil+pVoVO02ncD4lt4437lBgegkhrnH7gaI
 /WV89RIdJSW2Kz7B0bxT9rZ+4RKnx5Ei2eaTSPrvL5wkFPwvh/c+jCCI3rBy9FDI
 K/2ik+dOYKVc8mK4RS/Cx7Al9PkLDkMuNh/OBdNnakAiaNS7iPC744isCCqB09PB
 YbyOe32VRvxMP0JKiyyX1Do6hOKVTjButtogWikQcxZj4c6bC6VNumOuu28355KT
 mnIQ15XYOn7sjdRJtBEG0sBZ9IqYM1WwOVUf+kYt8eGuGljSshUxsGjU34LJ5Kn9
 iG7m+hRnMoyP9OxMOMkUHZ9FUyQ=
 =TIS3
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtRP8ACgkQYKtH/8kJ
 Uicw6hAAr+ltlqqfbKQ/6fveHbZS8BtUsd15Wyx+LvAI9jWqEpqEygRqSmB4LLKT
 DcnrphkTBc15HtUmKAQhukWTwRBnbGJ0tRL83Wdd/SYtNf3yVaTalDxc+nH/SfAe
 dKnxRNcUP/7E+Y6Nw6R/N0TV7LpglhtmxuXrqBHRf8a30C/VGF9kkgZBu9kr0V9A
 tsVTUE0fjBD28bxuyBlxRnDWT1k1zk59HBy2f+eLu9LvFigyTm8xfTzBeCITpEzb
 X2qEpUQeDAsVUJacZuPTRfqlv0/AzbWi5PcIc6I/y71jOB8Q0p4DKN5siCKhEnRG
 yAviYZpcQtQrrciuQxwjFJRc4blU+NrKzbqNuAuJFedyzet8SZwoq6rKAbCAspFJ
 9s0PA8SGT1ajdL4lxEnm8O19w/4IlupUtlRE3V75xISDVJ3UI+iGI1gU7NDG53jS
 v3RQUx6z9GqM/q7i+srYlvTwfg0pBFjN8m00p/hrTvLgEjZ9PRaJvCE5Gx0n9q1Y
 LEETKUqNKwSOl1pEApJppVEvcMO3NFm26oDmAcObG2mSzsJXeUYs1fEwSysSv2uK
 qiZ7Ei8psZNFvzegY6xnh8q4yWjc8nqvj9NR/feZKMgMhjfWC2gT547YD83PW5K8
 fFfQ9jnzsvRA+KeVnqb/APrJv0qdA1sYa6MtDF0nCcfJdW1rfPo=
 =hwWt
 -----END PGP SIGNATURE-----

Merge tag 'stm32-dt-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into soc/dt

STM32 DT for v6.7, round 1

Highlights:
----------

- MCU:
  - Add SDIO  sleep pins for F7 boards.

- MPU:
  - STM32MP13:
    - Add HASH and RNG support.

  - STMP32MP15:
    - OCTAVO:
      - Fix regulators (LDO1/2/6 and 3v3_hdmi) by removing "always-on"
        property on OSD32 common file.
      - Add new OS32MP1-RED board. It embeds a STM32157C SoC,
        512 MB of DDR3, CAN-FD, HDMI, USB-C OTG.

  - STM32MP25:
    - Add and enable SDCARD support.
    - Add and enable ARM watchdog support and set it to 32 seconds.

* tag 'stm32-dt-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32:
  ARM: dts: stm32: add SDIO pinctrl sleep support on stm32f7 boards
  ARM: dts: stm32: add stm32f7 SDIO sleep pins
  ARM: dts: stm32: add RNG node for STM32MP13x platforms
  ARM: dts: stm32: omit unused pinctrl groups from stm32mp15 dtb files
  ARM: dts: stm32: stm32f7-pinctrl: don't use multiple blank lines
  ARM: dts: stm32: add HASH on stm32mp131
  arm64: dts: st: enable secure arm-wdt watchdog on stm32mp257f-ev1
  arm64: dts: st: add arm-wdt node for watchdog support on stm32mp251
  arm64: dts: st: add SD-card support on STM32MP257F-EV1 board
  arm64: dts: st: add sdmmc1 pins for stm32mp25
  arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file
  ARM: dts: stm32: Add Octavo OSD32MP1-RED board
  dt-bindings: arm: stm32: add extra SiP compatible for oct,stm32mp157c-osd32-red
  ARM: dts: stm32: osd32: fix ldo6 not required to be always-on
  ARM: dts: stm32: lxa-tac: remove v3v3_hdmi override
  ARM: dts: stm32: osd32: fix ldo2 not required to be always-on
  ARM: dts: stm32: osd32: fix ldo1 not required to be always-on
  ARM: dts: stm32: Add alternate pinmux for can pins
  ARM: dts: stm32: Add alternate pinmux for ldtc pins
  ARM: dts: stm32: Add alternate pinmux for i2s pins

Link: https://lore.kernel.org/r/8a6b3ca9-f10d-825e-e371-8aeff3289a25@foss.st.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 16:13:19 +02:00
Arnd Bergmann
0a84cbfb7f Amlogic ARM64 DT changes for v6.7:
- Add audio DT nodes for p200/p201/u200
 - Add a bunch of peripherals for Amlogic-T7 (watchdog, power domain, pinctrl)
 - Add a bunch or peripherals for Amlogic-A1 (clk, usb, efuse, spi, uarts, emmc, ADC, rng, i2c)
 - Add NAND node on Amlogic AXG
 - Again a bunch of DT fixups for DT bindings check
 - New boards:
  - Amlogic AD402 reference board based on A113L SoC
  - Libre Computer Cottonwood boards
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmUs8wYACgkQd9zb2sjI
 SdEXiw/+MfPqD8Wx3I4VTZ2BnmSf8Od+CwU88yQm3aZQam0YvAxLihtjZ6671Eqd
 fQEeisrw9eUBYo+Pq7BFgNMdAwzeZV8YikyDB3+ZBjh3GPZGcxraigEuX7qDeokQ
 mUoKA8nmm6//OFnOWUC0ujuMqrl+PslfN/5p8Rwwp2UM7Odm3FmDxnzy/VWNtXPA
 udd1Z/S3+kNGLXRiO/61IIF/5jfgVQgbIaibhfC1B0dospAtmEmVRSs48aYuwXRo
 cLCBqKqwMKlXDqZU69Tyu8oYSqWQAUpD0z7wqbdPEN2rIe4oxafQJY2VqmOkFwrP
 Dh27eQ885WcvFOyUbAW7zQ34XZgU37j6TJLxxlQs5eqcpK/P4C6h01S6Ax4ITWeC
 7H3lcMZTIgK6Tg0Sdf54X7NrFxzyAAUyDp0Zvbd4EpdTzNDEu+Elq38kuPAD3w9s
 9t4t0bZoeaSLMAmhu2+bOhPbIgkDVGRchoAHS0KtbvuK9GmNAV+caSUV9YCghk/s
 qobauksucwNe/TgrMezis5LYLzXGGWlhNWZIYeAAD5tW1O7lk3kqMJ4v2Y0DNYf3
 f89ZhYpRaOrPpDFpIMNT7uCcOoNE6ocnYSK647dJoMWK5YTLhsbI8EEFpedsAG+N
 vwiT7c1tlCyH5Hoarh2KPsFxq8u6D7rBTEE2kF92dlBD9aI1ptU=
 =EFey
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtRHQACgkQYKtH/8kJ
 Uifsdw//UBHJWSq6MulnpGQ9rigQwifLWwM2rXus/dvgBJbbFiwYun0nuMUon2oI
 71e49QaujnfT54AjDT2+CckBZxwLsy/XvL2atlw2R+CU5zqvERUihZaC0ABLR5Ce
 //MYf55r1NQJNDBumbJjLM410K7ATjlxH9eABxnS3wc49Q3dikiwpb3gtiVs1Dfa
 500MzSVKR7OsvhZHq06q3bisuBVxK6c+9nITuaJe3UM+03Vc5QwwIyWdZwmR1Sq5
 F94AMOrJJHWWZKqVZI7ZKb8OzC05axXvX3YAzZs/++Zzc83L2W6jb0O6T2iUWaSk
 U4E0ZeWpf/JJ8WtSe8Ml2ezvTMnKSLvSjBK86UtRoBnYkE3XvJ2hVAgSE4ntBe3d
 mKOyoLfAYC+Me3J9PLg7wE3EB5/WOGpENS7e27fSFEnIQw8+YRa9iy70rOPevob8
 vzpIfGlI5AHegkUIubJ11KsduSgGnqyIlczJUg8WWU2IlS89hh2HRR5xCyKywjWl
 Ni1rHHIXsZTxbfwEAikjUsUINH/za3pr1tUrJVta8kR36gbY0GyRazflTfMZ9zTW
 6+BTlM6XzaK/jgo1y+OY0jwvJz+8L2AbaCxKvBtVP+Uo1z45AOTZfRVFhQ5QmmYP
 k77bN54hrSTs2BN3M0kBIudDXF/41P7ikUfzSwcZit4yQiNRYoM=
 =Knom
 -----END PGP SIGNATURE-----

Merge tag 'amlogic-arm64-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/dt

Amlogic ARM64 DT changes for v6.7:
- Add audio DT nodes for p200/p201/u200
- Add a bunch of peripherals for Amlogic-T7 (watchdog, power domain, pinctrl)
- Add a bunch or peripherals for Amlogic-A1 (clk, usb, efuse, spi, uarts, emmc, ADC, rng, i2c)
- Add NAND node on Amlogic AXG
- Again a bunch of DT fixups for DT bindings check
- New boards:
 - Amlogic AD402 reference board based on A113L SoC
 - Libre Computer Cottonwood boards

* tag 'amlogic-arm64-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: (38 commits)
  arm64: dts: amlogic: a1: support all i2c masters and their muxes
  arm64: dts: amlogic: add libretech cottonwood support
  dt-bindings: arm: amlogic: add libretech cottonwood support
  arm64: dts: meson-a1-ad402: set SPIFC pins
  arm64: dts: meson: a1: Add SPIFC mux pins
  arm64: dts: meson-s4: add hwrng node
  arm64: dts: meson: g12: name spdifout consistently
  arm64: dts: Add pinctrl node for Amlogic T7 SoCs
  arm64: dts: meson: u200: add onboard devices
  arm64: dts: meson: u200: use TDM C for HDMI
  arm64: dts: meson: u200: add spdifout b routes
  arm64: dts: meson: u200: add missing audio clock controller
  arm64: dts: meson: u200: fix spdif output pin
  arm64: dts: amlogic: t7: add power domain controller node
  dt-bindings: power: add Amlogic T7 power domains
  arm64: dts: meson-g12: Fix compatible for amlogic,g12a-tdmin
  arm64: dts: meson-g12: Fix clock order for amlogic,axg-tdm-iface devices
  arm64: dts: amlogic: meson-axg: Meson NAND node
  dt-bindings: arm: amlogic: add Amlogic AD402 bindings
  arm64: dts: introduce Amlogic AD402 reference board based on A113L SoC
  ...

Link: https://lore.kernel.org/r/b3e1bf66-9182-4d48-88ef-7efc20466e7c@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 16:11:00 +02:00
Bartosz Golaszewski
ada1682d60 firmware: qcom: qseecom: add missing include guards
The qseecom header does not contain ifdef guards against multiple
inclusion. Add them.

Fixes: 00b1248606 ("firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20231004185732.98621-1-brgl@bgdev.pl
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-10-16 07:08:23 -07:00
Arnd Bergmann
94d310e178 ASPEED device tree updates for 6.7
- New machine:
 
   * Facebook's Minevra, as Chassis Management Controller using the
     AST2600
 
  - Updates to Ampere's Mt Mitchell and Mt Jade systems, and IBM's
    Bonnell
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRz6FSYRMHvZ436fLaBQBa54y6+yAUCZSyNCQAKCRCBQBa54y6+
 yKsyAP0f/RYaNG3c2afpEjqci7/ek8u8Ts9sVazEprgwZsrhrQEA2TpCyLS3PJ3H
 CTuBEj1FZkepPzOzpNzVsKY0MkIBPQs=
 =KbHd
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtQ6UACgkQYKtH/8kJ
 UicL1hAAnzoh/+JNqwWfgHcDT0Q/QKDUrrXgowmZW6XLHMJGer88mJO018Z2SyTO
 3xavqK40xwD3ynZ6vrXewF3ti2SClyD08bg5ojru912QWxYyBetEYNulcnu0myRv
 KBaZgwKhAFaEomIEZsnXjLuJNNvqtiYkXQBwMxBvgK7PbRwYStVOsPY9jxWUPbCR
 LV3OCA6KIhZQKzd5bMv1SvIozUK69V/HTL9Yt+ug1D/CGp/Qtg7/FyL3XlNKMM32
 DFxaAlHyn4h1KWnSSGQaF7MfTm75XYZ1IykOBgM9J8ffcKv8cuIKW5FOtZb3mdeh
 kAKLArpFlnGdtskAjhG9hIrkkZ+auiX+rvVP8HDIjFAhIoL0f4YRfc8YJzTxi6O7
 Z6qxPn4iQaAus+qS3/qfGZeZZa4shR714qzxgVNZO9XKKUEV1YXFypWhQpz2NRln
 yv5yFvWx+ASv8gm6w3g7QiYh56u3B/BLRLsYGjcnei1FsTMTDemRLa7os59/Lwjw
 GyDQbOeScPToW1kOqeK3sJCNKWqZjv50ZlMrv9i2gcXnPdf1MEzwJ+8tI9TBM/mN
 uNyEOMFT+ThwW1kNK+jXGlF3Y7S3l66u7ycDYIvDz/zKLu5KnWdrK228ahiu8eWO
 KA+fC4RYtxDHENJmnQObv18fHYlR3NXra0r8vJ7w5Zkp8ODpzxQ=
 =+yks
 -----END PGP SIGNATURE-----

Merge tag 'aspeed-6.7-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into soc/dt

ASPEED device tree updates for 6.7

 - New machine:

  * Facebook's Minevra, as Chassis Management Controller using the
    AST2600

 - Updates to Ampere's Mt Mitchell and Mt Jade systems, and IBM's
   Bonnell

* tag 'aspeed-6.7-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc:
  ARM: dts: aspeed: mtmitchell: Add I2C NVMe alias port
  ARM: dts: aspeed: mtmitchell: Remove redundant ADC configurations
  ARM: dts: aspeed: mtmitchell: Add inlet temperature sensor
  ARM: dts: aspeed: mtjade: Add the gpio-hog
  ARM: dts: aspeed: mtjade, mtmitchell: Add new gpio-line-names
  ARM: dts: aspeed: mtjade, mtmitchell: Update gpio-line-names
  ARM: dts: aspeed: Minerva: Add Facebook Minerva CMC board
  dt-bindings: arm: aspeed: document board compatibles
  ARM: dts: aspeed: bonnell: Add reserved memory for TPM event log

Link: https://lore.kernel.org/r/CACPK8XebMAQvgQTRH+KoaTFg7CzRkS79Fz3Kn8p4mbaezWGkUQ@mail.gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 16:07:33 +02:00
Nicolin Chen
266dcae34d iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly
TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL
from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl().
This has been working when min_size is exactly the size of the structure.

However, if the size of the structure becomes larger than min_size, i.e.
the passing size above is larger than min_size, that min_size sanity no
longer works.

Since the first test in TEST_LENGTH() was to test that min_size sanity
routine, rework it to support a min_size calculation, rather than using
the full size of the structure.

Link: https://lore.kernel.org/r/20231015074648.24185-1-nicolinc@nvidia.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2023-10-16 11:05:51 -03:00
Imre Deak
02c8d561db drm/i915/dp: Remove unused DSC caps from intel_dp
The previous patches converted all users of the DSC DPCD caps to look
these up from the connector, so remove the version stored in intel_dp.

A follow-up patchset will read out the MST connector specific
capabilities in intel_dp_add_mst_connector() ->
intel_dp_mst_read_decompression_port_dsc_caps().

v2:
- Rebased on intel_edp_get_dsc_sink_cap() addition in the patchset.
v3:
- Rebased on read-out fix for eDP in the patchset.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (v1)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-3-imre.deak@intel.com
2023-10-16 17:01:58 +03:00
Imre Deak
d19daffc89 drm/i915/dp_mst: Use connector DSC DPCD in intel_dp_mst_mode_valid_ctx()
Use the connector's DSC DPCD capabilities in
intel_dp_mst_mode_valid_ctx().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-19-imre.deak@intel.com
2023-10-16 17:01:53 +03:00
Imre Deak
2bd3d20ffa drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_config()
Use the connector's DSC DPCD capabilities in
intel_dp_dsc_compute_config().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-18-imre.deak@intel.com
2023-10-16 17:01:48 +03:00
Imre Deak
031c19b52c drm/i915/dp: Use connector DSC DPCD in intel_dp_mode_valid()
Use the connector's DSC DPCD capabilities in intel_dp_mode_valid().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-17-imre.deak@intel.com
2023-10-16 17:01:41 +03:00
Imre Deak
7bca1b801e drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_get_slice_count()
Use the connector's DSC DPCD capabilities in
intel_dp_dsc_get_slice_count().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-16-imre.deak@intel.com
2023-10-16 17:01:38 +03:00
Imre Deak
926b726c3d drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_supports_format()
Use the connector's DSC DPCD capabilities in
intel_dp_dsc_supports_format().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-15-imre.deak@intel.com
2023-10-16 17:01:33 +03:00
Imre Deak
2c4907c2e6 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_params()
Use the connector's DSC DPCD capabilities in
intel_dp_dsc_compute_params().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-14-imre.deak@intel.com
2023-10-16 17:01:29 +03:00
Imre Deak
11a33d6b26 drm/i915/dp: Pass only the required DSC DPCD to intel_dp_sink_dsc_version_minor()
intel_dp_sink_dsc_version_minor() only requires the DSC DPCD, so pass
only this to the function.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-13-imre.deak@intel.com
2023-10-16 17:01:25 +03:00
Imre Deak
6a60a8fa7c drm/i915/dp: Pass only the required i915 to intel_dp_source_dsc_version_minor()
intel_dp_source_dsc_version_minor() only requires the i915 pointer, so pass
only this to the function.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-12-imre.deak@intel.com
2023-10-16 17:01:22 +03:00
Imre Deak
cc81951d9a drm/i915/dp: Pass connector DSC DPCD to drm_dp_dsc_sink_supported_input_bpcs()
Use the connector's DSC DPCD capabilities in
drm_dp_dsc_sink_supported_input_bpcs().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-11-imre.deak@intel.com
2023-10-16 17:01:17 +03:00
Imre Deak
bb414c941b drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_max_sink_compressed_bppx16()
Use the connector's DSC DPCD capabilities in
intel_dp_dsc_max_sink_compressed_bppx16().

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-10-imre.deak@intel.com
2023-10-16 17:01:12 +03:00
Imre Deak
0d8665e068 drm/i915/dp: Use connector DSC DPCD in intel_dp_supports_dsc()
Use the connector's DSC DPCD capabilities in intel_dp_supports_dsc().

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-9-imre.deak@intel.com
2023-10-16 17:01:07 +03:00
Imre Deak
987c945ab2 drm/i915/dp: Use connector DSC DPCD in intel_dp_supports_fec()
Use the connector's DSC DPCD capabilities in intel_dp_supports_fec().

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-8-imre.deak@intel.com
2023-10-16 17:01:02 +03:00
Imre Deak
f52bbfe2ac drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_max_bpp()
Use the connector's DSC DPCD capabilities in intel_dp_dsc_compute_max_bpp()
instead of the version stored in the encoder.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-7-imre.deak@intel.com
2023-10-16 17:00:58 +03:00
Imre Deak
102c8013b6 drm/i915/dp: Use connector DSC DPCD in i915_dsc_fec_support_show()
Use the connector's DSC DPCD capabilities in i915_dsc_fec_support_show()
instead of the version stored in the encoder. Atm the two are identical,
but a follow-up patch will store the (MST) connector specific version
in the connector.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-6-imre.deak@intel.com
2023-10-16 17:00:53 +03:00
Imre Deak
829d8a1943 drm/i915/dp: Use i915/intel connector local variables in i915_dsc_fec_support_show()
Cache the i915 specific device and connector pointers in
i915_dsc_fec_support_show().

v2:
- s/Cahce/Cache typo in commit log. (Stan)

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-5-imre.deak@intel.com
2023-10-16 17:00:45 +03:00
Imre Deak
808b43fa7e drm/i915/dp_mst: Set connector DSC capabilities and decompression AUX
Similarly to eDP and SST-DP connectors read out the DSC capabilities for
MST connectors as well. Atm these will match the root port's DSC caps
and only used after a follow-up change enables the decompression for
each stream separately (vs. the current way of enabling it only globally
in the first branch device downstream of the root port).

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231010112504.2156789-3-imre.deak@intel.com
2023-10-16 17:00:36 +03:00
Imre Deak
7389829f21 drm/i915/dp: Store DSC DPCD capabilities in the connector
In an MST topology the DSC capabilities are specific to each connector,
retrieved either from the sink if it decompresses the stream, or from a
branch device between the source and the sink in case this branch device
does the decompression. Accordingly each connector needs to cache its
own DSC DPCD and FEC capabilities, along with the AUX device through
which the decompression can be enabled. This patch prepares for that by
storing the capabilities and the DSC AUX device in the connector, for
now these just matching the version stored in intel_dp. The follow-up
patches will convert all users to look up these in the connector instead
of intel_dp, after which the intel_dp copies are removed.

v2:
- Rebased on intel_edp_get_dsc_sink_cap() addition in previous patch.
v3:
- Rebased on read-out fix for eDP in previous patch.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (v1)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-2-imre.deak@intel.com
2023-10-16 17:00:31 +03:00
Imre Deak
90780a633c drm/i915/dp: Sanitize DPCD revision check in intel_dp_get_dsc_sink_cap()
Check only the eDP or the DP specific DPCD revision depending on the
sink type. Pass the corresponding revision to the function, which allows
getting the DSC caps of a branch device (in an MST topology, which has
its own DPCD and so DPCD revision).

While at it use DP_DPCD_REV_14 instead of open coding it and for clarity
add a separate function to read out the DSC capability on eDP.

v2:
- Use DP_DPCD_REV_14 instead of open coding it. (Stan)
- Check EDP_DCPD_REV/DPCD_REV in a clearer way. (Ville)
v3:
- Fix the read-out for eDP in intel_dp_detect().

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> (v1)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v2)
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-1-imre.deak@intel.com
2023-10-16 17:00:22 +03:00
Arnd Bergmann
6fd3e8682b Qualcomm ARM DeviceTree updates for v6.7
RPM master stats is introduced for MSM8226 and MSM8974. The PCIe PHY of
 SDX55 is transitioned to the new binding. The hall sensor on the Samsung
 Galaxy Tab 4 is inverted.
 
 A number of fixes reported from DeviceTree validation are fixed.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmUsT2cVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FcqoQAIT+4aJlfy8qeEPG8u3TJOsQHV9F
 KXu9afQs40IwQIMdIkT6B7rvq8HWxsXmASWFY7aJjPuBtDdj9IycJpgAds3B3nEp
 HtZW6h99ZBIn0mF2wI7Z4Ul7oKsn5ppEPg3OUQvw67X2xQEgFRajFOJLKk6oFAaP
 rZsH5F5Ww1zT426FKDj1+IeR6Br+1PTZtOBhnGCD0nEZZsKka18W9XAo1sIX0ELI
 eZUF6zEUCTEztekyPOZvCEME6OUyE+awGxT8HAyZUjvzwQ4UX3vD4To8V3F/yIBZ
 fCzDHNbSYn0X75+DkWjVI0wHGjXEOx2L/ZijMm7477LrpLDywNXsSdK39IWvdbRz
 nsMykKnBmfppppgVa25RRgtbvppWYd5IYkNMun8UjMxvdU3k28s6yFK5BzNMyDvP
 cJEBBFApL1Og2yJrWMmhyByAPg+zwPNovGno13gXI/8oZQnzhT4zzv0e19MHYRqa
 kZzU0hw6RC0FCmWTXAQyCitsPAxzVL8pYeBiyG+BF9LbOB1mQSQWy262yBwoF7Kn
 3VPYqybPzwREONObrO6BlpLKXBNXp/gwhYWPk09UaoLyuOGXXRQwsQGDcJCvQbtI
 bGyN6KTIxk+XpqKnI7dZhhde9hpHVIQK+S4Cfgqdo1aJNTawk9ZMsDS3TItVHFHI
 FGxlB/xEAc0tByjj
 =Wkrx
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtP3EACgkQYKtH/8kJ
 Uiewfw//QcQleXnc4ULV9OccCsNJGHBiWM7pvpzCHzMLHMhpiqtg+nEB/Eq1HwoD
 o58yGjm7lbFwK5wNRqMBcCGnYMr5/yLIchVkquNr1sV6MI3iahN7wT+TxN0+N/TM
 Pqtovq+NlpxELJN5Q9BGrXjrWn4aERBK75yqUmCRwmZ+ZeHT0/A2PxwJm3ai/Wcp
 YxFu8A2FCnSIT6FeQam+IdIqTeHLyGmmcUI3MDgeZkL+HycmGUsrmkm+RaqzHK6G
 9wjbPdbg+HxQcSLhy5cuzdPwfZqaJCI9DjWhaYzvlK6XgW+YTY7lfdZBIhhfWnzf
 bfGSCleonEKTTNI50SozT02u9T0AMCl0TvLIkB4DJgCn9Pd2+IQzp8GGX1n+iUSf
 D3NEL/kR+CvGhuVk7jRN3Oy+Hf+9/dlZq+0m5QMWEAaX1T0A8uyIaEIH+oPxG1BS
 to/+4XF+avFt+klieIbGnJ9wHlPFPte6fxTT9syuiT52duHec6BPkYMDIm7n1OrF
 /9P4/uhXyeq/EgHUhk4TL4Q1v+qUbBGbJEUGwv7wQWTO2lTANuKbQeXIO8511smr
 N5ImOFZcOvBj9gDZ1Cq8KCSI55aMJT3TYilk1bmEI1JVykD/oa+PVX5pmpGff0Bp
 ieYIcuQ8ndG0T2Sfkuel0pWYXwr+kYxhI9KEWafp8cSKqt3epoU=
 =UL5s
 -----END PGP SIGNATURE-----

Merge tag 'qcom-dts-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt

Qualcomm ARM DeviceTree updates for v6.7

RPM master stats is introduced for MSM8226 and MSM8974. The PCIe PHY of
SDX55 is transitioned to the new binding. The hall sensor on the Samsung
Galaxy Tab 4 is inverted.

A number of fixes reported from DeviceTree validation are fixed.

* tag 'qcom-dts-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  ARM: dts: qcom: ipq8064: move keys and leds out of soc node
  ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator
  ARM: dts: qcom: apq8060: drop incorrect regulator-type
  ARM: dts: qcom: apq8064: drop incorrect regulator-type
  ARM: dts: qcom: sdx65: fix SDHCI clocks order
  ARM: dts: qcom: apq8064: drop label property from DSI
  ARM: qcom: msm8974: Add rpm-master-stats node
  ARM: qcom: msm8226: Add rpm-master-stats node
  ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor
  ARM: dts: qcom: drop incorrect cell-index from SPMI
  ARM: dts: qcom-sdx55: switch PCIe QMP PHY to new style of bindings

Link: https://lore.kernel.org/r/20231015204558.855987-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 15:49:37 +02:00
Yazen Ghannam
1bae0cfe4a x86/mce: Cleanup mce_usable_address()
Move Intel-specific checks into a helper function.

Explicitly use "bool" for return type.

No functional change intended.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230613141142.36801-4-yazen.ghannam@amd.com
2023-10-16 15:37:01 +02:00
Yazen Ghannam
48da1ad8ba x86/mce: Define amd_mce_usable_address()
Currently, all valid MCA_ADDR values are assumed to be usable on AMD
systems. However, this is not correct in most cases. Notifiers expecting
usable addresses may then operate on inappropriate values.

Define a helper function to do AMD-specific checks for a usable memory
address. List out all known cases.

  [ bp: Tone down the capitalized words. ]

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230613141142.36801-3-yazen.ghannam@amd.com
2023-10-16 15:31:32 +02:00
Arnd Bergmann
68f1d4198c Qualcomm ARM64 DeviceTree updates for v6.7
The SM7125 platform is introduced, with support for Xiaomi Redmi Note 9
 Pro. Support for Fairphone 5, on QCM6490, and BQ Aquaris M5, on MSM8939,
 are introduced.
 
 With the various QMP PHY bindings having been refactored, SC7180,
 SC7280, SDM845, SM8150, and SM8250 are transitioned to the new USB/DP
 combo PHY binding. IPQ6018, IPQ8074 MSM8998, SC7280, SC8180X, SDM845,
 SM8150, SM8250, and SM8450 are transitioned to the new PCIe PHY binding,
 and SC8180X is transitioned to the new UFS phy binding.
 
 The UFS power supply situation is clarified, and a range of boards
 across MSM8996, MSM8998, SM4250, SM6115, SM6125, SM8350, SM8450, and
 SM8550 receives corrections for this.
 
 On IPQ5018 watchdog support is introduced, and the SCM driver has SDI
 (debug image) enabled - so that it can be disabled. On IPQ5332 USB is
 enabled. The hwspinlock identifier is corrected across IPQ5332, IPQ6018,
 IPQ8074 and IPQ9574.
 
 The reserved-memory ranges for the remoteprocs on MSM8916 boards are
 refactored, to reduce the amount of duplicated boilerplate definitions.
 A number of nodes are transitioned to be disabled by default, to
 facilitate new boards.
 Samsung Galaxy Tab A 8.0 and Samsung Galaxy Tab A 9.7 gains display
 support, and the latter capacitive keys. Samsung Galaxy J5 gains
 accelerometer support. The Dragonboard 410c gains missing ADC7533
 regulator definition, and an overlay forcing the board to operate in
 host mode, for automation purposes.
 
 On MSM8976, the outgoing IPC bits for modem and wcss are corrected, and
 reserved-memory regions are updated.
 
 Incorrect reserved-memory regions are also corrected for MSM8992 and
 MSM8994 devices.
 
 The QRB2210 RB1 board gets debug UART moved per hardware update.
 regulator voltage ranges are corrected, remoteprocs are enabled, USB
 SuperSpeed PHY is enabled, and GPIO LEDs are introduced for Bluetooth,
 WiFi and a user LED.
 
 Interrupts are described for the SGMII PHYs on SA8775P Ride platform,
 and the inline crypto engine is introduced for UFS.
 
 On SC7180 the audio DSP remoteproc is introduced. Additional SKUs of the
 Lazor boards are added.The RT5682 audio codec part is reorganized to be
 easier to maintain. On Trogdor devices, the touchscreen and display
 panels are linked to improve the power cycling behavior across the two.
 
 On SC7280 the cpuidle states are rewritten to support OS-initiated PCSI
 mode. LMH interrupts are added, to receive feedback when throttling
 occurs. The embedded usb debugger (EUD) description  and the dummy
 usb-c-connector node is removed, as this is not correctly described. The
 USB3 pipe clock input of the global clock controller is properly
 described.
 
 Modem remoteproc is introduced on SDM630, and the SDM670 PDC mapping is
 corrected.
 
 On the SDM845 MTP PCIe support is introduced. The volumn down and reset
 buttons are defined. Remoteproc firmware names and the WiFI
 configuration is corrected.
 On Sony Xperia XZ2, XZ2 Compact, and XZ3 GPIO lines names are provided
 for TLMM and PMICs. The camera regulators are also added.
 
 Display hardware blocks are added to SM6125, and enabled on Sony Xperia
 10 II.
 
 The ref clock is wired up to PCIe PHY on SM8150.
 
 On SM8250/QRB5165, and the RB5 board, the DisplayPort controller and the
 TCPM is introduced, with all the plumbing to get USB role and
 orientation switching, as well as DisplayPort altmode to work.
 Interconnects and power-domains are also described for the QUPs on this
 platform.
 
 Previously ignored PMICs are described for the SM8350 Hardware
 Development Kit (HDK), and PMR735a regulators are introduced. The
 pinctrl state for uart18 is corrected.
 
 On SM8450 HDK audio routes are corrected, to enable the analog
 microphones on the board. The addition of the PRNG is reverted, in favor
 of an upcoming additon of a true RNG.
 
 Constants are replaced with QCOM_SCM_VMID_* defines on a variety of
 boards.
 
 The SM8550 QRD board gets Bluetooth support, and the camera clock
 controller is described.
 
 Additionally, a number of fixes are introduced in a variety of platforms
 and boards, to align with Devicetree bindings.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmUsOR4VHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FGQwP/j4xZY9E2lwB50BCFU7xtHSLHyf/
 HcUx6HjtUwvXj1ernoKLEykp6Vzpp+vn2mpuBmTYzXmi96rC8kQ9Ai/uNTt7IU1J
 xta08EoYDYyjXUoyQdjOav2VFJ60BK18pM4FIHECmx8zzoFkVzV1+rgH7ry1JX0I
 RV+NgTRNb3WphP7QCQk6iMIF4BUbiRp5FdqdpyxgxrHLFfhhvHeT1S+cqZ7DQ0nZ
 k72UuTeVyXXfihouJS2wnky69eA83YmOpBYoRvdBOvBtUS2GgCwcmCH4nXlDbzF+
 GkvVw5mmRmyXhpDK5bDhBsqJzbh0IDrjWMw/rgL356ZBAsc7hmlyA3s512L0qggj
 c5lj2VYKU3ebZwab4IhdO5zShXPyyqmkrRzRblMi5NXanK+2Dypt8a88N/djSwxJ
 3EH2rs4R2pRHITxH7u3J9qsqTFUR8jFanw/MJQvQHXLSAJJF6zpwinOsio7jup5x
 uMx3Ty1wNKMpzR0GGmfRkd0UEyQN0+yPDPesPIbr2B3I6ZMAXmHD+eLhpbL5Riw9
 DZAAzaEeERTRNaZ7GMC3g7jxwdnjrC5q8f7MKPYfvUjkQdMLzhH3GZmm3o4fN5Bo
 rDVx7alUOblvLViBZBfQIbw5GX+Yq38ow4KxeKTnT0WOaXchZxISKeeu7Gn8I+2j
 DgG7/KMpjbzmKDRM
 =zgxm
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmUtOv0ACgkQYKtH/8kJ
 UifMew/+MWcU1rn8D9083g00Hb9mqeCSNUp9o6B2AL0DZea9ABjWs/IQo5suRnMe
 TxQgnkgA+0nVCdfmF3spcMJ39D3gzaWnHGeMr1LsGsbMRmXVfBcWzpgkpRB2k2iE
 PxcpLpVWrrIjwhqtqcy8X4BGaDaVRA7jFGh810/tF9Avp74ndq4lXYNhf2/MmvuW
 iqGztm0n2Qua97dbP/Lyg4zmMMUT9i7QiuToxeJZuqg36am0OkXynsNT8wmwQuO2
 pvz9ul2sofIq677VUTMZgxmDl4QM4h+/qkeUwaBjvFOpEtaqjwynBcf1RBCzmMsj
 5/pWzypNUh0ELSbGiiDpwlTh9Blq4BY8Lt1tOXFBHXVe5Nee2KS79IVTcLxOFM0i
 e1K68r3kw/yzFwCgKBCfP3qzRCmUHeTDI0KTrL3erPMAhIB06TKlgNn+QPot2dti
 SkBj/zyXAtfxh6NYPKSQHKvJsun9BsO5ZML0Wo58U+hSm1W53zYmjMVKEJJux3N7
 31OECKmqzipo3PLEc0rcMJ0HMmPQR+YdGpfXP3IaDiT6o2Ea2LN4kSavCOrUbnec
 asg6LHcuDvmbarfBSfDeSAEcI4c6ZCs9LXTStkiB/K17sOZvFW1UO1pQmChK5EVA
 K8nSBBgeL1RnGTXM7IGJTbI9WJi00+mDS5gG5Kwq9x7GxsDtWuk=
 =9WsA
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt

Qualcomm ARM64 DeviceTree updates for v6.7

The SM7125 platform is introduced, with support for Xiaomi Redmi Note 9
Pro. Support for Fairphone 5, on QCM6490, and BQ Aquaris M5, on MSM8939,
are introduced.

With the various QMP PHY bindings having been refactored, SC7180,
SC7280, SDM845, SM8150, and SM8250 are transitioned to the new USB/DP
combo PHY binding. IPQ6018, IPQ8074 MSM8998, SC7280, SC8180X, SDM845,
SM8150, SM8250, and SM8450 are transitioned to the new PCIe PHY binding,
and SC8180X is transitioned to the new UFS phy binding.

The UFS power supply situation is clarified, and a range of boards
across MSM8996, MSM8998, SM4250, SM6115, SM6125, SM8350, SM8450, and
SM8550 receives corrections for this.

On IPQ5018 watchdog support is introduced, and the SCM driver has SDI
(debug image) enabled - so that it can be disabled. On IPQ5332 USB is
enabled. The hwspinlock identifier is corrected across IPQ5332, IPQ6018,
IPQ8074 and IPQ9574.

The reserved-memory ranges for the remoteprocs on MSM8916 boards are
refactored, to reduce the amount of duplicated boilerplate definitions.
A number of nodes are transitioned to be disabled by default, to
facilitate new boards.
Samsung Galaxy Tab A 8.0 and Samsung Galaxy Tab A 9.7 gains display
support, and the latter capacitive keys. Samsung Galaxy J5 gains
accelerometer support. The Dragonboard 410c gains missing ADC7533
regulator definition, and an overlay forcing the board to operate in
host mode, for automation purposes.

On MSM8976, the outgoing IPC bits for modem and wcss are corrected, and
reserved-memory regions are updated.

Incorrect reserved-memory regions are also corrected for MSM8992 and
MSM8994 devices.

The QRB2210 RB1 board gets debug UART moved per hardware update.
regulator voltage ranges are corrected, remoteprocs are enabled, USB
SuperSpeed PHY is enabled, and GPIO LEDs are introduced for Bluetooth,
WiFi and a user LED.

Interrupts are described for the SGMII PHYs on SA8775P Ride platform,
and the inline crypto engine is introduced for UFS.

On SC7180 the audio DSP remoteproc is introduced. Additional SKUs of the
Lazor boards are added.The RT5682 audio codec part is reorganized to be
easier to maintain. On Trogdor devices, the touchscreen and display
panels are linked to improve the power cycling behavior across the two.

On SC7280 the cpuidle states are rewritten to support OS-initiated PCSI
mode. LMH interrupts are added, to receive feedback when throttling
occurs. The embedded usb debugger (EUD) description  and the dummy
usb-c-connector node is removed, as this is not correctly described. The
USB3 pipe clock input of the global clock controller is properly
described.

Modem remoteproc is introduced on SDM630, and the SDM670 PDC mapping is
corrected.

On the SDM845 MTP PCIe support is introduced. The volumn down and reset
buttons are defined. Remoteproc firmware names and the WiFI
configuration is corrected.
On Sony Xperia XZ2, XZ2 Compact, and XZ3 GPIO lines names are provided
for TLMM and PMICs. The camera regulators are also added.

Display hardware blocks are added to SM6125, and enabled on Sony Xperia
10 II.

The ref clock is wired up to PCIe PHY on SM8150.

On SM8250/QRB5165, and the RB5 board, the DisplayPort controller and the
TCPM is introduced, with all the plumbing to get USB role and
orientation switching, as well as DisplayPort altmode to work.
Interconnects and power-domains are also described for the QUPs on this
platform.

Previously ignored PMICs are described for the SM8350 Hardware
Development Kit (HDK), and PMR735a regulators are introduced. The
pinctrl state for uart18 is corrected.

On SM8450 HDK audio routes are corrected, to enable the analog
microphones on the board. The addition of the PRNG is reverted, in favor
of an upcoming additon of a true RNG.

Constants are replaced with QCOM_SCM_VMID_* defines on a variety of
boards.

The SM8550 QRD board gets Bluetooth support, and the camera clock
controller is described.

Additionally, a number of fixes are introduced in a variety of platforms
and boards, to align with Devicetree bindings.

* tag 'qcom-arm64-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (148 commits)
  arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators
  ARM: dts: qcom: sdx65-mtp: Specify PM7250B SID to use
  arm64: dts: qcom: apq8016-sbc: Add overlay for usb host mode
  arm64: dts: qcom: qcm6490: Add device-tree for Fairphone 5
  dt-bindings: arm: qcom: Add QCM6490 Fairphone 5
  arm64: dts: qcom: pm8350c: Add flash led node
  arm64: dts: qcom: pm7250b: make SID configurable
  arm64: dts: qcom: sc7280: Mark some nodes as 'reserved'
  arm64: dts: qcom: msm8939: Fix iommu local address range
  arm64: dts: qcom: ipq5018: indicate that SDI should be disabled
  arm64: dts: qcom: msm8976: Fix ipc bit shifts
  arm64: dts: qcom: msm8976: Split lpass region
  arm64: dts: qcom: pm8150l: Add wled node
  arm64: dts: qcom: sa8775p: enable the inline crypto engine
  arm64: dts: qcom: msm8916/39: Fix venus memory size
  arm64: dts: qcom: msm8916/39: Move mpss_mem size to boards
  arm64: dts: qcom: msm8916/39: Disable unneeded firmware reservations
  arm64: dts: qcom: msm8939: Reserve firmware memory dynamically
  arm64: dts: qcom: msm8916: Reserve MBA memory dynamically
  arm64: dts: qcom: msm8916: Reserve firmware memory dynamically
  ...

Link: https://lore.kernel.org/r/20231015191107.854658-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-10-16 15:30:37 +02:00
Marek Marczykowski-Górecki
2c269f42d0 xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled
Linux enables MSI-X before disabling INTx, but keeps MSI-X masked until
the table is filled. Then it disables INTx just before clearing MASKALL
bit. Currently this approach is rejected by xen-pciback.
According to the PCIe spec, device cannot use INTx when MSI/MSI-X is
enabled (in other words: enabling MSI/MSI-X implicitly disables INTx).

Change the logic to consider INTx disabled if MSI/MSI-X is enabled. This
applies to three places:
 - checking currently enabled interrupts type,
 - transition to MSI/MSI-X - where INTx would be implicitly disabled,
 - clearing INTx disable bit - which can be allowed even if MSI/MSI-X is
   enabled, as device should consider INTx disabled anyway in that case

Fixes: 5e29500eba ("xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too")
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20231016131348.1734721-1-marmarek@invisiblethingslab.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:20:31 +02:00
Viresh Kumar
f0d7db7b33 xen: privcmd: Add support for ioeventfd
Virtio guests send VIRTIO_MMIO_QUEUE_NOTIFY notification when they need
to notify the backend of an update to the status of the virtqueue. The
backend or another entity, polls the MMIO address for updates to know
when the notification is sent.

It works well if the backend does this polling by itself. But as we move
towards generic backend implementations, we end up implementing this in
a separate user-space program.

Generally, the Virtio backends are implemented to work with the Eventfd
based mechanism. In order to make such backends work with Xen, another
software layer needs to do the polling and send an event via eventfd to
the backend once the notification from guest is received. This results
in an extra context switch.

This is not a new problem in Linux though. It is present with other
hypervisors like KVM, etc. as well. The generic solution implemented in
the kernel for them is to provide an IOCTL call to pass the address to
poll and eventfd, which lets the kernel take care of polling and raise
an event on the eventfd, instead of handling this in user space (which
involves an extra context switch).

This patch adds similar support for xen.

Inspired by existing implementations for KVM, etc..

This also copies ioreq.h header file (only struct ioreq and related
macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop
remaining uses of bool_t")).

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/b20d83efba6453037d0c099912813c79c81f7714.1697439990.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:18:33 +02:00
Viresh Kumar
9e90e58c11 xen: evtchn: Allow shared registration of IRQ handers
Currently the handling of events is supported either in the kernel or
userspace, but not both.

In order to support fast delivery of interrupts from the guest to the
backend, we need to handle the Queue notify part of Virtio protocol in
kernel and the rest in userspace.

Update the interrupt handler registration flag to IRQF_SHARED for event
channels, which would allow multiple entities to bind their interrupt
handler for the same event channel port.

Also increment the reference count of irq_info when multiple entities
try to bind event channel to irqchip, so the unbinding happens only
after all the users are gone.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/99b1edfd3147c6b5d22a5139dab5861e767dc34a.1697439990.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:18:33 +02:00
Viresh Kumar
767e33ca47 xen: irqfd: Use _IOW instead of the internal _IOC() macro
_IOC() an internal helper that we should not use in driver code.  In
particular, we got the data direction wrong here, which breaks a number
of tools, as having "_IOC_NONE" should never be paired with a nonzero
size.

Use _IOW() instead.

Fixes: f8941e6c4c ("xen: privcmd: Add support for irqfd")
Reported-by: Arnd Bergmann <arnd@kernel.org>
Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80b4a@app.fastmail.com/
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/599ca6f1b9dd2f0e6247ea37bee3ea6827404b6d.1697439990.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:18:33 +02:00
Viresh Kumar
8dd765a5d7 xen: Make struct privcmd_irqfd's layout architecture independent
Using indirect pointers in an ioctl command argument means that the
layout is architecture specific, in particular we can't use the same one
from 32-bit compat tasks. The general recommendation is to have __u64
members and use u64_to_user_ptr() to access it from the kernel if we are
unable to avoid the pointers altogether.

Fixes: f8941e6c4c ("xen: privcmd: Add support for irqfd")
Reported-by: Arnd Bergmann <arnd@kernel.org>
Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80b4a@app.fastmail.com/
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/a4ef0d4a68fc858b34a81fd3f9877d9b6898eb77.1697439990.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:18:33 +02:00
Gustavo A. R. Silva
d3a2b6b48f xen/xenbus: Add __counted_by for struct read_buffer and use struct_size()
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

While there, use struct_size() helper, instead of the open-coded
version, to calculate the size for the allocation of the whole
flexible structure, including of course, the flexible-array member.

This code was found with the help of Coccinelle, and audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Link: https://lore.kernel.org/r/ZSRMosLuJJS5Y/io@work
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:18:33 +02:00
Juergen Gross
44961b81a9 xenbus: fix error exit in xenbus_init()
In case an error occurs in xenbus_init(), xen_store_domain_type should
be set to XS_UNKNOWN.

Fix one instance where this action is missing.

Fixes: 5b3353949e ("xen: add support for initializing xenstore later as HVM domain")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202304200845.w7m4kXZr-lkp@intel.com/
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Link: https://lore.kernel.org/r/20230822091138.4765-1-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
2023-10-16 15:18:33 +02:00
Mark Rutland
e8d4006dc2 arm64: Remove cpus_have_const_cap()
There are no longer any users of cpus_have_const_cap(), and therefore it
can be removed.

Remove cpus_have_const_cap(). At the same time, remove
__cpus_have_const_cap(), as this is a trivial wrapper of
alternative_has_cap_unlikely(), which can be used directly instead.

The comment for __system_matches_cap() is updated to no longer refer to
cpus_have_const_cap(). As we have a number of ways to check the cpucaps,
the specific suggestions are removed.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Kristina Martsenko <kristina.martsenko@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-10-16 14:17:07 +01:00
Mark Rutland
47759eca76 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_REPEAT_TLBI
In arch_tlbbatch_should_defer() we use cpus_have_const_cap() to check
for ARM64_WORKAROUND_REPEAT_TLBI, but this is not necessary and
alternative_has_cap_*() would be preferable.

For historical reasons, cpus_have_const_cap() is more complicated than
it needs to be. Before cpucaps are finalized, it will perform a bitmap
test of the system_cpucaps bitmap, and once cpucaps are finalized it
will use an alternative branch. This used to be necessary to handle some
race conditions in the window between cpucap detection and the
subsequent patching of alternatives and static branches, where different
branches could be out-of-sync with one another (or w.r.t. alternative
sequences). Now that we use alternative branches instead of static
branches, these are all patched atomically w.r.t. one another, and there
are only a handful of cases that need special care in the window between
cpucap detection and alternative patching.

Due to the above, it would be nice to remove cpus_have_const_cap(), and
migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(),
or cpus_have_cap() depending on when their requirements. This will
remove redundant instructions and improve code generation, and will make
it easier to determine how each callsite will behave before, during, and
after alternative patching.

The cpus_have_const_cap() check in arch_tlbbatch_should_defer() is an
optimization to avoid some redundant work when the
ARM64_WORKAROUND_REPEAT_TLBI cpucap is detected and forces the immediate
use of TLBI + DSB ISH. In the window between detecting the
ARM64_WORKAROUND_REPEAT_TLBI cpucap and patching alternatives this is
not a big concern and there's no need to optimize this window at the
expsense of subsequent usage at runtime.

This patch replaces the use of cpus_have_const_cap() with
alternative_has_cap_unlikely(), which will avoid generating code to test
the system_cpucaps bitmap and should be better for all subsequent calls
at runtime. The ARM64_WORKAROUND_REPEAT_TLBI cpucap is added to
cpucap_is_possible() so that code can be elided entirely when this is
not possible without requiring ifdeffery or IS_ENABLED() checks at each
usage.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-10-16 14:17:07 +01:00
Mark Rutland
0d48058ef8 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_NVIDIA_CARMEL_CNP
In has_useable_cnp() we use cpus_have_const_cap() to check for
ARM64_WORKAROUND_NVIDIA_CARMEL_CNP, but this is not necessary and
cpus_have_cap() would be preferable.

For historical reasons, cpus_have_const_cap() is more complicated than
it needs to be. Before cpucaps are finalized, it will perform a bitmap
test of the system_cpucaps bitmap, and once cpucaps are finalized it
will use an alternative branch. This used to be necessary to handle some
race conditions in the window between cpucap detection and the
subsequent patching of alternatives and static branches, where different
branches could be out-of-sync with one another (or w.r.t. alternative
sequences). Now that we use alternative branches instead of static
branches, these are all patched atomically w.r.t. one another, and there
are only a handful of cases that need special care in the window between
cpucap detection and alternative patching.

Due to the above, it would be nice to remove cpus_have_const_cap(), and
migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(),
or cpus_have_cap() depending on when their requirements. This will
remove redundant instructions and improve code generation, and will make
it easier to determine how each callsite will behave before, during, and
after alternative patching.

We use has_useable_cnp() to determine whether we have the system-wide
ARM64_HAS_CNP cpucap. Due to the structure of the cpufeature code, we
call has_useable_cnp() in two distinct cases:

1) When finalizing system capabilities, setup_system_capabilities() will
   call has_useable_cnp() with SCOPE_SYSTEM to determine whether all
   CPUs have the feature. This is called after we've detected any local
   cpucaps including ARM64_WORKAROUND_NVIDIA_CARMEL_CNP, but prior to
   patching alternatives.

   If the ARM64_WORKAROUND_NVIDIA_CARMEL_CNP was detected, we will not
   detect ARM64_HAS_CNP.

2) After finalizing system capabilties, verify_local_cpu_capabilities()
   will call has_useable_cnp() with SCOPE_LOCAL_CPU to verify that CPUs
   have CNP if we previously detected it.

   Note that if ARM64_WORKAROUND_NVIDIA_CARMEL_CNP was detected, we will
   not have detected ARM64_HAS_CNP.

For case 1 we must check the system_cpucaps bitmap as this occurs prior
to patching the alternatives. For case 2 we'll only call
has_useable_cnp() once per subsequent onlining of a CPU, and as this
isn't a fast path it's not necessary to optimize for this case.

This patch replaces the use of cpus_have_const_cap() with
cpus_have_cap(), which will only generate the bitmap test and avoid
generating an alternative sequence, resulting in slightly simpler annd
smaller code being generated. The ARM64_WORKAROUND_NVIDIA_CARMEL_CNP
cpucap is added to cpucap_is_possible() so that code can be elided
entirely when this is not possible.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-10-16 14:17:07 +01:00
Mark Rutland
a98a5eac4d arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_CAVIUM_23154
In gic_read_iar() we use cpus_have_const_cap() to check for
ARM64_WORKAROUND_CAVIUM_23154 but this is not necessary and
alternative_has_cap_*() would be preferable.

For historical reasons, cpus_have_const_cap() is more complicated than
it needs to be. Before cpucaps are finalized, it will perform a bitmap
test of the system_cpucaps bitmap, and once cpucaps are finalized it
will use an alternative branch. This used to be necessary to handle some
race conditions in the window between cpucap detection and the
subsequent patching of alternatives and static branches, where different
branches could be out-of-sync with one another (or w.r.t. alternative
sequences). Now that we use alternative branches instead of static
branches, these are all patched atomically w.r.t. one another, and there
are only a handful of cases that need special care in the window between
cpucap detection and alternative patching.

Due to the above, it would be nice to remove cpus_have_const_cap(), and
migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(),
or cpus_have_cap() depending on when their requirements. This will
remove redundant instructions and improve code generation, and will make
it easier to determine how each callsite will behave before, during, and
after alternative patching.

The ARM64_WORKAROUND_CAVIUM_23154 cpucap is detected and patched early
on the boot CPU before the GICv3 driver is initialized and hence before
gic_read_iar() is ever called. Thus it is not necessary to use
cpus_have_const_cap(), and alternative_has_cap() is equivalent.

In addition, arm64's gic_read_iar() lives in irq-gic-v3.c purely for
historical reasons. It was originally added prior to 32-bit arm support
in commit:

  6d4e11c5e2 ("irqchip/gicv3: Workaround for Cavium ThunderX erratum 23154")

When support for 32-bit arm was added, 32-bit arm's gic_read_iar()
implementation was placed in <asm/arch_gicv3.h>, but the arm64 version
was kept within irq-gic-v3.c as it depended on a static key local to
irq-gic-v3.c and it was easier to add ifdeffery, which is what we did in
commit:

  7936e914f7 ("irqchip/gic-v3: Refactor the arm64 specific parts")

Subsequently the static key was replaced with a cpucap in commit:

  a4023f6827 ("arm64: Add hypervisor safe helper for checking constant capabilities")

Since that commit there has been no need to keep arm64's gic_read_iar()
in irq-gic-v3.c.

This patch replaces the use of cpus_have_const_cap() with
alternative_has_cap_unlikely(), which will avoid generating code to test
the system_cpucaps bitmap and should be better for all subsequent calls
at runtime. For consistency, move the arm64-specific gic_read_iar()
implementation over to arm64's <asm/arch_gicv3.h>. The
ARM64_WORKAROUND_CAVIUM_23154 cpucap is added to cpucap_is_possible() so
that code can be elided entirely when this is not possible.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-10-16 14:17:07 +01:00