1. 16 9月, 2020 1 次提交
  2. 04 9月, 2020 1 次提交
    • X
      drm/amdgpu: Fix a redundant kfree · 3d7248d7
      xinhui pan 提交于
      drm_dev_alloc() alloc *dev* and set managed.final_kfree to dev to free
      itself.
      Now from commit 5cdd68498918("drm/amdgpu: Embed drm_device into
      amdgpu_device (v3)") we alloc *adev* and ddev is just a member of it.
      So drm_dev_release try to free a wrong pointer then.
      
      Also driver's release trys to free adev, but drm_dev_release will
      access dev after call drvier's release.
      
      To fix it, remove driver's release and set managed.final_kfree to adev.
      
      [   36.269348] BUG: unable to handle page fault for address: ffffa0c279940028
      [   36.276841] #PF: supervisor read access in kernel mode
      [   36.282434] #PF: error_code(0x0000) - not-present page
      [   36.288053] PGD 676601067 P4D 676601067 PUD 86a414067 PMD 86a247067 PTE 800ffff8066bf060
      [   36.296868] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI
      [   36.302409] CPU: 4 PID: 1375 Comm: bash Tainted: G           O      5.9.0-rc2+ #46
      [   36.310670] Hardware name: System manufacturer System Product Name/PRIME Z390-A, BIOS 1401 11/26/2019
      [   36.320725] RIP: 0010:drm_managed_release+0x25/0x110 [drm]
      [   36.326741] Code: 80 00 00 00 00 0f 1f 44 00 00 55 48 c7 c2 5a 9f 41 c0 be 00 02 00 00 48 89 e5 41 57 41 56 41 55 41 54 49 89 fc 53 48 83 ec 08 <48> 8b 7f 18 e8 c2 10 ff ff 4d 8b 74 24 20 49 8d 44 24 5
      [   36.347217] RSP: 0018:ffffb9424141fce0 EFLAGS: 00010282
      [   36.352931] RAX: 0000000000000006 RBX: ffffa0c279940010 RCX: 0000000000000006
      [   36.360718] RDX: ffffffffc0419f5a RSI: 0000000000000200 RDI: ffffa0c279940010
      [   36.368503] RBP: ffffb9424141fd10 R08: 0000000000000001 R09: 0000000000000001
      [   36.376304] R10: 0000000000000000 R11: 0000000000000000 R12: ffffa0c279940010
      [   36.384070] R13: ffffffffc0e2a000 R14: ffffa0c26924e220 R15: fffffffffffffff2
      [   36.391845] FS:  00007fc4a277b740(0000) GS:ffffa0c288e00000(0000) knlGS:0000000000000000
      [   36.400669] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   36.406937] CR2: ffffa0c279940028 CR3: 0000000792304006 CR4: 00000000003706e0
      [   36.414732] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   36.422550] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   36.430354] Call Trace:
      [   36.433044]  drm_dev_put.part.0+0x40/0x60 [drm]
      [   36.438017]  drm_dev_put+0x13/0x20 [drm]
      [   36.442398]  amdgpu_pci_remove+0x56/0x60 [amdgpu]
      [   36.447528]  pci_device_remove+0x3e/0xb0
      [   36.451807]  device_release_driver_internal+0xff/0x1d0
      [   36.457416]  device_release_driver+0x12/0x20
      [   36.462094]  pci_stop_bus_device+0x70/0xa0
      [   36.466588]  pci_stop_and_remove_bus_device_locked+0x1b/0x30
      [   36.472786]  remove_store+0x7b/0x90
      [   36.476614]  dev_attr_store+0x17/0x30
      [   36.480646]  sysfs_kf_write+0x4b/0x60
      [   36.484655]  kernfs_fop_write+0xe8/0x1d0
      [   36.488952]  vfs_write+0xf5/0x230
      [   36.492562]  ksys_write+0x70/0xf0
      [   36.496206]  __x64_sys_write+0x1a/0x20
      [   36.500292]  do_syscall_64+0x38/0x90
      [   36.504219]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: Nxinhui pan <xinhui.pan@amd.com>
      Acked-by: NAlex Deucher <alexancer.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      3d7248d7
  3. 27 8月, 2020 2 次提交
    • H
      drm/amdkfd: implement the dGPU fallback path for apu (v6) · 6127896f
      Huang Rui 提交于
      We still have a few iommu issues which need to address, so force raven
      as "dgpu" path for the moment.
      
      This is to add the fallback path to bypass IOMMU if IOMMU v2 is disabled
      or ACPI CRAT table not correct.
      
      v2: Use ignore_crat parameter to decide whether it will go with IOMMUv2.
      v3: Align with existed thunk, don't change the way of raven, only renoir
          will use "dgpu" path by default.
      v4: don't update global ignore_crat in the driver, and revise fallback
          function if CRAT is broken.
      v5: refine acpi crat good but no iommu support case, and rename the
          title.
      v6: fix the issue of dGPU initialized firstly, just modify the report
          value in the node_show().
      Signed-off-by: NHuang Rui <ray.huang@amd.com>
      Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      6127896f
    • L
      drm/amdgpu: Embed drm_device into amdgpu_device (v3) · 8aba21b7
      Luben Tuikov 提交于
      a) Embed struct drm_device into struct amdgpu_device.
      b) Modify the inline-f drm_to_adev() accordingly.
      c) Modify the inline-f adev_to_drm() accordingly.
      d) Eliminate the use of drm_device.dev_private,
         in amdgpu.
      e) Switch from using drm_dev_alloc() to
         drm_dev_init().
      f) Add a DRM driver release function, which frees
         the container amdgpu_device after all krefs on
         the contained drm_device have been released.
      
      v2: Split out adding adev_to_drm() into its own
          patch (previous commit), making this patch
          more succinct and clear. More detailed commit
          description.
      v3: squash in fix to call drmm_add_final_kfree()
          to avoid a warning.
      Signed-off-by: NLuben Tuikov <luben.tuikov@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      8aba21b7
  4. 25 8月, 2020 1 次提交
  5. 07 8月, 2020 2 次提交
  6. 05 8月, 2020 2 次提交
  7. 28 7月, 2020 1 次提交
  8. 22 7月, 2020 1 次提交
  9. 16 7月, 2020 1 次提交
  10. 01 7月, 2020 4 次提交
  11. 22 5月, 2020 1 次提交
  12. 18 5月, 2020 1 次提交
  13. 09 5月, 2020 4 次提交
  14. 29 4月, 2020 3 次提交
  15. 28 4月, 2020 1 次提交
  16. 10 3月, 2020 1 次提交
  17. 29 2月, 2020 2 次提交
    • Y
      drm/amdgpu: release drm_device after amdgpu_driver_unload_kms · 6c26d558
      Yintian Tao 提交于
      If we release drm_device before amdgpu_driver_unload_kms,
      then it will raise the error below. Therefore, we need to
      place it before amdgpu_driver_unload_kms.
      [   43.055736] Memory manager not clean during takedown.
      [   43.055777] WARNING: CPU: 1 PID: 2807 at /build/linux-hwe-9KJ07q/linux-hwe-4.18.0/drivers/gpu/drm/drm_mm.c:913 drm_mm_takedown+0x24/0x30 [drm]
      [   43.055778] Modules linked in: amdgpu(OE-) amd_sched(OE) amdttm(OE) amdkcl(OE) amd_iommu_v2 drm_kms_helper drm i2c_algo_bit fb_sys_fops syscopyarea sysfillrect sysimgblt snd_hda_codec_generic nfit kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_pcm ghash_clmulni_intel snd_seq_midi snd_seq_midi_event pcbc snd_rawmidi snd_seq snd_seq_device aesni_intel snd_timer joydev aes_x86_64 crypto_simd cryptd glue_helper snd soundcore input_leds mac_hid serio_raw qemu_fw_cfg binfmt_misc sch_fq_codel nfsd auth_rpcgss nfs_acl lockd grace sunrpc parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic floppy usbhid psmouse hid i2c_piix4 e1000 pata_acpi
      [   43.055819] CPU: 1 PID: 2807 Comm: modprobe Tainted: G           OE     4.18.0-15-generic #16~18.04.1-Ubuntu
      [   43.055820] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
      [   43.055830] RIP: 0010:drm_mm_takedown+0x24/0x30 [drm]
      [   43.055831] Code: 84 00 00 00 00 00 0f 1f 44 00 00 48 8b 47 38 48 83 c7 38 48 39 c7 75 02 f3 c3 55 48 c7 c7 38 33 80 c0 48 89 e5 e8 1c 41 ec d0 <0f> 0b 5d c3 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41
      [   43.055857] RSP: 0018:ffffae33c1393d28 EFLAGS: 00010286
      [   43.055859] RAX: 0000000000000000 RBX: ffff9651b4a29800 RCX: 0000000000000006
      [   43.055860] RDX: 0000000000000007 RSI: 0000000000000096 RDI: ffff9651bfc964b0
      [   43.055861] RBP: ffffae33c1393d28 R08: 00000000000002a6 R09: 0000000000000004
      [   43.055861] R10: ffffae33c1393d20 R11: 0000000000000001 R12: ffff9651ba6cb000
      [   43.055863] R13: ffff9651b7f40000 R14: ffffffffc0de3a10 R15: ffff9651ba5c6460
      [   43.055864] FS:  00007f1d3c08d540(0000) GS:ffff9651bfc80000(0000) knlGS:0000000000000000
      [   43.055865] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   43.055866] CR2: 00005630a5831640 CR3: 000000012e274004 CR4: 00000000003606e0
      [   43.055870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   43.055871] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   43.055871] Call Trace:
      [   43.055885]  drm_vma_offset_manager_destroy+0x1b/0x30 [drm]
      [   43.055894]  drm_gem_destroy+0x19/0x40 [drm]
      [   43.055903]  drm_dev_fini+0x7f/0x90 [drm]
      [   43.055911]  drm_dev_release+0x2b/0x40 [drm]
      [   43.055919]  drm_dev_unplug+0x64/0x80 [drm]
      [   43.055994]  amdgpu_pci_remove+0x39/0x70 [amdgpu]
      [   43.055998]  pci_device_remove+0x3e/0xc0
      [   43.056001]  device_release_driver_internal+0x18a/0x260
      [   43.056003]  driver_detach+0x3f/0x80
      [   43.056004]  bus_remove_driver+0x59/0xd0
      [   43.056006]  driver_unregister+0x2c/0x40
      [   43.056008]  pci_unregister_driver+0x22/0xa0
      [   43.056087]  amdgpu_exit+0x15/0x57c [amdgpu]
      [   43.056090]  __x64_sys_delete_module+0x146/0x280
      [   43.056094]  do_syscall_64+0x5a/0x120
      
      v2: put drm_dev_put after pci_set_drvdata
      Signed-off-by: NYintian Tao <yttao@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      6c26d558
    • Y
      drm/amdgpu: no need to clean debugfs at amdgpu · d2790e10
      Yintian Tao 提交于
      drm_minor_unregister will invoke drm_debugfs_cleanup
      to clean all the child node under primary minor node.
      We don't need to invoke amdgpu_debugfs_fini and
      amdgpu_debugfs_regs_cleanup to clean agian.
      Otherwise, it will raise the NULL pointer like below.
      [   45.046029] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
      [   45.047256] PGD 0 P4D 0
      [   45.047713] Oops: 0002 [#1] SMP PTI
      [   45.048198] CPU: 0 PID: 2796 Comm: modprobe Tainted: G        W  OE     4.18.0-15-generic #16~18.04.1-Ubuntu
      [   45.049538] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
      [   45.050651] RIP: 0010:down_write+0x1f/0x40
      [   45.051194] Code: 90 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb e8 ce d9 ff ff 48 ba 01 00 00 00 ff ff ff ff 48 89 d8 <f0> 48 0f c1 10 85 d2 74 05 e8 53 1c ff ff 65 48 8b 04 25 00 5c 01
      [   45.053702] RSP: 0018:ffffad8f4133fd40 EFLAGS: 00010246
      [   45.054384] RAX: 00000000000000a8 RBX: 00000000000000a8 RCX: ffffa011327dd814
      [   45.055349] RDX: ffffffff00000001 RSI: 0000000000000001 RDI: 00000000000000a8
      [   45.056346] RBP: ffffad8f4133fd48 R08: 0000000000000000 R09: ffffffffc0690a00
      [   45.057326] R10: ffffad8f4133fd58 R11: 0000000000000001 R12: ffffa0113cff0300
      [   45.058266] R13: ffffa0113c0a0000 R14: ffffffffc0c02a10 R15: ffffa0113e5c7860
      [   45.059221] FS:  00007f60d46f9540(0000) GS:ffffa0113fc00000(0000) knlGS:0000000000000000
      [   45.060809] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   45.061826] CR2: 00000000000000a8 CR3: 0000000136250004 CR4: 00000000003606f0
      [   45.062913] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   45.064404] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   45.065897] Call Trace:
      [   45.066426]  debugfs_remove+0x36/0xa0
      [   45.067131]  amdgpu_debugfs_ring_fini+0x15/0x20 [amdgpu]
      [   45.068019]  amdgpu_debugfs_fini+0x2c/0x50 [amdgpu]
      [   45.068756]  amdgpu_pci_remove+0x49/0x70 [amdgpu]
      [   45.069439]  pci_device_remove+0x3e/0xc0
      [   45.070037]  device_release_driver_internal+0x18a/0x260
      [   45.070842]  driver_detach+0x3f/0x80
      [   45.071325]  bus_remove_driver+0x59/0xd0
      [   45.071850]  driver_unregister+0x2c/0x40
      [   45.072377]  pci_unregister_driver+0x22/0xa0
      [   45.073043]  amdgpu_exit+0x15/0x57c [amdgpu]
      [   45.073683]  __x64_sys_delete_module+0x146/0x280
      [   45.074369]  do_syscall_64+0x5a/0x120
      [   45.074916]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      v2: remove all debugfs cleanup/fini code at amdgpu
      v3: squash in unused variable removal
      Signed-off-by: NYintian Tao <yttao@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      d2790e10
  18. 27 2月, 2020 3 次提交
  19. 13 2月, 2020 3 次提交
  20. 12 2月, 2020 1 次提交
  21. 24 1月, 2020 1 次提交
  22. 08 1月, 2020 3 次提交