Skip to content
  1. Jul 29, 2022
    • Ben Dooks's avatar
      riscv: add as-options for modules with assembly compontents · c3dc7511
      Ben Dooks authored
      commit c1f6eff3 upstream.
      
      When trying to load modules built for RISC-V which include assembly files
      the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'"
      due to R_RISCV_ALIGN relocations being generated by the assembler.
      
      The R_RISCV_ALIGN relocations can be removed at the expense of code space
      by adding -mno-relax to gcc and as.  In commit 7a8e7da4
      
      
      ("RISC-V: Fixes to module loading") -mno-relax is added to the build
      variable KBUILD_CFLAGS_MODULE. See [1] for more info.
      
      The issue is that when kbuild builds a .S file, it invokes gcc with
      the -mno-relax flag, but this is not being passed through to the
      assembler. Adding -Wa,-mno-relax to KBUILD_AFLAGS_MODULE ensures that
      the assembler is invoked correctly. This may have now been fixed in
      gcc[2] and this addition should not stop newer gcc and as from working.
      
      [1] https://github.com/riscv/riscv-elf-psabi-doc/issues/183
      [2] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857
      
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Link: https://lore.kernel.org/r/20220529152200.609809-1-ben.dooks@codethink.co.uk
      Fixes: ab1ef68e
      
       ("RISC-V: Add sections of PLT and GOT for kernel module")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c3dc7511
    • Fabien Dessenne's avatar
      pinctrl: stm32: fix optional IRQ support to gpios · e5a6b05d
      Fabien Dessenne authored
      commit a1d4ef1a upstream.
      
      To act as an interrupt controller, a gpio bank relies on the
      "interrupt-parent" of the pin controller.
      When this optional "interrupt-parent" misses, do not create any IRQ domain.
      
      This fixes a "NULL pointer in stm32_gpio_domain_alloc()" kernel crash when
      the interrupt-parent = <exti> property is not declared in the Device Tree.
      
      Fixes: 0eb9f683
      
       ("pinctrl: Add IRQ support to STM32 gpios")
      Signed-off-by: default avatarFabien Dessenne <fabien.dessenne@foss.st.com>
      Link: https://lore.kernel.org/r/20220627142350.742973-1-fabien.dessenne@foss.st.com
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5a6b05d
  2. Jul 22, 2022