Skip to content
  1. Aug 27, 2023
    • Vincent Whitchurch's avatar
      um: virt-pci: fix missing declaration warning · 974b808d
      Vincent Whitchurch authored
      
      
      Fix this warning which appears with W=1 and without CONFIG_OF:
      
       warning: no previous declaration for 'pcibios_get_phb_of_node'
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202308230949.PphIIlhq-lkp@intel.com/
      Fixes: 314a1408
      
       ("um: virt-pci: implement pcibios_get_phb_of_node()")
      Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      974b808d
    • Justin Stitt's avatar
      um: Refactor deprecated strncpy to memcpy · 32280e83
      Justin Stitt authored
      
      
      Use `memcpy` since `console_buf` is not expected to be NUL-terminated
      and it more accurately describes what is happening with the buffers
      `console_buf` and `string` as per Kees' analysis [1].
      
      Also mark char buffer as `__nonstring` as per Kees' suggestion [2].
      
      This change now makes it more clear what this code does and that
      `console_buf` is not expected to be NUL-terminated.
      
      Link: https://lore.kernel.org/all/202308081708.D5ADC80F@keescook/ [1]
      Link: https://github.com/KSPP/linux/issues/90 [2]
      Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
      Cc: linux-hardening@vger.kernel.org
      Suggested-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      32280e83
    • Nick Desaulniers's avatar
      um: fix 3 instances of -Wmissing-prototypes · ab7ca2eb
      Nick Desaulniers authored
      
      
      Fixes the following build errors observed from W=1 builds:
        arch/um/drivers/xterm_kern.c:35:5: warning: no previous prototype for
        function 'xterm_fd' [-Wmissing-prototypes]
        35 | int xterm_fd(int socket, int *pid_out)
           |     ^
        arch/um/drivers/xterm_kern.c:35:1: note: declare 'static' if the
        function is not intended to be used outside of this translation unit
        35 | int xterm_fd(int socket, int *pid_out)
           | ^
           | static
        arch/um/drivers/chan_kern.c:183:6: warning: no previous prototype for
        function 'free_irqs' [-Wmissing-prototypes]
        183 | void free_irqs(void)
            |      ^
        arch/um/drivers/chan_kern.c:183:1: note: declare 'static' if the
        function is not intended to be used outside of this translation unit
        183 | void free_irqs(void)
            | ^
            | static
        arch/um/drivers/slirp_kern.c:18:6: warning: no previous prototype for
        function 'slirp_init' [-Wmissing-prototypes]
        18 | void slirp_init(struct net_device *dev, void *data)
           |      ^
        arch/um/drivers/slirp_kern.c:18:1: note: declare 'static' if the
        function is not intended to be used outside of this translation unit
        18 | void slirp_init(struct net_device *dev, void *data)
           | ^
           | static
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202308081050.sZEw4cQ5-lkp@intel.com/
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      ab7ca2eb
    • Nick Desaulniers's avatar
      um: port_kern: fix -Wmissing-variable-declarations · 4b038701
      Nick Desaulniers authored
      
      
      I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day
      bot spotted the following instance:
      
        arch/um/drivers/port_kern.c:147:14: warning: no previous extern
        declaration for non-static variable 'port_work'
        [-Wmissing-variable-declarations]
        DECLARE_WORK(port_work, port_work_proc);
                     ^
        arch/um/drivers/port_kern.c:147:1: note: declare 'static' if the
        variable is not intended to be used outside of this translation unit
        DECLARE_WORK(port_work, port_work_proc);
        ^
      
      This symbol is not referenced by more than one translation unit, so give
      it static storage.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/llvm/202308081050.sZEw4cQ5-lkp@intel.com/
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      4b038701
    • Nick Desaulniers's avatar
      uml: audio: fix -Wmissing-variable-declarations · b10eee78
      Nick Desaulniers authored
      
      
      I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day
      bot spotted the following instance:
      
        arch/um/drivers/hostaudio_kern.c:316:3: warning: no previous extern
        declaration for non-static variable 'module_data'
        [-Wmissing-variable-declarations]
        } module_data;
          ^
        arch/um/drivers/hostaudio_kern.c:313:1: note: declare 'static' if the
        variable is not intended to be used outside of this translation unit
        struct {
        ^
      
      This symbol is not referenced by more than one translation unit, so give
      it static storage.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/llvm/202308081050.sZEw4cQ5-lkp@intel.com/
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      b10eee78
    • Justin Stitt's avatar
      um: vector: refactor deprecated strncpy · e30955d0
      Justin Stitt authored
      
      
      `strncpy` is deprecated for use on NUL-terminated destination strings [1].
      
      A suitable replacement is `strscpy` [2] due to the fact that it
      guarantees NUL-termination on its destination buffer argument which is
      _not_ the case for `strncpy`!
      
      In this case, we are able to drop the now superfluous `... - 1`
      instances because `strscpy` will automatically truncate the last byte by
      setting it to a NUL byte if the source size exceeds the destination size
      or if the source string is not NUL-terminated.
      
      I've also opted to remove the seemingly useless char* casts. I'm not
      sure why they're present at all since (after expanding the `ifr_name`
      macro) `ifr.ifr_ifrn.ifrn_name` is a char* already.
      
      All in all, `strscpy` is a more robust and less ambiguous interface
      while also letting us remove some `... -1`'s which cleans things up a
      bit.
      
      [1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
      [2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
      
      Link: https://github.com/KSPP/linux/issues/90
      Cc: linux-hardening@vger.kernel.org
      Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
      Acked-by: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      e30955d0
    • Masahiro Yamada's avatar
      um: use obj-y to descend into arch/um/*/ · 8f85f93b
      Masahiro Yamada authored
      
      
      The single build rule does not work with the core-y syntax. [1]
      
      Use the standard obj-y syntax.
      
      [1]: https://lore.kernel.org/linux-kbuild/d57ba55f-20a3-b836-783d-b49c8a161b6e@kernel.org/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarJiri Slaby <jirislaby@kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Tested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      8f85f93b
    • Masahiro Yamada's avatar
      um: Hard-code the result of 'uname -s' · d32df108
      Masahiro Yamada authored
      
      
      We rely on 'uname -s' returning 'Linux' because there are os-Linux/
      directories, but no other os-*/.
      
      Supporting a non-Linux host is unlikely to happen.
      
      Let's hard-code 'Linux'.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      d32df108
    • David Gow's avatar
      um: Use the x86 checksum implementation on 32-bit · ff3f7860
      David Gow authored
      
      
      When UML is compiled under 32-bit x86, it uses its own copy of
      checksum_32.S, which is terribly out-of-date and doesn't support
      checksumming unaligned data.
      
      This causes the new "checksum" KUnit test to fail:
      ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_64BIT=n --cross_compile i686-linux-gnu- checksum
          KTAP version 1
          # Subtest: checksum
          1..3
          # test_csum_fixed_random_inputs: ASSERTION FAILED at lib/checksum_kunit.c:243
          Expected result == expec, but
              result == 33316 (0x8224)
              expec == 33488 (0x82d0)
          not ok 1 test_csum_fixed_random_inputs
          # test_csum_all_carry_inputs: ASSERTION FAILED at lib/checksum_kunit.c:267
          Expected result == expec, but
              result == 65280 (0xff00)
              expec == 0 (0x0)
          not ok 2 test_csum_all_carry_inputs
          # test_csum_no_carry_inputs: ASSERTION FAILED at lib/checksum_kunit.c:306
          Expected result == expec, but
              result == 65531 (0xfffb)
              expec == 0 (0x0)
          not ok 3 test_csum_no_carry_inputs
      
      Sharing the normal implementation in arch/x86/lib both fixes all of
      these issues and means any further fixes only need to be done once.
      
      x86_64 already seems to share the same implementation between UML and
      "normal" x86.
      
      Signed-off-by: default avatarDavid Gow <davidgow@google.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      ff3f7860
    • David Gow's avatar
      asm-generic: current: Don't include thread-info.h if building asm · 760ee8f8
      David Gow authored
      
      
      asm/current.h is included by some assembly files (either directly, or
      indirectly). This works on some architectures (such as x86), as their
      implementation of current.h is careful to not include any C, but the
      asm-generic version includes linux/thread-info.h unconditionally, which
      leads to errors when either C code or non-asm-compatible preprocessor
      directives are included.
      
      Just wrap the contents behind an #ifndef __ASSEMBLY__ to avoid any C
      code making its way in.
      
      Signed-off-by: default avatarDavid Gow <davidgow@google.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      760ee8f8
    • YueHaibing's avatar
      um: Remove unsued extern declaration ldt_host_info() · 11ae290e
      YueHaibing authored
      
      
      This is unused now, so can remove it.
      
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      11ae290e
  2. Aug 20, 2023
    • Randy Dunlap's avatar
      um: Fix hostaudio build errors · db4bfcba
      Randy Dunlap authored
      Use "select" to ensure that the required kconfig symbols are set
      as expected.
      Drop HOSTAUDIO since it is now equivalent to UML_SOUND.
      
      Set CONFIG_SOUND=m in ARCH=um defconfig files to maintain the
      status quo of the default configs.
      
      Allow SOUND with UML regardless of HAS_IOMEM. Otherwise there is a
      kconfig warning for unmet dependencies. (This was not an issue when
      SOUND was defined in arch/um/drivers/Kconfig. I have done 50 randconfig
      builds and didn't find any issues.)
      
      This fixes build errors when CONFIG_SOUND is not set:
      
      ld: arch/um/drivers/hostaudio_kern.o: in function `hostaudio_cleanup_module':
      hostaudio_kern.c:(.exit.text+0xa): undefined reference to `unregister_sound_mixer'
      ld: hostaudio_kern.c:(.exit.text+0x15): undefined reference to `unregister_sound_dsp'
      ld: arch/um/drivers/hostaudio_kern.o: in function `hostaudio_init_module':
      hostaudio_kern.c:(.init.text+0x19): undefined reference to `register_sound_dsp'
      ld: hostaudio_kern.c:(.init.text+0x31): undefined reference to `register_sound_mixer'
      ld: hostaudio_kern.c:(.init.text+0x49): undefined reference to `unregister_sound_dsp'
      
      and this kconfig warning:
      WARNING: unmet direct dependencies detected for SOUND
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Fixes: d886e87c
      
       ("sound: make OSS sound core optional")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: lore.kernel.org/r/202307141416.vxuRVpFv-lkp@intel.com
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: linux-um@lists.infradead.org
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: linux-kbuild@vger.kernel.org
      Cc: alsa-devel@alsa-project.org
      Reviewed-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      db4bfcba
    • Azeem Shaikh's avatar
      um: Remove strlcpy usage · f5ff432d
      Azeem Shaikh authored
      
      
      strlcpy() reads the entire source buffer first.
      This read may exceed the destination size limit.
      This is both inefficient and can lead to linear read
      overflows if a source string is not NUL-terminated [1].
      In an effort to remove strlcpy() completely [2], replace
      strlcpy() here with strscpy().
      No return values were used, so direct replacement is safe.
      
      [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
      [2] https://github.com/KSPP/linux/issues/89
      
      Signed-off-by: default avatarAzeem Shaikh <azeemshaikh38@gmail.com>
      [rw: Massaged subject]
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      f5ff432d
  3. Aug 14, 2023
  4. Aug 13, 2023
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.5-2' of... · 4c75bf7e
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Clear errno before calling getline()
      
       - Fix a modpost warning for ARCH=alpha
      
      * tag 'kbuild-fixes-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        alpha: remove __init annotation from exported page_is_ram()
        scripts/kallsyms: Fix build failure by setting errno before calling getline()
      4c75bf7e
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.5-4' of... · 3dcf1473
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform drivers fixes from Hans de Goede:
      
       -  lenovo-ymc driver causes keyboard + touchpad to not work with >= 6.4
          on some Thinkbook models, fix this
      
       -  A set of small fixes for mlx-platform
      
       -  Other small fixes and hw-id additions
      
      * tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type
        platform: mellanox: Change register offset addresses
        platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask
        platform: mellanox: mlx-platform: Fix signals polarity and latch mask
        platform: mellanox: Fix order in exit flow
        platform/x86: ISST: Reduce noise for missing numa information in logs
        platform/x86: msi-ec: Fix the build
        ACPI: scan: Create platform device for CS35L56
        platform/x86/amd/pmf: Fix unsigned comparison with less than zero
      3dcf1473
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 7308e927
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Eleven small fixes, ten in drivers.
      
        Of the two fixes marked core, one is in the raid helper class (used by
        some raid device drivers) and the other one is the /proc/scsi/scsi
        parsing fix for potential reads beyond the end of the buffer"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qedf: Fix firmware halt over suspend and resume
        scsi: qedi: Fix firmware halt over suspend and resume
        scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock
        scsi: lpfc: Remove reftag check in DIF paths
        scsi: ufs: renesas: Fix private allocation
        scsi: snic: Fix possible memory leak if device_add() fails
        scsi: core: Fix possible memory leak if device_add() fails
        scsi: core: Fix legacy /proc parsing buffer overflow
        scsi: 53c700: Check that command slot is not NULL
        scsi: fnic: Replace return codes in fnic_clean_pending_aborts()
        scsi: storvsc: Fix handling of virtual Fibre Channel timeouts
      7308e927
    • Hans de Goede's avatar
      platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type · 2b6aa661
      Hans de Goede authored
      The lenovo-ymc driver is causing the keyboard + touchpad to stop working
      on some regular laptop models such as the Lenovo ThinkBook 13s G2 ITL 20V9.
      
      The problem is that there are YMC WMI GUID methods in the ACPI tables
      of these laptops, despite them not being Yogas and lenovo-ymc loading
      causes libinput to see a SW_TABLET_MODE switch with state 1.
      
      This in turn causes libinput to ignore events from the builtin keyboard
      and touchpad, since it filters those out for a Yoga in tablet mode.
      
      Similar issues with false-positive SW_TABLET_MODE=1 reporting have
      been seen with the intel-hid driver.
      
      Copy the intel-hid driver approach to fix this and only bind to the WMI
      device on machines where the DMI chassis-type indicates the machine
      is a convertible.
      
      Add a 'force' module parameter to allow overriding the chassis-type check
      so that users can easily test if the YMC interface works on models which
      report an unexpected chassis-type.
      
      Fixes: e82882cd
      
       ("platform/x86: Add driver for Yoga Tablet Mode switch")
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229373
      Cc: André Apitzsch <git@apitzsch.eu>
      Cc: stable@vger.kernel.org
      Tested-by: default avatarAndrew Kallmeyer <kallmeyeras@gmail.com>
      Tested-by: default avatarGergő Köteles <soyer@irl.hu>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20230812144818.383230-1-hdegoede@redhat.com
      2b6aa661
    • Vadim Pasternak's avatar
      platform: mellanox: Change register offset addresses · d66a8aab
      Vadim Pasternak authored
      Move debug register offsets to different location due to hardware changes.
      
      Fixes: dd635e33
      
       ("platform: mellanox: Introduce support of new Nvidia L1 switch")
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Reviewed-by: default avatarMichael Shych <michaelsh@nvidia.com>
      Link: https://lore.kernel.org/r/20230813083735.39090-5-vadimp@nvidia.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      d66a8aab
    • Vadim Pasternak's avatar
      platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask · 9f8ccdb5
      Vadim Pasternak authored
      Use kernel_power_off() instead of kernel_halt() to pass through
      machine_power_off() -> pm_power_off(), otherwise axillary power does
      not go off.
      
      Change "power down" bitmask.
      
      Fixes: dd635e33
      
       ("platform: mellanox: Introduce support of new Nvidia L1 switch")
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Reviewed-by: default avatarMichael Shych <michaelsh@nvidia.com>
      Link: https://lore.kernel.org/r/20230813083735.39090-4-vadimp@nvidia.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      9f8ccdb5
    • Vadim Pasternak's avatar
      platform: mellanox: mlx-platform: Fix signals polarity and latch mask · 3c91d7e8
      Vadim Pasternak authored
      Change polarity of chassis health and power signals and fix latch reset
      mask for L1 switch.
      
      Fixes: dd635e33
      
       ("platform: mellanox: Introduce support of new Nvidia L1 switch")
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Reviewed-by: default avatarMichael Shych <michaelsh@nvidia.com>
      Link: https://lore.kernel.org/r/20230813083735.39090-3-vadimp@nvidia.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      3c91d7e8
    • Vadim Pasternak's avatar
      platform: mellanox: Fix order in exit flow · 8e3938cf
      Vadim Pasternak authored
      Fix exit flow order: call mlxplat_post_exit() after
      mlxplat_i2c_main_exit() in order to unregister main i2c driver before
      to "mlxplat" driver.
      
      Fixes: 0170f616
      
       ("platform: mellanox: Split initialization procedure")
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Reviewed-by: default avatarMichael Shych <michaelsh@nvidia.com>
      Link: https://lore.kernel.org/r/20230813083735.39090-2-vadimp@nvidia.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      8e3938cf
    • Linus Torvalds's avatar
      Merge tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · a785fd28
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "More fixes, some of them going back to older releases and there are
        fixes for hangs in stress tests regarding space caching:
      
         - fixes and progress tracking for hangs in free space caching, found
           by test generic/475
      
         - writeback fixes, write pages in integrity mode and skip writing
           pages that have been written meanwhile
      
         - properly clear end of extent range after an error
      
         - relocation fixes:
            - fix race betwen qgroup tree creation and relocation
            - detect and report invalid reloc roots"
      
      * tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: set cache_block_group_error if we find an error
        btrfs: reject invalid reloc tree root keys with stack dump
        btrfs: exit gracefully if reloc roots don't match
        btrfs: avoid race between qgroup tree creation and relocation
        btrfs: properly clear end of the unreserved range in cow_file_range
        btrfs: don't wait for writeback on clean pages in extent_write_cache_pages
        btrfs: don't stop integrity writeback too early
        btrfs: wait for actual caching progress during allocation
      a785fd28
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · ae545c32
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - mark virtual chips exposed by gpio-sim as ones that can sleep
         (callbacks must not be called from interrupt context)
      
       - fix an off-by-one error in gpio-ws16c48
      
      * tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent
        gpio: sim: mark the GPIO chip as a one that can sleep
      ae545c32
    • Mateusz Guzik's avatar
      locking: remove spin_lock_prefetch · c8afaa1b
      Mateusz Guzik authored
      
      
      The only remaining consumer is new_inode, where it showed up in 2001 as
      commit c37fa164f793 ("v2.4.9.9 -> v2.4.9.10") in a historical repo [1]
      with a changelog which does not mention it.
      
      Since then the line got only touched up to keep compiling.
      
      While it may have been of benefit back in the day, it is guaranteed to
      at best not get in the way in the multicore setting -- as the code
      performs *a lot* of work between the prefetch and actual lock acquire,
      any contention means the cacheline is already invalid by the time the
      routine calls spin_lock().  It adds spurious traffic, for short.
      
      On top of it prefetch is notoriously tricky to use for single-threaded
      purposes, making it questionable from the get go.
      
      As such, remove it.
      
      I admit upfront I did not see value in benchmarking this change, but I
      can do it if that is deemed appropriate.
      
      Removal from new_inode and of the entire thing are in the same patch as
      requested by Linus, so whatever weird looks can be directed at that guy.
      
      Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/fs/inode.c?id=c37fa164f793735b32aa3f53154ff1a7659e6442 [1]
      Signed-off-by: default avatarMateusz Guzik <mjguzik@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c8afaa1b
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 3feecb1b
      Linus Torvalds authored
      Pull char / misc driver fixes from Greg KH:
       "Here are some small char/misc driver fixes for 6.5-rc6 that resolve
        some reported issues. Included in here are:
      
         - bunch of iio driver fixes for reported problems
      
         - interconnect driver fixes
      
         - counter driver build fix
      
         - cardreader driver fixes
      
         - binder driver fixes
      
         - other tiny driver fixes
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
        misc: tps6594-esm: Disable ESM for rev 1 PMIC
        misc: rtsx: judge ASPM Mode to set PETXCFG Reg
        binder: fix memory leak in binder_init()
        iio: cros_ec: Fix the allocation size for cros_ec_command
        tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure
        iio: imu: lsm6dsx: Fix mount matrix retrieval
        iio: adc: meson: fix core clock enable/disable moment
        iio: core: Prevent invalid memory access when there is no parent
        iio: frequency: admv1013: propagate errors from regulator_get_voltage()
        counter: Fix menuconfig "Counter support" submenu entries disappearance
        dt-bindings: iio: adi,ad74115: remove ref from -nanoamp
        iio: adc: ina2xx: avoid NULL pointer dereference on OF device match
        iio: light: bu27008: Fix intensity data type
        iio: light: bu27008: Fix scale format
        iio: light: bu27034: Fix scale format
        iio: adc: ad7192: Fix ac excitation feature
        interconnect: qcom: sa8775p: add enable_mask for bcm nodes
        interconnect: qcom: sm8550: add enable_mask for bcm nodes
        interconnect: qcom: sm8450: add enable_mask for bcm nodes
        interconnect: qcom: Add support for mask-based BCMs
        ...
      3feecb1b
  5. Aug 12, 2023
    • Linus Torvalds's avatar
      Merge tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 469a2f50
      Linus Torvalds authored
      Pull USB / Thunderbolt driver fixes from Greg KH:
       "Here are some small USB and Thunderbolt driver fixes for reported
        problems. Included in here are:
      
         - thunderbolt driver memory leak fix
      
         - thunderbolt display flicker fix
      
         - usb dwc3 driver fix
      
         - usb gadget uvc disconnect crash fix
      
         - usb typec Kconfig build dependency fix
      
         - usb typec small fixes
      
         - usb-con-gpio bugfix
      
         - usb-storage old driver bugfix
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
        usb: dwc3: Properly handle processing of pending events
        usb-storage: alauda: Fix uninit-value in alauda_check_media()
        usb: common: usb-conn-gpio: Prevent bailing out if initial role is none
        USB: Gadget: core: Help prevent panic during UVC unconfigure
        usb: typec: mux: intel: Add dependency on USB_COMMON
        usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()
        usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
        usb: typec: tcpm: Fix response to vsafe0V event
        thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards
      469a2f50
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 43972cf2
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Do not parse the confidential computing blob on non-AMD hardware as
         it leads to an EFI config table ending up unmapped
      
       - Use the correct segment selector in the 32-bit version of getcpu() in
         the vDSO
      
       - Make sure vDSO and VVAR regions are placed in the 47-bit VA range
         even on 5-level paging systems
      
       - Add models 0x90-0x91 to the range of AMD Zenbleed-affected CPUs
      
      * tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405
        x86/mm: Fix VDSO and VVAR placement on 5-level paging machines
        x86/linkage: Fix typo of BUILD_VDSO in asm/linkage.h
        x86/vdso: Choose the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel
        x86/sev: Do not try to parse for the CC blob on non-AMD hardware
      43972cf2
    • Linus Torvalds's avatar
      Merge tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 272b86ba
      Linus Torvalds authored
      Pull x86 mitigation fixes from Borislav Petkov:
       "The first set of fallout fixes after the embargo madness. There will
        be another set next week too.
      
         - A first series of cleanups/unifications and documentation
           improvements to the SRSO and GDS mitigations code which got
           postponed to after the embargo date
      
         - Fix the SRSO aliasing addresses assertion so that the LLVM linker
           can parse it too"
      
      * tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        driver core: cpu: Fix the fallback cpu_show_gds() name
        x86: Move gds_ucode_mitigated() declaration to header
        x86/speculation: Add cpu_show_gds() prototype
        driver core: cpu: Make cpu_show_not_affected() static
        x86/srso: Fix build breakage with the LLVM linker
        Documentation/srso: Document IBPB aspect and fix formatting
        driver core: cpu: Unify redundant silly stubs
        Documentation/hw-vuln: Unify filename specification in index
      272b86ba
    • Linus Torvalds's avatar
      Merge tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd · f8de32cc
      Linus Torvalds authored
      Pull tpm irq fixes from Jarkko Sakkinen:
       "These change the probing and enabling of interrupts advertised by the
        platform firmware (i.e. ACPI, Device Tree) to be an opt-in for tpm_tis,
        which can be set from the kernel command-line.
      
        Note that the opt-in change is only for the PC MMIO tpm_tis module. It
        does not affect other similar drivers using IRQs, like tpm_tis_spi and
        synquacer"
      
      * tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
        tpm_tis: Opt-in interrupts
        tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition
      f8de32cc
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 9a20704f
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "A few small bugs:
      
         - Fix longstanding mlx5 bug where ODP would fail with certain MR
           alignments
      
         - cancel work to prevent a hfi1 UAF
      
         - MAINTAINERS update
      
         - UAF, missing mutex_init and an error unwind bug in bnxt_re"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/bnxt_re: Initialize dpi_tbl_lock mutex
        RDMA/bnxt_re: Fix error handling in probe failure path
        RDMA/bnxt_re: Properly order ib_device_unalloc() to avoid UAF
        MAINTAINERS: Remove maintainer of HiSilicon RoCE
        IB/hfi1: Fix possible panic during hotplug remove
        RDMA/umem: Set iova in ODP flow
      9a20704f
    • Linus Torvalds's avatar
      Merge tag 'zonefs-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs · 0725a704
      Linus Torvalds authored
      Pull zonefs fix from Damien Le Moal:
      
       - The switch to using iomap for executing a direct synchronous write to
         sequential files using a zone append BIO overlooked cases where the
         BIO built by iomap is too large and needs splitting, which is not
         allowed with zone append.
      
         Fix this by using regular write commands instead. The use of zone
         append commands will be reintroduced later with proper support from
         iomap.
      
      * tag 'zonefs-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
        zonefs: fix synchronous direct writes to sequential files
      0725a704
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v6.5-rc6' of... · 5512c33c
      Linus Torvalds authored
      Merge tag 'hwmon-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Fix sporadic comunication errors in pmbus/bel-pfe and
         aquacomputer_d5next drivers
      
      * tag 'hwmon-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report
        hwmon: (pmbus/bel-pfe) Enable PMBUS_SKIP_STATUS_CHECK for pfe1100
      5512c33c
    • Jarkko Sakkinen's avatar
      tpm_tis: Opt-in interrupts · 6aaf663e
      Jarkko Sakkinen authored
      Cc: stable@vger.kernel.org # v6.4+
      Link: https://lore.kernel.org/linux-integrity/CAHk-=whRVp4h8uWOX1YO+Y99+44u4s=XxMK4v00B6F1mOfqPLg@mail.gmail.com/
      Fixes: e644b2f4
      
       ("tpm, tpm_tis: Enable interrupt test")
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      6aaf663e
    • Peter Ujfalusi's avatar
      tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition · 51e5e551
      Peter Ujfalusi authored
      The patch which made it to the kernel somehow changed the
      match condition from
      DMI_MATCH(DMI_PRODUCT_NAME, "UPX-TGL01")
      to
      DMI_MATCH(DMI_PRODUCT_VERSION, "UPX-TGL")
      
      Revert back to the correct match condition to disable the
      interrupt mode on the board.
      
      Cc: stable@vger.kernel.org # v6.4+
      Fixes: edb13d7b
      
       ("tpm: tpm_tis: Disable interrupts *only* for AEON UPX-i11")
      Link: https://lore.kernel.org/lkml/20230524085844.11580-1-peter.ujfalusi@linux.intel.com/
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
      51e5e551
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2023-08-11-13-44' of... · 190bf7b1
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2023-08-11-13-44' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "14 hotfixes. 11 of these are cc:stable and the remainder address
        post-6.4 issues, or are not considered suitable for -stable
        backporting"
      
      * tag 'mm-hotfixes-stable-2023-08-11-13-44' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        mm/damon/core: initialize damo_filter->list from damos_new_filter()
        nilfs2: fix use-after-free of nilfs_root in dirtying inodes via iput
        selftests: cgroup: fix test_kmem_basic false positives
        fs/proc/kcore: reinstate bounce buffer for KCORE_TEXT regions
        MAINTAINERS: add maple tree mailing list
        mm: compaction: fix endless looping over same migrate block
        selftests: mm: ksm: fix incorrect evaluation of parameter
        hugetlb: do not clear hugetlb dtor until allocating vmemmap
        mm: memory-failure: avoid false hwpoison page mapped error info
        mm: memory-failure: fix potential unexpected return value from unpoison_memory()
        mm/swapfile: fix wrong swap entry type for hwpoisoned swapcache page
        radix tree test suite: fix incorrect allocation size for pthreads
        crypto, cifs: fix error handling in extract_iter_to_sg()
        zsmalloc: fix races between modifications of fullness and isolated
      190bf7b1
    • Cristian Ciocaltea's avatar
      x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405 · 6dbef74a
      Cristian Ciocaltea authored
      Commit
      
        522b1d69 ("x86/cpu/amd: Add a Zenbleed fix")
      
      provided a fix for the Zen2 VZEROUPPER data corruption bug affecting
      a range of CPU models, but the AMD Custom APU 0405 found on SteamDeck
      was not listed, although it is clearly affected by the vulnerability.
      
      Add this CPU variant to the Zenbleed erratum list, in order to
      unconditionally enable the fallback fix until a proper microcode update
      is available.
      
      Fixes: 522b1d69
      
       ("x86/cpu/amd: Add a Zenbleed fix")
      Signed-off-by: default avatarCristian Ciocaltea <cristian.ciocaltea@collabora.com>
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20230811203705.1699914-1-cristian.ciocaltea@collabora.com
      6dbef74a
    • William Breathitt Gray's avatar
      gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent · 33f83d13
      William Breathitt Gray authored
      The WinSystems WS16C48 I/O address region spans offsets 0x0 through 0xA,
      which is a total of 11 bytes. Fix the WS16C48_EXTENT define to the
      correct value of 11 so that access to necessary device registers is
      properly requested in the ws16c48_probe() callback by the
      devm_request_region() function call.
      
      Fixes: 2c05a0f2
      
       ("gpio: ws16c48: Implement and utilize register structures")
      Cc: stable@vger.kernel.org
      Cc: Paul Demetrotion <pdemetrotion@winsystems.com>
      Signed-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      33f83d13
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 29d99aae
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "Rework the handling of interrupt overrides on AMD Zen-based machines
        to avoid recently introduced regressions (Hans de Goede).
      
        Note that this is intended as a short-term mitigation for 6.5 and the
        long-term approach will be to attempt to use the configuration left by
        the BIOS, but it requires more investigation"
      
      * tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: resource: Add IRQ override quirk for PCSpecialist Elimina Pro 16 M
        ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen
        ACPI: resource: Always use MADT override IRQ settings for all legacy non i8042 IRQs
        ACPI: resource: revert "Remove "Zen" specific match and quirks"
      29d99aae
    • Linus Torvalds's avatar
      Merge tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 9578b04c
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix an amd-pstate cpufreq driver issues and recently introduced
        hibernation-related breakage.
      
        Specifics:
      
         - Make amd-pstate use device_attributes as expected by the CPU root
           kobject (Thomas Weißschuh)
      
         - Restore the previous behavior of resume_store() when hibernation is
           not available which is to return the full number of bytes that were
           to be written by user space (Vlastimil Babka)"
      
      * tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: amd-pstate: fix global sysfs attribute type
        PM: hibernate: fix resume_store() return value when hibernation not available
      9578b04c