Skip to content

Commit 72dc7c0

Browse files
committed
Merge tag 'amd-drm-next-6.16-2025-05-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amdgpu: - Misc code cleanups - UserQ fixes - MALL reporting fix - DP AUX fixes - DCN 3.5 fixes - DP MST fixes - DC DMI quirks cleanup - RAS fixes - SR-IOV updates - GC 9.5 updates - Misc display fixes - VCN 4.0.5 powergating race fix - SMU 13.x updates - Paritioning fixes - VCN 5.0.1 SR-IOV updates - JPEG 5.0.1 SR-IOV updates amdkfd: - Fix spurious warning in interrupt code - XNACK fixes radeon: - CIK doorbell cleanup Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents 5dca433 + 2f0268c commit 72dc7c0

File tree

114 files changed

+2043
-1128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2043
-1128
lines changed

Documentation/gpu/amdgpu/amdgpu-glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ we have a dedicated glossary for Display Core at
182182
SMU/SMC
183183
System Management Unit / System Management Controller
184184

185-
SPI
185+
SPI (AMDGPU)
186186
Shader Processor Input
187187

188188
SRLC

drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
281281
case ATOM_DGPU_VRAM_TYPE_GDDR6:
282282
vram_type = AMDGPU_VRAM_TYPE_GDDR6;
283283
break;
284+
case ATOM_DGPU_VRAM_TYPE_HBM3E:
285+
vram_type = AMDGPU_VRAM_TYPE_HBM3E;
286+
break;
284287
default:
285288
vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
286289
break;

drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int amdgpu_unmap_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,
109109
struct drm_exec exec;
110110
int r;
111111

112-
drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0);
112+
drm_exec_init(&exec, 0, 0);
113113
drm_exec_until_all_locked(&exec) {
114114
r = amdgpu_vm_lock_pd(vm, &exec, 0);
115115
if (likely(!r))

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,6 +2105,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
21052105
amdgpu_rap_debugfs_init(adev);
21062106
amdgpu_securedisplay_debugfs_init(adev);
21072107
amdgpu_fw_attestation_debugfs_init(adev);
2108+
amdgpu_psp_debugfs_init(adev);
21082109

21092110
debugfs_create_file("amdgpu_evict_vram", 0400, root, adev,
21102111
&amdgpu_evict_vram_fops);

drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void amdgpu_eviction_fence_destroy(struct amdgpu_eviction_fence_mgr *evf_mgr)
183183
dma_fence_wait(&ev_fence->base, false);
184184

185185
/* Last unref of ev_fence */
186-
dma_fence_put(&evf_mgr->ev_fence->base);
186+
dma_fence_put(&ev_fence->base);
187187
}
188188

189189
int amdgpu_eviction_fence_attach(struct amdgpu_eviction_fence_mgr *evf_mgr,

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
*/
6363
#define AMDGPU_GMC_FAULT_TIMEOUT 5000ULL
6464

65+
/* XNACK flags */
66+
#define AMDGPU_GMC_XNACK_FLAG_CHAIN BIT(0)
67+
6568
struct firmware;
6669

6770
enum amdgpu_memory_partition {
@@ -301,6 +304,7 @@ struct amdgpu_gmc {
301304
struct amdgpu_xgmi xgmi;
302305
struct amdgpu_irq_src ecc_irq;
303306
int noretry;
307+
uint32_t xnack_flags;
304308

305309
uint32_t vmid0_page_table_block_size;
306310
uint32_t vmid0_page_table_depth;

drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,10 @@ int amdgpu_irq_get(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
619619
int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
620620
unsigned int type)
621621
{
622+
/* When the threshold is reached,the interrupt source may not be enabled.return -EINVAL */
623+
if (amdgpu_ras_is_rma(adev))
624+
return -EINVAL;
625+
622626
if (!adev->irq.installed)
623627
return -ENOENT;
624628

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,16 +1425,16 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
14251425
mutex_init(&fpriv->bo_list_lock);
14261426
idr_init_base(&fpriv->bo_list_handles, 1);
14271427

1428+
r = amdgpu_userq_mgr_init(&fpriv->userq_mgr, file_priv, adev);
1429+
if (r)
1430+
DRM_WARN("Can't setup usermode queues, use legacy workload submission only\n");
1431+
14281432
r = amdgpu_eviction_fence_init(&fpriv->evf_mgr);
14291433
if (r)
14301434
goto error_vm;
14311435

14321436
amdgpu_ctx_mgr_init(&fpriv->ctx_mgr, adev);
14331437

1434-
r = amdgpu_userq_mgr_init(&fpriv->userq_mgr, file_priv, adev);
1435-
if (r)
1436-
DRM_WARN("Can't setup usermode queues, use legacy workload submission only\n");
1437-
14381438
file_priv->driver_priv = fpriv;
14391439
goto out_suspend;
14401440

@@ -1502,10 +1502,11 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
15021502
amdgpu_bo_unreserve(pd);
15031503
}
15041504

1505-
fpriv->evf_mgr.fd_closing = true;
1506-
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
1507-
amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
1508-
1505+
if (!fpriv->evf_mgr.fd_closing) {
1506+
fpriv->evf_mgr.fd_closing = true;
1507+
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
1508+
amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
1509+
}
15091510
amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
15101511
amdgpu_vm_fini(adev, &fpriv->vm);
15111512

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,8 @@ static const char * const amdgpu_vram_names[] = {
10441044
"GDDR6",
10451045
"DDR5",
10461046
"LPDDR4",
1047-
"LPDDR5"
1047+
"LPDDR5",
1048+
"HBM3E"
10481049
};
10491050

10501051
/**

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,6 +4186,110 @@ const struct attribute_group amdgpu_flash_attr_group = {
41864186
.is_visible = amdgpu_flash_attr_is_visible,
41874187
};
41884188

4189+
#if defined(CONFIG_DEBUG_FS)
4190+
static int psp_read_spirom_debugfs_open(struct inode *inode, struct file *filp)
4191+
{
4192+
struct amdgpu_device *adev = filp->f_inode->i_private;
4193+
struct spirom_bo *bo_triplet;
4194+
int ret;
4195+
4196+
/* serialize the open() file calling */
4197+
if (!mutex_trylock(&adev->psp.mutex))
4198+
return -EBUSY;
4199+
4200+
/*
4201+
* make sure only one userpace process is alive for dumping so that
4202+
* only one memory buffer of AMD_VBIOS_FILE_MAX_SIZE * 2 is consumed.
4203+
* let's say the case where one process try opening the file while
4204+
* another one has proceeded to read or release. In this way, eliminate
4205+
* the use of mutex for read() or release() callback as well.
4206+
*/
4207+
if (adev->psp.spirom_dump_trip) {
4208+
mutex_unlock(&adev->psp.mutex);
4209+
return -EBUSY;
4210+
}
4211+
4212+
bo_triplet = kzalloc(sizeof(struct spirom_bo), GFP_KERNEL);
4213+
if (!bo_triplet) {
4214+
mutex_unlock(&adev->psp.mutex);
4215+
return -ENOMEM;
4216+
}
4217+
4218+
ret = amdgpu_bo_create_kernel(adev, AMD_VBIOS_FILE_MAX_SIZE_B * 2,
4219+
AMDGPU_GPU_PAGE_SIZE,
4220+
AMDGPU_GEM_DOMAIN_GTT,
4221+
&bo_triplet->bo,
4222+
&bo_triplet->mc_addr,
4223+
&bo_triplet->cpu_addr);
4224+
if (ret)
4225+
goto rel_trip;
4226+
4227+
ret = psp_dump_spirom(&adev->psp, bo_triplet->mc_addr);
4228+
if (ret)
4229+
goto rel_bo;
4230+
4231+
adev->psp.spirom_dump_trip = bo_triplet;
4232+
mutex_unlock(&adev->psp.mutex);
4233+
return 0;
4234+
rel_bo:
4235+
amdgpu_bo_free_kernel(&bo_triplet->bo, &bo_triplet->mc_addr,
4236+
&bo_triplet->cpu_addr);
4237+
rel_trip:
4238+
kfree(bo_triplet);
4239+
mutex_unlock(&adev->psp.mutex);
4240+
dev_err(adev->dev, "Trying IFWI dump fails, err = %d\n", ret);
4241+
return ret;
4242+
}
4243+
4244+
static ssize_t psp_read_spirom_debugfs_read(struct file *filp, char __user *buf, size_t size,
4245+
loff_t *pos)
4246+
{
4247+
struct amdgpu_device *adev = filp->f_inode->i_private;
4248+
struct spirom_bo *bo_triplet = adev->psp.spirom_dump_trip;
4249+
4250+
if (!bo_triplet)
4251+
return -EINVAL;
4252+
4253+
return simple_read_from_buffer(buf,
4254+
size,
4255+
pos, bo_triplet->cpu_addr,
4256+
AMD_VBIOS_FILE_MAX_SIZE_B * 2);
4257+
}
4258+
4259+
static int psp_read_spirom_debugfs_release(struct inode *inode, struct file *filp)
4260+
{
4261+
struct amdgpu_device *adev = filp->f_inode->i_private;
4262+
struct spirom_bo *bo_triplet = adev->psp.spirom_dump_trip;
4263+
4264+
if (bo_triplet) {
4265+
amdgpu_bo_free_kernel(&bo_triplet->bo, &bo_triplet->mc_addr,
4266+
&bo_triplet->cpu_addr);
4267+
kfree(bo_triplet);
4268+
}
4269+
4270+
adev->psp.spirom_dump_trip = NULL;
4271+
return 0;
4272+
}
4273+
4274+
static const struct file_operations psp_dump_spirom_debugfs_ops = {
4275+
.owner = THIS_MODULE,
4276+
.open = psp_read_spirom_debugfs_open,
4277+
.read = psp_read_spirom_debugfs_read,
4278+
.release = psp_read_spirom_debugfs_release,
4279+
.llseek = default_llseek,
4280+
};
4281+
#endif
4282+
4283+
void amdgpu_psp_debugfs_init(struct amdgpu_device *adev)
4284+
{
4285+
#if defined(CONFIG_DEBUG_FS)
4286+
struct drm_minor *minor = adev_to_drm(adev)->primary;
4287+
4288+
debugfs_create_file_size("psp_spirom_dump", 0444, minor->debugfs_root,
4289+
adev, &psp_dump_spirom_debugfs_ops, AMD_VBIOS_FILE_MAX_SIZE_B * 2);
4290+
#endif
4291+
}
4292+
41894293
const struct amd_ip_funcs psp_ip_funcs = {
41904294
.name = "psp",
41914295
.early_init = psp_early_init,

0 commit comments

Comments
 (0)