Skip to contentSkip to conversation

drm/i915/fence: Do not use TIMER_IRQSAFE

PATCH In review Sebastian Andrzej Siewior 4 participants 7 messages Feb 12, 2019 – Feb 28, 2019

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

PATCH 1/1 drm/i915/fence: Do not use TIMER_IRQSAFE

The timer is initialized with TIMER_IRQSAFE flag. It does look like the timer callback requires this flag at all. Its sole purpose is to ensure synchronisation in the workqueue code.

Remove TIMER_IRQSAFE flag because it is not required.

---
 drivers/gpu/drm/i915/i915_sw_fence.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_sw_fence.c +1 -2
index fc2eeab823b70..6d22d9df6a433 100644
@@ -461,8 +461,7 @@ int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence,
 		timer->dma = dma_fence_get(dma);
 		init_irq_work(&timer->work, irq_i915_sw_fence_work);
 
-		timer_setup(&timer->timer,
-			    timer_i915_sw_fence_wake, TIMER_IRQSAFE);
+		timer_setup(&timer->timer, timer_i915_sw_fence_wake, 0);
 		mod_timer(&timer->timer, round_jiffies_up(jiffies + timeout));
 
 		func = dma_i915_sw_fence_wake_timer;
Signature · 1 line
2.20.1
#1 lore raw

✗ Fi.CI.BAT: failure for drm/i915/fence: Do not use TIMER_IRQSAFE

== Series Details ==

== Series Details ==

Series: drm/i915/fence: Do not use TIMER_IRQSAFE
URL : https://patchwork.freedesktop.org/series/56558/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5594 -> Patchwork_12204
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_12204 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_12204, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/56558/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_12204:

### IGT changes ###

#### Possible regressions ####

* igt@gem_close_race@basic-threads:

    - fi-ilk-650:         PASS -> DMESG-WARN
    - fi-bwr-2160:        PASS -> DMESG-WARN
    - fi-pnv-d510:        PASS -> DMESG-WARN

* igt@gem_ctx_exec@basic:
- fi-byt-j1900: PASS -> DMESG-WARN

* igt@gem_exec_create@basic:

    - fi-byt-clapper:     PASS -> DMESG-WARN
    - fi-blb-e6850:       PASS -> DMESG-WARN
    - fi-apl-guc:         PASS -> DMESG-WARN
    - fi-glk-j4005:       PASS -> DMESG-WARN
    - fi-bxt-j4205:       PASS -> DMESG-WARN
    - fi-byt-n2820:       PASS -> DMESG-WARN
    - fi-bsw-n3050:       PASS -> DMESG-WARN

* igt@gem_exec_fence@basic-busy-default:

    - fi-cfl-guc:         PASS -> DMESG-WARN
    - fi-skl-guc:         NOTRUN -> DMESG-WARN
    - fi-hsw-4770r:       PASS -> DMESG-WARN
    - fi-skl-6600u:       PASS -> DMESG-WARN
    - fi-kbl-x1275:       PASS -> DMESG-WARN
    - fi-cfl-8700k:       PASS -> DMESG-WARN
    - fi-bdw-5557u:       PASS -> DMESG-WARN
    - fi-kbl-7500u:       PASS -> DMESG-WARN
    - fi-kbl-8809g:       PASS -> DMESG-WARN
    - fi-skl-gvtdvm:      PASS -> DMESG-WARN
    - fi-hsw-4770:        PASS -> DMESG-WARN
    - fi-ivb-3520m:       PASS -> DMESG-WARN
    - fi-bdw-gvtdvm:      PASS -> DMESG-WARN
    - fi-skl-6700hq:      PASS -> DMESG-WARN
    - fi-skl-iommu:       PASS -> DMESG-WARN
    - fi-kbl-7567u:       PASS -> DMESG-WARN
    - fi-kbl-guc:         PASS -> DMESG-WARN
    - fi-kbl-r:           PASS -> DMESG-WARN
    - fi-skl-6770hq:      PASS -> DMESG-WARN
    - fi-cfl-8109u:       PASS -> DMESG-WARN
    - fi-elk-e7500:       PASS -> DMESG-WARN
    - fi-skl-6700k2:      PASS -> DMESG-WARN

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@gem_exec_fence@basic-busy-default:

    - {fi-icl-y}:         PASS -> DMESG-WARN
    - {fi-whl-u}:         PASS -> DMESG-WARN
    - {fi-icl-u2}:        NOTRUN -> DMESG-WARN
    - {fi-icl-u3}:        PASS -> DMESG-WARN

* {igt@runner@aborted}:

    - fi-ilk-650:         NOTRUN -> FAIL
    - fi-pnv-d510:        NOTRUN -> FAIL
    - fi-bdw-gvtdvm:      NOTRUN -> FAIL
    - fi-cfl-8109u:       NOTRUN -> FAIL
    - {fi-icl-u2}:        NOTRUN -> FAIL
    - fi-gdg-551:         NOTRUN -> FAIL
    - fi-hsw-4770:        NOTRUN -> FAIL
    - fi-kbl-7500u:       NOTRUN -> FAIL
    - fi-bxt-j4205:       NOTRUN -> FAIL
    - {fi-whl-u}:         NOTRUN -> FAIL
    - {fi-icl-u3}:        NOTRUN -> FAIL
    - fi-byt-j1900:       NOTRUN -> FAIL
    - fi-cfl-guc:         NOTRUN -> FAIL
    - {fi-icl-y}:         NOTRUN -> FAIL
    - fi-kbl-7567u:       NOTRUN -> FAIL
    - fi-bsw-n3050:       NOTRUN -> FAIL
    - fi-blb-e6850:       NOTRUN -> FAIL
    - fi-kbl-x1275:       NOTRUN -> FAIL
    - fi-cfl-8700k:       NOTRUN -> FAIL
    - fi-hsw-4770r:       NOTRUN -> FAIL
    - fi-kbl-8809g:       NOTRUN -> FAIL
    - fi-byt-clapper:     NOTRUN -> FAIL
    - fi-kbl-r:           NOTRUN -> FAIL
    - fi-bdw-5557u:       NOTRUN -> FAIL
    - fi-bwr-2160:        NOTRUN -> FAIL
    - fi-byt-n2820:       NOTRUN -> FAIL
    - fi-kbl-guc:         NOTRUN -> FAIL
    - fi-ivb-3520m:       NOTRUN -> FAIL
    - fi-elk-e7500:       NOTRUN -> FAIL

Known issues
------------

Here are the changes found in Patchwork_12204 that come from known issues:

### IGT changes ###

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321

Participating hosts (43 -> 39)
------------------------------

Additional (2): fi-skl-guc fi-icl-u2
Missing (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bdw-samus

Build changes
-------------

* Linux: CI_DRM_5594 -> Patchwork_12204

CI_DRM_5594: 3e893592ec07457b313e045adfb9ae83f2f7198b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4819: 845c9fb45b734aef95e2fb2317d0c02567e06a68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12204: d6a34845a9d667e54634ef6ccead2d42b2235063 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

d6a34845a9d6 drm/i915/fence: Do not use TIMER_IRQSAFE

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12204/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Sebastian Andrzej Siewior
Quoted 5 lines · On 2019-02-12 17:28:57 [+0100], To [email protected] wrote:

The timer is initialized with TIMER_IRQSAFE flag. It does look like the timer callback requires this flag at all. Its sole purpose is to ensure synchronisation in the workqueue code.

Remove TIMER_IRQSAFE flag because it is not required.

ping

Quoted 17 lines
---
 drivers/gpu/drm/i915/i915_sw_fence.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_sw_fence.c +0 -0
index fc2eeab823b70..6d22d9df6a433 100644

drivers/gpu/drm/i915/i915_sw_fence.c int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence, · line 467

Quoted 9 lines
drivers/gpu/drm/i915/i915_sw_fence.c +1 -2
@@ -461,8 +461,7 @@ int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence,
 		timer->dma = dma_fence_get(dma);
 		init_irq_work(&timer->work, irq_i915_sw_fence_work);
 
-		timer_setup(&timer->timer,
-			    timer_i915_sw_fence_wake, TIMER_IRQSAFE);
+		timer_setup(&timer->timer, timer_i915_sw_fence_wake, 0);
 		mod_timer(&timer->timer, round_jiffies_up(jiffies + timeout));
 
 		func = dma_i915_sw_fence_wake_timer;

Sebastian

#3 lore raw

Quoting Sebastian Andrzej Siewior (2019-02-26 16:00:38)

Quoted 8 lines · On 2019-02-12 17:28:57 [+0100], To [email protected] wrote:
Quoted 5 lines

The timer is initialized with TIMER_IRQSAFE flag. It does look like the timer callback requires this flag at all. Its sole purpose is to ensure synchronisation in the workqueue code.

Remove TIMER_IRQSAFE flag because it is not required.

ping

We call del_timer_sync from irq context, which mandates using TIMER_IRQSAFE. Failure to do so results in lots of explosions across CI -- every machine managed to hit the warning.

It may not be the best of api, but it's the only one available for the driver to use...
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 8 lines · Chris Wilson

Quoting Sebastian Andrzej Siewior (2019-02-26 16:00:38)

Quoted 7 lines · On 2019-02-12 17:28:57 [+0100], To [email protected] wrote:
Quoted 5 lines

The timer is initialized with TIMER_IRQSAFE flag. It does look like the timer callback requires this flag at all. Its sole purpose is to ensure synchronisation in the workqueue code.

Remove TIMER_IRQSAFE flag because it is not required.

Quoted 8 lines
Quoted 1 line

ping

We call del_timer_sync from irq context, which mandates using TIMER_IRQSAFE. Failure to do so results in lots of explosions across CI -- every machine managed to hit the warning.

It may not be the best of api, but it's the only one available for the driver to use...

The comment in the header files says clearly:

* Note: The irq disabled callback execution is a special case for
* workqueue locking issues. It's not meant for executing random crap
* with interrupts disabled. Abuse is monitored!

So what's so special in drm that you need to call del_timer_sync() from interrupt context?

Thanks

tglx

#5 lore raw

Quoting Thomas Gleixner (2019-02-28 10:09:26)

Quoted 19 lines · Chris Wilson
Quoted 9 lines

Quoting Sebastian Andrzej Siewior (2019-02-26 16:00:38)

Quoted 7 lines · On 2019-02-12 17:28:57 [+0100], To [email protected] wrote:
Quoted 5 lines

The timer is initialized with TIMER_IRQSAFE flag. It does look like the timer callback requires this flag at all. Its sole purpose is to ensure synchronisation in the workqueue code.

Remove TIMER_IRQSAFE flag because it is not required.

Quoted 8 lines
Quoted 1 line

ping

We call del_timer_sync from irq context, which mandates using TIMER_IRQSAFE. Failure to do so results in lots of explosions across CI -- every machine managed to hit the warning.

It may not be the best of api, but it's the only one available for the driver to use...

Quoted 8 lines

The comment in the header files says clearly:

* Note: The irq disabled callback execution is a special case for
* workqueue locking issues. It's not meant for executing random crap
* with interrupts disabled. Abuse is monitored!

So what's so special in drm that you need to call del_timer_sync() from interrupt context?

There's no protection against fence signaling from inside interrupt context, and a lot of pressure to do so.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
Quoted 11 lines · Chris Wilson

Quoting Thomas Gleixner (2019-02-28 10:09:26)

Quoted 10 lines · Chris Wilson
Quoted 2 lines

It may not be the best of api, but it's the only one available for the driver to use...

The comment in the header files says clearly:

* Note: The irq disabled callback execution is a special case for
* workqueue locking issues. It's not meant for executing random crap
* with interrupts disabled. Abuse is monitored!

Quoted 5 lines
Quoted 2 lines

So what's so special in drm that you need to call del_timer_sync() from interrupt context?

There's no protection against fence signaling from inside interrupt context, and a lot of pressure to do so.

Whatever that means that still does not justify to pick something which is clearly stated not to be for general usage without talking to the people who added that restriction.

I looked at that code and it's so well commented that's it's utterly obvious how all this is connected and why this is the only way to solve the problem. Oh well..

Thanks,

tglx