* [PATCH] drm/msm: handle for EPROBE_DEFER for of_icc_get
@ 2020-07-01 3:08 Jonathan Marek
2020-07-01 17:12 ` Matthias Kaehlcke
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Marek @ 2020-07-01 3:08 UTC (permalink / raw)
To: freedreno
Cc: David Airlie, open list:DRM DRIVER FOR MSM ADRENO GPU,
Bjorn Andersson, open list:DRM DRIVER FOR MSM ADRENO GPU,
Sean Paul, open list, Brian Masney
Check for EPROBE_DEFER instead of silently not using icc if the msm driver
probes before the interconnect driver.
Only check for EPROBE_DEFER because of_icc_get can return other errors that
we want to ignore (ENODATA).
Remove the WARN_ON in msm_gpu_cleanup because INIT_LIST_HEAD won't have
been called on the list yet when going through the defer error path.
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 17 ++++++++++++++---
drivers/gpu/drm/msm/msm_gpu.c | 2 --
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 89673c7ed473..393c00425d68 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -940,12 +940,20 @@ static int adreno_get_pwrlevels(struct device *dev,
*/
gpu->icc_path = of_icc_get(dev, NULL);
}
- if (IS_ERR(gpu->icc_path))
+ if (IS_ERR(gpu->icc_path)) {
+ ret = PTR_ERR(gpu->icc_path);
gpu->icc_path = NULL;
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ }
gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
- if (IS_ERR(gpu->ocmem_icc_path))
+ if (IS_ERR(gpu->ocmem_icc_path)) {
+ ret = PTR_ERR(gpu->ocmem_icc_path);
gpu->ocmem_icc_path = NULL;
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ }
return 0;
}
@@ -996,6 +1004,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
struct adreno_platform_config *config = pdev->dev.platform_data;
struct msm_gpu_config adreno_gpu_config = { 0 };
struct msm_gpu *gpu = &adreno_gpu->base;
+ int ret;
adreno_gpu->funcs = funcs;
adreno_gpu->info = adreno_info(config->rev);
@@ -1007,7 +1016,9 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
adreno_gpu_config.nr_rings = nr_rings;
- adreno_get_pwrlevels(&pdev->dev, gpu);
+ ret = adreno_get_pwrlevels(&pdev->dev, gpu);
+ if (ret)
+ return ret;
pm_runtime_set_autosuspend_delay(&pdev->dev,
adreno_gpu->info->inactive_period);
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index a22d30622306..ccf9a0dd9706 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -959,8 +959,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
DBG("%s", gpu->name);
- WARN_ON(!list_empty(&gpu->active_list));
-
for (i = 0; i < ARRAY_SIZE(gpu->rb); i++) {
msm_ringbuffer_destroy(gpu->rb[i]);
gpu->rb[i] = NULL;
--
2.26.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/msm: handle for EPROBE_DEFER for of_icc_get
2020-07-01 3:08 [PATCH] drm/msm: handle for EPROBE_DEFER for of_icc_get Jonathan Marek
@ 2020-07-01 17:12 ` Matthias Kaehlcke
2020-07-01 17:13 ` Jonathan Marek
0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2020-07-01 17:12 UTC (permalink / raw)
To: Jonathan Marek
Cc: David Airlie, freedreno, open list:DRM DRIVER FOR MSM ADRENO GPU,
Bjorn Andersson, open list:DRM DRIVER FOR MSM ADRENO GPU,
Sean Paul, open list, Brian Masney
Hi Jonathan,
On Tue, Jun 30, 2020 at 11:08:41PM -0400, Jonathan Marek wrote:
> Check for EPROBE_DEFER instead of silently not using icc if the msm driver
> probes before the interconnect driver.
Agreed with supporting deferred ICC probing.
> Only check for EPROBE_DEFER because of_icc_get can return other errors that
> we want to ignore (ENODATA).
What would be the -ENODATA case?
If the 'interconnects' property is not specified of_icc_get() returns NULL,
shouldn't all (or most) errors be propagated rather than staying silent?
Thanks
Matthias
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/msm: handle for EPROBE_DEFER for of_icc_get
2020-07-01 17:12 ` Matthias Kaehlcke
@ 2020-07-01 17:13 ` Jonathan Marek
2020-07-01 17:31 ` Matthias Kaehlcke
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Marek @ 2020-07-01 17:13 UTC (permalink / raw)
To: Matthias Kaehlcke
Cc: David Airlie, freedreno, open list:DRM DRIVER FOR MSM ADRENO GPU,
Bjorn Andersson, open list:DRM DRIVER FOR MSM ADRENO GPU,
Sean Paul, open list, Brian Masney
On 7/1/20 1:12 PM, Matthias Kaehlcke wrote:
> Hi Jonathan,
>
> On Tue, Jun 30, 2020 at 11:08:41PM -0400, Jonathan Marek wrote:
>> Check for EPROBE_DEFER instead of silently not using icc if the msm driver
>> probes before the interconnect driver.
>
> Agreed with supporting deferred ICC probing.
>
>> Only check for EPROBE_DEFER because of_icc_get can return other errors that
>> we want to ignore (ENODATA).
>
> What would be the -ENODATA case?
>
The of_icc_get for the ocmem_icc_path can return -ENODATA when the ocmem
path is not specified (it is optional and only relevant for a3xx/a4xx).
> If the 'interconnects' property is not specified of_icc_get() returns NULL,
> shouldn't all (or most) errors be propagated rather than staying silent?
>
> Thanks
>
> Matthias
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/msm: handle for EPROBE_DEFER for of_icc_get
2020-07-01 17:13 ` Jonathan Marek
@ 2020-07-01 17:31 ` Matthias Kaehlcke
0 siblings, 0 replies; 4+ messages in thread
From: Matthias Kaehlcke @ 2020-07-01 17:31 UTC (permalink / raw)
To: Jonathan Marek
Cc: David Airlie, freedreno, open list:DRM DRIVER FOR MSM ADRENO GPU,
Bjorn Andersson, open list:DRM DRIVER FOR MSM ADRENO GPU,
Sean Paul, open list, Brian Masney
On Wed, Jul 01, 2020 at 01:13:34PM -0400, Jonathan Marek wrote:
> On 7/1/20 1:12 PM, Matthias Kaehlcke wrote:
> > Hi Jonathan,
> >
> > On Tue, Jun 30, 2020 at 11:08:41PM -0400, Jonathan Marek wrote:
> > > Check for EPROBE_DEFER instead of silently not using icc if the msm driver
> > > probes before the interconnect driver.
> >
> > Agreed with supporting deferred ICC probing.
> >
> > > Only check for EPROBE_DEFER because of_icc_get can return other errors that
> > > we want to ignore (ENODATA).
> >
> > What would be the -ENODATA case?
> >
>
> The of_icc_get for the ocmem_icc_path can return -ENODATA when the ocmem
> path is not specified (it is optional and only relevant for a3xx/a4xx).
Thanks for the clarification!
In this case it seems reasonable to me to return any error for the
'gfx-mem' path and all errors except -ENODATA for 'ocmem'.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-02 7:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 3:08 [PATCH] drm/msm: handle for EPROBE_DEFER for of_icc_get Jonathan Marek
2020-07-01 17:12 ` Matthias Kaehlcke
2020-07-01 17:13 ` Jonathan Marek
2020-07-01 17:31 ` Matthias Kaehlcke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).