diff mbox series

[v2,1/3] drm/nouveau/tegra: Use iommu_paging_domain_alloc()

Message ID 20240902014700.66095-2-baolu.lu@linux.intel.com (mailing list archive)
State New
Headers show
Series drm: Use iommu_paging_domain_alloc() | expand

Commit Message

Baolu Lu Sept. 2, 2024, 1:46 a.m. UTC
In nvkm_device_tegra_probe_iommu(), a paging domain is allocated for @dev
and attached to it on success. Use iommu_paging_domain_alloc() to make it
explicit.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lyude Paul Sept. 4, 2024, 7:06 p.m. UTC | #1
Reviewed-by: Lyude Paul <lyude@redhat.com>

Will handle pushing it to drm-misc in just a moment

On Mon, 2024-09-02 at 09:46 +0800, Lu Baolu wrote:
> In nvkm_device_tegra_probe_iommu(), a paging domain is allocated for @dev
> and attached to it on success. Use iommu_paging_domain_alloc() to make it
> explicit.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> index 87caa4a72921..763c4c2925f9 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
> @@ -120,8 +120,8 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev)
>  	mutex_init(&tdev->iommu.mutex);
>  
>  	if (device_iommu_mapped(dev)) {
> -		tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);
> -		if (!tdev->iommu.domain)
> +		tdev->iommu.domain = iommu_paging_domain_alloc(dev);
> +		if (IS_ERR(tdev->iommu.domain))
>  			goto error;
>  
>  		/*
Jason Gunthorpe Sept. 5, 2024, 1:24 p.m. UTC | #2
On Wed, Sep 04, 2024 at 03:06:07PM -0400, Lyude Paul wrote:
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> 
> Will handle pushing it to drm-misc in just a moment

Did you just take this one patch? 

Who will take the rest of the series for DRM?

Jason
Lyude Paul Sept. 5, 2024, 4:26 p.m. UTC | #3
I did take the one patch - but I'm happy to push the others to drm-misc
(provided they all get reviewed. 2/3 seems to be reviewed already but not 3/3)

On Thu, 2024-09-05 at 10:24 -0300, Jason Gunthorpe wrote:
> On Wed, Sep 04, 2024 at 03:06:07PM -0400, Lyude Paul wrote:
> > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > 
> > Will handle pushing it to drm-misc in just a moment
> 
> Did you just take this one patch? 
> 
> Who will take the rest of the series for DRM?
> 
> Jason
>
Thierry Reding Sept. 9, 2024, 1:50 p.m. UTC | #4
On Mon, Sep 02, 2024 at 09:46:58AM GMT, Lu Baolu wrote:
> In nvkm_device_tegra_probe_iommu(), a paging domain is allocated for @dev
> and attached to it on success. Use iommu_paging_domain_alloc() to make it
> explicit.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>
Jason Gunthorpe Sept. 9, 2024, 1:51 p.m. UTC | #5
On Thu, Sep 05, 2024 at 12:26:31PM -0400, Lyude Paul wrote:
> I did take the one patch - but I'm happy to push the others to drm-misc
> (provided they all get reviewed. 2/3 seems to be reviewed already but not 3/3)

The whole series is acked now, can you pick it up please?

Thanks,
Jason
Lyude Paul Sept. 10, 2024, 7:34 p.m. UTC | #6
of course - will push in just a moment

On Mon, 2024-09-09 at 10:51 -0300, Jason Gunthorpe wrote:
> On Thu, Sep 05, 2024 at 12:26:31PM -0400, Lyude Paul wrote:
> > I did take the one patch - but I'm happy to push the others to drm-misc
> > (provided they all get reviewed. 2/3 seems to be reviewed already but not 3/3)
> 
> The whole series is acked now, can you pick it up please?
> 
> Thanks,
> Jason
>
Jason Gunthorpe Sept. 15, 2024, 2:08 p.m. UTC | #7
On Thu, Sep 05, 2024 at 12:26:31PM -0400, Lyude Paul wrote:
> I did take the one patch - but I'm happy to push the others to drm-misc
> (provided they all get reviewed. 2/3 seems to be reviewed already but not 3/3)

Did it get lost?

$ git reset --hard next-20240913
$ git grep 'iommu_domain_alloc(' drivers/gpu/
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c:		tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);

??

 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |  4 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c        | 10 +++++++---
 drivers/gpu/drm/tegra/drm.c                        |  5 +++--

Now we have the other two but not nouveau?

Jason
Lyude Paul Sept. 16, 2024, 8:42 p.m. UTC | #8
Sigh. Took me a minute but I think I know what happened - I meant to push the
entire series to drm-misc-next and not drm-misc-fixes, but I must have misread
or typo'd the branch name and pushed the second half of patches to drm-misc-
fixes by mistake. So the nouveau commit is present in drm-misc-next, but
presumably drm-misc-fixes got pulled first.

Sorry about that - I have no idea how I managed that mistake.

On Sun, 2024-09-15 at 11:08 -0300, Jason Gunthorpe wrote:
> On Thu, Sep 05, 2024 at 12:26:31PM -0400, Lyude Paul wrote:
> > I did take the one patch - but I'm happy to push the others to drm-misc
> > (provided they all get reviewed. 2/3 seems to be reviewed already but not 3/3)
> 
> Did it get lost?
> 
> $ git reset --hard next-20240913
> $ git grep 'iommu_domain_alloc(' drivers/gpu/
> drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c:		tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);
> 
> ??
> 
>  drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |  4 ++--
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c        | 10 +++++++---
>  drivers/gpu/drm/tegra/drm.c                        |  5 +++--
> 
> Now we have the other two but not nouveau?
> 
> Jason
>
Jason Gunthorpe Oct. 1, 2024, 1:35 p.m. UTC | #9
On Mon, Sep 16, 2024 at 04:42:33PM -0400, Lyude Paul wrote:
> Sigh. Took me a minute but I think I know what happened - I meant to push the
> entire series to drm-misc-next and not drm-misc-fixes, but I must have misread
> or typo'd the branch name and pushed the second half of patches to drm-misc-
> fixes by mistake. So the nouveau commit is present in drm-misc-next, but
> presumably drm-misc-fixes got pulled first.
> 
> Sorry about that - I have no idea how I managed that mistake.

Three didn't make it to rc1, including this one:

drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c:             tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type>
drivers/media/platform/nvidia/tegra-vde/iommu.c:        vde->domain = iommu_domain_alloc(&platform_bus_type);
drivers/remoteproc/remoteproc_core.c:   domain = iommu_domain_alloc(dev->bus);

I prefer we send these through the iommu tree now so we can make
progress.

Jason
Lyude Paul Oct. 2, 2024, 8:03 p.m. UTC | #10
Fine by me

On Tue, 2024-10-01 at 10:35 -0300, Jason Gunthorpe wrote:
> On Mon, Sep 16, 2024 at 04:42:33PM -0400, Lyude Paul wrote:
> > Sigh. Took me a minute but I think I know what happened - I meant to push the
> > entire series to drm-misc-next and not drm-misc-fixes, but I must have misread
> > or typo'd the branch name and pushed the second half of patches to drm-misc-
> > fixes by mistake. So the nouveau commit is present in drm-misc-next, but
> > presumably drm-misc-fixes got pulled first.
> > 
> > Sorry about that - I have no idea how I managed that mistake.
> 
> Three didn't make it to rc1, including this one:
> 
> drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c:             tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type>
> drivers/media/platform/nvidia/tegra-vde/iommu.c:        vde->domain = iommu_domain_alloc(&platform_bus_type);
> drivers/remoteproc/remoteproc_core.c:   domain = iommu_domain_alloc(dev->bus);
> 
> I prefer we send these through the iommu tree now so we can make
> progress.
> 
> Jason
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
index 87caa4a72921..763c4c2925f9 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
@@ -120,8 +120,8 @@  nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev)
 	mutex_init(&tdev->iommu.mutex);
 
 	if (device_iommu_mapped(dev)) {
-		tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);
-		if (!tdev->iommu.domain)
+		tdev->iommu.domain = iommu_paging_domain_alloc(dev);
+		if (IS_ERR(tdev->iommu.domain))
 			goto error;
 
 		/*