drm/amdgpu: add asic need_full_reset callback
Subsystems (2)
PATCH 1/6 drm/amdgpu: add asic need_full_reset callback
Allow us to determine at the soc level whether the asic requires full reset or if soft reset will work.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +3 -0
@@ -1203,6 +1203,8 @@ struct amdgpu_asic_funcs {/* invalidate hdp read cache */ void (*invalidate_hdp)(struct amdgpu_device *adev,struct amdgpu_ring *ring); +/* check if the asic needs a full reset of if soft reset will work */ +bool (*need_full_reset)(struct amdgpu_device *adev); };/*
@@ -1772,6 +1774,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)#define amdgpu_asic_get_config_memsize (adev) (adev)->asic_funcs->get_config_memsize((adev))#define amdgpu_asic_flush_hdp (adev, r) (adev)->asic_funcs->flush_hdp((adev), (r))#define amdgpu_asic_invalidate_hdp (adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r)) +#define amdgpu_asic_need_full_reset (adev) (adev)->asic_funcs->need_full_reset((adev))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180329200153.18168-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/6 drm/amdgpu/si: implement asic need_full_reset callback
Used to check on a per SoC basis whether the SoC needs a full reset of a per IP soft reset.
--- drivers/gpu/drm/amd/amdgpu/si.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/si.c +7 -0
@@ -1252,6 +1252,12 @@ static void si_invalidate_hdp(struct amdgpu_device *adev, } } +static bool si_need_full_reset (struct amdgpu_device *adev) +{ +/* change this when we support soft reset */ +return true; +} +static const struct amdgpu_asic_funcs si_asic_funcs = { .read_disabled_bios = &si_read_disabled_bios,
@@ -1265,6 +1271,7 @@ static const struct amdgpu_asic_funcs si_asic_funcs = .get_config_memsize = &si_get_config_memsize, .flush_hdp = &si_flush_hdp, .invalidate_hdp = &si_invalidate_hdp, + .need_full_reset = &si_need_full_reset, };static uint32_t si_get_rev_id (struct amdgpu_device *adev)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/6 drm/amdgpu/cik: implement asic need_full_reset callback
In reply to a message not in the archiveUsed to check on a per SoC basis whether the SoC needs a full reset of a per IP soft reset.
--- drivers/gpu/drm/amd/amdgpu/cik.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/cik.c +7 -0
@@ -1735,6 +1735,12 @@ static void cik_invalidate_hdp(struct amdgpu_device *adev, } } +static bool cik_need_full_reset (struct amdgpu_device *adev) +{ +/* change this when we support soft reset */ +return true; +} +static const struct amdgpu_asic_funcs cik_asic_funcs = { .read_disabled_bios = &cik_read_disabled_bios,
@@ -1748,6 +1754,7 @@ static const struct amdgpu_asic_funcs cik_asic_funcs = .get_config_memsize = &cik_get_config_memsize, .flush_hdp = &cik_flush_hdp, .invalidate_hdp = &cik_invalidate_hdp, + .need_full_reset = &cik_need_full_reset, };static int cik_common_early_init (void *handle)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/6 drm/amdgpu/vi: implement asic need_full_reset callback
In reply to a message not in the archiveUsed to check on a per SoC basis whether the SoC needs a full reset of a per IP soft reset.
--- drivers/gpu/drm/amd/amdgpu/vi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/gpu/drm/amd/amdgpu/vi.c +22 -0
@@ -876,6 +876,27 @@ static void vi_invalidate_hdp(struct amdgpu_device *adev, } } +static bool vi_need_full_reset (struct amdgpu_device *adev) +{ +switch (adev->asic_type) { +case CHIP_CARRIZO : +case CHIP_STONEY : +/* CZ has hang issues with full reset at the moment */ +return false; +case CHIP_FIJI : +case CHIP_TONGA : +/* XXX: soft reset should work on fiji and tonga */ +return true; +case CHIP_POLARIS10 : +case CHIP_POLARIS11 : +case CHIP_POLARIS12 : +case CHIP_TOPAZ : +default : +/* change this when we support soft reset */ +return true; + } +} +static const struct amdgpu_asic_funcs vi_asic_funcs = { .read_disabled_bios = &vi_read_disabled_bios,
@@ -889,6 +910,7 @@ static const struct amdgpu_asic_funcs vi_asic_funcs = .get_config_memsize = &vi_get_config_memsize, .flush_hdp = &vi_flush_hdp, .invalidate_hdp = &vi_invalidate_hdp, + .need_full_reset = &vi_need_full_reset, };#define CZ_REV_BRISTOL (rev) \
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/6 drm/amdgpu/soc15: implement asic need_full_reset callback
In reply to a message not in the archiveUsed to check on a per SoC basis whether the SoC needs a full reset of a per IP soft reset.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc15.c +7 -0
@@ -568,6 +568,12 @@ static void soc15_invalidate_hdp(struct amdgpu_device *adev, HDP, 0, mmHDP_READ_CACHE_INVALIDATE), 1); } +static bool soc15_need_full_reset (struct amdgpu_device *adev) +{ +/* change this when we implement soft reset */ +return true; +} +static const struct amdgpu_asic_funcs soc15_asic_funcs = { .read_disabled_bios = &soc15_read_disabled_bios,
@@ -581,6 +587,7 @@ static const struct amdgpu_asic_funcs soc15_asic_funcs = .get_config_memsize = &soc15_get_config_memsize, .flush_hdp = &soc15_flush_hdp, .invalidate_hdp = &soc15_invalidate_hdp, + .need_full_reset = &soc15_need_full_reset, };static int soc15_common_early_init (void *handle)
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/6 drm/amdgpu: use new asic need_full_reset callback
In reply to a message not in the archiveUse the new callback to determine whether to use full asic reset or per IP soft reset. Enables reset to actually proceed on asics which don't support soft reset yet.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
@@ -2738,6 +2738,9 @@ static bool amdgpu_device_ip_check_soft_reset(struct amdgpu_device *adev)if (amdgpu_sriov_vf (adev))return true; +if (amdgpu_asic_need_full_reset (adev)) +return true; +for (i =0 ; i < adev->num_ip_blocks; i++) {if (!adev->ip_blocks[i].status.valid)continue ;
@@ -2794,6 +2797,9 @@ static bool amdgpu_device_ip_need_full_reset(struct amdgpu_device *adev) {int i; +if (amdgpu_asic_need_full_reset (adev)) +return true; +for (i =0 ; i < adev->num_ip_blocks; i++) {if (!adev->ip_blocks[i].status.valid)continue ;
Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Alex Deucher
Allow us to determine at the soc level whether the asic requires full reset or if soft reset will work.
Signed-off-by Alex Deucher <[email protected]>
Series are Reviewed-by: Huang Rui <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu.h +3
-0@@ -1203,6 +1203,8 @@ struct amdgpu_asic_funcs {/* invalidate hdp read cache */ void (*invalidate_hdp)(struct amdgpu_device *adev,struct amdgpu_ring *ring); +/* check if the asic needs a full reset of if soft reset will work */ +bool (*need_full_reset)(struct amdgpu_device *adev); };/* @@ -1772,6 +1774,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)#define amdgpu_asic_get_config_memsize (adev) (adev)->asic_funcs->get_config_memsize((adev))#define amdgpu_asic_flush_hdp (adev, r) (adev)->asic_funcs->flush_hdp((adev), (r))#define amdgpu_asic_invalidate_hdp (adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r)) +#define amdgpu_asic_need_full_reset (adev) (adev)->asic_funcs->need_full_reset((adev))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))Signature · 6 lines
2.13.6 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
Reviewed-byAm 02.04.2018 um 11:24 schrieb Huang Rui:
Quoted 6 lines · Alex Deucher
Quoted 4 lines
Allow us to determine at the soc level whether the asic requires full reset or if soft reset will work.
Signed-off-by Alex Deucher <[email protected]>Series are Reviewed-by: Huang Rui <[email protected]>
Review
Quoted 4 lines
(quoted diff) +4
-0+ case CHIP_FIJI: + case CHIP_TONGA: + /* XXX: soft reset should work on fiji and tonga */ + return true;
Shouldn't we go ahead and enabled this?
Christian.
Quoted 29 lines
Quoted 29 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu.h +3
-0@@ -1203,6 +1203,8 @@ struct amdgpu_asic_funcs {/* invalidate hdp read cache */ void (*invalidate_hdp)(struct amdgpu_device *adev,struct amdgpu_ring *ring); +/* check if the asic needs a full reset of if soft reset will work */ +bool (*need_full_reset)(struct amdgpu_device *adev); };/* @@ -1772,6 +1774,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)#define amdgpu_asic_get_config_memsize (adev) (adev)->asic_funcs->get_config_memsize((adev))#define amdgpu_asic_flush_hdp (adev, r) (adev)->asic_funcs->flush_hdp((adev), (r))#define amdgpu_asic_invalidate_hdp (adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r)) +#define amdgpu_asic_need_full_reset (adev) (adev)->asic_funcs->need_full_reset((adev))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))Signature · 1 line
2.13.6
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 645d5310-387e-8134-7c2a-25d0ca32f0a0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 12 lines · Christian König
Am 02.04.2018 um 11:24 schrieb Huang Rui:
Quoted 9 lines · Alex Deucher
Quoted 5 lines
Allow us to determine at the soc level whether the asic requires full reset or if soft reset will work.
Signed-off-by Alex Deucher <[email protected]>Series are Reviewed-by: Huang Rui <[email protected]>
Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ case CHIP_FIJI: + case CHIP_TONGA: + /* XXX: soft reset should work on fiji and tonga */ + return true;Shouldn't we go ahead and enabled this?
Full reset apparently works so I'd rather verify that soft reset works reliably before enabling it.
Alex
Quoted 52 lines
Christian.
Quoted 46 lines
Quoted 37 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-0@@ -1203,6 +1203,8 @@ struct amdgpu_asic_funcs {/* invalidate hdp read cache */ void (*invalidate_hdp)(struct amdgpu_device *adev,struct amdgpu_ring *ring); +/* check if the asic needs a full reset of if soft reset will work */
drivers/gpu/drm/amd/amdgpu/amdgpu.h +2
-0+bool (*need_full_reset)(struct amdgpu_device *adev); };/* @@ -1772,6 +1774,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)#define amdgpu_asic_get_config_memsize (adev) (adev)->asic_funcs->get_config_memsize((adev))#define amdgpu_asic_flush_hdp (adev, r) (adev)->asic_funcs->flush_hdp((adev), (r))#define amdgpu_asic_invalidate_hdp (adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r)) +#define amdgpu_asic_need_full_reset (adev)(adev)->asic_funcs->need_full_reset((adev))
#defineamdgpu_gmc_flush_gpu_tlb(adev, vmid)
(adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid))
#defineamdgpu_gmc_emit_flush_gpu_tlb(r, vmid, addr)
(r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))
#defineamdgpu_gmc_emit_pasid_mapping(r, vmid, pasid)
(r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid)) --
2.13.6Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx