Skip to content

Commit

Permalink
Revert "drm/amdkfd: fix set kfd node ras properties value"
Browse files Browse the repository at this point in the history
This reverts commit c56d0ef.

The reverted patch will cause rocrtst failed on Mi50 and Mi60.

Change-Id: I8cc5a1af1fd19322e325f02fc584a1b80a410660
Signed-off-by: Rui Teng <rui.teng@amd.com>
Reviewed-by: Stanley.Yang <Stanley.Yang@amd.com>
  • Loading branch information
Rui Teng committed Sep 1, 2020
1 parent 8393d0e commit 6e203d1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 31 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,6 @@ struct amdgpu_device {

atomic_t throttling_logging_enabled;
struct ratelimit_state throttling_logging_rs;
uint32_t ras_features;
};

static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev)
Expand Down
28 changes: 9 additions & 19 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
Original file line number Diff line number Diff line change
Expand Up @@ -1963,17 +1963,6 @@ int amdgpu_ras_request_reset_on_boot(struct amdgpu_device *adev,
return 0;
}

static int amdgpu_ras_check_asic_type(struct amdgpu_device *adev)
{
if (adev->asic_type != CHIP_VEGA10 &&
adev->asic_type != CHIP_VEGA20 &&
adev->asic_type != CHIP_ARCTURUS &&
adev->asic_type != CHIP_SIENNA_CICHLID)
return 1;
else
return 0;
}

/*
* check hardware's ras ability which will be saved in hw_supported.
* if hardware does not support ras, we can skip some ras initializtion and
Expand All @@ -1990,7 +1979,9 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev,
*supported = 0;

if (amdgpu_sriov_vf(adev) || !adev->is_atom_fw ||
amdgpu_ras_check_asic_type(adev))
(adev->asic_type != CHIP_VEGA20 &&
adev->asic_type != CHIP_ARCTURUS &&
adev->asic_type != CHIP_SIENNA_CICHLID))
return;

if (amdgpu_atomfirmware_mem_ecc_supported(adev)) {
Expand All @@ -2012,7 +2003,6 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev,

*supported = amdgpu_ras_enable == 0 ?
0 : *hw_supported & amdgpu_ras_mask;
adev->ras_features = *supported;
}

int amdgpu_ras_init(struct amdgpu_device *adev)
Expand All @@ -2035,9 +2025,9 @@ int amdgpu_ras_init(struct amdgpu_device *adev)

amdgpu_ras_check_supported(adev, &con->hw_supported,
&con->supported);
if (!con->hw_supported || (adev->asic_type == CHIP_VEGA10)) {
if (!con->hw_supported) {
r = 0;
goto release_con;
goto err_out;
}

con->features = 0;
Expand All @@ -2048,25 +2038,25 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
if (adev->nbio.funcs->init_ras_controller_interrupt) {
r = adev->nbio.funcs->init_ras_controller_interrupt(adev);
if (r)
goto release_con;
goto err_out;
}

if (adev->nbio.funcs->init_ras_err_event_athub_interrupt) {
r = adev->nbio.funcs->init_ras_err_event_athub_interrupt(adev);
if (r)
goto release_con;
goto err_out;
}

if (amdgpu_ras_fs_init(adev)) {
r = -EINVAL;
goto release_con;
goto err_out;
}

dev_info(adev->dev, "RAS INFO: ras initialized successfully, "
"hardware ability[%x] ras_mask[%x]\n",
con->hw_supported, con->supported);
return 0;
release_con:
err_out:
amdgpu_ras_set_context(adev, NULL);
kfree(con);

Expand Down
24 changes: 13 additions & 11 deletions drivers/gpu/drm/amd/amdkfd/kfd_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
void *crat_image = NULL;
size_t image_size = 0;
int proximity_domain;
struct amdgpu_device *adev;
struct amdgpu_ras *ctx;

INIT_LIST_HEAD(&temp_topology_device_list);

Expand Down Expand Up @@ -1488,17 +1488,19 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
dev->node_props.max_waves_per_simd = 10;
}

adev = (struct amdgpu_device *)(dev->gpu->kgd);
/* kfd only concerns sram ecc on GFX and HBM ecc on UMC */
dev->node_props.capability |=
((adev->ras_features & BIT(AMDGPU_RAS_BLOCK__GFX)) != 0) ?
HSA_CAP_SRAM_EDCSUPPORTED : 0;
dev->node_props.capability |= ((adev->ras_features & BIT(AMDGPU_RAS_BLOCK__UMC)) != 0) ?
HSA_CAP_MEM_EDCSUPPORTED : 0;

if (adev->asic_type != CHIP_VEGA10)
dev->node_props.capability |= (adev->ras_features != 0) ?
ctx = amdgpu_ras_get_context((struct amdgpu_device *)(dev->gpu->kgd));
if (ctx) {
/* kfd only concerns sram ecc on GFX/SDMA and HBM ecc on UMC */
dev->node_props.capability |=
(((ctx->features & BIT(AMDGPU_RAS_BLOCK__SDMA)) != 0) ||
((ctx->features & BIT(AMDGPU_RAS_BLOCK__GFX)) != 0)) ?
HSA_CAP_SRAM_EDCSUPPORTED : 0;
dev->node_props.capability |= ((ctx->features & BIT(AMDGPU_RAS_BLOCK__UMC)) != 0) ?
HSA_CAP_MEM_EDCSUPPORTED : 0;

dev->node_props.capability |= (ctx->features != 0) ?
HSA_CAP_RASEVENTNOTIFY : 0;
}

kfd_debug_print_topology();

Expand Down

0 comments on commit 6e203d1

Please sign in to comment.