1. 10 Oct, 2023 2 commits
  2. 09 Oct, 2023 9 commits
  3. 07 Oct, 2023 7 commits
  4. 05 Oct, 2023 1 commit
    • Xuewen Yan's avatar
      cpufreq: schedutil: Update next_freq when cpufreq_limits change · 9e0bc36a
      Xuewen Yan authored
      When cpufreq's policy is 'single', there is a scenario that will
      cause sg_policy's next_freq to be unable to update.
      
      When the CPU's util is always max, the cpufreq will be max,
      and then if we change the policy's scaling_max_freq to be a
      lower freq, indeed, the sg_policy's next_freq need change to
      be the lower freq, however, because the cpu_is_busy, the next_freq
      would keep the max_freq.
      
      For example:
      
      The cpu7 is a single CPU:
      
        unisoc:/sys/devices/system/cpu/cpufreq/policy7 # while true;do done& [1] 4737
        unisoc:/sys/devices/system/cpu/cpufreq/policy7 # taskset -p 80 4737
        pid 4737's current affinity mask: ff
        pid 4737's new affinity mask: 80
        unisoc:/sys/devices/system/cpu/cpufreq/policy7 # cat scaling_max_freq
        2301000
        unisoc:/sys/devices/system/cpu/cpufreq/policy7 # cat scaling_cur_freq
        2301000
        unisoc:/sys/devices/system/cpu/cpufreq/policy7 # echo 2171000 > scaling_max_freq
        unisoc:/sys/devices/system/cpu/cpufreq/policy7 # cat scaling_max_freq
        2171000
      
      At this time, the sg_policy's next_freq would stay at 2301000, which
      is wrong.
      
      To fix this, add a check for the ->need_freq_update flag.
      
      [ mingo: Clarified the changelog. ]
      Co-developed-by: default avatarGuohua Yan <guohua.yan@unisoc.com>
      Signed-off-by: default avatarXuewen Yan <xuewen.yan@unisoc.com>
      Signed-off-by: default avatarGuohua Yan <guohua.yan@unisoc.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatar"Rafael J. Wysocki" <rafael@kernel.org>
      Link: https://lore.kernel.org/r/20230719130527.8074-1-xuewen.yan@unisoc.com
      9e0bc36a
  5. 03 Oct, 2023 3 commits
  6. 02 Oct, 2023 4 commits
    • Kir Kolyshkin's avatar
      sched/headers: Move 'struct sched_param' out of uapi, to work around glibc/musl breakage · d844fe65
      Kir Kolyshkin authored
      Both glibc and musl define 'struct sched_param' in sched.h, while kernel
      has it in uapi/linux/sched/types.h, making it cumbersome to use
      sched_getattr(2) or sched_setattr(2) from userspace.
      
      For example, something like this:
      
      	#include <sched.h>
      	#include <linux/sched/types.h>
      
      	struct sched_attr sa;
      
      will result in "error: redefinition of ‘struct sched_param’" (note the
      code doesn't need sched_param at all -- it needs struct sched_attr
      plus some stuff from sched.h).
      
      The situation is, glibc is not going to provide a wrapper for
      sched_{get,set}attr, thus the need to include linux/sched_types.h
      directly, which leads to the above problem.
      
      Thus, the userspace is left with a few sub-par choices when it wants to
      use e.g. sched_setattr(2), such as maintaining a copy of struct
      sched_attr definition, or using some other ugly tricks.
      
      OTOH, 'struct sched_param' is well known, defined in POSIX, and it won't
      be ever changed (as that would break backward compatibility).
      
      So, while 'struct sched_param' is indeed part of the kernel uapi,
      exposing it the way it's done now creates an issue, and hiding it
      (like this patch does) fixes that issue, hopefully without creating
      another one: common userspace software rely on libc headers, and as
      for "special" software (like libc), it looks like glibc and musl
      do not rely on kernel headers for 'struct sched_param' definition
      (but let's Cc their mailing lists in case it's otherwise).
      
      The alternative to this patch would be to move struct sched_attr to,
      say, linux/sched.h, or linux/sched/attr.h (the new file).
      
      Oh, and here is the previous attempt to fix the issue:
      
        https://lore.kernel.org/all/20200528135552.GA87103@google.com/
      
      While I support Linus arguments, the issue is still here
      and needs to be fixed.
      
      [ mingo: Linus is right, this shouldn't be needed - but on the other
               hand I agree that this header is not really helpful to
      	 user-space as-is. So let's pretend that
      	 <uapi/linux/sched/types.h> is only about sched_attr, and
      	 call this commit a workaround for user-space breakage
      	 that it in reality is ... Also, remove the Fixes tag. ]
      Signed-off-by: default avatarKir Kolyshkin <kolyshkin@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20230808030357.1213829-1-kolyshkin@gmail.com
      d844fe65
    • Cyril Hrubis's avatar
      83494dc5
    • Cyril Hrubis's avatar
      sched/rt/docs: Clarify & fix sched_rt_* sysctl docs · e6dbdd8f
      Cyril Hrubis authored
      - Describe explicitly that sched_rt_runtime_us is allocated from
        sched_rt_period_us and hence always less or equal to that value.
      
      - The limit for sched_rt_runtime_us is not INT_MAX-1, but rather it's
        limited by the value of sched_rt_period_us. If sched_rt_period_us is
        INT_MAX then sched_rt_runtime_us can be set to INT_MAX as well.
      Signed-off-by: default avatarCyril Hrubis <chrubis@suse.cz>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20231002115553.3007-3-chrubis@suse.cz
      e6dbdd8f
    • Cyril Hrubis's avatar
      sched/rt: Disallow writing invalid values to sched_rt_period_us · 079be8fc
      Cyril Hrubis authored
      The validation of the value written to sched_rt_period_us was broken
      because:
      
        - the sysclt_sched_rt_period is declared as unsigned int
        - parsed by proc_do_intvec()
        - the range is asserted after the value parsed by proc_do_intvec()
      
      Because of this negative values written to the file were written into a
      unsigned integer that were later on interpreted as large positive
      integers which did passed the check:
      
        if (sysclt_sched_rt_period <= 0)
      	return EINVAL;
      
      This commit fixes the parsing by setting explicit range for both
      perid_us and runtime_us into the sched_rt_sysctls table and processes
      the values with proc_dointvec_minmax() instead.
      
      Alternatively if we wanted to use full range of unsigned int for the
      period value we would have to split the proc_handler and use
      proc_douintvec() for it however even the
      Documentation/scheduller/sched-rt-group.rst describes the range as 1 to
      INT_MAX.
      
      As far as I can tell the only problem this causes is that the sysctl
      file allows writing negative values which when read back may confuse
      userspace.
      
      There is also a LTP test being submitted for these sysctl files at:
      
        http://patchwork.ozlabs.org/project/ltp/patch/20230901144433.2526-1-chrubis@suse.cz/Signed-off-by: default avatarCyril Hrubis <chrubis@suse.cz>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20231002115553.3007-2-chrubis@suse.cz
      079be8fc
  7. 01 Oct, 2023 14 commits
    • Linus Torvalds's avatar
      Linux 6.6-rc4 · 8a749fd1
      Linus Torvalds authored
      8a749fd1
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.6-2' of... · e81a2dab
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix the module compression with xz so the in-kernel decompressor
         works
      
       - Document a kconfig idiom to express an optional dependency between
         modules
      
       - Make modpost, when W=1 is given, detect broken drivers that reference
         .exit.* sections
      
       - Remove unused code
      
      * tag 'kbuild-fixes-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: remove stale code for 'source' symlink in packaging scripts
        modpost: Don't let "driver"s reference .exit.*
        vmlinux.lds.h: remove unused CPU_KEEP and CPU_DISCARD macros
        modpost: add missing else to the "of" check
        Documentation: kbuild: explain handling optional dependencies
        kbuild: Use CRC32 and a 1MiB dictionary for XZ compressed modules
      e81a2dab
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2023-10-01-08-34' of... · d2c52315
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2023-10-01-08-34' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "Fourteen hotfixes, eleven of which are cc:stable. The remainder
        pertain to issues which were introduced after 6.5"
      
      * tag 'mm-hotfixes-stable-2023-10-01-08-34' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        Crash: add lock to serialize crash hotplug handling
        selftests/mm: fix awk usage in charge_reserved_hugetlb.sh and hugetlb_reparenting_test.sh that may cause error
        mm: mempolicy: keep VMA walk if both MPOL_MF_STRICT and MPOL_MF_MOVE are specified
        mm/damon/vaddr-test: fix memory leak in damon_do_test_apply_three_regions()
        mm, memcg: reconsider kmem.limit_in_bytes deprecation
        mm: zswap: fix potential memory corruption on duplicate store
        arm64: hugetlb: fix set_huge_pte_at() to work with all swap entries
        mm: hugetlb: add huge page size param to set_huge_pte_at()
        maple_tree: add MAS_UNDERFLOW and MAS_OVERFLOW states
        maple_tree: add mas_is_active() to detect in-tree walks
        nilfs2: fix potential use after free in nilfs_gccache_submit_read_data()
        mm: abstract moving to the next PFN
        mm: report success more often from filemap_map_folio_range()
        fs: binfmt_elf_efpic: fix personality for ELF-FDPIC
      d2c52315
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 8f633369
      Linus Torvalds authored
      Pull misc driver fix from Greg KH:
       "Here is a single, much requested, fix for a set of misc drivers to
        resolve a much reported regression in the -rc series that has also
        propagated back to the stable releases. Sorry for the delay, lots of
        conference travel for a few weeks put me very far behind in patch
        wrangling.
      
        It has been reported by many to resolve the reported problem, and has
        been in linux-next with no reported issues"
      
      * tag 'char-misc-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        misc: rtsx: Fix some platforms can not boot and move the l1ss judgment to probe
      8f633369
    • Linus Torvalds's avatar
      Merge tag 'tty-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 3abd15e2
      Linus Torvalds authored
      Pull tty / serial driver fixes from Greg KH:
       "Here are two tty/serial driver fixes for 6.6-rc4 that resolve some
        reported regressions:
      
         - revert a n_gsm change that ended up causing problems
      
         - 8250_port fix for irq data
      
        both have been in linux-next for over a week with no reported
        problems"
      
      * tag 'tty-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        Revert "tty: n_gsm: fix UAF in gsm_cleanup_mux"
        serial: 8250_port: Check IRQ data before use
      3abd15e2
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ec8c2981
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes: a kerneldoc build warning fix, add SRSO mitigation for
        AMD-derived Hygon processors, and fix a SGX kernel crash in the page
        fault handler that can trigger when ksgxd races to reclaim the SECS
        special page, by making the SECS page unswappable"
      
      * tag 'x86-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/sgx: Resolves SECS reclaim vs. page fault for EAUG race
        x86/srso: Add SRSO mitigation for Hygon processors
        x86/kgdb: Fix a kerneldoc warning when build with W=1
      ec8c2981
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 373ceff2
      Linus Torvalds authored
      Pull timer fix from Ingo Molnar:
       "Fix a spurious kernel warning during CPU hotplug events that may
        trigger when timer/hrtimer softirqs are pending, which are otherwise
        hotplug-safe and don't merit a warning"
      
      * tag 'timers-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        timers: Tag (hr)timer softirq as hotplug safe
      373ceff2
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c5ecffe6
      Linus Torvalds authored
      Pull scheduler fix from Ingo Molnar:
       "Fix a RT tasks related lockup/live-lock during CPU offlining"
      
      * tag 'sched-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/rt: Fix live lock between select_fallback_rq() and RT push
      c5ecffe6
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3a38c57a
      Linus Torvalds authored
      Pull perf event fixes from Ingo Molnar:
       "Misc fixes: work around an AMD microcode bug on certain models, and
        fix kexec kernel PMI handlers on AMD systems that get loaded on older
        kernels that have an unexpected register state"
      
      * tag 'perf-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/amd: Do not WARN() on every IRQ
        perf/x86/amd/core: Fix overflow reset on hotplug
      3a38c57a
    • Masahiro Yamada's avatar
      kbuild: remove stale code for 'source' symlink in packaging scripts · 2d7d1bc1
      Masahiro Yamada authored
      Since commit d8131c29 ("kbuild: remove $(MODLIB)/source symlink"),
      modules_install does not create the 'source' symlink.
      
      Remove the stale code from builddeb and kernel.spec.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      2d7d1bc1
    • Uwe Kleine-König's avatar
      modpost: Don't let "driver"s reference .exit.* · f177cd0c
      Uwe Kleine-König authored
      Drivers must not reference functions marked with __exit as these likely
      are not available when the code is built-in.
      
      There are few creative offenders uncovered for example in ARCH=amd64
      allmodconfig builds. So only trigger the section mismatch warning for
      W=1 builds.
      
      The dual rule that drivers must not reference .init.* is implemented
      since commit 0db25245 ("modpost: don't allow *driver to reference
      .init.*") which however missed that .exit.* should be handled in the
      same way.
      
      Thanks to Masahiro Yamada and Arnd Bergmann who gave valuable hints to
      find this improvement.
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      f177cd0c
    • Masahiro Yamada's avatar
      vmlinux.lds.h: remove unused CPU_KEEP and CPU_DISCARD macros · 15e86643
      Masahiro Yamada authored
      Remove the left-over of commit e24f6628 ("modpost: remove all
      traces of cpuinit/cpuexit sections").
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      15e86643
    • Mauricio Faria de Oliveira's avatar
      modpost: add missing else to the "of" check · cbc3d00c
      Mauricio Faria de Oliveira authored
      Without this 'else' statement, an "usb" name goes into two handlers:
      the first/previous 'if' statement _AND_ the for-loop over 'devtable',
      but the latter is useless as it has no 'usb' device_id entry anyway.
      
      Tested with allmodconfig before/after patch; no changes to *.mod.c:
      
          git checkout v6.6-rc3
          make -j$(nproc) allmodconfig
          make -j$(nproc) olddefconfig
      
          make -j$(nproc)
          find . -name '*.mod.c' | cpio -pd /tmp/before
      
          # apply patch
      
          make -j$(nproc)
          find . -name '*.mod.c' | cpio -pd /tmp/after
      
          diff -r /tmp/before/ /tmp/after/
          # no difference
      
      Fixes: acbef7b7 ("modpost: fix module autoloading for OF devices with generic compatible property")
      Signed-off-by: default avatarMauricio Faria de Oliveira <mfo@canonical.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      cbc3d00c
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · e402b086
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "These are the latest bug fixes that have come up in the soc tree. Most
        of these are fairly minor. Most notably, the majority of changes this
        time are not for dts files as usual.
      
         - Updates to the addresses of the broadcom and aspeed entries in the
           MAINTAINERS file.
      
         - Defconfig updates to address a regression on samsung and a build
           warning from an unknown Kconfig symbol
      
         - Build fixes for the StrongARM and Uniphier platforms
      
         - Code fixes for SCMI and FF-A firmware drivers, both of which had a
           simple bug that resulted in invalid data, and a lesser fix for the
           optee firmware driver
      
         - Multiple fixes for the recently added loongson/loongarch "guts" soc
           driver
      
         - Devicetree fixes for RISC-V on the startfive platform, addressing
           issues with NOR flash, usb and uart.
      
         - Multiple fixes for NXP i.MX8/i.MX9 dts files, fixing problems with
           clock, gpio, hdmi settings and the Makefile
      
         - Bug fixes for i.MX firmware code and the OCOTP soc driver
      
         - Multiple fixes for the TI sysc bus driver
      
         - Minor dts updates for TI omap dts files, to address boot time
           warnings and errors"
      
      * tag 'soc-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (35 commits)
        MAINTAINERS: Fix Florian Fainelli's email address
        arm64: defconfig: enable syscon-poweroff driver
        ARM: locomo: fix locomolcd_power declaration
        soc: loongson: loongson2_guts: Remove unneeded semicolon
        soc: loongson: loongson2_guts: Convert to devm_platform_ioremap_resource()
        soc: loongson: loongson_pm2: Populate children syscon nodes
        dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child
        soc: loongson: loongson_pm2: Drop useless of_device_id compatible
        dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible
        soc: loongson: loongson_pm2: Add dependency for INPUT
        arm64: defconfig: remove CONFIG_COMMON_CLK_NPCM8XX=y
        ARM: uniphier: fix cache kernel-doc warnings
        MAINTAINERS: aspeed: Update Andrew's email address
        MAINTAINERS: aspeed: Update git tree URL
        firmware: arm_ffa: Don't set the memory region attributes for MEM_LEND
        arm64: dts: imx: Add imx8mm-prt8mm.dtb to build
        arm64: dts: imx8mm-evk: Fix hdmi@3d node
        soc: imx8m: Enable OCOTP clock for imx8mm before reading registers
        arm64: dts: imx8mp-beacon-kit: Fix audio_pll2 clock
        arm64: dts: imx8mp: Fix SDMA2/3 clocks
        ...
      e402b086