diff mbox series

[v6,02/16] drm/ttm: Expose ttm_tt_unpopulate for driver use

Message ID 20210510163625.407105-3-andrey.grodzovsky@amd.com
State New
Headers show
Series RFC Support hot device unplug in amdgpu | expand

Commit Message

Andrey Grodzovsky May 10, 2021, 4:36 p.m. UTC
It's needed to drop iommu backed pages on device unplug
before device's IOMMU group is released.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Felix Kuehling May 10, 2021, 6:27 p.m. UTC | #1
Am 2021-05-10 um 12:36 p.m. schrieb Andrey Grodzovsky:
> It's needed to drop iommu backed pages on device unplug
> before device's IOMMU group is released.

I don't see any calls to ttm_tt_unpopulate in the rest of the series
now. Is that an accident, or can this patch be dropped?

Regards,
  Felix


>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> ---
>  drivers/gpu/drm/ttm/ttm_tt.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 539e0232cb3b..dfbe1ea8763f 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -433,3 +433,4 @@ void ttm_tt_mgr_init(unsigned long num_pages, unsigned long num_dma32_pages)
>  	if (!ttm_dma32_pages_limit)
>  		ttm_dma32_pages_limit = num_dma32_pages;
>  }
> +EXPORT_SYMBOL(ttm_tt_unpopulate);
Andrey Grodzovsky May 10, 2021, 6:32 p.m. UTC | #2
On 2021-05-10 2:27 p.m., Felix Kuehling wrote:
> Am 2021-05-10 um 12:36 p.m. schrieb Andrey Grodzovsky:
>> It's needed to drop iommu backed pages on device unplug
>> before device's IOMMU group is released.
> I don't see any calls to ttm_tt_unpopulate in the rest of the series
> now. Is that an accident, or can this patch be dropped?
>
> Regards,
>    Felix


You are right, it can be dropped because it's not required post 5.11 
kernel (at least
not in the use cases I tested).

Andrey

>
>
>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>> ---
>>   drivers/gpu/drm/ttm/ttm_tt.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
>> index 539e0232cb3b..dfbe1ea8763f 100644
>> --- a/drivers/gpu/drm/ttm/ttm_tt.c
>> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
>> @@ -433,3 +433,4 @@ void ttm_tt_mgr_init(unsigned long num_pages, unsigned long num_dma32_pages)
>>   	if (!ttm_dma32_pages_limit)
>>   		ttm_dma32_pages_limit = num_dma32_pages;
>>   }
>> +EXPORT_SYMBOL(ttm_tt_unpopulate);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 539e0232cb3b..dfbe1ea8763f 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -433,3 +433,4 @@  void ttm_tt_mgr_init(unsigned long num_pages, unsigned long num_dma32_pages)
 	if (!ttm_dma32_pages_limit)
 		ttm_dma32_pages_limit = num_dma32_pages;
 }
+EXPORT_SYMBOL(ttm_tt_unpopulate);