1. 06 May, 2021 2 commits
    • Bas Nieuwenhuizen's avatar
      drm/amdgpu: Use device specific BO size & stride check. · 234055fd
      Bas Nieuwenhuizen authored
      The builtin size check isn't really the right thing for AMD
      modifiers due to a couple of reasons:
      
      1) In the format structs we don't do set any of the tilesize / blocks
      etc. to avoid having format arrays per modifier/GPU
      2) The pitch on the main plane is pixel_pitch * bytes_per_pixel even
      for tiled ...
      3) The pitch for the DCC planes is really the pixel pitch of the main
      surface that would be covered by it ...
      
      Note that we only handle GFX9+ case but we do this after converting
      the implicit modifier to an explicit modifier, so on GFX9+ all
      framebuffers should be checked here.
      
      There is a TODO about DCC alignment, but it isn't worse than before
      and I'd need to dig a bunch into the specifics. Getting this out in
      a reasonable timeframe to make sure it gets the appropriate testing
      seemed more important.
      
      Finally as I've found that debugging addfb2 failures is a pita I was
      generous adding explicit error messages to every failure case.
      
      Fixes: f258907f ("drm/amdgpu: Verify bo size can fit framebuffer size on init.")
      Tested-by: default avatarSimon Ser <contact@emersion.fr>
      Signed-off-by: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      234055fd
    • Bas Nieuwenhuizen's avatar
      drm/amdgpu: Init GFX10_ADDR_CONFIG for VCN v3 in DPG mode. · 8bf073ca
      Bas Nieuwenhuizen authored
      Otherwise tiling modes that require the values form this field
      (In particular _*_X) would be corrupted upon video decode.
      
      Copied from the VCN v2 code.
      
      Fixes: 99541f39 ("drm/amdgpu: add mc resume DPG mode for VCN3.0")
      Reviewed-and-Tested by: Leo Liu <leo.liu@amd.com>
      Signed-off-by: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      8bf073ca
  2. 04 May, 2021 5 commits
    • Tom Rix's avatar
      drm/amd/pm: initialize variable · 8651fcb9
      Tom Rix authored
      Static analysis reports this problem
      
      amdgpu_pm.c:478:16: warning: The right operand of '<' is a garbage value
        for (i = 0; i < data.nums; i++) {
                      ^ ~~~~~~~~~
      
      In some cases data is not set.  Initialize to 0 and flag not setting
      data as an error with the existing check.
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8651fcb9
    • Kees Cook's avatar
      drm/radeon: Avoid power table parsing memory leaks · c69f2713
      Kees Cook authored
      Avoid leaving a hanging pre-allocated clock_info if last mode is
      invalid, and avoid heap corruption if no valid modes are found.
      
      Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211537
      Fixes: 6991b8f2 ("drm/radeon/kms: fix segfault in pm rework")
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      c69f2713
    • Kees Cook's avatar
      drm/radeon: Fix off-by-one power_state index heap overwrite · 5bbf2193
      Kees Cook authored
      An out of bounds write happens when setting the default power state.
      KASAN sees this as:
      
      [drm] radeon: 512M of GTT memory ready.
      [drm] GART: num cpu pages 131072, num gpu pages 131072
      ==================================================================
      BUG: KASAN: slab-out-of-bounds in
      radeon_atombios_parse_power_table_1_3+0x1837/0x1998 [radeon]
      Write of size 4 at addr ffff88810178d858 by task systemd-udevd/157
      
      CPU: 0 PID: 157 Comm: systemd-udevd Not tainted 5.12.0-E620 #50
      Hardware name: eMachines        eMachines E620  /Nile       , BIOS V1.03 09/30/2008
      Call Trace:
       dump_stack+0xa5/0xe6
       print_address_description.constprop.0+0x18/0x239
       kasan_report+0x170/0x1a8
       radeon_atombios_parse_power_table_1_3+0x1837/0x1998 [radeon]
       radeon_atombios_get_power_modes+0x144/0x1888 [radeon]
       radeon_pm_init+0x1019/0x1904 [radeon]
       rs690_init+0x76e/0x84a [radeon]
       radeon_device_init+0x1c1a/0x21e5 [radeon]
       radeon_driver_load_kms+0xf5/0x30b [radeon]
       drm_dev_register+0x255/0x4a0 [drm]
       radeon_pci_probe+0x246/0x2f6 [radeon]
       pci_device_probe+0x1aa/0x294
       really_probe+0x30e/0x850
       driver_probe_device+0xe6/0x135
       device_driver_attach+0xc1/0xf8
       __driver_attach+0x13f/0x146
       bus_for_each_dev+0xfa/0x146
       bus_add_driver+0x2b3/0x447
       driver_register+0x242/0x2c1
       do_one_initcall+0x149/0x2fd
       do_init_module+0x1ae/0x573
       load_module+0x4dee/0x5cca
       __do_sys_finit_module+0xf1/0x140
       do_syscall_64+0x33/0x40
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Without KASAN, this will manifest later when the kernel attempts to
      allocate memory that was stomped, since it collides with the inline slab
      freelist pointer:
      
      invalid opcode: 0000 [#1] SMP NOPTI
      CPU: 0 PID: 781 Comm: openrc-run.sh Tainted: G        W 5.10.12-gentoo-E620 #2
      Hardware name: eMachines        eMachines E620  /Nile , BIOS V1.03       09/30/2008
      RIP: 0010:kfree+0x115/0x230
      Code: 89 c5 e8 75 ea ff ff 48 8b 00 0f ba e0 09 72 63 e8 1f f4 ff ff 41 89 c4 48 8b 45 00 0f ba e0 10 72 0a 48 8b 45 08 a8 01 75 02 <0f> 0b 44 89 e1 48 c7 c2 00 f0 ff ff be 06 00 00 00 48 d3 e2 48 c7
      RSP: 0018:ffffb42f40267e10 EFLAGS: 00010246
      RAX: ffffd61280ee8d88 RBX: 0000000000000004 RCX: 000000008010000d
      RDX: 4000000000000000 RSI: ffffffffba1360b0 RDI: ffffd61280ee8d80
      RBP: ffffd61280ee8d80 R08: ffffffffb91bebdf R09: 0000000000000000
      R10: ffff8fe2c1047ac8 R11: 0000000000000000 R12: 0000000000000000
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000100
      FS:  00007fe80eff6b68(0000) GS:ffff8fe339c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007fe80eec7bc0 CR3: 0000000038012000 CR4: 00000000000006f0
      Call Trace:
       __free_fdtable+0x16/0x1f
       put_files_struct+0x81/0x9b
       do_exit+0x433/0x94d
       do_group_exit+0xa6/0xa6
       __x64_sys_exit_group+0xf/0xf
       do_syscall_64+0x33/0x40
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      RIP: 0033:0x7fe80ef64bea
      Code: Unable to access opcode bytes at RIP 0x7fe80ef64bc0.
      RSP: 002b:00007ffdb1c47528 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
      RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fe80ef64bea
      RDX: 00007fe80ef64f60 RSI: 0000000000000000 RDI: 0000000000000000
      RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
      R10: 00007fe80ee2c620 R11: 0000000000000246 R12: 00007fe80eff41e0
      R13: 00000000ffffffff R14: 0000000000000024 R15: 00007fe80edf9cd0
      Modules linked in: radeon(+) ath5k(+) snd_hda_codec_realtek ...
      
      Use a valid power_state index when initializing the "flags" and "misc"
      and "misc2" fields.
      
      Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211537Reported-by: default avatarErhard F. <erhard_f@mailbox.org>
      Fixes: a48b9b4e ("drm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)")
      Fixes: 79daedc9 ("drm/radeon/kms: minor pm cleanups")
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      5bbf2193
    • Rodrigo Siqueira's avatar
      drm/amd/display: Fix two cursor duplication when using overlay · 16e9b3e5
      Rodrigo Siqueira authored
      Our driver supports overlay planes, and as expected, some userspace
      compositor takes advantage of these features. If the userspace is not
      enabling the cursor, they can use multiple planes as they please.
      Nevertheless, we start to have constraints when userspace tries to
      enable hardware cursor with various planes. Basically, we cannot draw
      the cursor at the same size and position on two separated pipes since it
      uses extra bandwidth and DML only run with one cursor.
      
      For those reasons, when we enable hardware cursor and multiple planes,
      our driver should accept variations like the ones described below:
      
        +-------------+   +--------------+
        | +---------+ |   |              |
        | |Primary  | |   | Primary      |
        | |         | |   | Overlay      |
        | +---------+ |   |              |
        |Overlay      |   |              |
        +-------------+   +--------------+
      
      In this scenario, we can have the desktop UI in the overlay and some
      other framebuffer attached to the primary plane (e.g., video). However,
      userspace needs to obey some rules and avoid scenarios like the ones
      described below (when enabling hw cursor):
      
                                            +--------+
                                            |Overlay |
       +-------------+    +-----+-------+ +-|        |--+
       | +--------+  | +--------+       | | +--------+  |
       | |Overlay |  | |Overlay |       | |             |
       | |        |  | |        |       | |             |
       | +--------+  | +--------+       | |             |
       | Primary     |    | Primary     | | Primary     |
       +-------------+    +-------------+ +-------------+
      
       +-------------+   +-------------+
       |     +--------+  |  Primary    |
       |     |Overlay |  |             |
       |     |        |  |             |
       |     +--------+  | +--------+  |
       | Primary     |   | |Overlay |  |
       +-------------+   +-|        |--+
                           +--------+
      
      If the userspace violates some of the above scenarios, our driver needs
      to reject the commit; otherwise, we can have unexpected behavior. Since
      we don't have a proper driver validation for the above case, we can see
      some problems like a duplicate cursor in applications that use multiple
      planes. This commit fixes the cursor issue and others by adding adequate
      verification for multiple planes.
      
      Change since V1 (Harry and Sean):
      - Remove cursor verification from the equation.
      
      Cc: Louis Li <Ching-shih.Li@amd.com>
      Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Cc: Harry Wentland <Harry.Wentland@amd.com>
      Cc: Hersen Wu <hersenxs.wu@amd.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      16e9b3e5
    • Evan Quan's avatar
      drm/amdgpu: add new MC firmware for Polaris12 32bit ASIC · c83c4e19
      Evan Quan authored
      Polaris12 32bit ASIC needs a special MC firmware.
      Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      c83c4e19
  3. 29 Apr, 2021 9 commits
    • Simon Ser's avatar
      amdgpu: fix GEM obj leak in amdgpu_display_user_framebuffer_create · e0c16eb4
      Simon Ser authored
      This error code-path is missing a drm_gem_object_put call. Other
      error code-paths are fine.
      Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
      Fixes: 1769152a ("drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)")
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      e0c16eb4
    • Kai-Heng Feng's avatar
      drm/amdgpu: Register VGA clients after init can no longer fail · 8c3dd61c
      Kai-Heng Feng authored
      When an amdgpu device fails to init, it makes another VGA device cause
      kernel splat:
      kernel: amdgpu 0000:08:00.0: amdgpu: amdgpu_device_ip_init failed
      kernel: amdgpu 0000:08:00.0: amdgpu: Fatal error during GPU init
      kernel: amdgpu: probe of 0000:08:00.0 failed with error -110
      ...
      kernel: amdgpu 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
      kernel: BUG: kernel NULL pointer dereference, address: 0000000000000018
      kernel: #PF: supervisor read access in kernel mode
      kernel: #PF: error_code(0x0000) - not-present page
      kernel: PGD 0 P4D 0
      kernel: Oops: 0000 [#1] SMP NOPTI
      kernel: CPU: 6 PID: 1080 Comm: Xorg Tainted: G        W         5.12.0-rc8+ #12
      kernel: Hardware name: HP HP EliteDesk 805 G6/872B, BIOS S09 Ver. 02.02.00 12/30/2020
      kernel: RIP: 0010:amdgpu_device_vga_set_decode+0x13/0x30 [amdgpu]
      kernel: Code: 06 31 c0 c3 b8 ea ff ff ff 5d c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 48 8b 87 90 06 00 00 48 89 e5 53 89 f3 <48> 8b 40 18 40 0f b6 f6 e8 40 58 39 fd 80 fb 01 5b 5d 19 c0 83 e0
      kernel: RSP: 0018:ffffae3c0246bd68 EFLAGS: 00010002
      kernel: RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      kernel: RDX: ffff8dd1af5a8560 RSI: 0000000000000000 RDI: ffff8dce8c160000
      kernel: RBP: ffffae3c0246bd70 R08: ffff8dd1af5985c0 R09: ffffae3c0246ba38
      kernel: R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000246
      kernel: R13: 0000000000000000 R14: 0000000000000003 R15: ffff8dce81490000
      kernel: FS:  00007f9303d8fa40(0000) GS:ffff8dd1af580000(0000) knlGS:0000000000000000
      kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      kernel: CR2: 0000000000000018 CR3: 0000000103cfa000 CR4: 0000000000350ee0
      kernel: Call Trace:
      kernel:  vga_arbiter_notify_clients.part.0+0x4a/0x80
      kernel:  vga_get+0x17f/0x1c0
      kernel:  vga_arb_write+0x121/0x6a0
      kernel:  ? apparmor_file_permission+0x1c/0x20
      kernel:  ? security_file_permission+0x30/0x180
      kernel:  vfs_write+0xca/0x280
      kernel:  ksys_write+0x67/0xe0
      kernel:  __x64_sys_write+0x1a/0x20
      kernel:  do_syscall_64+0x38/0x90
      kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xae
      kernel: RIP: 0033:0x7f93041e02f7
      kernel: Code: 75 05 48 83 c4 58 c3 e8 f7 33 ff ff 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
      kernel: RSP: 002b:00007fff60e49b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      kernel: RAX: ffffffffffffffda RBX: 000000000000000b RCX: 00007f93041e02f7
      kernel: RDX: 000000000000000b RSI: 00007fff60e49b40 RDI: 000000000000000f
      kernel: RBP: 00007fff60e49b40 R08: 00000000ffffffff R09: 00007fff60e499d0
      kernel: R10: 00007f93049350b5 R11: 0000000000000246 R12: 000056111d45e808
      kernel: R13: 0000000000000000 R14: 000056111d45e7f8 R15: 000056111d46c980
      kernel: Modules linked in: nls_iso8859_1 snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_seq input_leds snd_seq_device snd_timer snd soundcore joydev kvm_amd serio_raw k10temp mac_hid hp_wmi ccp kvm sparse_keymap wmi_bmof ucsi_acpi efi_pstore typec_ucsi rapl typec video wmi sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx libcrc32c xor raid6_pq raid1 raid0 multipath linear dm_mirror dm_region_hash dm_log hid_generic usbhid hid amdgpu drm_ttm_helper ttm iommu_v2 gpu_sched i2c_algo_bit drm_kms_helper syscopyarea sysfillrect crct10dif_pclmul sysimgblt crc32_pclmul fb_sys_fops ghash_clmulni_intel cec rc_core aesni_intel crypto_simd psmouse cryptd r8169 i2c_piix4 drm ahci xhci_pci realtek libahci xhci_pci_renesas gpio_amdpt gpio_generic
      kernel: CR2: 0000000000000018
      kernel: ---[ end trace 76d04313d4214c51 ]---
      
      Commit 4192f7b5 ("drm/amdgpu: unmap register bar on device init
      failure") makes amdgpu_driver_unload_kms() skips amdgpu_device_fini(),
      so the VGA clients remain registered. So when
      vga_arbiter_notify_clients() iterates over registered clients, it causes
      NULL pointer dereference.
      
      Since there's no reason to register VGA clients that early, so solve
      the issue by putting them after all the goto cleanups.
      
      v2:
       - Remove redundant vga_switcheroo cleanup in failed: label.
      
      Fixes: 4192f7b5 ("drm/amdgpu: unmap register bar on device init failure")
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8c3dd61c
    • Pavan Kumar Ramayanam's avatar
      drm/amdgpu: Handling of amdgpu_device_resume return value for graceful teardown · b45aeb2d
      Pavan Kumar Ramayanam authored
      The runtime resume PM op disregards the return value from
      amdgpu_device_resume(), masking errors for failed resumes at the PM
      layer.
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarPavan Kumar Ramayanam <pavan.ramayanam@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b45aeb2d
    • Victor Zhao's avatar
      drm/amdgpu: fix r initial values · 4b12ee6f
      Victor Zhao authored
      Sriov gets suspend of IP block <dce_virtual> failed as return
      value was not initialized.
      
      v2: return 0 directly to align original code semantic before this
      was broken out into a separate helper function instead of setting
      initial values
      Signed-off-by: default avatarVictor Zhao <Victor.Zhao@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      4b12ee6f
    • Mikita Lipski's avatar
      drm/amd/display: fix wrong statement in mst hpd debugfs · 3cbae5ab
      Mikita Lipski authored
      [why]
      Previous statement would always evaluate to true
      making it meaningless
      [how]
      Just check if a connector is MST by checking if its port exists.
      
      Fixes: 41efcd38 ("drm/amd/display: Add MST capability to trigger_hotplug interface")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarMikita Lipski <mikita.lipski@amd.com>
      Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Acked-by: default avatarWayne Lin <waynelin@amd.com>
      Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      3cbae5ab
    • Darren Powell's avatar
      amdgpu/pm: set pp_dpm_dcefclk to readonly on NAVI10 and newer gpus · d7b4a607
      Darren Powell authored
      v2 : change condition to apply to all chips after NAVI10
      
      Writing to dcefclk causes the gpu to become unresponsive, and requires a reboot.
      Patch prevents user from successfully writing to file pp_dpm_dcefclk on parts
      NAVI10 and newer, and gives better user feedback that this operation is not allowed.
      Signed-off-by: default avatarDarren Powell <darren.powell@amd.com>
      Reviewed-by: default avatarKenneth Feng <kenneth.feng@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      d7b4a607
    • Darren Powell's avatar
      amdgpu/pm: Prevent force of DCEFCLK on NAVI10 and SIENNA_CICHLID · b117b396
      Darren Powell authored
      Writing to dcefclk causes the gpu to become unresponsive, and requires a reboot.
      Patch ignores a .force_clk_levels(SMU_DCEFCLK) call and issues an
      info message.
      Signed-off-by: default avatarDarren Powell <darren.powell@amd.com>
      Reviewed-by: default avatarKenneth Feng <kenneth.feng@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b117b396
    • Christian König's avatar
      drm/amdgpu: fix concurrent VM flushes on Vega/Navi v2 · 20a5f5a9
      Christian König authored
      Starting with Vega the hardware supports concurrent flushes
      of VMID which can be used to implement per process VMID
      allocation.
      
      But concurrent flushes are mutual exclusive with back to
      back VMID allocations, fix this to avoid a VMID used in
      two ways at the same time.
      
      v2: don't set ring to NULL
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarJames Zhu <James.Zhu@amd.com>
      Tested-by: default avatarJames Zhu <James.Zhu@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      20a5f5a9
    • Harry Wentland's avatar
      drm/amd/display: Reject non-zero src_y and src_x for video planes · d89f6048
      Harry Wentland authored
      [Why]
      This hasn't been well tested and leads to complete system hangs on DCN1
      based systems, possibly others.
      
      The system hang can be reproduced by gesturing the video on the YouTube
      Android app on ChromeOS into full screen.
      
      [How]
      Reject atomic commits with non-zero drm_plane_state.src_x or src_y values.
      
      v2:
       - Add code comment describing the reason we're rejecting non-zero
         src_x and src_y
       - Drop gerrit Change-Id
       - Add stable CC
       - Based on amd-staging-drm-next
      
      v3: removed trailing whitespace
      Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Cc: stable@vger.kernel.org
      Cc: nicholas.kazlauskas@amd.com
      Cc: amd-gfx@lists.freedesktop.org
      Cc: alexander.deucher@amd.com
      Cc: Roman.Li@amd.com
      Cc: hersenxs.wu@amd.com
      Cc: danny.wang@amd.com
      Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarHersen Wu <hersenxs.wu@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      d89f6048
  4. 23 Apr, 2021 1 commit
  5. 21 Apr, 2021 2 commits
  6. 16 Apr, 2021 3 commits
  7. 13 Apr, 2021 3 commits
  8. 11 Apr, 2021 4 commits
  9. 10 Apr, 2021 10 commits
    • Linus Torvalds's avatar
      Merge branch 'for-5.12-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu · 52e44129
      Linus Torvalds authored
      Pull percpu fix from Dennis Zhou:
       "This contains a fix for sporadically failing atomic percpu
        allocations.
      
        I only caught it recently while I was reviewing a new series [1] and
        simultaneously saw reports by btrfs in xfstests [2] and [3].
      
        In v5.9, memcg accounting was extended to percpu done by adding a
        second type of chunk. I missed an interaction with the free page float
        count used to ensure we can support atomic allocations. If one type of
        chunk has no free pages, but the other has enough to satisfy the free
        page float requirement, we will not repopulate the free pages for the
        former type of chunk. This led to the sporadically failing atomic
        allocations"
      
      Link: https://lore.kernel.org/linux-mm/20210324190626.564297-1-guro@fb.com/ [1]
      Link: https://lore.kernel.org/linux-mm/20210401185158.3275.409509F4@e16-tech.com/ [2]
      Link: https://lore.kernel.org/linux-mm/CAL3q7H5RNBjCi708GH7jnczAOe0BLnacT9C+OBgA-Dx9jhB6SQ@mail.gmail.com/ [3]
      
      * 'for-5.12-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu:
        percpu: make pcpu_nr_empty_pop_pages per chunk type
      52e44129
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · efc2da92
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Seven fixes, all in drivers.
      
        The hpsa three are the most extensive and the most problematic: it's a
        packed structure misalignment that oopses on ia64 but looks like it
        would also oops on quite a few non-x86 architectures.
      
        The pm80xx is a regression and the rest are bug fixes for patches in
        the misc tree"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST state
        scsi: target: iscsi: Fix zero tag inside a trace event
        scsi: pm80xx: Fix chip initialization failure
        scsi: ufs: core: Fix wrong Task Tag used in task management request UPIUs
        scsi: ufs: core: Fix task management request completion timeout
        scsi: hpsa: Add an assert to prevent __packed reintroduction
        scsi: hpsa: Fix boot on ia64 (atomic_t alignment)
        scsi: hpsa: Use __packed on individual structs, not header-wide
      efc2da92
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.12-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 95c7b075
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Some some more powerpc fixes for 5.12:
      
         - Fix an oops triggered by ptrace when CONFIG_PPC_FPU_REGS=n
      
         - Fix an oops on sigreturn when the VDSO is unmapped on 32-bit
      
         - Fix vdso_wrapper.o not being rebuilt everytime vdso.so is rebuilt
      
        Thanks to Christophe Leroy"
      
      * tag 'powerpc-5.12-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/vdso: Make sure vdso_wrapper.o is rebuilt everytime vdso.so is rebuilt
        powerpc/signal32: Fix Oops on sigreturn with unmapped VDSO
        powerpc/ptrace: Don't return error when getting/setting FP regs without CONFIG_PPC_FPU_REGS
      95c7b075
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.12-rc7' of... · d5fa1dad
      Linus Torvalds authored
      Merge tag 'driver-core-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is a single driver core fix for 5.12-rc7 to resolve a reported
        problem that caused some devices to lockup when booting. It has been
        in linux-next with no reported issues"
      
      * tag 'driver-core-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: Fix locking bug in deferred_probe_timeout_work_func()
      d5fa1dad
    • Linus Torvalds's avatar
      Merge tag 'usb-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 445e09e7
      Linus Torvalds authored
      Pull USB/Thunderbolt fixes from Greg KH:
       "Here are a few small USB and Thunderbolt driver fixes for 5.12-rc7 for
        reported issues:
      
         - thunderbolt leaks and off-by-one fix
      
         - cdnsp deque fix
      
         - usbip fixes for syzbot-reported issues
      
        All have been in linux-next with no reported problems"
      
      * tag 'usb-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usbip: synchronize event handler with sysfs code paths
        usbip: vudc synchronize sysfs code paths
        usbip: stub-dev synchronize sysfs code paths
        usbip: add sysfs_lock to synchronize sysfs code paths
        thunderbolt: Fix off by one in tb_port_find_retimer()
        thunderbolt: Fix a leak in tb_retimer_add()
        usb: cdnsp: Fixes issue with dequeuing requests after disabling endpoint
      445e09e7
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 12a0cf72
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "A mixture of driver and documentation bugfixes for I2C"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: imx: mention Oleksij as maintainer of the binding docs
        i2c: exynos5: correct top kerneldoc
        i2c: designware: Adjust bus_freq_hz when refuse high speed mode set
        i2c: hix5hd2: use the correct HiSilicon copyright
        i2c: gpio: update email address in binding docs
        i2c: imx: drop me as maintainer of binding docs
        i2c: stm32f4: Mundane typo fix
        I2C: JZ4780: Fix bug for Ingenic X1000.
        i2c: turn recovery error on init to debug
      12a0cf72
    • Naohiro Aota's avatar
      btrfs: zoned: move superblock logging zone location · 53b74fa9
      Naohiro Aota authored
      Moves the location of the superblock logging zones. The new locations of
      the logging zones are now determined based on fixed block addresses
      instead of on fixed zone numbers.
      
      The old placement method based on fixed zone numbers causes problems when
      one needs to inspect a file system image without access to the drive zone
      information. In such case, the super block locations cannot be reliably
      determined as the zone size is unknown. By locating the superblock logging
      zones using fixed addresses, we can scan a dumped file system image without
      the zone information since a super block copy will always be present at or
      after the fixed known locations.
      
      Introduce the following three pairs of zones containing fixed offset
      locations, regardless of the device zone size.
      
        - primary superblock: offset   0B (and the following zone)
        - first copy:         offset 512G (and the following zone)
        - Second copy:        offset   4T (4096G, and the following zone)
      
      If a logging zone is outside of the disk capacity, we do not record the
      superblock copy.
      
      The first copy position is much larger than for a non-zoned filesystem,
      which is at 64M.  This is to avoid overlapping with the log zones for
      the primary superblock. This higher location is arbitrary but allows
      supporting devices with very large zone sizes, plus some space around in
      between.
      
      Such large zone size is unrealistic and very unlikely to ever be seen in
      real devices. Currently, SMR disks have a zone size of 256MB, and we are
      expecting ZNS drives to be in the 1-4GB range, so this limit gives us
      room to breathe. For now, we only allow zone sizes up to 8GB. The
      maximum zone size that would still fit in the space is 256G.
      
      The fixed location addresses are somewhat arbitrary, with the intent of
      maintaining superblock reliability for smaller and larger devices, with
      the preference for the latter. For this reason, there are two superblocks
      under the first 1T. This should cover use cases for physical devices and
      for emulated/device-mapper devices.
      
      The superblock logging zones are reserved for superblock logging and
      never used for data or metadata blocks. Note that we only reserve the
      two zones per primary/copy actually used for superblock logging. We do
      not reserve the ranges of zones possibly containing superblocks with the
      largest supported zone size (0-16GB, 512G-528GB, 4096G-4112G).
      
      The zones containing the fixed location offsets used to store
      superblocks on a non-zoned volume are also reserved to avoid confusion.
      Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      53b74fa9
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · d4961772
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "Here's the latest pile of clk driver and clk framework fixes for this
        release:
      
         - Two clk framework fixes for a long standing issue in
           clk_notifier_{register,unregister}() where we used a pointer that
           was for a struct containing a list head when there was no container
           struct
      
         - A compile warning fix for socfpga that's good to have
      
         - A double free problem with devm registered fixed factor clks
      
         - One last fix to the Qualcomm camera clk driver to use the right clk
           ops so clks don't get stuck and stop working because the firmware
           takes them for a ride"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: fixed: fix double free in resource managed fixed-factor clock
        clk: fix invalid usage of list cursor in unregister
        clk: fix invalid usage of list cursor in register
        clk: qcom: camcc: Update the clock ops for the SC7180
        clk: socfpga: fix iomem pointer cast on 64-bit
      d4961772
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.12-2020-04-09' of... · 9288e1f7
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.12-2020-04-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tool fixes from Arnaldo Carvalho de Melo:
      
       - Fix wrong LBR block sorting in 'perf report'
      
       - Fix 'perf inject' repipe usage when consuming perf.data files
      
       - Avoid potential buffer overrun when decoding ARM SPE hardware tracing
         packets, bug found using a fuzzer
      
      * tag 'perf-tools-fixes-for-v5.12-2020-04-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf arm-spe: Avoid potential buffer overrun
        perf report: Fix wrong LBR block sorting
        perf inject: Fix repipe usage
      9288e1f7
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · adb2c417
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "14 patches.
      
        Subsystems affected by this patch series: mm (kasan, gup, pagecache,
        and kfence), MAINTAINERS, mailmap, nds32, gcov, ocfs2, ia64, and lib"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS
        kfence, x86: fix preemptible warning on KPTI-enabled systems
        lib/test_kasan_module.c: suppress unused var warning
        kasan: fix conflict with page poisoning
        fs: direct-io: fix missing sdio->boundary
        ia64: fix user_stack_pointer() for ptrace()
        ocfs2: fix deadlock between setattr and dio_end_io_write
        gcov: re-fix clang-11+ support
        nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
        mm/gup: check page posion status for coredump.
        .mailmap: fix old email addresses
        mailmap: update email address for Jordan Crouse
        treewide: change my e-mail address, fix my name
        MAINTAINERS: update CZ.NIC's Turris information
      adb2c417
  10. 09 Apr, 2021 1 commit
    • Linus Torvalds's avatar
      Merge tag 'net-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 4e04e751
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Networking fixes for 5.12-rc7, including fixes from can, ipsec,
        mac80211, wireless, and bpf trees.
      
        No scary regressions here or in the works, but small fixes for 5.12
        changes keep coming.
      
        Current release - regressions:
      
         - virtio: do not pull payload in skb->head
      
         - virtio: ensure mac header is set in virtio_net_hdr_to_skb()
      
         - Revert "net: correct sk_acceptq_is_full()"
      
         - mptcp: revert "mptcp: provide subflow aware release function"
      
         - ethernet: lan743x: fix ethernet frame cutoff issue
      
         - dsa: fix type was not set for devlink port
      
         - ethtool: remove link_mode param and derive link params from driver
      
         - sched: htb: fix null pointer dereference on a null new_q
      
         - wireless: iwlwifi: Fix softirq/hardirq disabling in
           iwl_pcie_enqueue_hcmd()
      
         - wireless: iwlwifi: fw: fix notification wait locking
      
         - wireless: brcmfmac: p2p: Fix deadlock introduced by avoiding the
           rtnl dependency
      
        Current release - new code bugs:
      
         - napi: fix hangup on napi_disable for threaded napi
      
         - bpf: take module reference for trampoline in module
      
         - wireless: mt76: mt7921: fix airtime reporting and related tx hangs
      
         - wireless: iwlwifi: mvm: rfi: don't lock mvm->mutex when sending
           config command
      
        Previous releases - regressions:
      
         - rfkill: revert back to old userspace API by default
      
         - nfc: fix infinite loop, refcount & memory leaks in LLCP sockets
      
         - let skb_orphan_partial wake-up waiters
      
         - xfrm/compat: Cleanup WARN()s that can be user-triggered
      
         - vxlan, geneve: do not modify the shared tunnel info when PMTU
           triggers an ICMP reply
      
         - can: fix msg_namelen values depending on CAN_REQUIRED_SIZE
      
         - can: uapi: mark union inside struct can_frame packed
      
         - sched: cls: fix action overwrite reference counting
      
         - sched: cls: fix err handler in tcf_action_init()
      
         - ethernet: mlxsw: fix ECN marking in tunnel decapsulation
      
         - ethernet: nfp: Fix a use after free in nfp_bpf_ctrl_msg_rx
      
         - ethernet: i40e: fix receiving of single packets in xsk zero-copy
           mode
      
         - ethernet: cxgb4: avoid collecting SGE_QBASE regs during traffic
      
        Previous releases - always broken:
      
         - bpf: Refuse non-O_RDWR flags in BPF_OBJ_GET
      
         - bpf: Refcount task stack in bpf_get_task_stack
      
         - bpf, x86: Validate computation of branch displacements
      
         - ieee802154: fix many similar syzbot-found bugs
             - fix NULL dereferences in netlink attribute handling
             - reject unsupported operations on monitor interfaces
             - fix error handling in llsec_key_alloc()
      
         - xfrm: make ipv4 pmtu check honor ip header df
      
         - xfrm: make hash generation lock per network namespace
      
         - xfrm: esp: delete NETIF_F_SCTP_CRC bit from features for esp
           offload
      
         - ethtool: fix incorrect datatype in set_eee ops
      
         - xdp: fix xdp_return_frame() kernel BUG throw for page_pool memory
           model
      
         - openvswitch: fix send of uninitialized stack memory in ct limit
           reply
      
        Misc:
      
         - udp: add get handling for UDP_GRO sockopt"
      
      * tag 'net-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (182 commits)
        net: fix hangup on napi_disable for threaded napi
        net: hns3: Trivial spell fix in hns3 driver
        lan743x: fix ethernet frame cutoff issue
        net: ipv6: check for validity before dereferencing cfg->fc_nlinfo.nlh
        net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits
        net: dsa: lantiq_gswip: Don't use PHY auto polling
        net: sched: sch_teql: fix null-pointer dereference
        ipv6: report errors for iftoken via netlink extack
        net: sched: fix err handler in tcf_action_init()
        net: sched: fix action overwrite reference counting
        Revert "net: sched: bump refcount for new action in ACT replace mode"
        ice: fix memory leak of aRFS after resuming from suspend
        i40e: Fix sparse warning: missing error code 'err'
        i40e: Fix sparse error: 'vsi->netdev' could be null
        i40e: Fix sparse error: uninitialized symbol 'ring'
        i40e: Fix sparse errors in i40e_txrx.c
        i40e: Fix parameters in aq_get_phy_register()
        nl80211: fix beacon head validation
        bpf, x86: Validate computation of branch displacements for x86-32
        bpf, x86: Validate computation of branch displacements for x86-64
        ...
      4e04e751