@@ -672,12 +672,11 @@ static uint32_t sdma_v4_4_2_rb_cntl(struct amdgpu_ring *ring, uint32_t rb_cntl)
672
672
* @adev: amdgpu_device pointer
673
673
* @i: instance to resume
674
674
* @restore: used to restore wptr when restart
675
- * @guilty: boolean indicating whether this queue is the guilty one (caused the timeout/error)
676
675
*
677
676
* Set up the gfx DMA ring buffers and enable them.
678
677
* Returns 0 for success, error for failure.
679
678
*/
680
- static void sdma_v4_4_2_gfx_resume (struct amdgpu_device * adev , unsigned int i , bool restore , bool guilty )
679
+ static void sdma_v4_4_2_gfx_resume (struct amdgpu_device * adev , unsigned int i , bool restore )
681
680
{
682
681
struct amdgpu_ring * ring = & adev -> sdma .instance [i ].ring ;
683
682
u32 rb_cntl , ib_cntl , wptr_poll_cntl ;
@@ -714,7 +713,7 @@ static void sdma_v4_4_2_gfx_resume(struct amdgpu_device *adev, unsigned int i, b
714
713
/* For the guilty queue, set RPTR to the current wptr to skip bad commands,
715
714
* It is not a guilty queue, restore cache_rptr and continue execution.
716
715
*/
717
- if (guilty )
716
+ if (adev -> sdma . instance [ i ]. gfx_guilty )
718
717
rwptr = ring -> wptr ;
719
718
else
720
719
rwptr = ring -> cached_rptr ;
@@ -779,12 +778,11 @@ static void sdma_v4_4_2_gfx_resume(struct amdgpu_device *adev, unsigned int i, b
779
778
* @adev: amdgpu_device pointer
780
779
* @i: instance to resume
781
780
* @restore: boolean to say restore needed or not
782
- * @guilty: boolean indicating whether this queue is the guilty one (caused the timeout/error)
783
781
*
784
782
* Set up the page DMA ring buffers and enable them.
785
783
* Returns 0 for success, error for failure.
786
784
*/
787
- static void sdma_v4_4_2_page_resume (struct amdgpu_device * adev , unsigned int i , bool restore , bool guilty )
785
+ static void sdma_v4_4_2_page_resume (struct amdgpu_device * adev , unsigned int i , bool restore )
788
786
{
789
787
struct amdgpu_ring * ring = & adev -> sdma .instance [i ].page ;
790
788
u32 rb_cntl , ib_cntl , wptr_poll_cntl ;
@@ -803,7 +801,7 @@ static void sdma_v4_4_2_page_resume(struct amdgpu_device *adev, unsigned int i,
803
801
/* For the guilty queue, set RPTR to the current wptr to skip bad commands,
804
802
* It is not a guilty queue, restore cache_rptr and continue execution.
805
803
*/
806
- if (guilty )
804
+ if (adev -> sdma . instance [ i ]. page_guilty )
807
805
rwptr = ring -> wptr ;
808
806
else
809
807
rwptr = ring -> cached_rptr ;
@@ -989,9 +987,9 @@ static int sdma_v4_4_2_inst_start(struct amdgpu_device *adev,
989
987
uint32_t temp ;
990
988
991
989
WREG32_SDMA (i , regSDMA_SEM_WAIT_FAIL_TIMER_CNTL , 0 );
992
- sdma_v4_4_2_gfx_resume (adev , i , restore , adev -> sdma . gfx_guilty );
990
+ sdma_v4_4_2_gfx_resume (adev , i , restore );
993
991
if (adev -> sdma .has_page_queue )
994
- sdma_v4_4_2_page_resume (adev , i , restore , adev -> sdma . page_guilty );
992
+ sdma_v4_4_2_page_resume (adev , i , restore );
995
993
996
994
/* set utc l1 enable flag always to 1 */
997
995
temp = RREG32_SDMA (i , regSDMA_CNTL );
@@ -1446,6 +1444,10 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
1446
1444
1447
1445
for (i = 0 ; i < adev -> sdma .num_instances ; i ++ ) {
1448
1446
mutex_init (& adev -> sdma .instance [i ].engine_reset_mutex );
1447
+ /* Initialize guilty flags for GFX and PAGE queues */
1448
+ adev -> sdma .instance [i ].gfx_guilty = false;
1449
+ adev -> sdma .instance [i ].page_guilty = false;
1450
+
1449
1451
ring = & adev -> sdma .instance [i ].ring ;
1450
1452
ring -> ring_obj = NULL ;
1451
1453
ring -> use_doorbell = true;
@@ -1507,9 +1509,6 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
1507
1509
r = amdgpu_sdma_sysfs_reset_mask_init (adev );
1508
1510
if (r )
1509
1511
return r ;
1510
- /* Initialize guilty flags for GFX and PAGE queues */
1511
- adev -> sdma .gfx_guilty = false;
1512
- adev -> sdma .page_guilty = false;
1513
1512
1514
1513
return r ;
1515
1514
}
@@ -1689,9 +1688,11 @@ static int sdma_v4_4_2_stop_queue(struct amdgpu_device *adev, uint32_t instance_
1689
1688
return - EINVAL ;
1690
1689
1691
1690
/* Check if this queue is the guilty one */
1692
- adev -> sdma .gfx_guilty = sdma_v4_4_2_is_queue_selected (adev , instance_id , false);
1691
+ adev -> sdma .instance [instance_id ].gfx_guilty =
1692
+ sdma_v4_4_2_is_queue_selected (adev , instance_id , false);
1693
1693
if (adev -> sdma .has_page_queue )
1694
- adev -> sdma .page_guilty = sdma_v4_4_2_is_queue_selected (adev , instance_id , true);
1694
+ adev -> sdma .instance [instance_id ].page_guilty =
1695
+ sdma_v4_4_2_is_queue_selected (adev , instance_id , true);
1695
1696
1696
1697
/* Cache the rptr before reset, after the reset,
1697
1698
* all of the registers will be reset to 0
0 commit comments