1. 16 9月, 2020 1 次提交
  2. 03 9月, 2020 1 次提交
  3. 31 8月, 2020 1 次提交
  4. 27 8月, 2020 1 次提交
  5. 24 8月, 2020 3 次提交
  6. 12 8月, 2020 2 次提交
  7. 06 8月, 2020 6 次提交
  8. 31 7月, 2020 4 次提交
  9. 29 7月, 2020 1 次提交
  10. 28 7月, 2020 2 次提交
    • C
      drm/radeon: switch from 'pci_' to 'dma_' API · 4c0d0bcb
      Christophe JAILLET 提交于
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below and has been
      hand modified to replace GFP_ with a correct flag.
      It has been compile tested.
      
      When memory is allocated in 'radeon_gart_table_ram_alloc()' GFP_KERNEL
      can be used because its callers already use this flag.
      
      Both 'r100_pci_gart_init()' (r100.c) and 'rs400_gart_init()' (rs400.c)
      call 'radeon_gart_init()'.
      This function uses 'vmalloc'.
      
      @@
      @@
      -    PCI_DMA_BIDIRECTIONAL
      +    DMA_BIDIRECTIONAL
      
      @@
      @@
      -    PCI_DMA_TODEVICE
      +    DMA_TO_DEVICE
      
      @@
      @@
      -    PCI_DMA_FROMDEVICE
      +    DMA_FROM_DEVICE
      
      @@
      @@
      -    PCI_DMA_NONE
      +    DMA_NONE
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_alloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3;
      @@
      -    pci_zalloc_consistent(e1, e2, e3)
      +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_free_consistent(e1, e2, e3, e4)
      +    dma_free_coherent(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_single(e1, e2, e3, e4)
      +    dma_map_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_single(e1, e2, e3, e4)
      +    dma_unmap_single(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4, e5;
      @@
      -    pci_map_page(e1, e2, e3, e4, e5)
      +    dma_map_page(&e1->dev, e2, e3, e4, e5)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_page(e1, e2, e3, e4)
      +    dma_unmap_page(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_map_sg(e1, e2, e3, e4)
      +    dma_map_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_unmap_sg(e1, e2, e3, e4)
      +    dma_unmap_sg(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
      +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
      +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
      +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2, e3, e4;
      @@
      -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
      +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
      
      @@
      expression e1, e2;
      @@
      -    pci_dma_mapping_error(e1, e2)
      +    dma_mapping_error(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      4c0d0bcb
    • C
      drm/radeon: avoid a useless memset · f5cd8555
      Christophe JAILLET 提交于
      Avoid a memset after a call to 'dma_alloc_coherent()'.
      This is useless since
      commit 518a2f19 ("dma-mapping: zero memory returned from dma_alloc_*")
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      f5cd8555
  11. 22 7月, 2020 1 次提交
  12. 21 7月, 2020 2 次提交
  13. 13 7月, 2020 1 次提交
    • M
      drm: radeon: fix common struct sg_table related issues · 7b814900
      Marek Szyprowski 提交于
      The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function
      returns the number of the created entries in the DMA address space.
      However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and
      dma_unmap_sg must be called with the original number of the entries
      passed to the dma_map_sg().
      
      struct sg_table is a common structure used for describing a non-contiguous
      memory buffer, used commonly in the DRM and graphics subsystems. It
      consists of a scatterlist with memory pages and DMA addresses (sgl entry),
      as well as the number of scatterlist entries: CPU pages (orig_nents entry)
      and DMA mapped pages (nents entry).
      
      It turned out that it was a common mistake to misuse nents and orig_nents
      entries, calling DMA-mapping functions with a wrong number of entries or
      ignoring the number of mapped entries returned by the dma_map_sg()
      function.
      
      To avoid such issues, lets use a common dma-mapping wrappers operating
      directly on the struct sg_table objects and use scatterlist page
      iterators where possible. This, almost always, hides references to the
      nents and orig_nents entries, making the code robust, easier to follow
      and copy/paste safe.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Link: https://patchwork.freedesktop.org/patch/371172/Signed-off-by: NChristian König <christian.koenig@amd.com>
      7b814900
  14. 10 7月, 2020 1 次提交
    • T
      drm/radeon: fix double free · 41855a89
      Tom Rix 提交于
      clang static analysis flags this error
      
      drivers/gpu/drm/radeon/ci_dpm.c:5652:9: warning: Use of memory after it is freed [unix.Malloc]
                      kfree(rdev->pm.dpm.ps[i].ps_priv);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/radeon/ci_dpm.c:5654:2: warning: Attempt to free released memory [unix.Malloc]
              kfree(rdev->pm.dpm.ps);
              ^~~~~~~~~~~~~~~~~~~~~~
      
      problem is reported in ci_dpm_fini, with these code blocks.
      
      	for (i = 0; i < rdev->pm.dpm.num_ps; i++) {
      		kfree(rdev->pm.dpm.ps[i].ps_priv);
      	}
      	kfree(rdev->pm.dpm.ps);
      
      The first free happens in ci_parse_power_table where it cleans up locally
      on a failure.  ci_dpm_fini also does a cleanup.
      
      	ret = ci_parse_power_table(rdev);
      	if (ret) {
      		ci_dpm_fini(rdev);
      		return ret;
      	}
      
      So remove the cleanup in ci_parse_power_table and
      move the num_ps calculation to inside the loop so ci_dpm_fini
      will know how many array elements to free.
      
      Fixes: cc8dbbb4 ("drm/radeon: add dpm support for CI dGPUs (v2)")
      Signed-off-by: NTom Rix <trix@redhat.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      41855a89
  15. 08 7月, 2020 2 次提交
    • T
      drm/radeon: fix double free · 99010fac
      Tom Rix 提交于
      clang static analysis flags this error
      
      drivers/gpu/drm/radeon/ci_dpm.c:5652:9: warning: Use of memory after it is freed [unix.Malloc]
                      kfree(rdev->pm.dpm.ps[i].ps_priv);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/gpu/drm/radeon/ci_dpm.c:5654:2: warning: Attempt to free released memory [unix.Malloc]
              kfree(rdev->pm.dpm.ps);
              ^~~~~~~~~~~~~~~~~~~~~~
      
      problem is reported in ci_dpm_fini, with these code blocks.
      
      	for (i = 0; i < rdev->pm.dpm.num_ps; i++) {
      		kfree(rdev->pm.dpm.ps[i].ps_priv);
      	}
      	kfree(rdev->pm.dpm.ps);
      
      The first free happens in ci_parse_power_table where it cleans up locally
      on a failure.  ci_dpm_fini also does a cleanup.
      
      	ret = ci_parse_power_table(rdev);
      	if (ret) {
      		ci_dpm_fini(rdev);
      		return ret;
      	}
      
      So remove the cleanup in ci_parse_power_table and
      move the num_ps calculation to inside the loop so ci_dpm_fini
      will know how many array elements to free.
      
      Fixes: cc8dbbb4 ("drm/radeon: add dpm support for CI dGPUs (v2)")
      Signed-off-by: NTom Rix <trix@redhat.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      99010fac
    • T
      gpu/drm: Remove debug info about CPU address · e241df69
      Tiezhu Yang 提交于
      When I update the latest kernel, I see the following "____ptrval____" boot
      messages.
      
      [    1.872600] radeon 0000:01:05.0: fence driver on ring 0 use gpu addr 0x0000000048000c00 and cpu addr 0x(____ptrval____)
      [    1.879095] radeon 0000:01:05.0: fence driver on ring 5 use gpu addr 0x0000000040056038 and cpu addr 0x(____ptrval____)
      
      Both radeon_fence_driver_start_ring() and amdgpu_fence_driver_start_ring()
      have the similar issue, there exists the following two methods to solve it:
      (1) Use "%pK" instead of "%p" so that the CPU address can be printed when
      the kptr_restrict sysctl is set to 1.
      (2) Just completely drop the CPU address suggested by Christian, because
      the CPU address was useful in the past, but isn't any more. We now have a
      debugfs file to read the current fence values.
      
      Since the CPU address is not much useful, just remove the debug info about
      CPU address.
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NTiezhu Yang <yangtiezhu@loongson.cn>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      e241df69
  16. 01 7月, 2020 5 次提交
  17. 25 6月, 2020 1 次提交
  18. 24 6月, 2020 1 次提交
  19. 10 6月, 2020 1 次提交
  20. 29 5月, 2020 3 次提交