Skip to content
  1. Apr 17, 2021
    • Randy Dunlap's avatar
      ia64: fix discontig.c section mismatches · e2af9da4
      Randy Dunlap authored
      
      
      Fix IA64 discontig.c Section mismatch warnings.
      
      When CONFIG_SPARSEMEM=y and CONFIG_MEMORY_HOTPLUG=y, the functions
      computer_pernodesize() and scatter_node_data() should not be marked as
      __meminit because they are needed after init, on any memory hotplug
      event.  Also, early_nr_cpus_node() is called by compute_pernodesize(),
      so early_nr_cpus_node() cannot be __meminit either.
      
        WARNING: modpost: vmlinux.o(.text.unlikely+0x1612): Section mismatch in reference from the function arch_alloc_nodedata() to the function .meminit.text:compute_pernodesize()
        The function arch_alloc_nodedata() references the function __meminit compute_pernodesize().
        This is often because arch_alloc_nodedata lacks a __meminit annotation or the annotation of compute_pernodesize is wrong.
      
        WARNING: modpost: vmlinux.o(.text.unlikely+0x1692): Section mismatch in reference from the function arch_refresh_nodedata() to the function .meminit.text:scatter_node_data()
        The function arch_refresh_nodedata() references the function __meminit scatter_node_data().
        This is often because arch_refresh_nodedata lacks a __meminit annotation or the annotation of scatter_node_data is wrong.
      
        WARNING: modpost: vmlinux.o(.text.unlikely+0x1502): Section mismatch in reference from the function compute_pernodesize() to the function .meminit.text:early_nr_cpus_node()
        The function compute_pernodesize() references the function __meminit early_nr_cpus_node().
        This is often because compute_pernodesize lacks a __meminit annotation or the annotation of early_nr_cpus_node is wrong.
      
      Link: https://lkml.kernel.org/r/20210411001201.3069-1-rdunlap@infradead.org
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Mike Rapoport <rppt@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e2af9da4
    • Randy Dunlap's avatar
      ia64: remove duplicate entries in generic_defconfig · 19d000d9
      Randy Dunlap authored
      Fix ia64 generic_defconfig duplicate entries, as warned by:
      
        arch/ia64/configs/generic_defconfig: warning: override: reassigning to symbol ATA:  => 58
        arch/ia64/configs/generic_defconfig: warning: override: reassigning to symbol ATA_PIIX:  => 59
      
      These 2 symbols still have the same value as in the removed lines.
      
      Link: https://lkml.kernel.org/r/20210411020255.18052-1-rdunlap@infradead.org
      Fixes: c331649e
      
       ("ia64: Use libata instead of the legacy ide driver in defconfigs")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      19d000d9
    • Randy Dunlap's avatar
      csky: change a Kconfig symbol name to fix e1000 build error · d1991616
      Randy Dunlap authored
      
      
      e1000's #define of CONFIG_RAM_BASE conflicts with a Kconfig symbol in
      arch/csky/Kconfig.
      
      The symbol in e1000 has been around longer, so change arch/csky/ to use
      DRAM_BASE instead of RAM_BASE to remove the conflict.  (although e1000
      is also a 2-line change)
      
      Link: https://lkml.kernel.org/r/20210411055335.7111-1-rdunlap@infradead.org
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Acked-by: default avatarGuo Ren <guoren@kernel.org>
      Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d1991616
    • Walter Wu's avatar
      kasan: remove redundant config option · 02c58773
      Walter Wu authored
      CONFIG_KASAN_STACK and CONFIG_KASAN_STACK_ENABLE both enable KASAN stack
      instrumentation, but we should only need one config, so that we remove
      CONFIG_KASAN_STACK_ENABLE and make CONFIG_KASAN_STACK workable.  see [1].
      
      When enable KASAN stack instrumentation, then for gcc we could do no
      prompt and default value y, and for clang prompt and default value n.
      
      This patch fixes the following compilation warning:
      
        include/linux/kasan.h:333:30: warning: 'CONFIG_KASAN_STACK' is not defined, evaluates to 0 [-Wundef]
      
      [akpm@linux-foundation.org: fix merge snafu]
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=210221 [1]
      Link: https://lkml.kernel.org/r/20210226012531.29231-1-walter-zh.wu@mediatek.com
      Fixes: d9b571c8
      
       ("kasan: fix KASAN_STACK dependency for HW_TAGS")
      Signed-off-by: default avatarWalter Wu <walter-zh.wu@mediatek.com>
      Suggested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed...
      02c58773
    • Arnd Bergmann's avatar
      kasan: fix hwasan build for gcc · 5c595ac4
      Arnd Bergmann authored
      
      
      gcc-11 adds support for -fsanitize=kernel-hwaddress, so it becomes
      possible to enable CONFIG_KASAN_SW_TAGS.
      
      Unfortunately this fails to build at the moment, because the
      corresponding command line arguments use llvm specific syntax.
      
      Change it to use the cc-param macro instead, which works on both clang
      and gcc.
      
      [elver@google.com: fixup for "kasan: fix hwasan build for gcc"]
        Link: https://lkml.kernel.org/r/YHQZVfVVLE/LDK2v@elver.google.com
      
      Link: https://lkml.kernel.org/r/20210323124112.1229772-1-arnd@kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMarco Elver <elver@google.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Acked-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5c595ac4
    • Randy Dunlap's avatar
      mm: eliminate "expecting prototype" kernel-doc warnings · 845be1cd
      Randy Dunlap authored
      
      
      Fix stray kernel-doc warnings in mm/ due to mis-typed or missing function
      names.
      
      Quietens these kernel-doc warnings:
      
        mm/mmu_gather.c:264: warning: expecting prototype for tlb_gather_mmu(). Prototype was for __tlb_gather_mmu() instead
        mm/oom_kill.c:180: warning: expecting prototype for Check whether unreclaimable slab amount is greater than(). Prototype was for should_dump_unreclaim_slab() instead
        mm/shuffle.c:155: warning: expecting prototype for shuffle_free_memory(). Prototype was for __shuffle_free_memory() instead
      
      Link: https://lkml.kernel.org/r/20210411210642.11362-1-rdunlap@infradead.org
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      845be1cd
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 06c2aac4
      Linus Torvalds authored
      Pull arm64 fix from Catalin Marinas:
       "Fix kernel compilation when using the LLVM integrated assembly.
      
        A recent commit (2decad92, "arm64: mte: Ensure TIF_MTE_ASYNC_FAULT
        is set atomically") broke the kernel build when using the LLVM
        integrated assembly (only noticeable with clang-12 as MTE is not
        supported by earlier versions and the code in question not compiled).
        The Fixes: tag in the commit refers to the original patch introducing
        subsections for the alternative code sequences"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: alternatives: Move length validation in alternative_{insn, endif}
      06c2aac4
  2. Apr 16, 2021
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2021-04-16' of git://anongit.freedesktop.org/drm/drm · 2f7b98d1
      Linus Torvalds authored
      Pull drm fixes from Daniel Vetter:
       "I pinged the usual suspects, only intel fixes pending"
      
      * tag 'drm-fixes-2021-04-16' of git://anongit.freedesktop.org/drm/drm:
        drm/i915/display/vlv_dsi: Do not skip panel_pwr_cycle_delay when disabling the panel
        drm/i915: Don't zero out the Y plane's watermarks
        drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT
      2f7b98d1
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 7e25f40e
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Restore the initrd-based ACPI table override functionality broken by
        one of the recent fixes"
      
      * tag 'acpi-5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: x86: Call acpi_boot_table_init() after acpi_table_upgrade()
      7e25f40e
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 33f0d9d9
      Linus Torvalds authored
      Pull gpio fix from Bartosz Golaszewski:
       "A single fix for an older problem with the sysfs interface: do not
        allow exporting GPIO lines which were marked invalid by the driver"
      
      * tag 'gpio-fixes-for-v5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: sysfs: Obey valid_mask
      33f0d9d9
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · e7e3a53b
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
       "The changes are all device/driver specific fixes:
      
         - EV_KEY and EV_ABS regression fix for Wacom from Ping Cheng
      
         - BIOS-specific quirk to fix some of the AMD_SFH-based systems, from
           Hans de Goede
      
         - other small error handling fixes and device ID additions"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices
        AMD_SFH: Add DMI quirk table for BIOS-es which don't set the activestatus bits
        AMD_SFH: Add sensor_mask module parameter
        AMD_SFH: Removed unused activecontrolstatus member from the amd_mp2_dev struct
        HID: wacom: Assign boolean values to a bool variable
        HID cp2112: fix support for multiple gpiochips
        HID: alps: fix error return code in alps_input_configured()
        HID: asus: Add support for 2021 ASUS N-Key keyboard
        HID: google: add don USB id
      e7e3a53b
    • Nathan Chancellor's avatar
      arm64: alternatives: Move length validation in alternative_{insn, endif} · 22315a22
      Nathan Chancellor authored
      After commit 2decad92 ("arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is
      set atomically"), LLVM's integrated assembler fails to build entry.S:
      
      <instantiation>:5:7: error: expected assembly-time absolute expression
       .org . - (664b-663b) + (662b-661b)
            ^
      <instantiation>:6:7: error: expected assembly-time absolute expression
       .org . - (662b-661b) + (664b-663b)
            ^
      
      The root cause is LLVM's assembler has a one-pass design, meaning it
      cannot figure out these instruction lengths when the .org directive is
      outside of the subsection that they are in, which was changed by the
      .arch_extension directive added in the above commit.
      
      Apply the same fix from commit 966a0acc ("arm64/alternatives: move
      length validation inside the subsection") to the alternative_endif
      macro, shuffling the .org directives so that the length validation
      happen will always happen in the same subsections. alternative_insn has
      not shown any issue yet but it appears that it could have the same issue
      in the future so just preemptively change it.
      
      Fixes: f7b93d42
      
       ("arm64/alternatives: use subsections for replacement sequences")
      Cc: <stable@vger.kernel.org> # 5.8.x
      Link: https://github.com/ClangBuiltLinux/linux/issues/1347
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Tested-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Tested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Link: https://lore.kernel.org/r/20210414000803.662534-1-nathan@kernel.org
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      22315a22
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 1df01322
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
       "Just a few driver fixes here"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: elants_i2c - drop zero-checking of ABS_MT_TOUCH_MAJOR resolution
        Input: elants_i2c - fix division by zero if firmware reports zero phys size
        Input: nspire-keypad - enable interrupts only when opened
        Input: i8042 - fix Pegatron C15B ID entry
        Input: n64joy - fix return value check in n64joy_probe()
        Input: s6sy761 - fix coordinate read bit shift
      1df01322
  3. Apr 15, 2021
    • Daniel Vetter's avatar
      Merge tag 'drm-intel-fixes-2021-04-15' of... · 4d2e1288
      Daniel Vetter authored
      
      Merge tag 'drm-intel-fixes-2021-04-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      Display panel & power related fixes:
      
      - Backlight fix (Lyude)
      - Display watermark fix (Ville)
      - VLV panel power fix (Hans)
      
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/YHg4nz/ndzDRmPjd@intel.com
      4d2e1288
    • Linus Torvalds's avatar
      Merge tag 'for-5.12/dm-fixes-3' of... · 7f75285c
      Linus Torvalds authored
      Merge tag 'for-5.12/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fix from Mike Snitzer:
       "Fix DM verity target FEC support's RS roots IO to always be aligned.
      
        This fixes a previous stable@ fix that overcorrected for a different
        configuration that also resulted in misaligned roots IO"
      
      * tag 'for-5.12/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm verity fec: fix misaligned RS roots IO
      7f75285c
    • Jaegeuk Kim's avatar
      dm verity fec: fix misaligned RS roots IO · 8ca7cab8
      Jaegeuk Kim authored
      commit df7b59ba ("dm verity: fix FEC for RS roots unaligned to
      block size") introduced the possibility for misaligned roots IO
      relative to the underlying device's logical block size. E.g. Android's
      default RS roots=2 results in dm_bufio->block_size=1024, which causes
      the following EIO if the logical block size of the device is 4096,
      given v->data_dev_block_bits=12:
      
      E sd 0    : 0:0:0: [sda] tag#30 request not aligned to the logical block size
      E blk_update_request: I/O error, dev sda, sector 10368424 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
      E device-mapper: verity-fec: 254:8: FEC 9244672: parity read failed (block 18056): -5
      
      Fix this by onlu using f->roots for dm_bufio blocksize IFF it is
      aligned to v->data_dev_block_bits.
      
      Fixes: df7b59ba
      
       ("dm verity: fix FEC for RS roots unaligned to block size")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@google.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      8ca7cab8
    • Linus Torvalds's avatar
      Merge tag 's390-5.12-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 8e2e0104
      Linus Torvalds authored
      Pull s390 fixes from Heiko Carstens:
      
       - setup stack backchain properly in external and i/o interrupt handler
         to fix stack unwinding. This broke when converting to generic entry
      
        - save caller address of psw_idle to get a sane stacktrace
      
      * tag 's390-5.12-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/entry: save the caller of psw_idle
        s390/entry: avoid setting up backchain in ext|io handlers
      8e2e0104
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · ec97a729
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
      
       - Fix incorrect asm constraint for load_unaligned_zeropad() fixup
      
       - Fix thread flag update when setting TIF_MTE_ASYNC_FAULT
      
       - Fix restored irq state when handling fault on kprobe
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: kprobes: Restore local irqflag if kprobes is cancelled
        arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically
        arm64: fix inline asm in load_unaligned_zeropad()
      ec97a729
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · c17a3066
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "A couple of dmaengine driver fixes for:
      
         - race and descriptor issue for xilinx driver
      
         - fix interrupt handling, wq state & cleanup, field sizes for
           completion, msix permissions for idxd driver
      
         - runtime pm fix for tegra driver
      
         - double free fix in dma_async_device_register"
      
      * tag 'dmaengine-fix-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: idxd: fix wq cleanup of WQCFG registers
        dmaengine: idxd: clear MSIX permission entry on shutdown
        dmaengine: plx_dma: add a missing put_device() on error path
        dmaengine: tegra20: Fix runtime PM imbalance on error
        dmaengine: Fix a double free in dma_async_device_register
        dmaengine: dw: Make it dependent to HAS_IOMEM
        dmaengine: idxd: fix wq size store permission state
        dmaengine: idxd: fix opcap sysfs attribute output
        dmaengine: idxd: fix delta_rec and crc size field for completion record
        dmaengine: idxd: Fix clobbering of SWERR overflow bit on writeback
        dmaengine: xilinx: dpdma: Fix race condition in done IRQ
        dmaengine: xilinx: dpdma: Fix descriptor issuing on video group
      c17a3066
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.12-rc8' of git://github.com/awilliam/linux-vfio · e70b911a
      Linus Torvalds authored
      Pull VFIO fix from Alex Williamson:
       "Verify mmap region within range (Christian A. Ehrhardt)"
      
      * tag 'vfio-v5.12-rc8' of git://github.com/awilliam/linux-vfio:
        vfio/pci: Add missing range check in vfio_pci_mmap
      e70b911a
  4. Apr 14, 2021
  5. Apr 13, 2021
  6. Apr 12, 2021
    • Catalin Marinas's avatar
      arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically · 2decad92
      Catalin Marinas authored
      
      
      The entry from EL0 code checks the TFSRE0_EL1 register for any
      asynchronous tag check faults in user space and sets the
      TIF_MTE_ASYNC_FAULT flag. This is not done atomically, potentially
      racing with another CPU calling set_tsk_thread_flag().
      
      Replace the non-atomic ORR+STR with an STSET instruction. While STSET
      requires ARMv8.1 and an assembler that understands LSE atomics, the MTE
      feature is part of ARMv8.5 and already requires an updated assembler.
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Fixes: 637ec831
      
       ("arm64: mte: Handle synchronous and asynchronous tag check faults")
      Cc: <stable@vger.kernel.org> # 5.10.x
      Reported-by: default avatarWill Deacon <will@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/20210409173710.18582-1-catalin.marinas@arm.com
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      2decad92
    • Hans de Goede's avatar
      drm/i915/display/vlv_dsi: Do not skip panel_pwr_cycle_delay when disabling the panel · aee6f25e
      Hans de Goede authored
      After the recently added commit fe0f1e3b ("drm/i915: Shut down
      displays gracefully on reboot"), the DSI panel on a Cherry Trail based
      Predia Basic tablet would no longer properly light up after reboot.
      
      I've managed to reproduce this without rebooting by doing:
      chvt 3; echo 1 > /sys/class/graphics/fb0/blank;\
      echo 0 > /sys/class/graphics/fb0/blank
      
      Which rapidly turns the panel off and back on again.
      
      The vlv_dsi.c code uses an intel_dsi_msleep() helper for the various delays
      used for panel on/off, since starting with MIPI-sequences version >= 3 the
      delays are already included inside the MIPI-sequences.
      
      The problems exposed by the "Shut down displays gracefully on reboot"
      change, show that using this helper for the panel_pwr_cycle_delay is
      not the right thing to do. This has not been noticed until now because
      normally the panel never is cycled off and directly on again in quick
      succession.
      
      Change the msleep for the panel_pwr_cycle_delay to a normal msleep()
      call to avoid the panel staying black after a quick off + on cycle.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Fixes: fe0f1e3b
      
       ("drm/i915: Shut down displays gracefully on reboot")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210325114823.44922-1-hdegoede@redhat.com
      (cherry picked from commit 2878b29f
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      aee6f25e
    • Ville Syrjälä's avatar
      drm/i915: Don't zero out the Y plane's watermarks · bf52dc49
      Ville Syrjälä authored
      Don't zero out the watermarks for the Y plane since we've already
      computed them when computing the UV plane's watermarks (since the
      UV plane always appears before ethe Y plane when iterating through
      the planes).
      
      This leads to allocating no DDB for the Y plane since .min_ddb_alloc
      also gets zeroed. And that of course leads to underruns when scanning
      out planar formats.
      
      Cc: stable@vger.kernel.org
      Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Fixes: dbf71381
      
       ("drm/i915: Nuke intel_atomic_crtc_state_for_each_plane_state() from skl+ wm code")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210327005945.4929-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      (cherry picked from commit f99b805f
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      bf52dc49
    • Lyude Paul's avatar
      drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT · 11664169
      Lyude Paul authored
      Looks like that there actually are another subset of laptops on the market
      that don't support the Intel HDR backlight interface, but do advertise
      support for the VESA DPCD backlight interface despite the fact it doesn't
      seem to work.
      
      Note though I'm not entirely clear on this - on one of the machines where
      this issue was observed, I also noticed that we appeared to be rejecting
      the VBT defined backlight frequency in
      intel_dp_aux_vesa_calc_max_backlight(). It's noted in this function that:
      
      /* Use highest possible value of Pn for more granularity of brightness
       * adjustment while satifying the conditions below.
       * ...
       * - FxP is within 25% of desired value.
       *   Note: 25% is arbitrary value and may need some tweak.
       */
      
      So it's possible that this value might just need to be tweaked, but for now
      let's just disable the VESA backlight interface unless it's specified in
      the VBT just to be safe. We might be able to try enabling this again by
      default in the future.
      
      Fixes: 2227816e
      
       ("drm/i915/dp: Allow forcing specific interfaces through enable_dpcd_backlight")
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3169
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210318170204.513000-1-lyude@redhat.com
      (cherry picked from commit 9e2eb6d5
      
      )
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      11664169
    • Vasily Gorbik's avatar
      s390/entry: save the caller of psw_idle · a994eddb
      Vasily Gorbik authored
      
      
      Currently psw_idle does not allocate a stack frame and does not
      save its r14 and r15 into the save area. Even though this is valid from
      call ABI point of view, because psw_idle does not make any calls
      explicitly, in reality psw_idle is an entry point for controlled
      transition into serving interrupts. So, in practice, psw_idle stack
      frame is analyzed during stack unwinding. Depending on build options
      that r14 slot in the save area of psw_idle might either contain a value
      saved by previous sibling call or complete garbage.
      
        [task    0000038000003c28] do_ext_irq+0xd6/0x160
        [task    0000038000003c78] ext_int_handler+0xba/0xe8
        [task   *0000038000003dd8] psw_idle_exit+0x0/0x8 <-- pt_regs
       ([task    0000038000003dd8] 0x0)
        [task    0000038000003e10] default_idle_call+0x42/0x148
        [task    0000038000003e30] do_idle+0xce/0x160
        [task    0000038000003e70] cpu_startup_entry+0x36/0x40
        [task    0000038000003ea0] arch_call_rest_init+0x76/0x80
      
      So, to make a stacktrace nicer and actually point for the real caller of
      psw_idle in this frequently occurring case, make psw_idle save its r14.
      
        [task    0000038000003c28] do_ext_irq+0xd6/0x160
        [task    0000038000003c78] ext_int_handler+0xba/0xe8
        [task   *0000038000003dd8] psw_idle_exit+0x0/0x6 <-- pt_regs
       ([task    0000038000003dd8] arch_cpu_idle+0x3c/0xd0)
        [task    0000038000003e10] default_idle_call+0x42/0x148
        [task    0000038000003e30] do_idle+0xce/0x160
        [task    0000038000003e70] cpu_startup_entry+0x36/0x40
        [task    0000038000003ea0] arch_call_rest_init+0x76/0x80
      
      Reviewed-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      a994eddb
    • Vasily Gorbik's avatar
      s390/entry: avoid setting up backchain in ext|io handlers · b74e409e
      Vasily Gorbik authored
      Currently when interrupt arrives to cpu while in kernel context
      INT_HANDLER macro (used for ext_int_handler and io_int_handler)
      allocates new stack frame and pt_regs on the kernel stack and
      sets up the backchain to jump over the pt_regs to the frame which has
      been interrupted. This is not ideal to two reasons:
      
      1. This hides the fact that kernel stack contains interrupt frame in it
         and hence breaks arch_stack_walk_reliable(), which needs to know that to
         guarantee "reliability" and checks that there are no pt_regs on the way.
      
      2. It breaks the backchain unwinder logic, which assumes that the next
         stack frame after an interrupt frame is reliable, while it is not.
         In some cases (when r14 contains garbage) this leads to early unwinding
         termination with an error, instead of marking frame as unreliable
         and continuing.
      
      To address that, only set backchain to 0.
      
      Fixes: 56e62a73
      
       ("s390: convert to generic entry")
      Reviewed-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      b74e409e
    • Dan Carpenter's avatar
      dmaengine: plx_dma: add a missing put_device() on error path · 07503e6a
      Dan Carpenter authored
      Add a missing put_device(&pdev->dev) if the call to
      dma_async_device_register(dma); fails.
      
      Fixes: 905ca51e
      
       ("dmaengine: plx-dma: Introduce PLX DMA engine PCI driver skeleton")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
      Link: https://lore.kernel.org/r/YFnq/0IQzixtAbC1@mwanda
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      07503e6a
    • Dinghao Liu's avatar
      dmaengine: tegra20: Fix runtime PM imbalance on error · 917a3200
      Dinghao Liu authored
      
      
      pm_runtime_get_sync() will increase the runtime PM counter
      even it returns an error. Thus a pairing decrement is needed
      to prevent refcount leak. Fix this by replacing this API with
      pm_runtime_resume_and_get(), which will not change the runtime
      PM counter on error.
      
      Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/20210409082805.23643-1-dinghao.liu@zju.edu.cn
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      917a3200
    • Lv Yunlong's avatar
      dmaengine: Fix a double free in dma_async_device_register · ea45b600
      Lv Yunlong authored
      In the first list_for_each_entry() macro of dma_async_device_register,
      it gets the chan from list and calls __dma_async_device_channel_register
      (..,chan). We can see that chan->local is allocated by alloc_percpu() and
      it is freed chan->local by free_percpu(chan->local) when
      __dma_async_device_channel_register() failed.
      
      But after __dma_async_device_channel_register() failed, the caller will
      goto err_out and freed the chan->local in the second time by free_percpu().
      
      The cause of this problem is forget to set chan->local to NULL when
      chan->local was freed in __dma_async_device_channel_register(). My
      patch sets chan->local to NULL when the callee failed to avoid double free.
      
      Fixes: d2fb0a04
      
       ("dmaengine: break out channel registration")
      Signed-off-by: default avatarLv Yunlong <lyl2019@mail.ustc.edu.cn>
      Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
      Link: https://lore.kernel.org/r/20210331014458.3944-1-lyl2019@mail.ustc.edu.cn
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      ea45b600