mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	drm/amdgpu: Fix missing drain retry fault the last entry
While the entry get in svm_range_unmap_from_cpu is the last entry, and the entry is page fault, it also need to be dropped. So for equal case, it also need to be dropped. v2: Only modify the svm_range_restore_pages. Signed-off-by: Emily Deng <Emily.Deng@amd.com> Reviewed-by: Xiaogang Chen<xiaogang.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
		
							parent
							
								
									94b0908b85
								
							
						
					
					
						commit
						fe2fa3be3d
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -78,6 +78,9 @@ struct amdgpu_ih_ring {
 | 
				
			||||||
#define amdgpu_ih_ts_after(t1, t2) \
 | 
					#define amdgpu_ih_ts_after(t1, t2) \
 | 
				
			||||||
		(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) > 0LL)
 | 
							(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) > 0LL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define amdgpu_ih_ts_after_or_equal(t1, t2) \
 | 
				
			||||||
 | 
							(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) >= 0LL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* provided by the ih block */
 | 
					/* provided by the ih block */
 | 
				
			||||||
struct amdgpu_ih_funcs {
 | 
					struct amdgpu_ih_funcs {
 | 
				
			||||||
	/* ring read/write ptr handling, called from interrupt context */
 | 
						/* ring read/write ptr handling, called from interrupt context */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3011,7 +3011,7 @@ svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* check if this page fault time stamp is before svms->checkpoint_ts */
 | 
						/* check if this page fault time stamp is before svms->checkpoint_ts */
 | 
				
			||||||
	if (svms->checkpoint_ts[gpuidx] != 0) {
 | 
						if (svms->checkpoint_ts[gpuidx] != 0) {
 | 
				
			||||||
		if (amdgpu_ih_ts_after(ts,  svms->checkpoint_ts[gpuidx])) {
 | 
							if (amdgpu_ih_ts_after_or_equal(ts,  svms->checkpoint_ts[gpuidx])) {
 | 
				
			||||||
			pr_debug("draining retry fault, drop fault 0x%llx\n", addr);
 | 
								pr_debug("draining retry fault, drop fault 0x%llx\n", addr);
 | 
				
			||||||
			r = 0;
 | 
								r = 0;
 | 
				
			||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue