1. 23 Sep, 2021 6 commits
    • Philip Yang's avatar
      drm/amdkfd: fix svm_migrate_fini warning · 197ae177
      Philip Yang authored
      Device manager releases device-specific resources when a driver
      disconnects from a device, devm_memunmap_pages and
      devm_release_mem_region calls in svm_migrate_fini are redundant.
      It causes below warning trace after patch "drm/amdgpu: Split
      amdgpu_device_fini into early and late", so remove function
      BUG: drm/amd#1718
      WARNING: CPU: 1 PID: 3646 at drivers/base/devres.c:795
      Call Trace:
          ? memunmap_pages+0x360/0x360
          svm_migrate_fini+0x2d/0x60 [amdgpu]
          kgd2kfd_device_exit+0x23/0xa0 [amdgpu]
          amdgpu_amdkfd_device_fini_sw+0x1d/0x30 [amdgpu]
          amdgpu_device_fini_sw+0x45/0x290 [amdgpu]
          amdgpu_driver_release_kms+0x12/0x30 [amdgpu]
          drm_dev_release+0x20/0x40 [drm]
          amdgpu_exit+0x11/0x20 [amdgpu]
      Signed-off-by: Philip Yang's avatarPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: Felix Kuehling's avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    • Philip Yang's avatar
      drm/amdkfd: handle svm migrate init error · 7d668720
      Philip Yang authored
      If svm migration init failed to create pgmap for device memory, set
      pgmap type to 0 to disable device SVM support capability.
      Signed-off-by: Philip Yang's avatarPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: Felix Kuehling's avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    • lijo lazar's avatar
      drm/amd/pm: Update intermediate power state for SI · ab39d3ce
      lijo lazar authored
      Update the current state as boot state during dpm initialization.
      During the subsequent initialization, set_power_state gets called to
      transition to the final power state. set_power_state refers to values
      from the current state and without current state populated, it could
      result in NULL pointer dereference.
      For ex: on platforms where PCI speed change is supported through ACPI
      ATCS method, the link speed of current state needs to be queried before
      deciding on changing to final power state's link speed. The logic to query
      ATCS-support was broken on certain platforms. The issue became visible
      when broken ATCS-support logic got fixed with commit
      f9b7f370 ("drm/amdgpu/acpi: make ATPX/ATCS structures global (v2)").
      Bug: drm/amd#1698
      Signed-off-by: lijo lazar's avatarLijo Lazar <lijo.lazar@amd.com>
      Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
    • Philip Yang's avatar
      drm/amdkfd: fix dma mapping leaking warning · f6325118
      Philip Yang authored
      For xnack off, restore work dma unmap previous system memory page, and
      dma map the updated system memory page to update GPU mapping, this is
      not dma mapping leaking, remove the WARN_ONCE for dma mapping leaking.
      prange->dma_addr store the VRAM page pfn after the range migrated to
      VRAM, should not dma unmap VRAM page when updating GPU mapping or
      remove prange. Add helper svm_is_valid_dma_mapping_addr to check VRAM
      page and error cases.
      Mask out SVM_RANGE_VRAM_DOMAIN flag in dma_addr before calling amdgpu vm
      update to avoid BUG_ON(*addr & 0xFFFF00000000003FULL), and set it again
      immediately after. This flag is used to know the type of page later to
      dma unmapping system memory page.
      Fixes: 1d5dbfe6
       ("drm/amdkfd: classify and map mixed svm range pages in GPU")
      Signed-off-by: Philip Yang's avatarPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: Felix Kuehling's avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    • Philip Yang's avatar
      drm/amdkfd: SVM map to gpus check vma boundary · 7beb26dc
      Philip Yang authored
      SVM range may includes multiple VMAs with different vm_flags, if prange
      page index is the last page of the VMA offset + npages, update GPU
      mapping to create GPU page table with same VMA access permission.
      Signed-off-by: Philip Yang's avatarPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: Felix Kuehling's avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    • Arnd Bergmann's avatar
      drm/amd/display: fix empty debug macros · c48977f0
      Arnd Bergmann authored
      Using an empty macro expansion as a conditional expression
      produces a W=1 warning:
      drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 'dce_aux_transfer_with_retries':
      drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:156: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
        775 |                                                                 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER");
            |                                                                                                                                                            ^
      drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:783:155: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
        783 |                                                                 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK");
            |                                                                                                                                                           ^
      Expand it to "do { } while (0)" instead to make the expression
      more robust and avoid the warning.
      Fixes: 56aca230
       ("drm/amd/display: Add AUX I2C tracing.")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
  2. 19 Sep, 2021 3 commits
  3. 18 Sep, 2021 2 commits
    • Linus Torvalds's avatar
      tgafb: clarify dependencies · cd395d52
      Linus Torvalds authored
      The TGA boards were based on the DECchip 21030 PCI graphics accelerator
      used mainly for alpha, and existed in a TURBOchannel (TC) version for
      the DECstation (MIPS) workstations.
      However, the config option for the TGA code is a bit confused, and says
      	depends on FB && (ALPHA || TC)
      because people didn't really want to enable the option for random PCI
      environments, so the "ALPHA" stands in for that case (while the TC case
      is then the MIPS DECstation case).
      So that config dependency is kind of a mixture of architecture and bus
      choices.  But it's incorrect, in that there were non-PCI-based alpha
      hardware, and then the driver just causes warnings:
        drivers/video/fbdev/tgafb.c:1532:13: error: ‘tgafb_unregister’ defined but not used [-Werror=unused-function]
         1532 | static void tgafb_unregister(struct device *dev)
              |             ^~~~~~~~~~~~~~~~
        drivers/video/fbdev/tgafb.c:1387:12: error: ‘tgafb_register’ defined but not used [-Werror=unused-function]
         1387 | static int tgafb_register(struct device *dev)
              |            ^~~~~~~~~~~~~~
      so let's make the config option dependencies a bit more explict:
      	depends on FB
      	depends on PCI || TC
      	depends on ALPHA || TC
      where that first "FB" is the software configuration dependency, the
      second "PCI || TC" is the hardware bus dependency, while that final
      "ALPHA || TC" dependency is the "don't bother asking except for these
      We could make that third case have "COMPILE_TEST" as an option, and mark
      the register/unregister functions as __maybe_unused, but I'm not sure
      it's really worth it.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Linus Torvalds's avatar
      spi: Fix tegra20 build with CONFIG_PM=n · efafec27
      Linus Torvalds authored
      Without CONFIG_PM enabled, the SET_RUNTIME_PM_OPS() macro ends up being
      empty, and the only use of tegra_slink_runtime_{resume,suspend} goes
      away, resulting in
        drivers/spi/spi-tegra20-slink.c:1200:12: error: ‘tegra_slink_runtime_resume’ defined but not used [-Werror=unused-function]
         1200 | static int tegra_slink_runtime_resume(struct device *dev)
              |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
        drivers/spi/spi-tegra20-slink.c:1188:12: error: ‘tegra_slink_runtime_suspend’ defined but not used [-Werror=unused-function]
         1188 | static int tegra_slink_runtime_suspend(struct device *dev)
              |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      mark the functions __maybe_unused to make the build happy.
      This hits the alpha allmodconfig build (and others).
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  4. 17 Sep, 2021 1 commit
  5. 16 Sep, 2021 28 commits