diff mbox series

[2/2] media: venus: firmware: Use iommu_paging_domain_alloc()

Message ID 20240812072105.9578-2-baolu.lu@linux.intel.com (mailing list archive)
State Not Applicable
Headers show
Series [1/2] media: nvidia: tegra: Use iommu_paging_domain_alloc() | expand

Commit Message

Baolu Lu Aug. 12, 2024, 7:21 a.m. UTC
An iommu domain is allocated in venus_firmware_init() and is attached to
core->fw.dev in the same function. Use iommu_paging_domain_alloc() to
make it explicit.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240610085555.88197-10-baolu.lu@linux.intel.com
---
 drivers/media/platform/qcom/venus/firmware.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stanimir Varbanov Aug. 20, 2024, 8:43 p.m. UTC | #1
Hi,

Thank you for the patch!

On 12.08.24 г. 10:21 ч., Lu Baolu wrote:
> An iommu domain is allocated in venus_firmware_init() and is attached to
> core->fw.dev in the same function. Use iommu_paging_domain_alloc() to
> make it explicit.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Link: https://lore.kernel.org/r/20240610085555.88197-10-baolu.lu@linux.intel.com
> ---
>   drivers/media/platform/qcom/venus/firmware.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
> index fe7da2b30482..66a18830e66d 100644
> --- a/drivers/media/platform/qcom/venus/firmware.c
> +++ b/drivers/media/platform/qcom/venus/firmware.ced

Acked-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>

I'll take the patch through linux-media tree.

> @@ -316,10 +316,10 @@ int venus_firmware_init(struct venus_core *core)
>   
>   	core->fw.dev = &pdev->dev;
>   
> -	iommu_dom = iommu_domain_alloc(&platform_bus_type);
> -	if (!iommu_dom) {
> +	iommu_dom = iommu_paging_domain_alloc(core->fw.dev);
> +	if (IS_ERR(iommu_dom)) {
>   		dev_err(core->fw.dev, "Failed to allocate iommu domain\n");
> -		ret = -ENOMEM;
> +		ret = PTR_ERR(iommu_dom);
>   		goto err_unregister;
>   	}
>
Jason Gunthorpe Sept. 4, 2024, 12:16 p.m. UTC | #2
On Tue, Aug 20, 2024 at 11:43:50PM +0300, Stanimir Varbanov wrote:
> Hi,
> 
> Thank you for the patch!
> 
> On 12.08.24 г. 10:21 ч., Lu Baolu wrote:
> > An iommu domain is allocated in venus_firmware_init() and is attached to
> > core->fw.dev in the same function. Use iommu_paging_domain_alloc() to
> > make it explicit.
> > 
> > Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> > Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> > Link: https://lore.kernel.org/r/20240610085555.88197-10-baolu.lu@linux.intel.com
> > ---
> >   drivers/media/platform/qcom/venus/firmware.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
> > index fe7da2b30482..66a18830e66d 100644
> > --- a/drivers/media/platform/qcom/venus/firmware.c
> > +++ b/drivers/media/platform/qcom/venus/firmware.ced
> 
> Acked-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
> 
> I'll take the patch through linux-media tree.

Did this patch and the 1/2:

https://lore.kernel.org/linux-iommu/20240812072105.9578-1-baolu.lu@linux.intel.com/

Get picked up for media? I don't see it in linux-next?

Thanks,
Jason
Stanimir Varbanov Sept. 6, 2024, 9:51 a.m. UTC | #3
Hi Jason,

On 9/4/24 15:16, Jason Gunthorpe wrote:
> On Tue, Aug 20, 2024 at 11:43:50PM +0300, Stanimir Varbanov wrote:
>> Hi,
>>
>> Thank you for the patch!
>>
>> On 12.08.24 г. 10:21 ч., Lu Baolu wrote:
>>> An iommu domain is allocated in venus_firmware_init() and is attached to
>>> core->fw.dev in the same function. Use iommu_paging_domain_alloc() to
>>> make it explicit.
>>>
>>> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
>>> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
>>> Link: https://lore.kernel.org/r/20240610085555.88197-10-baolu.lu@linux.intel.com
>>> ---
>>>   drivers/media/platform/qcom/venus/firmware.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
>>> index fe7da2b30482..66a18830e66d 100644
>>> --- a/drivers/media/platform/qcom/venus/firmware.c
>>> +++ b/drivers/media/platform/qcom/venus/firmware.ced
>>
>> Acked-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
>>
>> I'll take the patch through linux-media tree.
> 
> Did this patch and the 1/2:

2/2 is in linux-next now.

~Stan
Jason Gunthorpe Sept. 6, 2024, 1:20 p.m. UTC | #4
On Fri, Sep 06, 2024 at 12:51:08PM +0300, Stanimir Varbanov wrote:
> >> On 12.08.24 г. 10:21 ч., Lu Baolu wrote:
> >>> An iommu domain is allocated in venus_firmware_init() and is attached to
> >>> core->fw.dev in the same function. Use iommu_paging_domain_alloc() to
> >>> make it explicit.
> >>>
> >>> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> >>> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> >>> Link: https://lore.kernel.org/r/20240610085555.88197-10-baolu.lu@linux.intel.com
> >>> ---
> >>>   drivers/media/platform/qcom/venus/firmware.c | 6 +++---
> >>>   1 file changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
> >>> index fe7da2b30482..66a18830e66d 100644
> >>> --- a/drivers/media/platform/qcom/venus/firmware.c
> >>> +++ b/drivers/media/platform/qcom/venus/firmware.ced
> >>
> >> Acked-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
> >>
> >> I'll take the patch through linux-media tree.
> > 
> > Did this patch and the 1/2:
>
> 2/2 is in linux-next now.

And 1/2? Can someone pick it up too?

https://lore.kernel.org/all/2o6gpxknio4kvf5fmqgai5jaov65semmw3wvtmt4gdauwzhbti@ii3ydtlmp2sb/

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index fe7da2b30482..66a18830e66d 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -316,10 +316,10 @@  int venus_firmware_init(struct venus_core *core)
 
 	core->fw.dev = &pdev->dev;
 
-	iommu_dom = iommu_domain_alloc(&platform_bus_type);
-	if (!iommu_dom) {
+	iommu_dom = iommu_paging_domain_alloc(core->fw.dev);
+	if (IS_ERR(iommu_dom)) {
 		dev_err(core->fw.dev, "Failed to allocate iommu domain\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(iommu_dom);
 		goto err_unregister;
 	}