Skip to contentSkip to conversation

drm/msm: log iommu init failure

PATCH In review Marc Gonzalez 7 participants 11 messages May 15, 2024 – Jun 25, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm: log iommu init failure

When create_address_space() fails (e.g. when smmu node is disabled) msm_gpu_init() silently fails:

msm_dpu c901000.display-controller: failed to load adreno gpu
msm_dpu c901000.display-controller: failed to bind 5000000.gpu (ops a3xx_ops): -19

Log create_address_space() failure.

---
 drivers/gpu/drm/msm/msm_gpu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_gpu.c +1 -0
index 655002b21b0d5..f1e692866cc38 100644
@@ -941,6 +941,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
 		DRM_DEV_INFO(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name);
 	else if (IS_ERR(gpu->aspace)) {
 		ret = PTR_ERR(gpu->aspace);
+		DRM_DEV_ERROR(drm->dev, "could not create address space: %d\n", ret);
 		goto fail;
 	}
 
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Marc Gonzalez

When create_address_space() fails (e.g. when smmu node is disabled) msm_gpu_init() silently fails:

msm_dpu c901000.display-controller: failed to load adreno gpu
msm_dpu c901000.display-controller: failed to bind 5000000.gpu (ops a3xx_ops): -19

Log create_address_space() failure.

Thanks!

And, after checking the below:

drivers/gpu/drm/msm/msm_gpu.c int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · line 944

Quoted 13 lines
---
 drivers/gpu/drm/msm/msm_gpu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_gpu.c +1 -0
index 655002b21b0d5..f1e692866cc38 100644
@@ -941,6 +941,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
 		DRM_DEV_INFO(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name);
 	else if (IS_ERR(gpu->aspace)) {
 		ret = PTR_ERR(gpu->aspace);
+		DRM_DEV_ERROR(drm->dev, "could not create address space: %d\n", ret);

Maybe this wasn't done before because this also includes -EPROBE_DEFER, so you might want to wrap this in

	if (ret != -EPROBE_DEFER)
		DRM_DEV_ERROR...

But then dev_err_probe() was built specifically to be less verbose about this (and track defer reasons). While this is an init and not probe function, it's called from struct component_ops->bind where it should be okay to call that, as long as you have access to the component struct device* and not its master (IIRC).

- Marijn

Quoted 6 lines
drivers/gpu/drm/msm/msm_gpu.c +0 -0
 		goto fail;
 	}
 
Signature · 1 line
2.34.1
#2 lore raw
Quoted 37 lines · Marijn Suijten
Quoted 9 lines · Marc Gonzalez

When create_address_space() fails (e.g. when smmu node is disabled) msm_gpu_init() silently fails:

msm_dpu c901000.display-controller: failed to load adreno gpu
msm_dpu c901000.display-controller: failed to bind 5000000.gpu (ops a3xx_ops): -19

Log create_address_space() failure.

Thanks!

And, after checking the below:

drivers/gpu/drm/msm/msm_gpu.c int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · line 944

Quoted 13 lines
---
 drivers/gpu/drm/msm/msm_gpu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_gpu.c +1 -0
index 655002b21b0d5..f1e692866cc38 100644
@@ -941,6 +941,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
 		DRM_DEV_INFO(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name);
 	else if (IS_ERR(gpu->aspace)) {
 		ret = PTR_ERR(gpu->aspace);
+		DRM_DEV_ERROR(drm->dev, "could not create address space: %d\n", ret);

Maybe this wasn't done before because this also includes -EPROBE_DEFER, so you might want to wrap this in

Quoted 8 lines
	if (ret != -EPROBE_DEFER)
		DRM_DEV_ERROR...

But then dev_err_probe() was built specifically to be less verbose about this (and track defer reasons). While this is an init and not probe function, it's called from struct component_ops->bind where it should be okay to call that, as long as you have access to the component struct device* and not its master (IIRC).

Hello Marijn,

I have moved on to HDMI.

Feel free to take full ownership of this submission, as I won't have the energy to get it accepted.

Regards,

Marc

#3 lore raw
Quoted 6 lines · Marc Gonzalez
Quoted 3 lines · Marijn Suijten
Quoted 1 line · Marc Gonzalez

When create_address_space() fails (e.g. when smmu node is disabled)

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

BR,
-R

Quoted 55 lines
Quoted 34 lines
Quoted 8 lines

msm_gpu_init() silently fails:

msm_dpu c901000.display-controller: failed to load adreno gpu
msm_dpu c901000.display-controller: failed to bind 5000000.gpu (ops a3xx_ops): -19

Log create_address_space() failure.

Thanks!

And, after checking the below:

drivers/gpu/drm/msm/msm_gpu.c int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · line 944

Quoted 13 lines
---
 drivers/gpu/drm/msm/msm_gpu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_gpu.c +1 -0
index 655002b21b0d5..f1e692866cc38 100644
@@ -941,6 +941,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
             DRM_DEV_INFO(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name);
     else if (IS_ERR(gpu->aspace)) {
             ret = PTR_ERR(gpu->aspace);
+            DRM_DEV_ERROR(drm->dev, "could not create address space: %d\n", ret);

Maybe this wasn't done before because this also includes -EPROBE_DEFER, so you might want to wrap this in

Quoted 8 lines
      if (ret != -EPROBE_DEFER)
              DRM_DEV_ERROR...

But then dev_err_probe() was built specifically to be less verbose about this (and track defer reasons). While this is an init and not probe function, it's called from struct component_ops->bind where it should be okay to call that, as long as you have access to the component struct device* and not its master (IIRC).

Hello Marijn,

I have moved on to HDMI.

Feel free to take full ownership of this submission, as I won't have the energy to get it accepted.

Regards,

Marc

#4 lore raw
Quoted 5 lines · Rob Clark
Quoted 3 lines · Marc Gonzalez

On 16/05/2024 10:43, Marijn Suijten wrote:

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines · Marc Gonzalez
Quoted 2 lines

When create_address_space() fails (e.g. when smmu node is disabled)

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

Does that mean that we will lose GPU support on MSM8974?

Quoted 21 lines

BR,
-R

Quoted 17 lines
Quoted 17 lines
Quoted 8 lines

msm_gpu_init() silently fails:

msm_dpu c901000.display-controller: failed to load adreno gpu
msm_dpu c901000.display-controller: failed to bind 5000000.gpu (ops a3xx_ops): -19

Log create_address_space() failure.

Thanks!

And, after checking the below:

Signature · 2 lines
With best wishes
Dmitry
#5 lore raw
Quoted 8 lines · Dmitry Baryshkov
Quoted 7 lines · Rob Clark
Quoted 5 lines · Marc Gonzalez
Quoted 2 lines · Marijn Suijten

On 2024-05-15 17:09:02, Marc Gonzalez wrote:

Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

When create_address_space() fails (e.g. when smmu node is disabled)

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

Does that mean that we will lose GPU support on MSM8974?

Yeah, that was brought up on #freedreno some time ago

Konrad

#6 lore raw
Quoted 13 lines · Konrad Dybcio
Quoted 10 lines · Dmitry Baryshkov
Quoted 9 lines · Rob Clark
Quoted 6 lines · Marc Gonzalez
Quoted 3 lines · Marijn Suijten
Quoted 1 line · Marc Gonzalez

When create_address_space() fails (e.g. when smmu node is disabled)

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

Does that mean that we will lose GPU support on MSM8974?

Yeah, that was brought up on #freedreno some time ago

Also on MSM8226 which I also care about...

Anyone at all knowledgable on IOMMU would be very welcome to help out with IOMMU support on these two platforms (and anything else that old?) in any case, since me and some other people have looked at this (on and off) for years but haven't gotten to any stable or usable point unfortunately.

Regards
Luca

Quoted 2 lines

Konrad

#7 lore raw
Quoted 13 lines · Luca Weiss
Quoted 11 lines · Konrad Dybcio
Quoted 8 lines · Dmitry Baryshkov
Quoted 7 lines · Rob Clark
Quoted 5 lines · Marc Gonzalez
Quoted 2 lines · Marijn Suijten

On 2024-05-15 17:09:02, Marc Gonzalez wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

When create_address_space() fails (e.g. when smmu node is disabled)

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

Does that mean that we will lose GPU support on MSM8974?

And display support as well :-/

Note that GPU should be disabled by default without smmu.. you can override with modparam, but please don't. It is incredibly insecure, you might as well make /dev/mem world readable/writeable.

Is simplefb an option on 8974 or 8226 to keep display support?

BR,
-R

Quoted 17 lines
Quoted 2 lines

Yeah, that was brought up on #freedreno some time ago

Also on MSM8226 which I also care about...

Anyone at all knowledgable on IOMMU would be very welcome to help out with IOMMU support on these two platforms (and anything else that old?) in any case, since me and some other people have looked at this (on and off) for years but haven't gotten to any stable or usable point unfortunately.

Regards
Luca

Quoted 2 lines

Konrad

#8 lore raw
Quoted 23 lines · Rob Clark
Quoted 13 lines · Luca Weiss
Quoted 11 lines · Konrad Dybcio
Quoted 8 lines · Dmitry Baryshkov
Quoted 7 lines · Rob Clark
Quoted 5 lines · Marc Gonzalez
Quoted 2 lines · Marijn Suijten

On 2024-05-15 17:09:02, Marc Gonzalez wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

When create_address_space() fails (e.g. when smmu node is disabled)

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

Does that mean that we will lose GPU support on MSM8974?

Quoted 7 lines

And display support as well :-/

Note that GPU should be disabled by default without smmu.. you can override with modparam, but please don't. It is incredibly insecure, you might as well make /dev/mem world readable/writeable.

Is simplefb an option on 8974 or 8226 to keep display support?

Not in a longer term, I still hope to push HDMI PHY/PLL support for MSM8974, which means dynamic resolution support.

Quoted 21 lines

BR,
-R

Quoted 17 lines
Quoted 2 lines

Yeah, that was brought up on #freedreno some time ago

Also on MSM8226 which I also care about...

Anyone at all knowledgable on IOMMU would be very welcome to help out with IOMMU support on these two platforms (and anything else that old?) in any case, since me and some other people have looked at this (on and off) for years but haven't gotten to any stable or usable point unfortunately.

Regards
Luca

Quoted 2 lines

Konrad

Signature · 2 lines
With best wishes
Dmitry
#9 lore raw
Quoted 27 lines · Dmitry Baryshkov
Quoted 25 lines · Rob Clark
Quoted 13 lines · Luca Weiss
Quoted 11 lines · Konrad Dybcio
Quoted 8 lines · Dmitry Baryshkov
Quoted 7 lines · Rob Clark
Quoted 5 lines · Marc Gonzalez
Quoted 2 lines · Marijn Suijten

On 2024-05-15 17:09:02, Marc Gonzalez wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

When create_address_space() fails (e.g. when smmu node is disabled)

Note that smmu support is going to become a hard dependency with the drm_gpuvm/VM_BIND conversion.. which I think means we should never get far enough to hit this error path..

Does that mean that we will lose GPU support on MSM8974?

And display support as well :-/

Quoted 8 lines
Quoted 5 lines

Note that GPU should be disabled by default without smmu.. you can override with modparam, but please don't. It is incredibly insecure, you might as well make /dev/mem world readable/writeable.

Is simplefb an option on 8974 or 8226 to keep display support?

Not in a longer term, I still hope to push HDMI PHY/PLL support for MSM8974, which means dynamic resolution support.

Hmm, maybe it would be possible to re-add carveout support.. but my hopes aren't too high. It would be better if we could get smmu going. (Not to mention, I don't really like the idea of people using the gpu without an smmu... it is a really insecure thing to do.)

BR,
-R

Quoted 27 lines
Quoted 21 lines

BR,
-R

Quoted 17 lines
Quoted 2 lines

Yeah, that was brought up on #freedreno some time ago

Also on MSM8226 which I also care about...

Anyone at all knowledgable on IOMMU would be very welcome to help out with IOMMU support on these two platforms (and anything else that old?) in any case, since me and some other people have looked at this (on and off) for years but haven't gotten to any stable or usable point unfortunately.

Regards
Luca

Quoted 2 lines

Konrad

--
With best wishes
Dmitry

#10 lore raw
In reply to Luca Weiss
Quoted 6 lines · Luca Weiss
Quoted 4 lines · Konrad Dybcio
Quoted 1 line · Dmitry Baryshkov

Does that mean that we will lose GPU support on MSM8974?

Yeah, that was brought up on #freedreno some time ago

Quoted 7 lines

Also on MSM8226 which I also care about...

Anyone at all knowledgable on IOMMU would be very welcome to help out with IOMMU support on these two platforms (and anything else that old?) in any case, since me and some other people have looked at this (on and off) for years but haven't gotten to any stable or usable point unfortunately.

I posted in 2020 some details about what I encountered when I tried to enable the IOMMU on msm8974:

https://lore.kernel.org/lkml/[email protected]/

Brian