1. 31 Jan, 2021 3 commits
    • Andrea Righi's avatar
      leds: trigger: fix potential deadlock with libata · 27af8e2c
      Andrea Righi authored
      We have the following potential deadlock condition:
      
       ========================================================
       WARNING: possible irq lock inversion dependency detected
       5.10.0-rc2+ #25 Not tainted
       --------------------------------------------------------
       swapper/3/0 just changed the state of lock:
       ffff8880063bd618 (&host->lock){-...}-{2:2}, at: ata_bmdma_interrupt+0x27/0x200
       but this lock took another, HARDIRQ-READ-unsafe lock in the past:
        (&trig->leddev_list_lock){.+.?}-{2:2}
      
       and interrupts could create inverse lock ordering between them.
      
       other info that might help us debug this:
        Possible interrupt unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(&trig->leddev_list_lock);
                                      local_irq_disable();
                                      lock(&host->lock);
                                      lock(&trig->leddev_list_lock);
         <Interrupt>
           lock(&host->lock);
      
        *** DEADLOCK ***
      
       no locks held by swapper/3/0.
      
       the shortest dependencies between 2nd lock and 1st lock:
        -> (&trig->leddev_list_lock){.+.?}-{2:2} ops: 46 {
           HARDIRQ-ON-R at:
                             lock_acquire+0x15f/0x420
                             _raw_read_lock+0x42/0x90
                             led_trigger_event+0x2b/0x70
                             rfkill_global_led_trigger_worker+0x94/0xb0
                             process_one_work+0x240/0x560
                             worker_thread+0x58/0x3d0
                             kthread+0x151/0x170
                             ret_from_fork+0x1f/0x30
           IN-SOFTIRQ-R at:
                             lock_acquire+0x15f/0x420
                             _raw_read_lock+0x42/0x90
                             led_trigger_event+0x2b/0x70
                             kbd_bh+0x9e/0xc0
                             tasklet_action_common.constprop.0+0xe9/0x100
                             tasklet_action+0x22/0x30
                             __do_softirq+0xcc/0x46d
                             run_ksoftirqd+0x3f/0x70
                             smpboot_thread_fn+0x116/0x1f0
                             kthread+0x151/0x170
                             ret_from_fork+0x1f/0x30
           SOFTIRQ-ON-R at:
                             lock_acquire+0x15f/0x420
                             _raw_read_lock+0x42/0x90
                             led_trigger_event+0x2b/0x70
                             rfkill_global_led_trigger_worker+0x94/0xb0
                             process_one_work+0x240/0x560
                             worker_thread+0x58/0x3d0
                             kthread+0x151/0x170
                             ret_from_fork+0x1f/0x30
           INITIAL READ USE at:
                                 lock_acquire+0x15f/0x420
                                 _raw_read_lock+0x42/0x90
                                 led_trigger_event+0x2b/0x70
                                 rfkill_global_led_trigger_worker+0x94/0xb0
                                 process_one_work+0x240/0x560
                                 worker_thread+0x58/0x3d0
                                 kthread+0x151/0x170
                                 ret_from_fork+0x1f/0x30
         }
         ... key      at: [<ffffffff83da4c00>] __key.0+0x0/0x10
         ... acquired at:
          _raw_read_lock+0x42/0x90
          led_trigger_blink_oneshot+0x3b/0x90
          ledtrig_disk_activity+0x3c/0xa0
          ata_qc_complete+0x26/0x450
          ata_do_link_abort+0xa3/0xe0
          ata_port_freeze+0x2e/0x40
          ata_hsm_qc_complete+0x94/0xa0
          ata_sff_hsm_move+0x177/0x7a0
          ata_sff_pio_task+0xc7/0x1b0
          process_one_work+0x240/0x560
          worker_thread+0x58/0x3d0
          kthread+0x151/0x170
          ret_from_fork+0x1f/0x30
      
       -> (&host->lock){-...}-{2:2} ops: 69 {
          IN-HARDIRQ-W at:
                           lock_acquire+0x15f/0x420
                           _raw_spin_lock_irqsave+0x52/0xa0
                           ata_bmdma_interrupt+0x27/0x200
                           __handle_irq_event_percpu+0xd5/0x2b0
                           handle_irq_event+0x57/0xb0
                           handle_edge_irq+0x8c/0x230
                           asm_call_irq_on_stack+0xf/0x20
                           common_interrupt+0x100/0x1c0
                           asm_common_interrupt+0x1e/0x40
                           native_safe_halt+0xe/0x10
                           arch_cpu_idle+0x15/0x20
                           default_idle_call+0x59/0x1c0
                           do_idle+0x22c/0x2c0
                           cpu_startup_entry+0x20/0x30
                           start_secondary+0x11d/0x150
                           secondary_startup_64_no_verify+0xa6/0xab
          INITIAL USE at:
                          lock_acquire+0x15f/0x420
                          _raw_spin_lock_irqsave+0x52/0xa0
                          ata_dev_init+0x54/0xe0
                          ata_link_init+0x8b/0xd0
                          ata_port_alloc+0x1f1/0x210
                          ata_host_alloc+0xf1/0x130
                          ata_host_alloc_pinfo+0x14/0xb0
                          ata_pci_sff_prepare_host+0x41/0xa0
                          ata_pci_bmdma_prepare_host+0x14/0x30
                          piix_init_one+0x21f/0x600
                          local_pci_probe+0x48/0x80
                          pci_device_probe+0x105/0x1c0
                          really_probe+0x221/0x490
                          driver_probe_device+0xe9/0x160
                          device_driver_attach+0xb2/0xc0
                          __driver_attach+0x91/0x150
                          bus_for_each_dev+0x81/0xc0
                          driver_attach+0x1e/0x20
                          bus_add_driver+0x138/0x1f0
                          driver_register+0x91/0xf0
                          __pci_register_driver+0x73/0x80
                          piix_init+0x1e/0x2e
                          do_one_initcall+0x5f/0x2d0
                          kernel_init_freeable+0x26f/0x2cf
                          kernel_init+0xe/0x113
                          ret_from_fork+0x1f/0x30
        }
        ... key      at: [<ffffffff83d9fdc0>] __key.6+0x0/0x10
        ... acquired at:
          __lock_acquire+0x9da/0x2370
          lock_acquire+0x15f/0x420
          _raw_spin_lock_irqsave+0x52/0xa0
          ata_bmdma_interrupt+0x27/0x200
          __handle_irq_event_percpu+0xd5/0x2b0
          handle_irq_event+0x57/0xb0
          handle_edge_irq+0x8c/0x230
          asm_call_irq_on_stack+0xf/0x20
          common_interrupt+0x100/0x1c0
          asm_common_interrupt+0x1e/0x40
          native_safe_halt+0xe/0x10
          arch_cpu_idle+0x15/0x20
          default_idle_call+0x59/0x1c0
          do_idle+0x22c/0x2c0
          cpu_startup_entry+0x20/0x30
          start_secondary+0x11d/0x150
          secondary_startup_64_no_verify+0xa6/0xab
      
      This lockdep splat is reported after:
      commit e9181886 ("locking: More accurate annotations for read_lock()")
      
      To clarify:
       - read-locks are recursive only in interrupt context (when
         in_interrupt() returns true)
       - after acquiring host->lock in CPU1, another cpu (i.e. CPU2) may call
         write_lock(&trig->leddev_list_lock) that would be blocked by CPU0
         that holds trig->leddev_list_lock in read-mode
       - when CPU1 (ata_ac_complete()) tries to read-lock
         trig->leddev_list_lock, it would be blocked by the write-lock waiter
         on CPU2 (because we are not in interrupt context, so the read-lock is
         not recursive)
       - at this point if an interrupt happens on CPU0 and
         ata_bmdma_interrupt() is executed it will try to acquire host->lock,
         that is held by CPU1, that is currently blocked by CPU2, so:
      
         * CPU0 blocked by CPU1
         * CPU1 blocked by CPU2
         * CPU2 blocked by CPU0
      
           *** DEADLOCK ***
      
      The deadlock scenario is better represented by the following schema
      (thanks to Boqun Feng <boqun.feng@gmail.com> for the schema and the
      detailed explanation of the deadlock condition):
      
       CPU 0:                          CPU 1:                        CPU 2:
       -----                           -----                         -----
       led_trigger_event():
         read_lock(&trig->leddev_list_lock);
       				<workqueue>
       				ata_hsm_qc_complete():
       				  spin_lock_irqsave(&host->lock);
       								write_lock(&trig->leddev_list_lock);
       				  ata_port_freeze():
       				    ata_do_link_abort():
       				      ata_qc_complete():
       					ledtrig_disk_activity():
       					  led_trigger_blink_oneshot():
       					    read_lock(&trig->leddev_list_lock);
       					    // ^ not in in_interrupt() context, so could get blocked by CPU 2
       <interrupt>
         ata_bmdma_interrupt():
           spin_lock_irqsave(&host->lock);
      
      Fix by using read_lock_irqsave/irqrestore() in led_trigger_event(), so
      that no interrupt can happen in between, preventing the deadlock
      condition.
      
      Apply the same change to led_trigger_blink_setup() as well, since the
      same deadlock scenario can also happen in power_supply_update_bat_leds()
      -> led_trigger_blink() -> led_trigger_blink_setup() (workqueue context),
      and potentially prevent other similar usages.
      
      Link: https://lore.kernel.org/lkml/20201101092614.GB3989@xps-13-7390/
      Fixes: eb25cb99 ("leds: convert IDE trigger to common disk trigger")
      Signed-off-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      27af8e2c
    • Zheng Yongjun's avatar
      leds: leds-ariel: convert comma to semicolon · 47854d2d
      Zheng Yongjun authored
      Replace a comma between expression statements by a semicolon.
      Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
      Reviewed-by: default avatarAlexander Dahl <ada@thorsis.com>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      47854d2d
    • Zheng Yongjun's avatar
      leds: leds-lm3533: convert comma to semicolon · 4e04b118
      Zheng Yongjun authored
      Replace a comma between expression statements by a semicolon.
      Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      4e04b118
  2. 27 Dec, 2020 8 commits
  3. 26 Dec, 2020 5 commits
  4. 25 Dec, 2020 5 commits
    • Linus Torvalds's avatar
      drm/amd/display: avoid uninitialized variable warning · 61d79136
      Linus Torvalds authored
      clang (quite rightly) complains fairly loudly about the newly added
      mpc1_get_mpc_out_mux() function returning an uninitialized value if the
      'opp_id' checks don't pass.
      
      This may not happen in practice, but the code really shouldn't return
      garbage if the sanity checks don't pass.
      
      So just initialize 'val' to zero to avoid the issue.
      
      Fixes: 110b055b ("drm/amd/display: add getter routine to retrieve mpcc mux")
      Cc: Josip Pavic <Josip.Pavic@amd.com>
      Cc: Bindu Ramamurthy <bindu.r@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      61d79136
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-2020-12-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux · 5814bc2d
      Linus Torvalds authored
      Pull more perf tools updates from Arnaldo Carvalho de Melo:
      
       - Refactor 'perf stat' per CPU/socket/die/thread aggregation fixing use
         cases in ARM machines.
      
       - Fix memory leak when synthesizing SDT probes in 'perf probe'.
      
       - Update kernel header copies related to KVM, epol_pwait. msr-index and
         powerpc and s390 syscall tables.
      
      * tag 'perf-tools-2020-12-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (24 commits)
        perf probe: Fix memory leak when synthesizing SDT probes
        perf stat aggregation: Add separate thread member
        perf stat aggregation: Add separate core member
        perf stat aggregation: Add separate die member
        perf stat aggregation: Add separate socket member
        perf stat aggregation: Add separate node member
        perf stat aggregation: Start using cpu_aggr_id in map
        perf cpumap: Drop in cpu_aggr_map struct
        perf cpumap: Add new map type for aggregation
        perf stat: Replace aggregation ID with a struct
        perf cpumap: Add new struct for cpu aggregation
        perf cpumap: Use existing allocator to avoid using malloc
        perf tests: Improve topology test to check all aggregation types
        perf tools: Update s390's syscall.tbl copy from the kernel sources
        perf tools: Update powerpc's syscall.tbl copy from the kernel sources
        perf s390: Move syscall.tbl check into check-headers.sh
        perf powerpc: Move syscall.tbl check to check-headers.sh
        tools headers UAPI: Synch KVM's svm.h header with the kernel
        tools kvm headers: Update KVM headers from the kernel sources
        tools headers UAPI: Sync KVM's vmx.h header with the kernel sources
        ...
      5814bc2d
    • Linus Torvalds's avatar
      Merge branch 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux · 42dc45e8
      Linus Torvalds authored
      Pull coccinelle updates from Julia Lawall.
      
      * 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
        scripts: coccicheck: Correct usage of make coccicheck
        coccinelle: update expiring email addresses
        coccinnelle: Remove ptr_ret script
        kbuild: do not use scripts/ld-version.sh for checking spatch version
        remove boolinit.cocci
      42dc45e8
    • Michael Ellerman's avatar
      genirq: Fix export of irq_to_desc() for powerpc KVM · 11cc92eb
      Michael Ellerman authored
      Commit 64a1b95b ("genirq: Restrict export of irq_to_desc()") removed
      the export of irq_to_desc() unless powerpc KVM is being built, because
      there is still a use of irq_to_desc() in modular code there.
      
      However it used:
      
        #ifdef CONFIG_KVM_BOOK3S_64_HV
      
      Which doesn't work when that symbol is =m, leading to a build failure:
      
        ERROR: modpost: "irq_to_desc" [arch/powerpc/kvm/kvm-hv.ko] undefined!
      
      Fix it by checking for the definedness of the correct symbol which is
      CONFIG_KVM_BOOK3S_64_HV_MODULE.
      
      Fixes: 64a1b95b ("genirq: Restrict export of irq_to_desc()")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      11cc92eb
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 7bb5226c
      Linus Torvalds authored
      Pull misc vfs updates from Al Viro:
       "Assorted patches from previous cycle(s)..."
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fix hostfs_open() use of ->f_path.dentry
        Make sure that make_create_in_sticky() never sees uninitialized value of dir_mode
        fs: Kill DCACHE_DONTCACHE dentry even if DCACHE_REFERENCED is set
        fs: Handle I_DONTCACHE in iput_final() instead of generic_drop_inode()
        fs/namespace.c: WARN if mnt_count has become negative
      7bb5226c
  5. 24 Dec, 2020 19 commits
    • Linus Torvalds's avatar
      Merge tag 'docs-5.11-2' of git://git.lwn.net/linux · 71c5f031
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "A small set of late-arriving, small documentation fixes"
      
      * tag 'docs-5.11-2' of git://git.lwn.net/linux:
        docs: admin-guide: Fix default value of max_map_count in sysctl/vm.rst
        Documentation/submitting-patches: Document the SoB chain
        Documentation: process: Correct numbering
        docs: submitting-patches: Trivial - fix grammatical error
      71c5f031
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 555a6e8c
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "Various bug fixes and cleanups for ext4; no new features this cycle"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (29 commits)
        ext4: remove unnecessary wbc parameter from ext4_bio_write_page
        ext4: avoid s_mb_prefetch to be zero in individual scenarios
        ext4: defer saving error info from atomic context
        ext4: simplify ext4 error translation
        ext4: move functions in super.c
        ext4: make ext4_abort() use __ext4_error()
        ext4: standardize error message in ext4_protect_reserved_inode()
        ext4: remove redundant sb checksum recomputation
        ext4: don't remount read-only with errors=continue on reboot
        ext4: fix deadlock with fs freezing and EA inodes
        jbd2: add a helper to find out number of fast commit blocks
        ext4: make fast_commit.h byte identical with e2fsprogs/fast_commit.h
        ext4: fix fall-through warnings for Clang
        ext4: add docs about fast commit idempotence
        ext4: remove the unused EXT4_CURRENT_REV macro
        ext4: fix an IS_ERR() vs NULL check
        ext4: check for invalid block size early when mounting a file system
        ext4: fix a memory leak of ext4_free_data
        ext4: delete nonsensical (commented-out) code inside ext4_xattr_block_set()
        ext4: update ext4_data_block_valid related comments
        ...
      555a6e8c
    • Linus Torvalds's avatar
      Merge tag 'Smack-for-5.11-io_uring-fix' of git://github.com/cschaufler/smack-next · 2f2fce3d
      Linus Torvalds authored
      Pull smack fix from Casey Schaufler:
       "Provide a fix for the incorrect handling of privilege in the face of
        io_uring's use of kernel threads. That invalidated an long standing
        assumption regarding the privilege of kernel threads.
      
        The fix is simple and safe. It was provided by Jens Axboe and has been
        tested"
      
      * tag 'Smack-for-5.11-io_uring-fix' of git://github.com/cschaufler/smack-next:
        Smack: Handle io_uring kernel thread privileges
      2f2fce3d
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 7a2fde8d
      Linus Torvalds authored
      Pull RISC-V fix from Palmer Dabbelt
       "Avoid trying to initialize memory regions outside the usable range"
      
      * tag 'riscv-for-linus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Fix usage of memblock_enforce_memory_limit
      7a2fde8d
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 9b3f7f1b
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Four commits fixing various things in the new C VDSO code
      
       - One fix for a 32-bit VMAP stack bug
      
       - Two minor build fixes
      
      Thanks to Cédric Le Goater, Christophe Leroy, and Will Springer.
      
      * tag 'powerpc-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too
        powerpc/vdso: Fix DOTSYM for 32-bit LE VDSO
        powerpc/vdso: Don't pass 64-bit ABI cflags to 32-bit VDSO
        powerpc/vdso: Block R_PPC_REL24 relocations
        powerpc/smp: Add __init to init_big_cores()
        powerpc/time: Force inlining of get_tb()
        powerpc/boot: Fix build of dts/fsl
      9b3f7f1b
    • Linus Torvalds's avatar
      Merge tag 'irq-core-2020-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3913d00a
      Linus Torvalds authored
      Pull irq updates from Thomas Gleixner:
       "This is the second attempt after the first one failed miserably and
        got zapped to unblock the rest of the interrupt related patches.
      
        A treewide cleanup of interrupt descriptor (ab)use with all sorts of
        racy accesses, inefficient and disfunctional code. The goal is to
        remove the export of irq_to_desc() to prevent these things from
        creeping up again"
      
      * tag 'irq-core-2020-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
        genirq: Restrict export of irq_to_desc()
        xen/events: Implement irq distribution
        xen/events: Reduce irq_info:: Spurious_cnt storage size
        xen/events: Only force affinity mask for percpu interrupts
        xen/events: Use immediate affinity setting
        xen/events: Remove disfunct affinity spreading
        xen/events: Remove unused bind_evtchn_to_irq_lateeoi()
        net/mlx5: Use effective interrupt affinity
        net/mlx5: Replace irq_to_desc() abuse
        net/mlx4: Use effective interrupt affinity
        net/mlx4: Replace irq_to_desc() abuse
        PCI: mobiveil: Use irq_data_get_irq_chip_data()
        PCI: xilinx-nwl: Use irq_data_get_irq_chip_data()
        NTB/msi: Use irq_has_action()
        mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc
        pinctrl: nomadik: Use irq_has_action()
        drm/i915/pmu: Replace open coded kstat_irqs() copy
        drm/i915/lpe_audio: Remove pointless irq_to_desc() usage
        s390/irq: Use irq_desc_kstat_cpu() in show_msi_interrupt()
        parisc/irq: Use irq_desc_kstat_cpu() in show_interrupts()
        ...
      3913d00a
    • Linus Torvalds's avatar
      Merge tag 'efi_updates_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4a1106af
      Linus Torvalds authored
      Pull EFI updates from Borislav Petkov:
       "These got delayed due to a last minute ia64 build issue which got
        fixed in the meantime.
      
        EFI updates collected by Ard Biesheuvel:
      
         - Don't move BSS section around pointlessly in the x86 decompressor
      
         - Refactor helper for discovering the EFI secure boot mode
      
         - Wire up EFI secure boot to IMA for arm64
      
         - Some fixes for the capsule loader
      
         - Expose the RT_PROP table via the EFI test module
      
         - Relax DT and kernel placement restrictions on ARM
      
        with a few followup fixes:
      
         - fix the build breakage on IA64 caused by recent capsule loader
           changes
      
         - suppress a type mismatch build warning in the expansion of
           EFI_PHYS_ALIGN on ARM"
      
      * tag 'efi_updates_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi: arm: force use of unsigned type for EFI_PHYS_ALIGN
        efi: ia64: disable the capsule loader
        efi: stub: get rid of efi_get_max_fdt_addr()
        efi/efi_test: read RuntimeServicesSupported
        efi: arm: reduce minimum alignment of uncompressed kernel
        efi: capsule: clean scatter-gather entries from the D-cache
        efi: capsule: use atomic kmap for transient sglist mappings
        efi: x86/xen: switch to efi_get_secureboot_mode helper
        arm64/ima: add ima_arch support
        ima: generalize x86/EFI arch glue for other EFI architectures
        efi: generalize efi_get_secureboot
        efi/libstub: EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER should not default to yes
        efi/x86: Only copy the compressed kernel image in efi_relocate_kernel()
        efi/libstub/x86: simplify efi_is_native()
      4a1106af
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.11-2020-12-23' of git://git.kernel.dk/linux-block · 60e8edd2
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "All straight fixes, or a prep patch for a fix, either bound for stable
        or fixing issues from this merge window. In particular:
      
         - Fix new shutdown op not breaking links on failure
      
         - Hold mm->mmap_sem for mm->locked_vm manipulation
      
         - Various cancelation fixes (me, Pavel)
      
         - Fix error path potential double ctx free (Pavel)
      
         - IOPOLL fixes (Xiaoguang)"
      
      * tag 'io_uring-5.11-2020-12-23' of git://git.kernel.dk/linux-block:
        io_uring: hold uring_lock while completing failed polled io in io_wq_submit_work()
        io_uring: fix double io_uring free
        io_uring: fix ignoring xa_store errors
        io_uring: end waiting before task cancel attempts
        io_uring: always progress task_work on task cancel
        io-wq: kill now unused io_wq_cancel_all()
        io_uring: make ctx cancel on exit targeted to actual ctx
        io_uring: fix 0-iov read buffer select
        io_uring: close a small race gap for files cancel
        io_uring: fix io_wqe->work_list corruption
        io_uring: limit {io|sq}poll submit locking scope
        io_uring: inline io_cqring_mark_overflow()
        io_uring: consolidate CQ nr events calculation
        io_uring: remove racy overflow list fast checks
        io_uring: cancel reqs shouldn't kill overflow list
        io_uring: hold mmap_sem for mm->locked_vm manipulation
        io_uring: break links on shutdown failure
      60e8edd2
    • Linus Torvalds's avatar
      Merge tag 'block-5.11-2020-12-23' of git://git.kernel.dk/linux-block · 771e7e41
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A few stragglers in here, but mostly just straight fixes. In
        particular:
      
         - Set of rnbd fixes for issues around changes for the merge window
           (Gioh, Jack, Md Haris Iqbal)
      
         - iocost tracepoint addition (Baolin)
      
         - Copyright/maintainers update (Christoph)
      
         - Remove old blk-mq fast path CPU warning (Daniel)
      
         - loop max_part fix (Josh)
      
         - Remote IPI threaded IRQ fix (Sebastian)
      
         - dasd stable fixes (Stefan)
      
         - bcache merge window fixup and style fixup (Yi, Zheng)"
      
      * tag 'block-5.11-2020-12-23' of git://git.kernel.dk/linux-block:
        md/bcache: convert comma to semicolon
        bcache:remove a superfluous check in register_bcache
        block: update some copyrights
        block: remove a pointless self-reference in block_dev.c
        MAINTAINERS: add fs/block_dev.c to the block section
        blk-mq: Don't complete on a remote CPU in force threaded mode
        s390/dasd: fix list corruption of lcu list
        s390/dasd: fix list corruption of pavgroup group list
        s390/dasd: prevent inconsistent LCU device data
        s390/dasd: fix hanging device offline processing
        blk-iocost: Add iocg idle state tracepoint
        nbd: Respect max_part for all partition scans
        block/rnbd-clt: Does not request pdu to rtrs-clt
        block/rnbd-clt: Dynamically allocate sglist for rnbd_iu
        block/rnbd: Set write-back cache and fua same to the target device
        block/rnbd: Fix typos
        block/rnbd-srv: Protect dev session sysfs removal
        block/rnbd-clt: Fix possible memleak
        block/rnbd-clt: Get rid of warning regarding size argument in strlcpy
        blk-mq: Remove 'running from the wrong CPU' warning
      771e7e41
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 1f13d2f7
      Linus Torvalds authored
      Pull libnvdimm updates from Dan Williams:
       "Twas the day before Christmas and the only thing stirring in libnvdimm
        / device-dax land is a pile of miscellaneous fixups and cleanups.
      
        The bulk of it has appeared in -next save the last two patches to
        device-dax that have passed my build and unit tests.
      
         - Fix a long standing block-window-namespace issue surfaced by the
           ndctl change to attempt to preserve the kernel device name over
           a 'reconfigure'
      
         - Fix a few error path memory leaks in nfit and device-dax
      
         - Silence a smatch warning in the ioctl path
      
         - Miscellaneous cleanups"
      
      * tag 'libnvdimm-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        device-dax: Avoid an unnecessary check in alloc_dev_dax_range()
        device-dax: Fix range release
        device-dax: delete a redundancy check in dev_dax_validate_align()
        libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
        device-dax/core: Fix memory leak when rmmod dax.ko
        device-dax/pmem: Convert comma to semicolon
        libnvdimm: Cleanup include of badblocks.h
        ACPI: NFIT: Fix input validation of bus-family
        libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
        ACPI/nfit: avoid accessing uninitialized memory in acpi_nfit_ctl()
      1f13d2f7
    • Linus Torvalds's avatar
      Merge tag 'drm-next-2020-12-24' of git://anongit.freedesktop.org/drm/drm · ef2c8b81
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Xmas eve pull request present.
      
        Just some fixes that trickled in this past week: Mostly amdgpu fixes,
        with a dma-buf/mips build fix and some misc komeda fixes.
      
        dma-buf:
         - fix build on mips
      
        komeda:
         - fix commit tail operation order
         - NULL pointer fix
         - out of bounds access fix
      
        ttm:
         - remove an unused function
      
        amdgpu:
         - Vangogh SMU fixes
         - Arcturus gfx9 fixes
         - Misc display fixes
         - Sienna Cichlid SMU update
         - Fix S3 display memory leak
         - Fix regression caused by DP sub-connector support
      
        amdkfd:
         - Properly require pcie atomics for gfx10"
      
      * tag 'drm-next-2020-12-24' of git://anongit.freedesktop.org/drm/drm: (31 commits)
        drm/amd/display: Fix memory leaks in S3 resume
        drm/amdgpu: Fix a copy-pasta comment
        drm/amdgpu: only set DP subconnector type on DP and eDP connectors
        drm/amd/pm: bump Sienna Cichlid smu_driver_if version to match latest pmfw
        drm/amd/display: add getter routine to retrieve mpcc mux
        drm/amd/display: always program DPPDTO unless not safe to lower
        drm/amd/display: [FW Promotion] Release 0.0.47
        drm/amd/display: updated wm table for Renoir
        drm/amd/display: Acquire DSC during split stream for ODM only if top_pipe
        drm/amd/display: Multi-display underflow observed
        drm/amd/display: Remove unnecessary NULL check
        drm/amd/display: Update RN/VGH active display count workaround
        drm/amd/display: change SMU repsonse timeout to 2s.
        drm/amd/display: gradually ramp ABM intensity
        drm/amd/display: To modify the condition in indicating branch device
        drm/amd/display: Modify the hdcp device count check condition
        drm/amd/display: Interfaces for hubp blank and soft reset
        drm/amd/display: handler not correctly checked at remove_irq_handler
        drm/amdgpu: check gfx pipe availability before toggling its interrupts
        drm/amdgpu: remove unnecessary asic type check
        ...
      ef2c8b81
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 14571d5f
      Linus Torvalds authored
      Pull devicetree fixes from Rob Herring:
      
       - Correct the JSON pointer syntax in binding schemas
      
       - Drop unnecessary *-supply schema constraints
      
       - Drop redundant maxItems/items on array schemas
      
       - Fix various yamllint warnings
      
       - Fix various missing 'additionalProperties' properties
      
      * tag 'devicetree-fixes-for-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: Drop redundant maxItems/items
        dt-bindings: net: qcom,ipa: Drop unnecessary type ref on 'memory-region'
        dt-bindings: Drop unnecessary *-supply schemas properties
        dt-bindings/display: abt,y030xx067a: Fix binding
        dt-bindings: clock: imx8qxp-lpcg: eliminate yamllint warnings
        dt-bindings: display: eliminate yamllint warnings
        dt-bindings: media: nokia,smia: eliminate yamllint warnings
        dt-bindings: devapc: add the required property 'additionalProperties'
        dt-bindings: soc: add the required property 'additionalProperties'
        dt-bindings: serial: add the required property 'additionalProperties'
        dt-bindings: xlnx,vcu-settings: fix dt_binding_check warnings
        media: dt-bindings: coda: Add missing 'additionalProperties'
        dt-bindings: Fix JSON pointers
      14571d5f
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 64145482
      Linus Torvalds authored
      Pull virtio updates from Michael Tsirkin:
      
       - vdpa sim refactoring
      
       - virtio mem: Big Block Mode support
      
       - misc cleanus, fixes
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (61 commits)
        vdpa: Use simpler version of ida allocation
        vdpa: Add missing comment for virtqueue count
        uapi: virtio_ids: add missing device type IDs from OASIS spec
        uapi: virtio_ids.h: consistent indentions
        vhost scsi: fix error return code in vhost_scsi_set_endpoint()
        virtio_ring: Fix two use after free bugs
        virtio_net: Fix error code in probe()
        virtio_ring: Cut and paste bugs in vring_create_virtqueue_packed()
        tools/virtio: add barrier for aarch64
        tools/virtio: add krealloc_array
        tools/virtio: include asm/bug.h
        vdpa/mlx5: Use write memory barrier after updating CQ index
        vdpa: split vdpasim to core and net modules
        vdpa_sim: split vdpasim_virtqueue's iov field in out_iov and in_iov
        vdpa_sim: make vdpasim->buffer size configurable
        vdpa_sim: use kvmalloc to allocate vdpasim->buffer
        vdpa_sim: set vringh notify callback
        vdpa_sim: add set_config callback in vdpasim_dev_attr
        vdpa_sim: add get_config callback in vdpasim_dev_attr
        vdpa_sim: make 'config' generic and usable for any device type
        ...
      64145482
    • Dan Williams's avatar
      Merge branch 'for-5.11/dax' into for-5.11/libnvdimm · 127c3d2e
      Dan Williams authored
      Pull in miscellaneous device-dax fixups and cleanups for v5.11.
      127c3d2e
    • Zhen Lei's avatar
      device-dax: Avoid an unnecessary check in alloc_dev_dax_range() · ff8da37d
      Zhen Lei authored
      Swap the calling sequence of krealloc() and __request_region(), call the
      latter first. In this way, the value of dev_dax->nr_range does not need to
      be considered when __request_region() failed.
      Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20201219081840.1149-2-thunder.leizhen@huawei.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      ff8da37d
    • Dan Williams's avatar
      device-dax: Fix range release · 6268d7da
      Dan Williams authored
      There are multiple locations that open-code the release of the last
      range in a device-dax instance. Consolidate this into a new
      dev_dax_trim_range() helper.
      
      This also addresses a kmemleak report:
      
      # cat /sys/kernel/debug/kmemleak
      [..]
      unreferenced object 0xffff976bd46f6240 (size 64):
         comm "ndctl", pid 23556, jiffies 4299514316 (age 5406.733s)
         hex dump (first 32 bytes):
           00 00 00 00 00 00 00 00 00 00 20 c3 37 00 00 00  .......... .7...
           ff ff ff 7f 38 00 00 00 00 00 00 00 00 00 00 00  ....8...........
         backtrace:
           [<00000000064003cf>] __kmalloc_track_caller+0x136/0x379
           [<00000000d85e3c52>] krealloc+0x67/0x92
           [<00000000d7d3ba8a>] __alloc_dev_dax_range+0x73/0x25c
           [<0000000027d58626>] devm_create_dev_dax+0x27d/0x416
           [<00000000434abd43>] __dax_pmem_probe+0x1c9/0x1000 [dax_pmem_core]
           [<0000000083726c1c>] dax_pmem_probe+0x10/0x1f [dax_pmem]
           [<00000000b5f2319c>] nvdimm_bus_probe+0x9d/0x340 [libnvdimm]
           [<00000000c055e544>] really_probe+0x230/0x48d
           [<000000006cabd38e>] driver_probe_device+0x122/0x13b
           [<0000000029c7b95a>] device_driver_attach+0x5b/0x60
           [<0000000053e5659b>] bind_store+0xb7/0xc3
           [<00000000d3bdaadc>] drv_attr_store+0x27/0x31
           [<00000000949069c5>] sysfs_kf_write+0x4a/0x57
           [<000000004a8b5adf>] kernfs_fop_write+0x150/0x1e5
           [<00000000bded60f0>] __vfs_write+0x1b/0x34
           [<00000000b92900f0>] vfs_write+0xd8/0x1d1
      Reported-by: default avatarJane Chu <jane.chu@oracle.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/160834570161.1791850.14911670304441510419.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      6268d7da
    • Arnaldo Carvalho de Melo's avatar
      perf probe: Fix memory leak when synthesizing SDT probes · 5149303f
      Arnaldo Carvalho de Melo authored
      The argv_split() function must be paired with argv_free(), else we must
      keep a reference to the argv array received or do the freeing ourselves,
      in synthesize_sdt_probe_command() we were simply leaking that argv[]
      array.
      
      Fixes: 3b1f8311 ("perf probe: Add sdt probes arguments into the uprobe cmd string")
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexis Berlemont <alexis.berlemont@gmail.com>
      Cc: He Zhe <zhe.he@windriver.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20201224135139.GF477817@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5149303f
    • James Clark's avatar
      perf stat aggregation: Add separate thread member · 8d4852b4
      James Clark authored
      A separate field isn't strictly required. The core field could be
      re-used for thread IDs as a single field was used previously.
      
      But separating them will avoid confusion and catch potential errors
      where core IDs are read as thread IDs and vice versa.
      
      Also remove the placeholder id field which is now no longer used.
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: https://lore.kernel.org/r/20201126141328.6509-13-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8d4852b4
    • James Clark's avatar
      perf stat aggregation: Add separate core member · b9933817
      James Clark authored
      Add core as a separate member so that it doesn't have to be packed into
      the int value.
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: https://lore.kernel.org/r/20201126141328.6509-12-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b9933817