Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: add the kernel docs for alloc/free/valid range

Add kernel docs for the functions related to hmm_range.

Documents added for functions:
amdgpu_hmm_range_valid
amdgpu_hmm_range_alloc
amdgpu_hmm_range_free

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sunil Khatri and committed by
Alex Deucher
d5a62b7a 6169b555

+33
+33
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
··· 227 227 return r; 228 228 } 229 229 230 + /** 231 + * amdgpu_hmm_range_valid - check if an HMM range is still valid 232 + * @range: pointer to the &struct amdgpu_hmm_range to validate 233 + * 234 + * Determines whether the given HMM range @range is still valid by 235 + * checking for invalidations via the MMU notifier sequence. This is 236 + * typically used to verify that the range has not been invalidated 237 + * by concurrent address space updates before it is accessed. 238 + * 239 + * Return: 240 + * * true if @range is valid and can be used safely 241 + * * false if @range is NULL or has been invalidated 242 + */ 230 243 bool amdgpu_hmm_range_valid(struct amdgpu_hmm_range *range) 231 244 { 232 245 if (!range) ··· 249 236 range->hmm_range.notifier_seq); 250 237 } 251 238 239 + /** 240 + * amdgpu_hmm_range_alloc - allocate and initialize an AMDGPU HMM range 241 + * @bo: optional buffer object to associate with this HMM range 242 + * 243 + * Allocates memory for amdgpu_hmm_range and associates it with the @bo passed. 244 + * The reference count of the @bo is incremented. 245 + * 246 + * Return: 247 + * Pointer to a newly allocated struct amdgpu_hmm_range on success, 248 + * or NULL if memory allocation fails. 249 + */ 252 250 struct amdgpu_hmm_range *amdgpu_hmm_range_alloc(struct amdgpu_bo *bo) 253 251 { 254 252 struct amdgpu_hmm_range *range; ··· 272 248 return range; 273 249 } 274 250 251 + /** 252 + * amdgpu_hmm_range_free - release an AMDGPU HMM range 253 + * @range: pointer to the range object to free 254 + * 255 + * Releases all resources held by @range, including the associated 256 + * hmm_pfns and the dropping reference of associated bo if any. 257 + * 258 + * Return: void 259 + */ 275 260 void amdgpu_hmm_range_free(struct amdgpu_hmm_range *range) 276 261 { 277 262 if (!range)