1. 21 Sep, 2022 10 commits
    • Arnaldo Carvalho de Melo's avatar
      tools headers cpufeatures: Sync with the kernel sources · 356edeca
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        7df54884 ("x86/bugs: Add "unknown" reporting for MMIO Stale Data")
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
      Link: https://lore.kernel.org/lkml/YysTRji90sNn2p5f@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      356edeca
    • Adrian Hunter's avatar
      perf kcore_copy: Do not check /proc/modules is unchanged · 5b427df2
      Adrian Hunter authored
      /proc/kallsyms and /proc/modules are compared before and after the copy
      in order to ensure no changes during the copy.
      
      However /proc/modules also might change due to reference counts changing
      even though that does not make any difference.
      
      Any modules loaded or unloaded should be visible in changes to kallsyms,
      so it is not necessary to check /proc/modules also anyway.
      
      Remove the comparison checking that /proc/modules is unchanged.
      
      Fixes: fc1b691d ("perf buildid-cache: Add ability to add kcore to the cache")
      Reported-by: default avatarDaniel Dao <dqminh@cloudflare.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarDaniel Dao <dqminh@cloudflare.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: https://lore.kernel.org/r/20220914122429.8770-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5b427df2
    • Adrian Hunter's avatar
      libperf evlist: Fix polling of system-wide events · 6cc44796
      Adrian Hunter authored
      Originally, (refer commit f90d194a ("perf evlist: Do not poll
      events that use the system_wide flag") there wasn't much reason to poll
      system-wide events because:
      
       1. The mmaps get "merged" via set-output anyway (the per-cpu case)
       2. perf reads all mmaps when any event is woken
       3. system-wide mmaps do not fill up as fast as the mmaps for user
          selected events
      
      But there was 1 reason not to poll which was that it prevented correct
      termination due to POLLHUP on all user selected events.  That issue is
      now easily resolved by using fdarray_flag__nonfilterable.
      
      With the advent of commit ae4f8ae1 ("libperf evlist: Allow
      mixing per-thread and per-cpu mmaps"), system-wide mmaps can be used
      also in the per-thread case where reason 1 does not apply.
      
      Fix the omission of system-wide events from polling by using the
      fdarray_flag__nonfilterable flag.
      
      Example:
      
       Before:
      
          $ perf record --no-bpf-event -vvv -e intel_pt// --per-thread uname 2>err.txt
          Linux
          $ grep 'sys_perf_event_open.*=\|pollfd' err.txt
          sys_perf_event_open: pid 155076  cpu -1  group_fd -1  flags 0x8 = 5
          sys_perf_event_open: pid 155076  cpu -1  group_fd -1  flags 0x8 = 6
          sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 7
          sys_perf_event_open: pid -1  cpu 1  group_fd -1  flags 0x8 = 9
          sys_perf_event_open: pid -1  cpu 2  group_fd -1  flags 0x8 = 10
          sys_perf_event_open: pid -1  cpu 3  group_fd -1  flags 0x8 = 11
          sys_perf_event_open: pid -1  cpu 4  group_fd -1  flags 0x8 = 12
          sys_perf_event_open: pid -1  cpu 5  group_fd -1  flags 0x8 = 13
          sys_perf_event_open: pid -1  cpu 6  group_fd -1  flags 0x8 = 14
          sys_perf_event_open: pid -1  cpu 7  group_fd -1  flags 0x8 = 15
          thread_data[0x55fb43c29e80]: pollfd[0] <- event_fd=5
          thread_data[0x55fb43c29e80]: pollfd[1] <- event_fd=6
          thread_data[0x55fb43c29e80]: pollfd[2] <- non_perf_event fd=4
      
       After:
      
          $ perf record --no-bpf-event -vvv -e intel_pt// --per-thread uname 2>err.txt
          Linux
          $ grep 'sys_perf_event_open.*=\|pollfd' err.txt
          sys_perf_event_open: pid 156316  cpu -1  group_fd -1  flags 0x8 = 5
          sys_perf_event_open: pid 156316  cpu -1  group_fd -1  flags 0x8 = 6
          sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 7
          sys_perf_event_open: pid -1  cpu 1  group_fd -1  flags 0x8 = 9
          sys_perf_event_open: pid -1  cpu 2  group_fd -1  flags 0x8 = 10
          sys_perf_event_open: pid -1  cpu 3  group_fd -1  flags 0x8 = 11
          sys_perf_event_open: pid -1  cpu 4  group_fd -1  flags 0x8 = 12
          sys_perf_event_open: pid -1  cpu 5  group_fd -1  flags 0x8 = 13
          sys_perf_event_open: pid -1  cpu 6  group_fd -1  flags 0x8 = 14
          sys_perf_event_open: pid -1  cpu 7  group_fd -1  flags 0x8 = 15
          thread_data[0x55cc19e58e80]: pollfd[0] <- event_fd=5
          thread_data[0x55cc19e58e80]: pollfd[1] <- event_fd=6
          thread_data[0x55cc19e58e80]: pollfd[2] <- event_fd=7
          thread_data[0x55cc19e58e80]: pollfd[3] <- event_fd=9
          thread_data[0x55cc19e58e80]: pollfd[4] <- event_fd=10
          thread_data[0x55cc19e58e80]: pollfd[5] <- event_fd=11
          thread_data[0x55cc19e58e80]: pollfd[6] <- event_fd=12
          thread_data[0x55cc19e58e80]: pollfd[7] <- event_fd=13
          thread_data[0x55cc19e58e80]: pollfd[8] <- event_fd=14
          thread_data[0x55cc19e58e80]: pollfd[9] <- event_fd=15
          thread_data[0x55cc19e58e80]: pollfd[10] <- non_perf_event fd=4
      
      Fixes: ae4f8ae1 ("libperf evlist: Allow mixing per-thread and per-cpu mmaps")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20220915122612.81738-3-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6cc44796
    • Adrian Hunter's avatar
      perf record: Fix cpu mask bit setting for mixed mmaps · ca76d7d2
      Adrian Hunter authored
      With mixed per-thread and (system-wide) per-cpu maps, the "any cpu" value
       -1 must be skipped when setting CPU mask bits.
      
      Prior to commit cbd7bfc7 ("tools/perf: Fix out of bound access
      to cpu mask array") the invalid setting went unnoticed, but since then
      it causes perf record to fail with an error.
      
      Example:
      
       Before:
      
         $ perf record -e intel_pt// --per-thread uname
         Failed to initialize parallel data streaming masks
      
       After:
      
         $ perf record -e intel_pt// --per-thread uname
         Linux
         [ perf record: Woken up 1 times to write data ]
         [ perf record: Captured and wrote 0.068 MB perf.data ]
      
      Fixes: ae4f8ae1 ("libperf evlist: Allow mixing per-thread and per-cpu mmaps")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20220915122612.81738-2-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ca76d7d2
    • Namhyung Kim's avatar
      perf test: Skip wp modify test on old kernels · e1dda48e
      Namhyung Kim authored
      It uses PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl.	 The kernel would return
      ENOTTY if it's not supported.  Update the skip reason in that case.
      
      Committer notes:
      
      On s/390 the args aren't used, so need to be marked __maybe_unused.
      Reviewed-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Link: https://lore.kernel.org/r/20220914183338.546357-1-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e1dda48e
    • Lieven Hey's avatar
      perf jit: Include program header in ELF files · babd0438
      Lieven Hey authored
      The missing header makes it hard for programs like elfutils to open
      these files.
      
      Fixes: 2d86612a ("perf symbol: Correct address for bss symbols")
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarLieven Hey <lieven.hey@kdab.com>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Link: https://lore.kernel.org/r/20220915092910.711036-1-lieven.hey@kdab.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      babd0438
    • Namhyung Kim's avatar
      perf test: Add a new test for perf stat cgroup BPF counter · 79010860
      Namhyung Kim authored
        $ sudo ./perf test -v each-cgroup
         96: perf stat --bpf-counters --for-each-cgroup test                 :
        --- start ---
        test child forked, pid 79600
        test child finished with 0
        ---- end ----
        perf stat --bpf-counters --for-each-cgroup test: Ok
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220916184132.1161506-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      79010860
    • Namhyung Kim's avatar
      perf stat: Use evsel->core.cpus to iterate cpus in BPF cgroup counters · 8a92605d
      Namhyung Kim authored
      If it mixes core and uncore events, each evsel would have different cpu map.
      But it assumed they are same with evlist's all_cpus and accessed by the same
      index.  This resulted in a crash like below.
      
        $ perf stat -a --bpf-counters --for-each_cgroup ^. -e cycles,imc/cas_count_read/ sleep 1
        Segmentation fault
      
      While it's not recommended to use uncore events for cgroup aggregation, it
      should not crash.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220916184132.1161506-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8a92605d
    • Namhyung Kim's avatar
      perf stat: Fix cpu map index in bperf cgroup code · 3da35231
      Namhyung Kim authored
      The previous cpu map introduced a bug in the bperf cgroup counter.  This
      results in a failure when user gives a partial cpu map starting from
      non-zero.
      
        $ sudo ./perf stat -C 1-2 --bpf-counters --for-each-cgroup ^. sleep 1
        libbpf: prog 'on_cgrp_switch': failed to create BPF link for perf_event FD 0:
                                       -9 (Bad file descriptor)
        Failed to attach cgroup program
      
      To get the FD of an evsel, it should use a map index not the CPU number.
      
      Fixes: 0255571a ("perf cpumap: Switch to using perf_cpu_map API")
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: bpf@vger.kernel.org
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Link: https://lore.kernel.org/r/20220916184132.1161506-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3da35231
    • Namhyung Kim's avatar
      perf stat: Fix BPF program section name · 0d77326c
      Namhyung Kim authored
      It seems the recent libbpf got more strict about the section name.
      I'm seeing a failure like this:
      
        $ sudo ./perf stat -a --bpf-counters --for-each-cgroup ^. sleep 1
        libbpf: prog 'on_cgrp_switch': missing BPF prog type, check ELF section name 'perf_events'
        libbpf: prog 'on_cgrp_switch': failed to load: -22
        libbpf: failed to load object 'bperf_cgroup_bpf'
        libbpf: failed to load BPF skeleton 'bperf_cgroup_bpf': -22
        Failed to load cgroup skeleton
      
      The section name should be 'perf_event' (without the trailing 's').
      Although it's related to the libbpf change, it'd be better fix the
      section name in the first place.
      
      Fixes: 944138f0 ("perf stat: Enable BPF counter with --for-each-cgroup")
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: bpf@vger.kernel.org
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Link: https://lore.kernel.org/r/20220916184132.1161506-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0d77326c
  2. 20 Sep, 2022 4 commits
    • Linus Torvalds's avatar
      Merge tag 'for-6.0-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 60891ec9
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - two fixes for hangs in the umount sequence where threads depend on
         each other and the work must be finished in the right order
      
       - in zoned mode, wait for flushing all block group metadata IO before
         finishing the zone
      
      * tag 'for-6.0-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: zoned: wait for extent buffer IOs before finishing a zone
        btrfs: fix hang during unmount when stopping a space reclaim worker
        btrfs: fix hang during unmount when stopping block group reclaim worker
      60891ec9
    • Linus Torvalds's avatar
      Merge tag 'fs.fixes.v6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping · 84a31938
      Linus Torvalds authored
      Pull vfs fix from Christian Brauner:
       "Beginning of the merge window we introduced the vfs{g,u}id_t types in
        b27c82e1 ("attr: port attribute changes to new types") and changed
        various codepaths over including chown_common().
      
        When userspace passes -1 for an ownership change the ownership fields
        in struct iattr stay uninitialized. Usually this is fine because any
        code making use of any fields in struct iattr must check the
        ->ia_valid field whether the value of interest has been initialized.
        That's true for all struct iattr passing code.
      
        However, over the course of the last year with more heavy use of KMSAN
        we found quite a few places that got this wrong. A recent one I fixed
        was 3cb6ee99 ("9p: only copy valid iattrs in 9P2000.L setattr
        implementation").
      
        But we also have LSM hooks. Actually we have two. The first one is
        security_inode_setattr() in notify_change() which does the right thing
        and passes the full struct iattr down to LSMs and thus LSMs can check
        whether it is initialized.
      
        But then we also have security_path_chown() which passes down a path
        argument and the target ownership as the filesystem would see it. For
        the latter we now generate the target values based on struct iattr and
        pass it down. However, when userspace passes -1 then struct iattr
        isn't initialized.
      
        This patch simply initializes ->ia_vfs{g,u}id with INVALID_VFS{G,U}ID
        so the hook continue to see invalid ownership when -1 is passed from
        userspace. The only LSM that cares about the actual values is Tomoyo.
      
        The vfs codepaths don't look at these fields without ->ia_valid being
        set so there's no harm in initializing ->ia_vfs{g,u}id. Arguably this
        is also safer since we can't end up copying valid ownership values
        when invalid ownership values should be passed.
      
        This only affects mainline. No kernel has been released with this and
        thus no backport is needed. The commit is thus marked with a Fixes:
        tag but annotated with "# mainline only" (I didn't quite remember what
        Greg said about how to tell stable autoselect to not bother with fixes
        for mainline only)"
      
      * tag 'fs.fixes.v6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping:
        open: always initialize ownership fields
      84a31938
    • Linus Torvalds's avatar
      Merge tag 'execve-v6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · f489921d
      Linus Torvalds authored
      Pull execve reverts from Kees Cook:
       "The recent work to support time namespace unsharing turns out to have
        some undesirable corner cases, so rather than allowing the API to stay
        exposed for another release, it'd be best to remove it ASAP, with the
        replacement getting another cycle of testing. Nothing is known to use
        this yet, so no userspace breakage is expected.
      
        For more details, see:
      
          https://lore.kernel.org/lkml/ed418e43ad28b8688cfea2b7c90fce1c@ispras.ru
      
        Summary:
      
         - Remove the recent 'unshare time namespace on vfork+exec' feature
           (Andrei Vagin)"
      
      * tag 'execve-v6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        Revert "fs/exec: allow to unshare a time namespace on vfork+exec"
        Revert "selftests/timens: add a test for vfork+exit"
      f489921d
    • Tetsuo Handa's avatar
      open: always initialize ownership fields · f52d74b1
      Tetsuo Handa authored
      Beginning of the merge window we introduced the vfs{g,u}id_t types in
      b27c82e1 ("attr: port attribute changes to new types") and changed
      various codepaths over including chown_common().
      
      During that change we forgot to account for the case were the passed
      ownership value is -1. In this case the ownership fields in struct iattr
      aren't initialized but we rely on them being initialized by the time we
      generate the ownership to pass down to the LSMs. All the major LSMs
      don't care about the ownership values at all. Only Tomoyo uses them and
      so it took a while for syzbot to unearth this issue.
      
      Fix this by initializing the ownership fields and do it within the
      retry_deleg block. While notify_change() doesn't alter the ownership
      fields currently we shouldn't rely on it.
      
      Since no kernel has been released with these changes this does not
      needed to be backported to any stable kernels.
      
      [Christian Brauner (Microsoft) <brauner@kernel.org>]
      * rewrote commit message
      * use INVALID_VFS{G,U}ID macros
      
      Fixes: b27c82e1 ("attr: port attribute changes to new types") # mainline only
      Reported-and-tested-by: syzbot+541e21dcc32c4046cba9@syzkaller.appspotmail.com
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reviewed-by: default avatarSeth Forshee (DigitalOcean) <sforshee@kernel.org>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      f52d74b1
  3. 18 Sep, 2022 5 commits
  4. 16 Sep, 2022 9 commits
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · a335366b
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix the level-low interrupt type support in gpio-mpc8xxx
      
       - convert another two drivers to using immutable irq chips
      
       - MAINTAINERS update
      
      * tag 'gpio-fixes-for-v6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: mt7621: Make the irqchip immutable
        gpio: ixp4xx: Make irqchip immutable
        MAINTAINERS: Update HiSilicon GPIO Driver maintainer
        gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx
      a335366b
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 6879c2d3
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Nothing special, just driver fixes:
      
         - Fix IRQ wakeup and pins for UFS and SDC2 issues on the Qualcomm
           SC8180x
      
         - Fix the Rockchip driver to support interrupt on both rising and
           falling edges.
      
         - Name the Allwinner A100 R_PIO properly
      
         - Fix several issues with the Ocelot interrupts"
      
      * tag 'pinctrl-v6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: ocelot: Fix interrupt controller
        pinctrl: sunxi: Fix name for A100 R_PIO
        pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH
        pinctrl: qcom: sc8180x: Fix wrong pin numbers
        pinctrl: qcom: sc8180x: Fix gpio_wakeirq_map
      6879c2d3
    • Linus Torvalds's avatar
      Merge tag 'block-6.0-2022-09-16' of git://git.kernel.dk/linux-block · 68e777e4
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Two fixes for -rc6:
      
         - Fix a mixup of sectors and bytes in the secure erase ioctl
           (Mikulas)
      
         - Fix for a bad return value for a non-blocking bio/blk queue enter
           call (me)"
      
      * tag 'block-6.0-2022-09-16' of git://git.kernel.dk/linux-block:
        blk-lib: fix blkdev_issue_secure_erase
        block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait
      68e777e4
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.0-2022-09-16' of git://git.kernel.dk/linux-block · 0158137d
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Two small patches:
      
         - Fix using an unsigned type for the return value, introduced in this
           release (Pavel)
      
         - Stable fix for a missing check for a fixed file on put (me)"
      
      * tag 'io_uring-6.0-2022-09-16' of git://git.kernel.dk/linux-block:
        io_uring/msg_ring: check file type before putting
        io_uring/rw: fix error'ed retry return values
      0158137d
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-09-16' of git://anongit.freedesktop.org/drm/drm · 5763d7f2
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This is the regular drm fixes pull.
      
        The i915 and misc fixes are fairly regular, but the amdgpu contains
        fixes for new hw blocks, the dcn314 specific path hookups and also has
        a bunch of fixes for clang stack size warnings which are a bit churny
        but fairly straightforward. This means it looks a little larger than
        usual.
      
        amdgpu:
         - BACO fixes for some RDNA2 boards
         - PCI AER fixes uncovered by a core PCI change
         - Properly hook up dirtyfb helper
         - RAS fixes for GC 11.x
         - TMR fix
         - DCN 3.2.x fixes
         - DCN 3.1.4 fixes
         - LLVM DML stack size fixes
      
        i915:
         - Revert a display patch around max DP source rate now that the
           proper WaEdpLinkRateDataReload is in place
         - Fix perf limit reasons bit position
         - Fix unclaimmed mmio registers on suspend flow with GuC
         - A vma_move_to_active fix for a regression with video decoding
         - DP DSP fix
      
        gma500:
         - Locking and IRQ fixes
      
        meson:
         - OSD1 display fixes
      
        panel-edp:
         - Fix Innolux timings
      
        rockchip:
         - DP/HDMI fixes"
      
      * tag 'drm-fixes-2022-09-16' of git://anongit.freedesktop.org/drm/drm: (42 commits)
        drm/amdgpu: make sure to init common IP before gmc
        drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega
        drm/amdgpu: move nbio ih_doorbell_range() into ih code for vega
        drm/rockchip: Fix return type of cdn_dp_connector_mode_valid
        drm/amd/display: Mark dml30's UseMinimumDCFCLK() as noinline for stack usage
        drm/amd/display: Reduce number of arguments of dml31's CalculateFlipSchedule()
        drm/amd/display: Reduce number of arguments of dml31's CalculateWatermarksAndDRAMSpeedChangeSupport()
        drm/amd/display: Reduce number of arguments of dml32_CalculatePrefetchSchedule()
        drm/amd/display: Reduce number of arguments of dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport()
        drm/amd/display: Refactor SubVP calculation to remove FPU
        drm/amd/display: Limit user regamma to a valid value
        drm/amd/display: add workaround for subvp cursor corruption for DCN32/321
        drm/amd/display: SW cursor fallback for SubVP
        drm/amd/display: Round cursor width up for MALL allocation
        drm/amd/display: Correct dram channel width for dcn314
        drm/amd/display: Relax swizzle checks for video non-RGB formats on DCN314
        drm/amd/display: Hook up DCN314 specific dml implementation
        drm/amd/display: Enable dlg and vba compilation for dcn314
        drm/amd/display: Fix compilation errors on DCN314
        drm/amd/display: Fix divide by zero in DML
        ...
      5763d7f2
    • Linus Torvalds's avatar
      Merge tag '6.0-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 714820c6
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Four smb3 fixes for stable:
      
         - important fix to revalidate mapping when doing direct writes
      
         - missing spinlock
      
         - two fixes to socket handling
      
         - trivial change to update internal version number for cifs.ko"
      
      * tag '6.0-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: update internal module number
        cifs: add missing spinlock around tcon refcount
        cifs: always initialize struct msghdr smb_msg completely
        cifs: don't send down the destination address to sendmsg for a SOCK_STREAM
        cifs: revalidate mapping when doing direct writes
      714820c6
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2022-09-15' of... · 25100377
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2022-09-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - Revert a display patch around max DP source rate now
        that the proper WaEdpLinkRateDataReload is in place. (Ville)
      - Fix perf limit reasons bit position. (Ashutosh)
      - Fix unclaimmed mmio registers on suspend flow with GuC. (Umesh)
      - A vma_move_to_active fix for a regression with video decoding. (Nirmoy)
      - DP DSP fix. (Ankit)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/YyMtmGMXRLsURoM5@intel.com
      25100377
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2022-09-15' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 87d9862b
      Dave Airlie authored
      Short summary of fixes pull:
      
       * gma500: Locking and IRQ fixes
       * meson: OSD1 display fixes
       * panel-edp: Fix Innolux timings
       * rockchip: DP/HDMI fixes
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/YyMUpP1w21CPXq+I@linux-uq9g
      87d9862b
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-6.0-2022-09-14' of... · e2111ae2
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-6.0-2022-09-14' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-6.0-2022-09-14:
      
      amdgpu:
      - BACO fixes for some RDNA2 boards
      - PCI AER fixes uncovered by a core PCI change
      - Properly hook up dirtyfb helper
      - RAS fixes for GC 11.x
      - TMR fix
      - DCN 3.2.x fixes
      - DCN 3.1.4 fixes
      - LLVM DML stack size fixes
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220914184030.6145-1-alexander.deucher@amd.com
      e2111ae2
  5. 15 Sep, 2022 4 commits
  6. 14 Sep, 2022 8 commits
    • Alex Deucher's avatar
      drm/amdgpu: make sure to init common IP before gmc · a8671493
      Alex Deucher authored
      Move common IP init before GMC init so that HDP gets
      remapped before GMC init which uses it.
      
      This fixes the Unsupported Request error reported through
      AER during driver load. The error happens as a write happens
      to the remap offset before real remapping is done.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373
      
      The error was unnoticed before and got visible because of the commit
      referenced below. This doesn't fix anything in the commit below, rather
      fixes the issue in amdgpu exposed by the commit. The reference is only
      to associate this commit with below one so that both go together.
      
      Fixes: 8795e182 ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()")
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      a8671493
    • Alex Deucher's avatar
      drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega · e3163bc8
      Alex Deucher authored
      This mirrors what we do for other asics and this way we are
      sure the sdma doorbell range is properly initialized.
      
      There is a comment about the way doorbells on gfx9 work that
      requires that they are initialized for other IPs before GFX
      is initialized.  However, the statement says that it applies to
      multimedia as well, but the VCN code currently initializes
      doorbells after GFX and there are no known issues there.  In my
      testing at least I don't see any problems on SDMA.
      
      This is a prerequisite for fixing the Unsupported Request error
      reported through AER during driver load.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373
      
      The error was unnoticed before and got visible because of the commit
      referenced below. This doesn't fix anything in the commit below, rather
      fixes the issue in amdgpu exposed by the commit. The reference is only
      to associate this commit with below one so that both go together.
      
      Fixes: 8795e182 ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()")
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      e3163bc8
    • Alex Deucher's avatar
      drm/amdgpu: move nbio ih_doorbell_range() into ih code for vega · dc1d85cb
      Alex Deucher authored
      This mirrors what we do for other asics and this way we are
      sure the ih doorbell range is properly initialized.
      
      There is a comment about the way doorbells on gfx9 work that
      requires that they are initialized for other IPs before GFX
      is initialized.  In this case IH is initialized before GFX,
      so there should be no issue.
      
      This is a prerequisite for fixing the Unsupported Request error
      reported through AER during driver load.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373
      
      The error was unnoticed before and got visible because of the commit
      referenced below. This doesn't fix anything in the commit below, rather
      fixes the issue in amdgpu exposed by the commit. The reference is only
      to associate this commit with below one so that both go together.
      
      Fixes: 8795e182 ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()")
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      dc1d85cb
    • Horatiu Vultur's avatar
      pinctrl: ocelot: Fix interrupt controller · c297561b
      Horatiu Vultur authored
      When an external device generated a level based interrupt then the
      interrupt controller could miss the interrupt. The reason is that the
      interrupt controller can detect only link changes.
      
      In the following example, if there is a PHY that generates an interrupt
      then the following would happen. The GPIO detected that the interrupt
      line changed, and then the 'ocelot_irq_handler' was called. Here it
      detects which GPIO line saw the change and for that will call the
      following:
      1. irq_mask
      2. phy interrupt routine
      3. irq_eoi
      4. irq_unmask
      
      And this works fine for simple cases, but if the PHY generates many
      interrupts, for example when doing PTP timestamping, then the following
      could happen. Again the function 'ocelot_irq_handler' will be called
      and then from here the following could happen:
      1. irq_mask
      2. phy interrupt routine
      3. irq_eoi
      4. irq_unmask
      
      Right before step 3(irq_eoi), the PHY will generate another interrupt.
      Now the interrupt controller will acknowledge the change in the
      interrupt line. So we miss the interrupt.
      
      A solution will be to use 'handle_level_irq' instead of
      'handle_fasteoi_irq', because for this will change routine order of
      handling the interrupt.
      1. irq_mask
      2. irq_ack
      3. phy interrupt routine
      4. irq_unmask
      
      And now if the PHY will generate a new interrupt before irq_unmask, the
      interrupt controller will detect this because it already acknowledge the
      change in interrupt line at step 2(irq_ack).
      
      But this is not the full solution because there is another issue. In
      case there are 2 PHYs that share the interrupt line. For example phy1
      generates an interrupt, then the following can happen:
      1.irq_mask
      2.irq_ack
      3.phy0 interrupt routine
      4.phy1 interrupt routine
      5.irq_unmask
      
      In case phy0 will generate an interrupt while clearing the interrupt
      source in phy1, then the interrupt line will be kept down by phy0. So
      the interrupt controller will not see any changes in the interrupt line.
      The solution here is to update 'irq_unmask' such that it can detect if
      the interrupt line is still active or not. And if it is active then call
      again the procedure to clear the interrupts. But we don't want to do it
      every time, only if we know that the interrupt controller has not seen
      already that the interrupt line has changed.
      
      While at this, add support also for IRQ_TYPE_LEVEL_LOW.
      
      Fixes: be36abb7 ("pinctrl: ocelot: add support for interrupt controller")
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Link: https://lore.kernel.org/r/20220909145942.844102-1-horatiu.vultur@microchip.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      c297561b
    • Sergio Paracuellos's avatar
      gpio: mt7621: Make the irqchip immutable · 09eed5a1
      Sergio Paracuellos authored
      Commit 6c846d02 ("gpio: Don't fiddle with irqchips marked as
      immutable") added a warning to indicate if the gpiolib is altering the
      internals of irqchips.  Following this change the following warnings
      are now observed for the mt7621 driver:
      
      gpio gpiochip0: (1e000600.gpio-bank0): not an immutable chip, please consider fixing it!
      gpio gpiochip1: (1e000600.gpio-bank1): not an immutable chip, please consider fixing it!
      gpio gpiochip2: (1e000600.gpio-bank2): not an immutable chip, please consider fixing it!
      
      Fix this by making the irqchip in the mt7621 driver immutable.
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
      Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
      09eed5a1
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 3245cb65
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
      
       - Update some stale binding maintainer emails
      
       - Fix property name error in apple,aic binding
      
       - Add missing param to of_dma_configure_id() stub
      
       - Fix an off-by-one error in unflatten_dt_nodes()
      
      * tag 'devicetree-fixes-for-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: pinctrl: qcom: drop non-working codeaurora.org emails
        dt-bindings: power: qcom,rpmpd: drop non-working codeaurora.org emails
        dt-bindings: apple,aic: Fix required item "apple,fiq-index" in affinity description
        dt-bindings: interconnect: fsl,imx8m-noc: drop Leonard Crestez
        of/device: Fix up of_dma_configure_id() stub
        MAINTAINERS: Update email of Neil Armstrong
        of: fdt: fix off-by-one error in unflatten_dt_nodes()
      3245cb65
    • Steve French's avatar
      cifs: update internal module number · 8af8aed9
      Steve French authored
      To 2.39
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      8af8aed9
    • Paulo Alcantara's avatar
      cifs: add missing spinlock around tcon refcount · 621a41ae
      Paulo Alcantara authored
      Add missing spinlock to protect updates on tcon refcount in
      cifs_put_tcon().
      
      Fixes: d7d7a66a ("cifs: avoid use of global locks for high contention data")
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      621a41ae