Skip to content
  1. Jun 14, 2023
    • Stephan Gerhold's avatar
      spi: qup: Request DMA before enabling clocks · e96f5270
      Stephan Gerhold authored
      
      
      [ Upstream commit 0c331fd1 ]
      
      It is usually better to request all necessary resources (clocks,
      regulators, ...) before starting to make use of them. That way they do
      not change state in case one of the resources is not available yet and
      probe deferral (-EPROBE_DEFER) is necessary. This is particularly
      important for DMA channels and IOMMUs which are not enforced by
      fw_devlink yet (unless you use fw_devlink.strict=1).
      
      spi-qup does this in the wrong order, the clocks are enabled and
      disabled again when the DMA channels are not available yet.
      
      This causes issues in some cases: On most SoCs one of the SPI QUP
      clocks is shared with the UART controller. When using earlycon UART is
      actively used during boot but might not have probed yet, usually for
      the same reason (waiting for the DMA controller). In this case, the
      brief enable/disable cycle ends up gating the clock and further UART
      console output will halt the system completely.
      
      Avoid this by requesting the DMA channels before changing the clock
      state.
      
      Fixes: 612762e8 ("spi: qup: Add DMA capabilities")
      Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
      Link: https://lore.kernel.org/r/20230518-spi-qup-clk-defer-v1-1-f49fc9ca4e02@gerhold.net
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e96f5270
    • Greg Kroah-Hartman's avatar
      i40e: fix build warnings in i40e_alloc.h · 1cc6435c
      Greg Kroah-Hartman authored
      
      
      Not upstream as it was fixed in a much larger api change in newer
      kernels.
      
      gcc-13 rightfully complains that enum is not the same as an int, so fix
      up the function prototypes in i40e_alloc.h to be correct, solving a
      bunch of build warnings.
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1cc6435c
    • Greg Kroah-Hartman's avatar
      i40iw: fix build warning in i40iw_manage_apbvt() · fc75b897
      Greg Kroah-Hartman authored
      
      
      Not upstream as this function is no longer around anymore.
      
      The function i40iw_manage_apbvt() has the wrong prototype match from the
      .h file to the .c declaration, so fix it up, otherwise gcc-13 complains
      (rightfully) that the type is incorrect.
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc75b897
    • Jiri Slaby (SUSE)'s avatar
      block/blk-iocost (gcc13): keep large values in a new enum · c425e718
      Jiri Slaby (SUSE) authored
      commit ff1cc97b upstream.
      
      Since gcc13, each member of an enum has the same type as the enum [1]. And
      that is inherited from its members. Provided:
        VTIME_PER_SEC_SHIFT     = 37,
        VTIME_PER_SEC           = 1LLU << VTIME_PER_SEC_SHIFT,
        ...
        AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
      the named type is unsigned long.
      
      This generates warnings with gcc-13:
        block/blk-iocost.c: In function 'ioc_weight_prfill':
        block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int'
      
        block/blk-iocost.c: In function 'ioc_weight_show':
        block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int'
      
      So split the anonymous enum with large values to a separate enum, so
      that they don't affect other members.
      
      [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113
      
      Cc: Martin Liska <mliska...
      c425e718
    • Arnd Bergmann's avatar
      blk-iocost: avoid 64-bit division in ioc_timer_fn · ec97af8e
      Arnd Bergmann authored
      
      
      commit 5f2779df upstream.
      
      The behavior of 'enum' types has changed in gcc-13, so now the
      UNBUSY_THR_PCT constant is interpreted as a 64-bit number because
      it is defined as part of the same enum definition as some other
      constants that do not fit within a 32-bit integer. This in turn
      leads to some inefficient code on 32-bit architectures as well
      as a link error:
      
      arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function `ioc_timer_fn':
      blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod'
      arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to `__aeabi_uldivmod'
      
      Split the enum definition to keep the 64-bit timing constants in
      a separate enum type from those constants that can clearly fit
      within a smaller type.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ec97af8e
  2. Jun 09, 2023