Commit graph

21816 commits

Author SHA1 Message Date
Linus Torvalds
865dad2022 kcfi updates for v6.1-rc1
This replaces the prior support for Clang's standard Control Flow
 Integrity (CFI) instrumentation, which has required a lot of special
 conditions (e.g. LTO) and work-arounds. The current implementation
 ("Kernel CFI") is specific to C, directly designed for the Linux kernel,
 and takes advantage of architectural features like x86's IBT. This
 series retains arm64 support and adds x86 support. Additional "generic"
 architectural support is expected soon:
 https://github.com/samitolvanen/llvm-project/commits/kcfi_generic
 
 - treewide: Remove old CFI support details
 
 - arm64: Replace Clang CFI support with Clang KCFI support
 
 - x86: Introduce Clang KCFI support
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmM4aAUWHGtlZXNjb29r
 QGNocm9taXVtLm9yZwAKCRCJcvTf3G3AJkgWD/4mUgb7xewNIG/+fuipGd620Iao
 K0T8q4BNxLNRltOxNc3Q0WMDCggX0qJGCeds7EdFQJQOGxWcbifM8MAS4idAGM0G
 fc3Gxl1imC/oF6goCAbQgndA6jYFIWXGsv8LsRjAXRidWLFr3GFAqVqYJyokSySr
 8zMQsEDuF4I1gQnOhEWdtPZbV3MQ4ZjfFzpv+33agbq6Gb72vKvDh3G6g2VXlxjt
 1qnMtS+eEpbBU65cJkOi4MSLgymWbnIAeTMb0dbsV4kJ08YoTl8uz1B+weeH6GgT
 WP73ZJ4nqh1kkkT9EqS9oKozNB9fObhvCokEuAjuQ7i1eCEZsbShvRc0iL7OKTGG
 UfuTJa5qQ4h7Z0JS35FCSJETa+fcG0lTyEd133nLXLMZP9K2antf+A6O//fd0J1V
 Jg4VN7DQmZ+UNGOzRkL6dTtQUy4PkxhniIloaClfSYXxhNirA+v//sHTnTK3z2Bl
 6qceYqmFmns2Laual7+lvnZgt6egMBcmAL/MOdbU74+KIR9Xw76wxQjifktHX+WF
 FEUQkUJDB5XcUyKlbvHoqobRMxvEZ8RIlC5DIkgFiPRE3TI0MqfzNSFnQ/6+lFNg
 Y0AS9HYJmcj8sVzAJ7ji24WPFCXzsbFn6baJa9usDNbWyQZokYeiv7ZPNPHPDVrv
 YEBP6aYko0lVSUS9qw==
 =Li4D
 -----END PGP SIGNATURE-----

Merge tag 'kcfi-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull kcfi updates from Kees Cook:
 "This replaces the prior support for Clang's standard Control Flow
  Integrity (CFI) instrumentation, which has required a lot of special
  conditions (e.g. LTO) and work-arounds.

  The new implementation ("Kernel CFI") is specific to C, directly
  designed for the Linux kernel, and takes advantage of architectural
  features like x86's IBT. This series retains arm64 support and adds
  x86 support.

  GCC support is expected in the future[1], and additional "generic"
  architectural support is expected soon[2].

  Summary:

   - treewide: Remove old CFI support details

   - arm64: Replace Clang CFI support with Clang KCFI support

   - x86: Introduce Clang KCFI support"

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107048 [1]
Link: https://github.com/samitolvanen/llvm-project/commits/kcfi_generic [2]

* tag 'kcfi-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (22 commits)
  x86: Add support for CONFIG_CFI_CLANG
  x86/purgatory: Disable CFI
  x86: Add types to indirectly called assembly functions
  x86/tools/relocs: Ignore __kcfi_typeid_ relocations
  kallsyms: Drop CONFIG_CFI_CLANG workarounds
  objtool: Disable CFI warnings
  objtool: Preserve special st_shndx indexes in elf_update_symbol
  treewide: Drop __cficanonical
  treewide: Drop WARN_ON_FUNCTION_MISMATCH
  treewide: Drop function_nocfi
  init: Drop __nocfi from __init
  arm64: Drop unneeded __nocfi attributes
  arm64: Add CFI error handling
  arm64: Add types to indirect called assembly functions
  psci: Fix the function type for psci_initcall_t
  lkdtm: Emit an indirect call for CFI tests
  cfi: Add type helper macros
  cfi: Switch to -fsanitize=kcfi
  cfi: Drop __CFI_ADDRESSABLE
  cfi: Remove CONFIG_CFI_CLANG_SHADOW
  ...
2022-10-03 17:11:07 -07:00
Linus Torvalds
49c13ed031 ARM: SoC fixes for 6.0-rc7
This should be the last set of bugfixes in the SoC tree:
 
  - Two fixes for Arm integrator, dealing with a regression caused
    by invalid DT properties combined with a change in dma address
    translation, and missing device_type annotations on the PCI
    bus.
 
  - Fixes for drivers/reset/, addressing bugs in i.MX8MP, Sparx5 and
    NPCM8XX platforms.
 
  - Bjorn Andersson's email address changes in the MAINTAINERS file
 
  - Multiple minor fixes to Qualcomm dts files, and a change to the
    remoteproc firmware filename that did not match the actual
    path in the linux-firmware package.
 
  - Minor code fixes for the Allwinner/sunxi SRAM driver, and the
    broadcom STB Bus Interface Unit driver
 
  - A build fix for the sunplus sp7021 platform
 
  - Two dts fixes for TI OMAP family SoCs, addressing an extraneous
    usb4 device node and an incorrect DMA handle.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMzbMYACgkQmmx57+YA
 GNnPnA/+IhwfCRrfLdDpzekitMNN/wWa3YcSRKc8LvIIg3lLjcHX8jt8/8bfiB5m
 L/QgfaM8s0C0fh6PN1iXBXlWQEXc/hUyYS0EcEY9qTy4S8Yx0oukByhV9W76oROE
 WeSF3J2WeLxTolj8Tli6iKJRPlv6/CjNSkhjmdECpwkrRpD5AV6Xkr/B5AJntn0X
 huPgpixJ5O6vW5D1qgtF1QejJIzKvkohQIEaWaQ4zJJwTIujXmjvv6Dt7b5/+hKt
 8qhhJe8VOVjnrZZz8FD3xoGp4+p+plkaPhG2SmMn2IdE6Wf/yVuWwzjXAF250vH7
 /IGh1IHUYG6Vbt/gKk47wre+Kjzmzlj9v9P1XpI4OlTGUvqiaFdwg9LWcgrS2cR6
 pQOfhVBmphsE+zODo7aCCCh8I9ZX0eXhcOpMIdEPeGYQgR1jjDnIOiCf8bhsZoEy
 8a8zKH6UvhHQkNO0bzUComcU/LWY1EjnKzb9OGzekEb45bwxjhRLLdIghGpcb2Sb
 dnhjQ2MFrlOonbrGxupmC5zgCmdoyoH7MlvOI58IeehAGW79LRsgVrD3hGrmJuBc
 Gu63RDmbXNn2rktOurRcl/z8JcYf/lA7saK83PcYomYHDAXqYGkhnXpwcMlEsUeQ
 CPcgkCOWSorl5yevghWAAJOCPOZmIG1bZuaqc8cD4bvYWpLAxLY=
 =3Mv6
 -----END PGP SIGNATURE-----

Merge tag 'soc-fixes-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "This should be the last set of bugfixes in the SoC tree:

   - Two fixes for Arm integrator, dealing with a regression caused by
     invalid DT properties combined with a change in dma address
     translation, and missing device_type annotations on the PCI bus

   - Fixes for drivers/reset/, addressing bugs in i.MX8MP, Sparx5 and
     NPCM8XX platforms

   - Bjorn Andersson's email address changes in the MAINTAINERS file

   - Multiple minor fixes to Qualcomm dts files, and a change to the
     remoteproc firmware filename that did not match the actual path in
     the linux-firmware package

   - Minor code fixes for the Allwinner/sunxi SRAM driver, and the
     broadcom STB Bus Interface Unit driver

   - A build fix for the sunplus sp7021 platform

   - Two dts fixes for TI OMAP family SoCs, addressing an extraneous
     usb4 device node and an incorrect DMA handle"

* tag 'soc-fixes-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  ARM: dts: integrator: Fix DMA ranges
  ARM: dts: integrator: Tag PCI host with device_type
  ARM: sunplus: fix serial console kconfig and build problems
  reset: npcm: fix iprst2 and iprst4 setting
  arm64: dts: qcom: sm8350: fix UFS PHY serdes size
  soc: bcm: brcmstb: biuctrl: Avoid double of_node_put()
  arm64: dts: qcom: sc8280xp-x13s: Update firmware location
  soc: sunxi: sram: Fix debugfs info for A64 SRAM C
  soc: sunxi: sram: Fix probe function ordering issues
  soc: sunxi: sram: Prevent the driver from being unbound
  soc: sunxi: sram: Actually claim SRAM regions
  ARM: dts: am5748: keep usb4_tm disabled
  reset: microchip-sparx5: issue a reset on startup
  reset: imx7: Fix the iMX8MP PCIe PHY PERST support
  MAINTAINERS: Update Bjorn's email address
  arm64: dts: qcom: sc7280: move USB wakeup-source property
  arm64: dts: qcom: thinkpad-x13s: Fix firmware location
  arm64: dts: qcom: sm8150: Fix fastrpc iommu values
  ARM: dts: am33xx: Fix MMCHS0 dma properties
2022-09-27 16:49:42 -07:00
Sami Tolvanen
607289a7cd treewide: Drop function_nocfi
With -fsanitize=kcfi, we no longer need function_nocfi() as
the compiler won't change function references to point to a
jump table. Remove all implementations and uses of the macro.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220908215504.3686827-14-samitolvanen@google.com
2022-09-26 10:13:14 -07:00
Sami Tolvanen
5f20997c19 arm64: Drop unneeded __nocfi attributes
With -fsanitize=kcfi, CONFIG_CFI_CLANG no longer has issues
with address space confusion in functions that switch to linear
mapping. Now that the indirectly called assembly functions have
type annotations, drop the __nocfi attributes.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220908215504.3686827-12-samitolvanen@google.com
2022-09-26 10:13:14 -07:00
Sami Tolvanen
b26e484b8b arm64: Add CFI error handling
With -fsanitize=kcfi, CFI always traps. Add arm64 support for handling CFI
failures. The registers containing the target address and the expected type
are encoded in the first ten bits of the ESR as follows:

 - 0-4: n, where the register Xn contains the target address
 - 5-9: m, where the register Wm contains the type hash

This produces the following oops on CFI failure (generated using lkdtm):

[   21.885179] CFI failure at lkdtm_indirect_call+0x2c/0x44 [lkdtm]
(target: lkdtm_increment_int+0x0/0x1c [lkdtm]; expected type: 0x7e0c52a)
[   21.886593] Internal error: Oops - CFI: 0 [#1] PREEMPT SMP
[   21.891060] Modules linked in: lkdtm
[   21.893363] CPU: 0 PID: 151 Comm: sh Not tainted
5.19.0-rc1-00021-g852f4e48dbab #1
[   21.895560] Hardware name: linux,dummy-virt (DT)
[   21.896543] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   21.897583] pc : lkdtm_indirect_call+0x2c/0x44 [lkdtm]
[   21.898551] lr : lkdtm_CFI_FORWARD_PROTO+0x3c/0x6c [lkdtm]
[   21.899520] sp : ffff8000083a3c50
[   21.900191] x29: ffff8000083a3c50 x28: ffff0000027e0ec0 x27: 0000000000000000
[   21.902453] x26: 0000000000000000 x25: ffffc2aa3d07e7b0 x24: 0000000000000002
[   21.903736] x23: ffffc2aa3d079088 x22: ffffc2aa3d07e7b0 x21: ffff000003379000
[   21.905062] x20: ffff8000083a3dc0 x19: 0000000000000012 x18: 0000000000000000
[   21.906371] x17: 000000007e0c52a5 x16: 000000003ad55aca x15: ffffc2aa60d92138
[   21.907662] x14: ffffffffffffffff x13: 2e2e2e2065707974 x12: 0000000000000018
[   21.909775] x11: ffffc2aa62322b88 x10: ffffc2aa62322aa0 x9 : c7e305fb5195d200
[   21.911898] x8 : ffffc2aa3d077e20 x7 : 6d20676e696c6c61 x6 : 43203a6d74646b6c
[   21.913108] x5 : ffffc2aa6266c9df x4 : ffffc2aa6266c9e1 x3 : ffff8000083a3968
[   21.914358] x2 : 80000000fffff122 x1 : 00000000fffff122 x0 : ffffc2aa3d07e8f8
[   21.915827] Call trace:
[   21.916375]  lkdtm_indirect_call+0x2c/0x44 [lkdtm]
[   21.918060]  lkdtm_CFI_FORWARD_PROTO+0x3c/0x6c [lkdtm]
[   21.919030]  lkdtm_do_action+0x34/0x4c [lkdtm]
[   21.919920]  direct_entry+0x170/0x1ac [lkdtm]
[   21.920772]  full_proxy_write+0x84/0x104
[   21.921759]  vfs_write+0x188/0x3d8
[   21.922387]  ksys_write+0x78/0xe8
[   21.922986]  __arm64_sys_write+0x1c/0x2c
[   21.923696]  invoke_syscall+0x58/0x134
[   21.924554]  el0_svc_common+0xb4/0xf4
[   21.925603]  do_el0_svc+0x2c/0xb4
[   21.926563]  el0_svc+0x2c/0x7c
[   21.927147]  el0t_64_sync_handler+0x84/0xf0
[   21.927985]  el0t_64_sync+0x18c/0x190
[   21.929133] Code: 728a54b1 72afc191 6b11021f 54000040 (d4304500)
[   21.930690] ---[ end trace 0000000000000000 ]---
[   21.930971] Kernel panic - not syncing: Oops - CFI: Fatal exception

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220908215504.3686827-11-samitolvanen@google.com
2022-09-26 10:13:14 -07:00
Sami Tolvanen
c50d32859e arm64: Add types to indirect called assembly functions
With CONFIG_CFI_CLANG, assembly functions indirectly called from C
code must be annotated with type identifiers to pass CFI checking. Use
SYM_TYPED_FUNC_START for the indirectly called functions, and ensure
we emit `bti c` also with SYM_TYPED_FUNC_START.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220908215504.3686827-10-samitolvanen@google.com
2022-09-26 10:13:13 -07:00
Sami Tolvanen
f143ff397a treewide: Filter out CC_FLAGS_CFI
In preparation for removing CC_FLAGS_CFI from CC_FLAGS_LTO, explicitly
filter out CC_FLAGS_CFI in all the makefiles where we currently filter
out CC_FLAGS_LTO.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220908215504.3686827-2-samitolvanen@google.com
2022-09-26 10:13:12 -07:00
Linus Torvalds
a63f2e7cb1 arm64 fixes for -rc7
- Fix false positive "sleeping while atomic" warning resulting from
   the kPTI rework taking a mutex too early.
 
 - Fix possible overflow in AMU frequency calculation
 
 - Fix incorrect shift in CMN PMU driver which causes problems with
   newer versions of the IP
 
 - Reduce alignment of the CFI jump table to avoid huge kernel images
   and link errors with !4KiB page size configurations
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCgAuFiEEPxTL6PPUbjXGY88ct6xw3ITBYzQFAmMtrWwQHHdpbGxAa2Vy
 bmVsLm9yZwAKCRC3rHDchMFjNJ/QCACnRX9+S83mixt+EEbqDMkCDqlKqpwYAP0a
 Fq7Yb4/iOqBCHY0n9of5SalpLc/ExAWDJiXoA0Y5g1E2hZMJnSvMx8aC6r92Ofdx
 uwx9PlWP6GhB7s1+kCNEHcSGHLDv4HT0nu/xbFHl64R+JwONeiB7tH3Mf9vXE05g
 As07ij7aLckMx19+SnezPawD55A6xKJ1KtoAF9NjWOuj79jJ7uTm9wCjAM29GPMT
 wC8axTaeqgHcI6fLqNpQ5cSQNHwN51f0PnPmj/fAeaJ8riAEubP1+ys4NNczrO0H
 uHQOnD0kArtjro/dNYZZZGa1u9BS+qYENgSwAl09cZ3r6orRrda4
 =EiMW
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "These are all very simple and self-contained, although the CFI
  jump-table fix touches the generic linker script as that's where the
  problematic macro lives.

   - Fix false positive "sleeping while atomic" warning resulting from
     the kPTI rework taking a mutex too early.

   - Fix possible overflow in AMU frequency calculation

   - Fix incorrect shift in CMN PMU driver which causes problems with
     newer versions of the IP

   - Reduce alignment of the CFI jump table to avoid huge kernel images
     and link errors with !4KiB page size configurations"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  vmlinux.lds.h: CFI: Reduce alignment of jump-table to function alignment
  perf/arm-cmn: Add more bits to child node address offset field
  arm64: topology: fix possible overflow in amu_fie_setup()
  arm64: mm: don't acquire mutex when rewriting swapper
2022-09-23 15:28:51 -07:00
Linus Torvalds
317fab7ec5 ARM:
* Fix for kmemleak with pKVM
 
 s390:
 
 * Fixes for VFIO with zPCI
 
 * smatch fix
 
 x86:
 
 * Ensure XSAVE-capable hosts always allow  FP and SSE state to be saved
   and restored via KVM_{GET,SET}_XSAVE
 
 * Fix broken max_mmu_rmap_size stat
 
 * Fix compile error with old glibc that doesn't have gettid()
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmMtvg4UHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroNy2Af/VybWK2uAbaMkV6irQ1YTJIrRPco1
 C+JQdiQklYbjzThfPWNF/MiH+VTObloR1KqztOeQbfcrgwzygO68D3bs0wkAukLA
 mtdcMjdsqNx8r9u533i6S8Dpo0RkHKl+I8+3mHdPHTzlrbCuYJFFFxFNLhE+xbrK
 DP2Gl/xXIGYwOv2nfHA/xxI7TRICv4IxmzQazxlmC27n6BLNSr8qp6jI9lXJQfJ8
 XJh3SbmRux3/cs2oEqONg8DySJh631kI1jGGOmL3qk07ZR7A5KZ+lju0xM7vQIEq
 aR25YNYZux+BPIY/WxT1R0j6pwinBmFp8OoQYCs8DaQ65fdE5gegtJRpow==
 =VADm
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "As everyone back came back from conferences, here are the pending
  patches for Linux 6.0.

  ARM:

   - Fix for kmemleak with pKVM

  s390:

   - Fixes for VFIO with zPCI

   - smatch fix

  x86:

   - Ensure XSAVE-capable hosts always allow FP and SSE state to be
     saved and restored via KVM_{GET,SET}_XSAVE

   - Fix broken max_mmu_rmap_size stat

   - Fix compile error with old glibc that doesn't have gettid()"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: x86: Inject #UD on emulated XSETBV if XSAVES isn't enabled
  KVM: x86: Always enable legacy FP/SSE in allowed user XFEATURES
  KVM: x86: Reinstate kvm_vcpu_arch.guest_supported_xcr0
  KVM: x86/mmu: add missing update to max_mmu_rmap_size
  selftests: kvm: Fix a compile error in selftests/kvm/rseq_test.c
  KVM: s390: pci: register pci hooks without interpretation
  KVM: s390: pci: fix GAIT physical vs virtual pointers usage
  KVM: s390: Pass initialized arg even if unused
  KVM: s390: pci: fix plain integer as NULL pointer warnings
  KVM: arm64: Use kmemleak_free_part_phys() to unregister hyp_mem_base
2022-09-23 08:42:30 -07:00
Arnd Bergmann
c69badd1d7 Qualcomm ARM64 DTS fixes for 6.0
This corrects invalid IOMMU streams for the SM8150 CDSP FastRPC, moves
 the wakeup-source of SC7280 USB nodes to the correct place, fixes the
 SM8350 UFS PHY serdes size to not overlap with the other subnodes and
 updates the firmware location for the Lenovo ThinkPad X13s to match the
 movement in linux-firmware.
 
 It also updates MAINTAINERS and .mailmap to reflect the changes in my
 email address.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmMrHooVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FXQcP/i9Np/QVhTEcyeGyXcM9Et+gUCK+
 ne/4bz+hXJLqrFbd4eZSeHb+tAg0S6yFnEXGrYPHhoe5iRHZGXoIxCbgTwCWO/SN
 sVwfVa5/ekvCQK+yUaKa1POka2TjKKWfTXj/HZiCYRcezWyxkxFZh00cjD3NiC1u
 WaHCB0YbMnvEC1RabJoh+ZK+N2KXPVQpP9n/MZEMXtyPrCLe59feQyg7xcviJ/cY
 Xwc77YB9lKsLiWzbDOvhwdSrEpb7vFvPXFKj4Pg7xEZ1nINUPmdtjf1v/Z/1luAj
 gyxL92xZytSw5oireRf6Vwio80SPopafTeMvsjjvcO0mnmA1LhAD5srnUi8z8yXE
 XVk9CQ/v4HjXYGJJxuTNUo7J30ar3O8Whbd5i0jRuwUCqu1OsgamXJYtK2WUSVyr
 65idMgDfv01F7WMC59ZoLxvoZpncAO5nu+JozdZ4ryR9Iidl3L/D4ge+gjLLBFvR
 8CN1Y/ZV5qqa+VUbovLod4zrr6tGO27OJ7QNIxblMqEBOFF9OEW+fRezH4R37VsM
 Y9B7LWbPVVV/QNmGjXud4hl/ihz8AcgplXMOR5oMmpy8mp3gHFyi8umMcWpw/u6g
 6DeQ356dSP2wFAgE+xlhEYABxIYdN+3wSrxNElgHldP5QxoYufrqT/Tcg6Nd7iHq
 R4VNA9vp/irXtksF
 =0C1/
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMtxlUACgkQmmx57+YA
 GNkb4A/+M9UqBcaskORpCLzW9CF3NFvD9eUqK1c04vlZySnJAnhSv7FiemRM13Ru
 31k1MVORRH0i5KjReM9yB95nyasDhodmumZgZPoYL+iF236NzekeJ3xn+RvG2mpp
 EOVIIL0LlWVS1FQMr8kGaPJxydUxtocPfeaisEu1TIKS01cA4xQ9DlJrYUU/POkV
 BiRVaZlN2kdQPmEJW8ZaAruNsOo7KmGI0yuQ4IzBMFh20Zu/fOnyORNtrbKCfQqK
 9axTb9M/xtnkuoFxtLrVRF7rAumSr5tjvOqWw7gmSM/2kvK6/RuN5/BLkWh8dMyS
 yvQ3xztyI8IJX6YOZ7qcbcLPobxUHcuqUH/cUMRXqtSSW0jMuVItQ4DHm5qleFZ6
 +1XFsHsI8Y7c2jaxY3V5BV2jd98zwxD0FCSvLNi1Sc+eW1FJXdCiv+fqf8q8302O
 jjto6UW7/aiWOFiTErE+Hddcyq0D14BNVlwBMRmPK2Mk4h5NUmMPmur69uYniTcb
 3+Grt8lY13uO5smhFBUrQ/HjC6bGEeKjOpxTQ/LT0/aWlwBsZcP+/ihOK3EinNLJ
 ROSW63iv2iOhNYZ9A7W4D1CGOH62RAxxfaee568LwG8aCLt47FrQ/g5U+z5zkUHc
 M8loNtUpTKIfw4GxJgGHomVXppFx1JbhTrDY35MsmWEeJjIl5rQ=
 =WotM
 -----END PGP SIGNATURE-----

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

Qualcomm ARM64 DTS fixes for 6.0

This corrects invalid IOMMU streams for the SM8150 CDSP FastRPC, moves
the wakeup-source of SC7280 USB nodes to the correct place, fixes the
SM8350 UFS PHY serdes size to not overlap with the other subnodes and
updates the firmware location for the Lenovo ThinkPad X13s to match the
movement in linux-firmware.

It also updates MAINTAINERS and .mailmap to reflect the changes in my
email address.

* tag 'qcom-arm64-fixes-for-6.0' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  arm64: dts: qcom: sm8350: fix UFS PHY serdes size
  arm64: dts: qcom: sc8280xp-x13s: Update firmware location
  MAINTAINERS: Update Bjorn's email address
  arm64: dts: qcom: sc7280: move USB wakeup-source property
  arm64: dts: qcom: thinkpad-x13s: Fix firmware location
  arm64: dts: qcom: sm8150: Fix fastrpc iommu values

Link: https://lore.kernel.org/r/20220921142939.1310163-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-23 16:44:37 +02:00
Paolo Bonzini
69604fe76e More pci fixes
Fix for a code analyser warning
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEwGNS88vfc9+v45Yq41TmuOI4ufgFAmMtmHcACgkQ41TmuOI4
 ufhapA/+OGjJtUKEa/LkCArUMUgJ+ZYy9cwx3Qrkvm7BtEguN35uxO5T7X8pdMDU
 /dYSDwtPT1ob/QmjhwwE0dpgUF8yfkBNLKBK37f6jTznI4mS6UEq/IB1BcCk3ss5
 45xG8rWiXS7oFm9bxtNsa5jkrSf7gIOuEa570tOVtOlBYvtFIH2SiHvcCUY1w48N
 A6docb+vOJnPIBHPR/1q+bBoghO5rplYaX0EiAt3EYThrhAjsXjIFzaQPwXUxgFh
 Nk/3ni1St72sbWDiC7YxjDghMVuW1GuQAlgkDWvy8bdA0IfsaqbyISuyIWZWkRfx
 V8+7OfGVsCB7qhT4C+65fQPqwZwERNwwvAFsx175/Mm9/AXn217+sN52O54olFcM
 dhKI7med1R/LqO2HH9kCGIUfJ3t+0JHpFDwcJyiAZsFbYffnwUQbIW4YcA3O+rje
 cV8/kRhD6ebzrScTOMVH+Rb4Q0N0kL34iHXbI8wcTBKmSFrdRm9YeLtQM2P/HtPA
 GVyg49bfXfA13goM9jaUW/IgT1aSHNRHfbfFKTUB7ph2Wi5ktMizpkn/CQ8L7bm1
 I0JoZfA7ALDufg2Ajyqsqmv3RX2k6ydenmX/AxzQlo34kSXY6X+N+yiPlqhumBqq
 Gs2pmvQoyvAmuShhj+eSZsQYBObgjzN7B/SAbbUBT71GerGyWeQ=
 =Z7gl
 -----END PGP SIGNATURE-----

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

More pci fixes
Fix for a code analyser warning
2022-09-23 10:06:08 -04:00
Paolo Bonzini
b4ac28a32f KVM/arm64 fixes for 6.0, take #2
- Fix kmemleak usage in Protected KVM (again)
 -----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCgAtFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAmMoo2EPHG1hekBrZXJu
 ZWwub3JnAAoJECPQ0LrRPXpD308QAL5sZ7lzB6sS2Zw4zMxpi1nW0qPJKJuvwaF7
 PZKhZTJhbXUWlSFIBRtcfzR7Aw7fP5W/dcE66TcE8IA5zNd8/O+jrJtE3uul65SG
 3nKaVuU0cYvFiA7rLJsrg+KLqPHYGnKbRO3KQrfpPT8MDs0t/OgXdyiwBycU8Os0
 XWT5anjJRCPpUIUhOW19gBKSMyYrMRlhybrWbY0MAJgtpJTMJyqjosrHWFUeDog8
 0ecDg/FS7SZhRvm6Ruf27fydNkh4mJ2dNZqzpaWTttxOV8+LN2r9ClJP98a4VWYz
 ek55ihLU+XijNozOu3O9OxcC3VULf12R/0SMnXpGdi752H+3fH26iiDmxKiHGSSR
 LV/JVPLrw1OgxAK7Wb/0v29+Z7dD9l7gBGIgvZGT5PhgKGR4W//k1EGkIS0Yh7HI
 lT7URgwagP8qgdJBfmaROdx3V4XEDX17I862aEinstr8HaCvQzgKIXmdUHiW+21P
 4Xk7HcvgJuL/NOhVtZFT8ejAlgWNi4HRyPZ/YHVA2XPbmCZk2KS0Oe0WbX9iX7vT
 SYx/X9J/CJ1+BRiDk/hMQlNMxua/9eTG42iNdg/5zB/medZpb3GlDVmvO5vXIHut
 V2chjnt11rWtzskP4noaGYGd6QlURbSHYPWTG0+XCL9BG0CJ0+Pmu9lMRHwWGnlU
 NJoGm0ZC
 =UygE
 -----END PGP SIGNATURE-----

Merge tag 'kvmarm-fixes-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 6.0, take #2

- Fix kmemleak usage in Protected KVM (again)
2022-09-22 17:01:33 -04:00
Linus Torvalds
c69cf88cda ARM: SoC fixes for 6.0-rc6
Another set of fixes for fixes for the soc tree:
 
  - A fix for the interrupt number on at91/lan966 ethernet PHYs
 
  - A second round of fixes for NXP i.MX series, including a couple
    of build issues, and board specific DT corrections on
    TQMa8MPQL, imx8mp-venice-gw74xx and imx8mm-verdin for reliability
    and partially broken functionality.
 
  - Several fixes for Rockchip SoCs, addressing a USB issue on BPI-R2-Pro,
    wakeup on Gru-Bob and reliability of high-speed SD cards, among
    other minor issues.
 
  - A fix for a long-running naming mistake that prevented the moxart mmc
    driver from working at all.
 
  - Multiple Arm SCMI firmware fixes for hardening some corner cases.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMsf8kACgkQmmx57+YA
 GNklew//T+pAuVwhR8OMp3DolbM/CwezgZgEXkuqDS0GvLkuoR71N7y1wEO77CDI
 9/luYQiFnMI8ooBMXLG545EJCZNommtDKWfSMjJnYeVQit3nupJSYaOLkzD949hg
 fg2BhA3mIKJY53m5SHRfZJOr+Q5E1DEmREX7m9e3nXTDY7izWpE2HtlKt26lKTq4
 w4sbchmrC4YRLqkBbSGLczClCakF0/L3QhGUIfBlTdLmhye0PJiQzfhVTKgdb7Jr
 l0T8vt5vg+5f5ib3PrnPQCaA3Azgu0QvImwKr7/vU/Sn6/e/xwV/hcuqQBZPFbbl
 RmSkHb3mBLXogk/EjLiw8y59D22SIbdtE+/tD+FRP+q0gjgPKobRZiqLFijvIWSB
 TtaTsKhotFKFs+pDysF0C/IfpK9MaYcX71WdqfvwlPiGGK7xCt3W+AKzgUmRVfew
 dVMeyBlVL9T3003MpLkiaIoDp8JfJsD3051CCH5tdOtF53PeKsgTUEXtnQezBof2
 80KgGXg2QGbwx+vYPGJqgQKzG7teq06G4BERK/yeFCrOsxrRXzH/icDA3F5xKY5f
 IqQiTqvZeCQvvr8G1iZb6YkhflQHaNktsRCajxERTgPfRzuQFHwF96C/+weGcZBp
 edBtweGCJ7AvV8vmvmvCdMDg9BDfgHOOwiNOKqmVvsIO01Ei8Oc=
 =fI2K
 -----END PGP SIGNATURE-----

Merge tag 'soc-fixes-6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "Another set of fixes for fixes for the soc tree:

   - A fix for the interrupt number on at91/lan966 ethernet PHYs

   - A second round of fixes for NXP i.MX series, including a couple of
     build issues, and board specific DT corrections on TQMa8MPQL,
     imx8mp-venice-gw74xx and imx8mm-verdin for reliability and
     partially broken functionality

   - Several fixes for Rockchip SoCs, addressing a USB issue on
     BPI-R2-Pro, wakeup on Gru-Bob and reliability of high-speed SD
     cards, among other minor issues

   - A fix for a long-running naming mistake that prevented the moxart
     mmc driver from working at all

   - Multiple Arm SCMI firmware fixes for hardening some corner cases"

* tag 'soc-fixes-6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (30 commits)
  arm64: dts: imx8mp-venice-gw74xx: fix port/phy validation
  ARM: dts: lan966x: Fix the interrupt number for internal PHYs
  arm64: dts: imx8mp-venice-gw74xx: fix ksz9477 cpu port
  arm64: dts: imx8mp-venice-gw74xx: fix CAN STBY polarity
  dt-bindings: memory-controllers: fsl,imx8m-ddrc: drop Leonard Crestez
  arm64: dts: tqma8mqml: Include phy-imx8-pcie.h header
  arm64: defconfig: enable ARCH_NXP
  arm64: dts: imx8mp-tqma8mpql-mba8mpxl: add missing pinctrl for RTC alarm
  ARM: dts: fix Moxa SDIO 'compatible', remove 'sdhci' misnomer
  arm64: dts: imx8mm-verdin: extend pmic voltages
  arm64: dts: rockchip: Remove 'enable-active-low' from rk3566-quartz64-a
  arm64: dts: rockchip: Remove 'enable-active-low' from rk3399-puma
  arm64: dts: rockchip: fix property for usb2 phy supply on rk3568-evb1-v10
  arm64: dts: rockchip: fix property for usb2 phy supply on rock-3a
  arm64: dts: imx8ulp: add #reset-cells for pcc
  arm64: dts: tqma8mpxl-ba8mpxl: Fix button GPIOs
  arm64: dts: imx8mn: remove GPU power domain reset
  arm64: dts: rockchip: Set RK3399-Gru PCLK_EDP to 24 MHz
  arm64: dts: imx8mm: Reverse CPLD_Dn GPIO label mapping on MX8Menlo
  arm64: dts: rockchip: fix upper usb port on BPI-R2-Pro
  ...
2022-09-22 11:10:11 -07:00
Sergey Shtylyov
d4955c0ad7 arm64: topology: fix possible overflow in amu_fie_setup()
cpufreq_get_hw_max_freq() returns max frequency in kHz as *unsigned int*,
while freq_inv_set_max_ratio() gets passed this frequency in Hz as 'u64'.
Multiplying max frequency by 1000 can potentially result in overflow --
multiplying by 1000ULL instead should avoid that...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Fixes: cd0ed03a89 ("arm64: use activity monitors for frequency invariance")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/01493d64-2bce-d968-86dc-11a122a9c07d@omp.ru
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-22 12:57:06 +01:00
Mark Rutland
61d2d1808b arm64: mm: don't acquire mutex when rewriting swapper
Since commit:

  47546a1912 ("arm64: mm: install KPTI nG mappings with MMU enabled)"

... when building with CONFIG_DEBUG_ATOMIC_SLEEP=y and booting under
QEMU TCG with '-cpu max', there's a boot-time splat:

| BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580
| in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 15, name: migration/0
| preempt_count: 1, expected: 0
| RCU nest depth: 0, expected: 0
| no locks held by migration/0/15.
| irq event stamp: 28
| hardirqs last  enabled at (27): [<ffff8000091ed180>] _raw_spin_unlock_irq+0x3c/0x7c
| hardirqs last disabled at (28): [<ffff8000081b8d74>] multi_cpu_stop+0x150/0x18c
| softirqs last  enabled at (0): [<ffff80000809a314>] copy_process+0x594/0x1964
| softirqs last disabled at (0): [<0000000000000000>] 0x0
| CPU: 0 PID: 15 Comm: migration/0 Not tainted 6.0.0-rc3-00002-g419b42ff7eef #3
| Hardware name: linux,dummy-virt (DT)
| Stopper: multi_cpu_stop+0x0/0x18c <- stop_cpus.constprop.0+0xa0/0xfc
| Call trace:
|  dump_backtrace.part.0+0xd0/0xe0
|  show_stack+0x1c/0x5c
|  dump_stack_lvl+0x88/0xb4
|  dump_stack+0x1c/0x38
|  __might_resched+0x180/0x230
|  __might_sleep+0x4c/0xa0
|  __mutex_lock+0x5c/0x450
|  mutex_lock_nested+0x30/0x40
|  create_kpti_ng_temp_pgd+0x4fc/0x6d0
|  kpti_install_ng_mappings+0x2b8/0x3b0
|  cpu_enable_non_boot_scope_capabilities+0x7c/0xd0
|  multi_cpu_stop+0xa0/0x18c
|  cpu_stopper_thread+0x88/0x11c
|  smpboot_thread_fn+0x1ec/0x290
|  kthread+0x118/0x120
|  ret_from_fork+0x10/0x20

Since commit:

  ee017ee353 ("arm64/mm: avoid fixmap race condition when create pud mapping")

... once the kernel leave the SYSTEM_BOOTING state, the fixmap pagetable
entries are protected by the fixmap_lock mutex.

The new KPTI rewrite code uses __create_pgd_mapping() to create a
temporary pagetable. This happens in atomic context, after secondary
CPUs are brought up and the kernel has left the SYSTEM_BOOTING state.
Hence we try to acquire a mutex in atomic context, which is generally
unsound (though benign in this case as the mutex should be free and all
other CPUs are quiescent).

This patch avoids the issue by pulling the mutex out of alloc_init_pud()
and calling it at a higher level in the pagetable manipulation code.
This allows it to be used without locking where one CPU is known to be
in exclusive control of the machine, even after having left the
SYSTEM_BOOTING state.

Fixes: 47546a1912 ("arm64: mm: install KPTI nG mappings with MMU enabled")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220920134731.1625740-1-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-22 12:55:39 +01:00
Zenghui Yu
522c9a64c7 KVM: arm64: Use kmemleak_free_part_phys() to unregister hyp_mem_base
With commit 0c24e06119 ("mm: kmemleak: add rbtree and store physical
address for objects allocated with PA"), kmemleak started to put the
objects allocated with physical address onto object_phys_tree_root tree.
The kmemleak_free_part() therefore no longer worked as expected on
physically allocated objects (hyp_mem_base in this case) as it attempted to
search and remove things in object_tree_root tree.

Fix it by using kmemleak_free_part_phys() to unregister hyp_mem_base. This
fixes an immediate crash when booting a KVM host in protected mode with
kmemleak enabled.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220908130659.2021-1-yuzenghui@huawei.com
2022-09-19 17:59:48 +01:00
Johan Hovold
40e9541959 arm64: dts: qcom: sm8350: fix UFS PHY serdes size
The size of the UFS PHY serdes register region is 0x1c4 and the
corresponding 'reg' property should specifically not include the
adjacent regions that are defined in the child node (e.g. tx and rx).

Fixes: 59c7cf8147 ("arm64: dts: qcom: sm8350: Add UFS nodes")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220916093603.24263-1-johan+linaro@kernel.org
2022-09-16 13:55:36 -05:00
Arnd Bergmann
7b9a516a91 i.MX fixes for 6.0, 2nd round:
- A couple of TQMa8MPQL device tree fixes from Alexander Stein on button
   GPIOs and PCF85063 RTC alarm pinctrl.
 - Include phy-imx8-pcie.h header in tqma8mqml-mba8mx device tree to fix
   build errors when this SoM dtsi is included on customer carrier boards.
 - Remove GPU power domain reset from i.MX8MN device tree to fix
   a sporadical hang seen with GPUMIX powering up.
 - Correct CPLD_Dn GPIO label mapping for Toradex Verdin based Menlo
   board.
 - Add ARCH_NXP back to defconfig, which was dropped accidentally by
   commit 566e373fe0 ("arm64: Kconfig.platforms: Group NXP platforms
   together").
 - Add missing #reset-cells for i.MX8ULP PCC clock controllers.
 - Update PMIC voltages for imx8mm-verdin board to fix an issue with one
   Toradex SKU that uses a consumer-grade chip that is capable of going up
   to 1.8GHz at 1.00V.
 - A series of imx8mp-venice-gw74xx device tree changes from Tim Harvey
   to fix things on CAN STBY polarity, KSZ9477 CPU uplink port and
   phy-mode.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmMhTsEUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM64hwf/eBQJ7ZE/HKw4UavMZWmoGMhAnqXs
 MbN2rWl68C/j+Sl05h86MZR7/Ejmjo0x0db0mosMrcDWoufZM6zSSFjU9ncviSYT
 z4q5lgXdE2BSvSWoVfML4j9M+kU0+VWPFbRCynkGifV7Km/sTfVgbfKZaxo+UqYO
 9mV6iZP9wCn4/+4vA01WOUfl294icqizN0iDEiWpHI8EobsdeGlYXgclfd6twJO7
 Io/ooPppaJxM+3ZiY0+ZGfkX0fJOncRjSvA5SALys2h0OsHlyu43AcG2CEGP8/fl
 GhweRmIKXqlwWwJxkKf8vp37L4Ao5Syl5IBaY+FqyVYtbz9GGdvUbrA/XQ==
 =E1d7
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMjNDgACgkQmmx57+YA
 GNmjcxAAoI1siIoOI0dFgru6i64QGfASE4RQZGWFVyAFu4kTG7jblrHFi3ejNx2J
 UP+4YoiUSaml7d933cs4Rp5AKe3H87NN/451pLvQ0hFic+GBNOduIHaKcMPxImM0
 HSszajoXmTBDgb6a5Cmh0CS1tfmhKCvyO8ubFC1slC24+9dJ/AdyJzH0sQf6iB4W
 YluDXjWr5PaLa30ZCqgOHsXjZc3fWXUauHAKoQXL8stve7uG/r3pHPy7lJATN5CM
 hUBvKGOSp3sJYau+n5+IUcwrBAjpDm7CNcpLFued7iZypTO0/LJpLRlo925YV2Kb
 fZOkz3rmF4EwXZBSyKeEpa+U2XVj7/PgOLaObIIf7O64QYoStmjaEHauv85VWLvJ
 T5MzmrU+tgds1Jk2VhmJSKj6ctFLt87xt0ZKUF3BUb+PgBLubavrI0NME7RIiN02
 deFPnyEF0YThXRp6jwYO7auFgnF/xUmlJy76+fB7S6O2bXybZAQga4ng8KNkuCo6
 JX0c5UOKrfYjVxBZ0GjFQG6k9zhXTsMFzFU0MKynVB9PSQnRadPmAWMU7wXN2dXW
 aVjzLntVUblybjyZFHykXRgBhlRMB72qvdIGZXimkxuE+F/v+khSbQY9PxQfg2dY
 uwLOQ5HQijz9/lSE+315KBy9REOLUyqvT7QRfeEj4AzGGPtHAw4=
 =OdRx
 -----END PGP SIGNATURE-----

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

i.MX fixes for 6.0, 2nd round:

- A couple of TQMa8MPQL device tree fixes from Alexander Stein on button
  GPIOs and PCF85063 RTC alarm pinctrl.
- Include phy-imx8-pcie.h header in tqma8mqml-mba8mx device tree to fix
  build errors when this SoM dtsi is included on customer carrier boards.
- Remove GPU power domain reset from i.MX8MN device tree to fix
  a sporadical hang seen with GPUMIX powering up.
- Correct CPLD_Dn GPIO label mapping for Toradex Verdin based Menlo
  board.
- Add ARCH_NXP back to defconfig, which was dropped accidentally by
  commit 566e373fe0 ("arm64: Kconfig.platforms: Group NXP platforms
  together").
- Add missing #reset-cells for i.MX8ULP PCC clock controllers.
- Update PMIC voltages for imx8mm-verdin board to fix an issue with one
  Toradex SKU that uses a consumer-grade chip that is capable of going up
  to 1.8GHz at 1.00V.
- A series of imx8mp-venice-gw74xx device tree changes from Tim Harvey
  to fix things on CAN STBY polarity, KSZ9477 CPU uplink port and
  phy-mode.

* tag 'imx-fixes-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  arm64: dts: imx8mp-venice-gw74xx: fix port/phy validation
  arm64: dts: imx8mp-venice-gw74xx: fix ksz9477 cpu port
  arm64: dts: imx8mp-venice-gw74xx: fix CAN STBY polarity
  arm64: dts: tqma8mqml: Include phy-imx8-pcie.h header
  arm64: defconfig: enable ARCH_NXP
  arm64: dts: imx8mp-tqma8mpql-mba8mpxl: add missing pinctrl for RTC alarm
  arm64: dts: imx8mm-verdin: extend pmic voltages
  arm64: dts: imx8ulp: add #reset-cells for pcc
  arm64: dts: tqma8mpxl-ba8mpxl: Fix button GPIOs
  arm64: dts: imx8mn: remove GPU power domain reset
  arm64: dts: imx8mm: Reverse CPLD_Dn GPIO label mapping on MX8Menlo

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-15 16:18:31 +02:00
Manivannan Sadhasivam
29f894eca8 arm64: dts: qcom: sc8280xp-x13s: Update firmware location
The firmware location in linux-firmware has been changed to include the
SoC name. So use the updated location in Thinkpad devicetree.

Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220914073922.7145-1-manivannan.sadhasivam@linaro.org
2022-09-14 12:54:01 -05:00
Tim Harvey
f7fc391a5e arm64: dts: imx8mp-venice-gw74xx: fix port/phy validation
Since commit 65ac79e181 ("net: dsa: microchip: add the phylink
get_caps") the phy-mode must be set otherwise the switch driver will
assume "NA" mode and invalidate the port.

Fixes: 7899eb6cb1 ("arm64: dts: imx: Add i.MX8M Plus Gateworks gw7400 dts support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-14 11:45:09 +08:00
Tim Harvey
c3681de3b8 arm64: dts: imx8mp-venice-gw74xx: fix ksz9477 cpu port
The CPU uplink port on the KSZ9477 is P5 not P6 - fix this.

Fixes: 7899eb6cb1 ("arm64: dts: imx: Add i.MX8M Plus Gateworks gw7400 dts support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-13 10:23:35 +08:00
Tim Harvey
e4ef088563 arm64: dts: imx8mp-venice-gw74xx: fix CAN STBY polarity
The CAN STBY poarlity is active-low. Specify it as such by removing the
'enable-active-high' property and updating the gpio property.

Fixes: 7899eb6cb1 ("arm64: dts: imx: Add i.MX8M Plus Gateworks gw7400 dts support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-13 10:23:03 +08:00
Arnd Bergmann
78c94808a4 Drop some not-specified properties, fix phy-supply properties,
fix edp clock on Gru, fix usb port on BPI-R2-Pro, fix license typo,
 fix wlan-wake-pin on Gru-Bob and lower the sd-card speed on Quartz64-B
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAmMb4fQQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgbZ6B/4j5Up0eubn3kxWt1Mn5XSYXoPOHH+dgwxu
 CkR0ZijvvTmdHjYCSg7Iy+ZNreowSUJkbjES6iEGVZbflopAcss6hxvwTM+Y7GU0
 Q6+ZCKDqpDr23TZZ7VMzkOwQIYEyV3FKZ1vZfhdAk6/WNpdkHl9NVBrWcfSmJHY4
 Mh32a7YIuaWhLI3MKTt5/umdGRzqMtvxhKfYlLKOrRc3ePoTIXVTWGdx0OzOFvCT
 B9cWCq5YbVb+0VTbS5yHLG9i6ssOsMlYpoyl+m6mcqKu7CDjsNVwucc/keTIIavD
 NeaJY7wkRdvjsd+0MF3U63bVSCcuslnLlGsGt5NTREpLvIuHHYRH
 =DVTd
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMfRJoACgkQmmx57+YA
 GNnZ/A//ZHE9W/+pPxXUkFW81BWTaVbqsGMd7S74+0WK9kdQGejdnovkj2HUKOc2
 m3f7K36qsfhFMZsgdn9o1QO01wM7moPa23/T99yd1i7Ja/y4r0oTNBC1Bn6VlGu4
 3NWGptaOZhdn4WHKxFjVZP/U4Mf67Ze5R62YsnfvjSsMDKysbUzJJFhzP/MkyJEP
 RmJwcFiVAIGKI6LTRqynYx2PkcH/wanjMDOsPol0gpRxBSdGrIMTLBDqnp+qpbbp
 9jXkHE2kU+Eb64ZdeR0wkf34bkHYrxExgP7tjN6hrbGbbXspnX5VfRcKpUeU5vfJ
 FStzsKgEN0Lq4ssH5qBnoNCAxLoihGwz4UT5jn+bgCsLnJpSmc8XQRfoHCbJejK9
 +lvG1q7RjVJhX7ekmn1gSOw7ltxebk9hx3lV6T8rTilg25HXM+aATuiDTyckD1v4
 Oi8hxw+NS8p0XRXAe9p6lsxJYXlsIpEXIWoXC9SYgzF2iqLpHwFHEvfpyBbVltw5
 QtPG1fhq9a3/At3GEjYg/rSYq/VDrBu1DwVfshy6DpyqeUB30Mdrj3uVpH2ZPH5L
 Uv0/Wp+F4WynXxn14qmuLiIXBsxTtb1oLZifUCMmrb6w8eeGudu7TN6olT0+ynVl
 L7ks2Kah3Nf9p2JshEVBI76xQnrU4+RDCN/LfRs9KN2P6WemcX4=
 =6QKc
 -----END PGP SIGNATURE-----

Merge tag 'v6.0-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes

Drop some not-specified properties, fix phy-supply properties,
fix edp clock on Gru, fix usb port on BPI-R2-Pro, fix license typo,
fix wlan-wake-pin on Gru-Bob and lower the sd-card speed on Quartz64-B

* tag 'v6.0-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: Remove 'enable-active-low' from rk3566-quartz64-a
  arm64: dts: rockchip: Remove 'enable-active-low' from rk3399-puma
  arm64: dts: rockchip: fix property for usb2 phy supply on rk3568-evb1-v10
  arm64: dts: rockchip: fix property for usb2 phy supply on rock-3a
  arm64: dts: rockchip: Set RK3399-Gru PCLK_EDP to 24 MHz
  arm64: dts: rockchip: fix upper usb port on BPI-R2-Pro
  arm64: dts: rockchip: Fix typo in lisense text for PX30.Core
  arm64: dts: rockchip: Pull up wlan wake# on Gru-Bob
  arm64: dts: rockchip: Lower sd speed on quartz64-b

Link: https://lore.kernel.org/r/2645885.mvXUDI8C0e@phil
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-09-12 16:39:22 +02:00
Fabio Estevam
70ae49c5ac arm64: dts: tqma8mqml: Include phy-imx8-pcie.h header
imx8mm-tqma8mqml.dtsi has PCIe support, so it should include
<dt-bindings/phy/phy-imx8-pcie.h>.

Otherwise, there are build errors when this SoM dtsi is included
on customers' carrier boards.

While at it, remove the PCI header from imx8mm-tqma8mqml-mba8mx.dts,
which is now unneeded.

Fixes: 1d84283101 ("arm64: dts: tqma8mqml: add PCIe support")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-12 21:07:53 +08:00
Michael Walle
3c20d96181 arm64: defconfig: enable ARCH_NXP
Commit 566e373fe0 ("arm64: Kconfig.platforms: Group NXP platforms
together") introduced a new symbol ARCH_NXP and made ARCH_LAYERSCAPE
(among others) depend on it, but didn't enable it in the defconfig.
Thus, now the defconfig doesn't include support for any NXP
architectures anymore. Fix it.

Fixes: 566e373fe0 ("arm64: Kconfig.platforms: Group NXP platforms together")
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-12 18:15:49 +08:00
Alexander Stein
45b91a1589 arm64: dts: imx8mp-tqma8mpql-mba8mpxl: add missing pinctrl for RTC alarm
Although the RTC is on the module, the RTC_EVENT# signal is connected
on the mainboard. Already set by bootloader, but make it explicit in Linux
as well.

Fixes: 418d1d840e ("arm64: dts: freescale: add initial device tree for TQMa8MPQL with i.MX8MP")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-12 18:06:39 +08:00
Linus Torvalds
087aa69a9f arm64 fixes for -rc5
- Disable in-kernel BTI when compiling with GCC, as it makes invalid
   assumptions about the distance between functions which has led to
   crashes when calling modules on a CPU with BTI support.
 
 - Remove bogus TIF_SME flag management if memory allocation fails in the
   ptrace code.
 
 - Fix the resume path when configured for 52-bit virtual addressing.
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCgAuFiEEPxTL6PPUbjXGY88ct6xw3ITBYzQFAmMcmCUQHHdpbGxAa2Vy
 bmVsLm9yZwAKCRC3rHDchMFjNJEPB/9hhMNrX0yAc64otI99DRBuuZjlGWm5tLVj
 A5dByt0bvca6XIE/5nZpduYcSGBORL4Ss29mbYteWlaU89TlLEHaedOpDTX0xj5g
 61H8UiK0YDX9w/7hbPZw7Uxdvw30LJSxszWZ4Ucst9CYTq+mMbbhgf8h7/BDmBD+
 OBpkOlouW4fSw15/UlbgBu6UTAVkbWNcWxzwzOVAdqFYzQ75eMnmOEkEZ8b/YBAA
 wZ+0kFmpjGkWymZKlgTxLfQ3eVdKwlrFzBliDtbFoFNuWyyDQ2e1qDQKFZvST4ul
 NMVlF19K9NKGVlxl2++rafbg5BQ+Y+0RJ2Hujf72W6sPaThJUDM2
 =7sa1
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "Three small arm64 fixes, all related to optional architecture
  extensions: BTI, SME and 52-bit virtual addressing:

   - Disable in-kernel BTI when compiling with GCC, as it makes invalid
     assumptions about the distance between functions which has led to
     crashes when calling modules on a CPU with BTI support

   - Remove bogus TIF_SME flag management if memory allocation fails in
     the ptrace code

   - Fix the resume path when configured for 52-bit virtual addressing"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: mm: fix resume for 52-bit enabled builds
  arm64/ptrace: Don't clear calling process' TIF_SME on OOM
  arm64/bti: Disable in kernel BTI when cross section thunks are broken
2022-09-11 07:48:21 -04:00
Joey Gouly
3fe3fd5f30 arm64: mm: fix resume for 52-bit enabled builds
__cpu_setup() was changed to take the actual number of VA bits in x0,
however the resume path was not updated at the same time.

Load `vabits_actual` in the resume path, to ensure that the correct
number of VA bits is used.

This fixes booting v6.0-rc kernels on my Juno.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Fixes: 0aaa68532e ("arm64: mm: fix booting with 52-bit address space")
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220909124311.38489-1-joey.gouly@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-10 14:46:28 +01:00
Mark Brown
d105d6920e arm64/ptrace: Don't clear calling process' TIF_SME on OOM
If allocating memory for the target SVE state in za_set() fails we clear
TIF_SME for the ptracing task which is obviously not correct.  If we are
here we know that the target task already had neither TIF_SVE nor
TIF_SME set since we only need to allocate if either the target had not
used either SVE or SME and had no need to allocate state before or we
just changed the vector length with vec_set_vector_length() which clears
TIF_ for us on allocation failure so just remove the clear entirely.

Reported-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220902132802.39682-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-08 14:26:59 +01:00
Mark Brown
c0a454b904 arm64/bti: Disable in kernel BTI when cross section thunks are broken
GCC does not insert a `bti c` instruction at the beginning of a function
when it believes that all callers reach the function through a direct
branch[1]. Unfortunately the logic it uses to determine this is not
sufficiently robust, for example not taking account of functions being
placed in different sections which may be loaded separately, so we may
still see thunks being generated to these functions. If that happens,
the first instruction in the callee function will result in a Branch
Target Exception due to the missing landing pad.

While this has currently only been observed in the case of modules
having their main code loaded sufficiently far from their init section
to require thunks it could potentially happen for other cases so the
safest thing is to disable BTI for the kernel when building with an
affected toolchain.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671

Reported-by: D Scott Phillips <scott@os.amperecomputing.com>
[Bits of the commit message are lifted from his report & workaround]
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220905142255.591990-1-broonie@kernel.org
Cc: <stable@vger.kernel.org> # v5.10+
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-06 08:56:46 +01:00
Philippe Schenker
b5a76cb38d arm64: dts: imx8mm-verdin: extend pmic voltages
Currently, we limited the voltages from the PMIC very strictly. This
causes an issue with one Toradex SKU that uses a consumer-grade chip
that is capable of going up to 1.8GHz at 1.00V.

Extend the ranges to min/max values of the SoC operating ranges (table
10) in the datasheet. Detailed explanation as follows:

BUCK2:
  - As already described above, the SKU with the consumer-grade chip
    needs a voltage of at least 1.00V. 1.05V is chosen now as this is
    listed as the maximum. Both industrial and consumer-grade chips have
    an absolute maximum rating of 1.15V which makes it still safe to put
    1.05V
  - Lower the regulator-min value to the smallest value allowed from the
    Quad-A53, 1.2GHz version of the SoC

BUCK3:
  - This regulator is used for SoC input voltages VDD_GPU, VDD_VPU and
    VDD_DRAM.
  - Use the smallest value of these three inputs as the regulator-min
  - Use the largest value of these three inputs as the regulator-max

LDO2:
  - This LDO is used for VDD_SNVS_0P8 SoC input voltage. As this has a
    single nominal input voltage just put this in the middle of 0.8V.

Fixes: 6a57f224f7 ("arm64: dts: freescale: add initial support for verdin imx8m mini")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-06 10:05:18 +08:00
Linus Torvalds
53e99dcff6 ARM: SoC fixes for 6.0
These are the expected fixes for the SoC tree. I have let the
 patches pile up a little too long, so this is bigger than I
 would have liked.
 
  - Minor build fixes for Broadcom STB and NXP i.MX8M SoCs as well\
    as TEE firmware
 
  - Updates to the MAINTAINERS file for the PolarFire SoC
 
  - Minor DT fixes for Renesas White Hawk and Arm Versatile and
    Juno platforms
 
  - A fix for a missing dependnecy in the NXP DPIO driver
 
  - Broadcom BCA fixes to the newly added devicetree files
 
  - Multiple fixes for Microchip AT91 based SoCs, dealing with
    self-refresh timings and regulator settings in DT
 
  - Several DT fixes for NXP i.MX platforms, dealing with incorrect
    GPIO settings, extraneous nodes, and a wrong clock setting.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMWH4QACgkQmmx57+YA
 GNkxQg/+Nnv/cd/u3Vmc3s9MjWFZd6s9gP2z/VSCGtE32eQZC7h8uPKhxTainv2z
 CWLCQlWEs9iTj9u4e6N7WDI4A3f7z5uuVy9EY3yTaL/mrB2it/sx45q7aeiWrzEC
 Bat0GPh/7DPy1++CUJalXhmrZa358T8QJWln+cP2vQDIv3CNEs89Z6GIO6HLJgfO
 Hy/FJ9H34LUDUK8Rj/QRKYrAZkjFfGIXTTM1gAiXHMW6x+Uz3WhxMftSsi6oyxT3
 KnE565LMva9LSFWuPbDrRgg0eR+M+w/UkRaXOOTEIAPavqEZGF891iAHZWmzpugZ
 RLXPPy4xHRwoba20nbCibsaZei7GrQxyGc36bp8+0OHkC5AOP8rfe2lXLgw2utYk
 IfKaqTNdL3MS/Ukp5A/Q8+dCfna52zvpuA6Mr8IoJ2FanddcXCw3QM/dIIV3NIGI
 1/D8g2jAUiXgZew8QmOvKf/40hwQs81N1D3uZJqgDr8B7XPFC7M2aSplpfVROjRb
 3KbRdGb7vBoHloz/hXoKRb9UPYeRiTeybhiKaAZa6d98Im63Wc5hYVvh1+oPZsgQ
 aR6z+K/UgkQX1TqfcF+6sBEqvMZY7aY4hlz0qx3JNLWZFzQUlX9r73LxrNTQF9Bi
 lwowW5ogjmPJQlSM25DFGyKmflUqpmz47GKSiV5j122Oq3C+J9c=
 =q/h8
 -----END PGP SIGNATURE-----

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

Pull ARM SoC fixes from Arnd Bergmann:
 "These are the expected fixes for the SoC tree. I have let the patches
  pile up a little too long, so this is bigger than I would have liked.

   - Minor build fixes for Broadcom STB and NXP i.MX8M SoCs as well\ as
     TEE firmware

   - Updates to the MAINTAINERS file for the PolarFire SoC

   - Minor DT fixes for Renesas White Hawk and Arm Versatile and Juno
     platforms

   - A fix for a missing dependnecy in the NXP DPIO driver

   - Broadcom BCA fixes to the newly added devicetree files

   - Multiple fixes for Microchip AT91 based SoCs, dealing with
     self-refresh timings and regulator settings in DT

   - Several DT fixes for NXP i.MX platforms, dealing with incorrect
     GPIO settings, extraneous nodes, and a wrong clock setting"

* tag 'soc-fixes-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (45 commits)
  soc: fsl: select FSL_GUTS driver for DPIO
  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
  soc: brcmstb: pm-arm: Fix refcount leak and __iomem leak bugs
  ARM: configs: at91: remove CONFIG_MICROCHIP_PIT64B
  ARM: ixp4xx: fix typos in comments
  arm64: dts: renesas: r8a779g0: Fix HSCIF0 interrupt number
  tee: fix compiler warning in tee_shm_register()
  arm64: dts: freescale: verdin-imx8mp: fix atmel_mxt_ts reset polarity
  arm64: dts: freescale: verdin-imx8mm: fix atmel_mxt_ts reset polarity
  arm64: dts: imx8mp: Fix I2C5 GPIO assignment on i.MX8M Plus DHCOM
  arm64: dts: imx8mm-venice-gw7901: fix port/phy validation
  arm64: dts: verdin-imx8mm: add otg2 pd to usbphy
  soc: imx: gpcv2: Assert reset before ungating clock
  arm64: dts: ls1028a-qds-65bb: don't use in-band autoneg for 2500base-x
  ...
2022-09-05 17:44:48 -04:00
Fabio Estevam
ea89926d96 arm64: dts: rockchip: Remove 'enable-active-low' from rk3566-quartz64-a
The 'enable-active-low' property is not a valid one.

Only 'enable-active-high' is valid, and when this property is absent
the gpio regulator will act as active low by default.

Remove the invalid 'enable-active-low' property.

Fixes: b33a22a1e7 ("arm64: dts: rockchip: add basic dts for Pine64 Quartz64-A")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20220827175140.1696699-2-festevam@denx.de
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2022-09-05 12:18:20 +02:00
Fabio Estevam
a994b34b9a arm64: dts: rockchip: Remove 'enable-active-low' from rk3399-puma
The 'enable-active-low' property is not a valid one.

Only 'enable-active-high' is valid, and when this property is absent
the gpio regulator will act as active low by default.

Remove the invalid 'enable-active-low' property.

Fixes: 2c66fc34e9 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20220827175140.1696699-1-festevam@denx.de
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2022-09-05 12:18:08 +02:00
Michael Riesch
1988e3ef05 arm64: dts: rockchip: fix property for usb2 phy supply on rk3568-evb1-v10
The property "vbus-supply" was copied from the vendor kernel but is not
available in mainstream. Use correct property "phy-supply".

Fixes: d6cfb110b0 ("arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10")
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.kernel.org/r/20220905064335.104650-2-michael.riesch@wolfvision.net
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2022-09-05 12:00:42 +02:00
Michael Riesch
43e1d6d3b4 arm64: dts: rockchip: fix property for usb2 phy supply on rock-3a
The property "vbus-supply" was copied from the vendor kernel but is not
available in mainstream. Use correct property "phy-supply".

Fixes: 254a1f6a29 ("arm64: dts: rockchip: add usb3 support to the radxa rock3 model a")
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.kernel.org/r/20220905064335.104650-1-michael.riesch@wolfvision.net
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2022-09-05 12:00:42 +02:00
Peng Fan
5fa383a25f arm64: dts: imx8ulp: add #reset-cells for pcc
The binding file clock/imx8ulp-pcc-clock.yaml indicates '#reset-cells'
is a required property, add it.

Fixes: fe6291e963 ("arm64: dts: imx8ulp: Add the basic dtsi file for imx8ulp")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-05 11:38:44 +08:00
Alexander Stein
d707ff3470 arm64: dts: tqma8mpxl-ba8mpxl: Fix button GPIOs
They were in wrong order, so fix it by switching them.

Fixes: 418d1d840e ("arm64: dts: freescale: add initial device tree for TQMa8MPQL with i.MX8MP")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-05 11:30:42 +08:00
Marco Felsch
347155d1fa arm64: dts: imx8mn: remove GPU power domain reset
The PGC (power gating controller) already handles the reset for the
GPUMIX power domain. By specifying it within the device tree the reset
it issued a 2nd time. This confuses the hardware during power up and
sporadically hangs the SoC. Fix this by removing the reset property and
let the hardware handle the reset.

Fixes: 9a0f3b157e ("arm64: dts: imx8mn: Enable GPU")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-05 09:29:26 +08:00
zain wang
8123437cf4 arm64: dts: rockchip: Set RK3399-Gru PCLK_EDP to 24 MHz
We've found the AUX channel to be less reliable with PCLK_EDP at a
higher rate (typically 25 MHz). This is especially important on systems
with PSR-enabled panels (like Gru-Kevin), since we make heavy, constant
use of AUX.

According to Rockchip, using any rate other than 24 MHz can cause
"problems between syncing the PHY an PCLK", which leads to all sorts of
unreliabilities around register operations.

Fixes: d67a38c5a6 ("arm64: dts: rockchip: move core edp from rk3399-kevin to shared chromebook")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://lore.kernel.org/r/20220830131212.v2.1.I98d30623f13b785ca77094d0c0fd4339550553b6@changeid
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2022-09-04 18:17:47 +02:00
Marek Vasut
8194a35622 arm64: dts: imx8mm: Reverse CPLD_Dn GPIO label mapping on MX8Menlo
The CPLD_Dn GPIO assignment between SoM and CPLD has now been clarified
in schematic and the assignment is reversed. Update the DT to match the
hardware.

Fixes: 510c527b4f ("arm64: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board")
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2022-09-04 20:37:28 +08:00
Linus Torvalds
cf3488fa25 arm64 fixes for -rc4
- Fix two boot issues caused by the recent head.S rework when !KASLR
 
 - Fix calculation of crashkernel memory reservation
 
 - Fix bogus error check in PMU IRQ probing code
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCgAuFiEEPxTL6PPUbjXGY88ct6xw3ITBYzQFAmMRwE8QHHdpbGxAa2Vy
 bmVsLm9yZwAKCRC3rHDchMFjNP6lB/4m0NNn4PQJ5FmTBuNurwB+CvZyC/pl/exL
 reXG0hwI+ApX1xj6aD7tZ3tB+mi6EG0+3PBLuJ4KuSNecwwT/au5ZxAipsc+IRs0
 EI4loeItzTaevaVTyydsTMgXYAJlCHlMDxEI0QIW3/datH10bZ1GzhEDL/Ebflfu
 Mo4g0/+eysGmSHtj7kL5IU4bE+CCXnXycphgCLAn0qcdxuF/iZphu/GgB4Az6gSS
 9ks3HJkO+X1UVb8qK0prVDsalX2z5tTWbxQ7XACJ4KEVEiSqh7ei3B283cF+Zeip
 3PSg6gkPC5YZmLjv431B/pAycsx/x8KeXY0yDAadTRmOQYROMm0j
 =a7xW
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
 "It's a lot smaller than last week, with the star of the show being a
  couple of fixes to head.S addressing a boot regression introduced by
  the recent overhaul of that code in non-default configurations (i.e.
  KASLR disabled).

  The first of those two resolves the issue reported (and bisected) by
  Mikulus in the wait_on_bit() thread.

  Summary:

   - Fix two boot issues caused by the recent head.S rework when !KASLR

   - Fix calculation of crashkernel memory reservation

   - Fix bogus error check in PMU IRQ probing code"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: mm: Reserve enough pages for the initial ID map
  perf/arm_pmu_platform: fix tests for platform_get_irq() failure
  arm64: head: Ignore bogus KASLR displacement on non-relocatable kernels
  arm64/kexec: Fix missing extra range for crashkres_low.
2022-09-02 10:32:30 -07:00
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
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
Ard Biesheuvel
5fbc49cef9 arm64: mm: Reserve enough pages for the initial ID map
The logic that conditionally allocates one additional page at each
swapper page table level if KASLR is enabled is also applied to the
initial ID map, now that we have started using the same set of macros
to allocate the space for it.

However, the placement of the kernel in physical memory might result in
additional pages being needed at any level, even if KASLR is disabled in
the build. So account for this in the computation.

Fixes: c3cee924bd ("arm64: head: cover entire kernel image in initial ID map")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220826164800.2059148-1-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-01 12:02:39 +01:00
Ard Biesheuvel
e62b9e6f25 arm64: head: Ignore bogus KASLR displacement on non-relocatable kernels
Even non-KASLR kernels can be built as relocatable, to work around
broken bootloaders that violate the rules regarding physical placement
of the kernel image - in this case, the physical offset modulo 2 MiB is
used as the KASLR offset, and all absolute symbol references are fixed
up in the usual way. This workaround is enabled by default.

CONFIG_RELOCATABLE can also be disabled entirely, in which case the
relocation code and the code that captures the offset are omitted from
the build. However, since commit aacd149b62 ("arm64: head: avoid
relocating the kernel twice for KASLR"), this code got out of sync, and
we still add the offset to the kernel virtual address before populating
the page tables even though we never capture it. This means we add a
bogus value instead, breaking the boot entirely.

Fixes: aacd149b62 ("arm64: head: avoid relocating the kernel twice for KASLR")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20220827070904.2216989-1-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-01 11:50:44 +01:00
Levi Yun
4831be702b arm64/kexec: Fix missing extra range for crashkres_low.
Like crashk_res, Calling crash_exclude_mem_range function with
crashk_low_res area would need extra crash_mem range too.

Add one more extra cmem slot in case of crashk_low_res is used.

Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
Fixes: 944a45abfa ("arm64: kdump: Reimplement crashkernel=X")
Cc: <stable@vger.kernel.org> # 5.19.x
Acked-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20220831103913.12661-1-ppbuk5246@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
2022-09-01 11:50:00 +01:00
Johan Hovold
d5089f79b1 arm64: dts: qcom: sc7280: move USB wakeup-source property
Move the USB-controller wakeup-source property to the dwc3 glue node to
match the updated binding.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220802152642.2516-1-johan+linaro@kernel.org
2022-08-29 18:14:00 -05:00
Steev Klimaszewski
b6a6535b33 arm64: dts: qcom: thinkpad-x13s: Fix firmware location
The firmware for the Lenovo Thinkpad X13s has been submitted, accepted
and merged upstream, so update to the correct path.

Signed-off-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220817231236.3971-1-steev@kali.org
2022-08-29 18:14:00 -05:00
Bhupesh Sharma
1d330a6783 arm64: dts: qcom: sm8150: Fix fastrpc iommu values
Fix the 'memory access' related crash seen while running Hexagon
SDK example applications on the cdsp dsp available on sm8150 SoC
based boards:

  qcom_q6v5_pas 8300000.remoteproc: fatal error received:
    EX:kernel:0x0:frpck_0_0:0xf5:PC=0xc020ceb0

This crash is caused by incorrect IOMMU SID values being used
in the fastrpc node.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Rob Herring <robh@kernel.org>
Suggested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220819053945.4114430-1-bhupesh.sharma@linaro.org
2022-08-29 18:14:00 -05:00