Skip to contentSkip to conversation

drm/lima: fix lima_gem_wait() return value

PATCH In review Vasily Khoruzhick 3 participants 6 messages Sep 8, 2019 – Sep 10, 2019

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

PATCH 1/1 drm/lima: fix lima_gem_wait() return value

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error.

---
 drivers/gpu/drm/lima/lima_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/lima/lima_gem.c +1 -1
index 477c0f766663..b609dc030d6c 100644
@@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
 	timeout = drm_timeout_abs_to_jiffies(timeout_ns);
 
 	ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
-	if (ret == 0)
+	if (ret == -ETIME)
 		ret = timeout ? -ETIMEDOUT : -EBUSY;
 
 	return ret;
Signature · 1 line
2.23.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Oh, I was miss leading by the drm_gem_reservation_object_wait comments. Patch is:

I'll apply this patch to drm-misc-next.

Current kernel release is 5.3-rc8, is it too late for this fix to go into the mainline 5.3 release?
I'd like to know how to apply this fix for current rc kernels, by drm-misc-fixes? Can I push
to drm-misc-fixes by dim or I can only push to drm-misc-next and drm-misc maintainer will
pick fixes from it to drm-misc-fixes?

Thanks,
Qiang

Quoted 26 lines · Vasily Khoruzhick

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error.

---
 drivers/gpu/drm/lima/lima_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/lima/lima_gem.c +1 -2
index 477c0f766663..b609dc030d6c 100644
@@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
        timeout = drm_timeout_abs_to_jiffies(timeout_ns);
 
        ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
-       if (ret == 0)
+       if (ret == -ETIME)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
 
        return ret;
--

2.23.0

#2 lore raw

Hi Qiang,

Am Montag, 9. September 2019, 04:30:43 CEST schrieb Qiang Yu:

Quoted 6 lines

Oh, I was miss leading by the drm_gem_reservation_object_wait comments. Patch is:

I'll apply this patch to drm-misc-next.

Quoted 7 lines

Current kernel release is 5.3-rc8, is it too late for this fix to go into the mainline 5.3 release?
I'd like to know how to apply this fix for current rc kernels, by drm-misc-fixes? Can I push
to drm-misc-fixes by dim or I can only push to drm-misc-next and drm-misc maintainer will
pick fixes from it to drm-misc-fixes?

drm-misc-fixes gets merged into drm-misc-next by maintainers regularly, so I _think_ you should apply the fix-patch to drm-misc-fixes first. [I also always have to read the documentation ;-) ]

In any case you might want to add a "Fixes: ....." tag as well as a "Cc: [email protected]" tag, so it can be backported to stable kernels if applicable.

Heiko

Quoted 31 lines · Vasily Khoruzhick
Quoted 24 lines

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error.

---
 drivers/gpu/drm/lima/lima_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/lima/lima_gem.c +1 -2
index 477c0f766663..b609dc030d6c 100644
@@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
        timeout = drm_timeout_abs_to_jiffies(timeout_ns);
 
        ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
-       if (ret == 0)
+       if (ret == -ETIME)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
 
        return ret;
--
Quoted 2 lines

2.23.0

_______________________________________________
lima mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/lima

#3 lore raw
Quoted 18 lines · Heiko Stübner

Hi Qiang,

Am Montag, 9. September 2019, 04:30:43 CEST schrieb Qiang Yu:

Quoted 6 lines

Oh, I was miss leading by the drm_gem_reservation_object_wait comments. Patch is:

I'll apply this patch to drm-misc-next.

Quoted 7 lines

Current kernel release is 5.3-rc8, is it too late for this fix to go into the mainline 5.3 release?
I'd like to know how to apply this fix for current rc kernels, by drm-misc-fixes? Can I push
to drm-misc-fixes by dim or I can only push to drm-misc-next and drm-misc maintainer will
pick fixes from it to drm-misc-fixes?

Quoted 7 lines

drm-misc-fixes gets merged into drm-misc-next by maintainers regularly, so I _think_ you should apply the fix-patch to drm-misc-fixes first. [I also always have to read the documentation ;-) ]

In any case you might want to add a "Fixes: ....." tag as well as a "Cc: [email protected]" tag, so it can be backported to stable kernels if applicable.

Cc stable is already here, but I think it still needs "Fixes: " tag.

Qiang, can you add it at your side or you want me to resend the patch?

Quoted 38 lines

Heiko

Quoted 31 lines · Vasily Khoruzhick
Quoted 24 lines

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error.

---
 drivers/gpu/drm/lima/lima_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/lima/lima_gem.c +1 -2
index 477c0f766663..b609dc030d6c 100644
@@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
        timeout = drm_timeout_abs_to_jiffies(timeout_ns);
 
        ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
-       if (ret == 0)
+       if (ret == -ETIME)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
 
        return ret;
--
Quoted 2 lines

2.23.0

_______________________________________________
lima mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/lima

maintainer
#4 lore raw

Thanks Heiko, I'll push this patch to drm-misc-fixes.

I can add the Fixes tag before push.

Thanks,
Qiang

Quoted 70 lines · Vasily Khoruzhick
Quoted 18 lines · Heiko Stübner

Hi Qiang,

Am Montag, 9. September 2019, 04:30:43 CEST schrieb Qiang Yu:

Quoted 6 lines

Oh, I was miss leading by the drm_gem_reservation_object_wait comments. Patch is:

I'll apply this patch to drm-misc-next.

Quoted 7 lines

Current kernel release is 5.3-rc8, is it too late for this fix to go into the mainline 5.3 release?
I'd like to know how to apply this fix for current rc kernels, by drm-misc-fixes? Can I push
to drm-misc-fixes by dim or I can only push to drm-misc-next and drm-misc maintainer will
pick fixes from it to drm-misc-fixes?

Quoted 7 lines

drm-misc-fixes gets merged into drm-misc-next by maintainers regularly, so I _think_ you should apply the fix-patch to drm-misc-fixes first. [I also always have to read the documentation ;-) ]

In any case you might want to add a "Fixes: ....." tag as well as a "Cc: [email protected]" tag, so it can be backported to stable kernels if applicable.

Cc stable is already here, but I think it still needs "Fixes: " tag.

Qiang, can you add it at your side or you want me to resend the patch?

Quoted 38 lines

Heiko

Quoted 31 lines · Vasily Khoruzhick
Quoted 24 lines

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error.

---
 drivers/gpu/drm/lima/lima_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/lima/lima_gem.c +1 -2
index 477c0f766663..b609dc030d6c 100644
@@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
        timeout = drm_timeout_abs_to_jiffies(timeout_ns);
 
        ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
-       if (ret == 0)
+       if (ret == -ETIME)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
 
        return ret;
--
Quoted 2 lines

2.23.0

_______________________________________________
lima mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/lima

maintainer
#5 lore raw

I've pushed this patch to drm-misc-fixes:
https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-fixes&id=21670bd78a25001cf8ef2679b378c73fb73b904f

There is a conflict when drm-tip merge process which has been solved by following the doc:
https://drm.pages.freedesktop.org/maintainer-tools/drm-tip.html
drm_gem_reservation_object_wait() has been renamed to drm_gem_dma_resv_wait() in drm-misc-next and drm-next.

Please let me know if I have to also push this fix to drm-misc-next by my own.

Thanks,
Qiang

Quoted 79 lines · Qiang Yu

Thanks Heiko, I'll push this patch to drm-misc-fixes.

I can add the Fixes tag before push.

Thanks,
Qiang

Quoted 70 lines · Vasily Khoruzhick
Quoted 18 lines · Heiko Stübner

Hi Qiang,

Am Montag, 9. September 2019, 04:30:43 CEST schrieb Qiang Yu:

Quoted 6 lines

Oh, I was miss leading by the drm_gem_reservation_object_wait comments. Patch is:

I'll apply this patch to drm-misc-next.

Quoted 7 lines

Current kernel release is 5.3-rc8, is it too late for this fix to go into the mainline 5.3 release?
I'd like to know how to apply this fix for current rc kernels, by drm-misc-fixes? Can I push
to drm-misc-fixes by dim or I can only push to drm-misc-next and drm-misc maintainer will
pick fixes from it to drm-misc-fixes?

Quoted 7 lines

drm-misc-fixes gets merged into drm-misc-next by maintainers regularly, so I _think_ you should apply the fix-patch to drm-misc-fixes first. [I also always have to read the documentation ;-) ]

In any case you might want to add a "Fixes: ....." tag as well as a "Cc: [email protected]" tag, so it can be backported to stable kernels if applicable.

Cc stable is already here, but I think it still needs "Fixes: " tag.

Qiang, can you add it at your side or you want me to resend the patch?

Quoted 38 lines

Heiko

Quoted 31 lines · Vasily Khoruzhick
Quoted 24 lines

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error.

---
 drivers/gpu/drm/lima/lima_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/lima/lima_gem.c +1 -2
index 477c0f766663..b609dc030d6c 100644
@@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
        timeout = drm_timeout_abs_to_jiffies(timeout_ns);
 
        ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
-       if (ret == 0)
+       if (ret == -ETIME)
                ret = timeout ? -ETIMEDOUT : -EBUSY;
 
        return ret;
--
Quoted 2 lines

2.23.0

_______________________________________________
lima mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/lima

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel