Skip to contentSkip to conversation

sanitize RPS interrupt enabling/disabling

PATCH In review Imre Deak 3 participants 6 messages Nov 5, 2014 – Nov 18, 2014

lore
Share & tools
lore

Imre Deak

author
#0 lore raw

cover sanitize RPS interrupt enabling/disabling

While fixing [1] I noticed that we can simplify a couple of things in the RPS enabling/disabling code. So I did that and also fixed one WARN that we can hit with some of the pm_rpm subtests. Hopefully these changes also makes it clearer how we avoid the race during RPS interrupt disabling and makes it less fragile (see the comment in patch 7/8).

[1] https://bugs.freedesktop.org/show_bug.cgi?id=82939

Imre Deak (8):
drm/i915: unify gen6/gen8 pm irq helpers drm/i915: unify gen6/gen8 rps irq handler drm/i915: unify gen6/gen8 rps irq enable/disable drm/i915: move rps irq enable/disable to i915_irq.c drm/i915: move rps irq disable one level up drm/i915: sanitize rps irq enabling
drm/i915: sanitize rps irq disabling
drm/i915: disable rps irqs earlier during suspend/unload

 drivers/gpu/drm/i915/i915_drv.c      |   9 +--
 drivers/gpu/drm/i915/i915_drv.h      |   6 +-
 drivers/gpu/drm/i915/i915_irq.c      | 122 +++++++++++++++++++----------------
 drivers/gpu/drm/i915/intel_display.c |   6 +-
 drivers/gpu/drm/i915/intel_drv.h     |   5 +-
 drivers/gpu/drm/i915/intel_pm.c      |  90 +++-----------------------
 6 files changed, 90 insertions(+), 148 deletions(-)
Signature · 6 lines
1.8.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

2014-11-05 16:48 GMT-02:00 Imre Deak <[email protected]>:

Quoted 5 lines

While fixing [1] I noticed that we can simplify a couple of things in the RPS enabling/disabling code. So I did that and also fixed one WARN that we can hit with some of the pm_rpm subtests. Hopefully these changes also makes it clearer how we avoid the race during RPS interrupt disabling and makes it less fragile (see the comment in patch 7/8).

For patches 1-4: Reviewed-by: Paulo Zanoni <[email protected]>

But for patch 4, can't we try to create a new intel_rps.c and move stuff there, instead of keeping them in i915_irq.c? I kinda like the idea of files containing single features... Anyway, we can do this in yet-another patch.

For patches 5-6: the addition of gen9_disable_rps() and gen9_enable_rps() kinda broke these patches...

Quoted 28 lines

[1] https://bugs.freedesktop.org/show_bug.cgi?id=82939

Imre Deak (8):
drm/i915: unify gen6/gen8 pm irq helpers drm/i915: unify gen6/gen8 rps irq handler drm/i915: unify gen6/gen8 rps irq enable/disable drm/i915: move rps irq enable/disable to i915_irq.c drm/i915: move rps irq disable one level up drm/i915: sanitize rps irq enabling
drm/i915: sanitize rps irq disabling
drm/i915: disable rps irqs earlier during suspend/unload

 drivers/gpu/drm/i915/i915_drv.c      |   9 +--
 drivers/gpu/drm/i915/i915_drv.h      |   6 +-
 drivers/gpu/drm/i915/i915_irq.c      | 122 +++++++++++++++++++----------------
 drivers/gpu/drm/i915/intel_display.c |   6 +-
 drivers/gpu/drm/i915/intel_drv.h     |   5 +-
 drivers/gpu/drm/i915/intel_pm.c      |  90 +++-----------------------
 6 files changed, 90 insertions(+), 148 deletions(-)

--
1.8.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 5 lines
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#2 lore raw
Quoted 7 lines · Paulo Zanoni

2014-11-05 16:48 GMT-02:00 Imre Deak <[email protected]>:

Quoted 5 lines

While fixing [1] I noticed that we can simplify a couple of things in the RPS enabling/disabling code. So I did that and also fixed one WARN that we can hit with some of the pm_rpm subtests. Hopefully these changes also makes it clearer how we avoid the race during RPS interrupt disabling and makes it less fragile (see the comment in patch 7/8).

Quoted 5 lines

For patches 1-4: Reviewed-by: Paulo Zanoni <[email protected]> But for patch 4, can't we try to create a new intel_rps.c and move stuff there, instead of keeping them in i915_irq.c? I kinda like the idea of files containing single features... Anyway, we can do this in yet-another patch.

intel_rps.c sounds like a good idea. For now I moved the RPS interrupt handling to i915_irq.c, since half of it is already there (snb_update_pm_irq() which pokes at the same registers) as well as the RPS work itself and its scheduling. Ville also had the idea to further simplify things since the PM IRQ clearing, masking, enabling is very similar to how this is done for other interrupt sources and i915_irq.c would be a good staging area for such future work. So I'd also suggest refactoring thing into intel_rps.c as a follow-up.

Quoted 2 lines

For patches 5-6: the addition of gen9_disable_rps() and gen9_enable_rps() kinda broke these patches...

Good catch, I didn't consider the GEN9 patches. We don't yet support RPS there at all, but still call gen9_enable/disable_rps(), since the same function deals with RC6 too. I assume that the GEN9 RPS support will be added soonish though so for now I'd solve this by simply skipping gen6_reset/enable/disable_rps_interrupts() for GEN9.

Quoted 22 lines
Quoted 22 lines

[1] https://bugs.freedesktop.org/show_bug.cgi?id=82939

Imre Deak (8):
drm/i915: unify gen6/gen8 pm irq helpers drm/i915: unify gen6/gen8 rps irq handler drm/i915: unify gen6/gen8 rps irq enable/disable drm/i915: move rps irq enable/disable to i915_irq.c drm/i915: move rps irq disable one level up drm/i915: sanitize rps irq enabling
drm/i915: sanitize rps irq disabling
drm/i915: disable rps irqs earlier during suspend/unload

 drivers/gpu/drm/i915/i915_drv.c      |   9 +--
 drivers/gpu/drm/i915/i915_drv.h      |   6 +-
 drivers/gpu/drm/i915/i915_irq.c      | 122 +++++++++++++++++++----------------
 drivers/gpu/drm/i915/intel_display.c |   6 +-
 drivers/gpu/drm/i915/intel_drv.h     |   5 +-
 drivers/gpu/drm/i915/intel_pm.c      |  90 +++-----------------------
 6 files changed, 90 insertions(+), 148 deletions(-)
Quoted 10 lines
Quoted 7 lines

--
1.8.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 14 lines · Imre Deak
Quoted 7 lines · Paulo Zanoni

2014-11-05 16:48 GMT-02:00 Imre Deak <[email protected]>:

Quoted 5 lines

While fixing [1] I noticed that we can simplify a couple of things in the RPS enabling/disabling code. So I did that and also fixed one WARN that we can hit with some of the pm_rpm subtests. Hopefully these changes also makes it clearer how we avoid the race during RPS interrupt disabling and makes it less fragile (see the comment in patch 7/8).

Quoted 5 lines

For patches 1-4: Reviewed-by: Paulo Zanoni <[email protected]> But for patch 4, can't we try to create a new intel_rps.c and move stuff there, instead of keeping them in i915_irq.c? I kinda like the idea of files containing single features... Anyway, we can do this in yet-another patch.

Quoted 8 lines

intel_rps.c sounds like a good idea. For now I moved the RPS interrupt handling to i915_irq.c, since half of it is already there (snb_update_pm_irq() which pokes at the same registers) as well as the RPS work itself and its scheduling. Ville also had the idea to further simplify things since the PM IRQ clearing, masking, enabling is very similar to how this is done for other interrupt sources and i915_irq.c would be a good staging area for such future work. So I'd also suggest refactoring thing into intel_rps.c as a follow-up.

With my recent i915_irq.c cleanup I've left the low-level irq masking/handling of the interrupt regs in i915_irq.c and only moved the actual logic for a feature into new files like intel_fifo_underrun.c.

The reason for that is that often the irq bits change on different platforms than the actual registers, e.g. gmbus has pretty much not changed since gen2, but the irq bits moved like crazy. And I also like to keep all the irq masking stuff together - it's tricky code and keeping it in one feel increases changes that we handle everything the same. So I think that should generally be a good split.

But intel_rps.c for all the rps code + a bit of kerneldoc sounds like a really good idea. Especially since rps code is called from lots of places (e.g. Chris' booster logic).
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
In reply to Imre Deak

2014-11-05 16:48 GMT-02:00 Imre Deak <[email protected]>:

Quoted 8 lines

While fixing [1] I noticed that we can simplify a couple of things in the RPS enabling/disabling code. So I did that and also fixed one WARN that we can hit with some of the pm_rpm subtests. Hopefully these changes also makes it clearer how we avoid the race during RPS interrupt disabling and makes it less fragile (see the comment in patch 7/8).

[1] https://bugs.freedesktop.org/show_bug.cgi?id=82939

Quoted 9 lines

Imre Deak (8):
drm/i915: unify gen6/gen8 pm irq helpers drm/i915: unify gen6/gen8 rps irq handler drm/i915: unify gen6/gen8 rps irq enable/disable drm/i915: move rps irq enable/disable to i915_irq.c drm/i915: move rps irq disable one level up drm/i915: sanitize rps irq enabling
drm/i915: sanitize rps irq disabling
drm/i915: disable rps irqs earlier during suspend/unload

With or without my bikesheds, feel free to add "Reviewed-by: Paulo Zanoni <[email protected]>" to:
- new versions of patches 5, 6, and 7
- patch 8

Although it would be nice to see those "gen != 9" replaced with "gen < 9", but maybe Daniel can do this.

Quoted 16 lines
 drivers/gpu/drm/i915/i915_drv.c      |   9 +--
 drivers/gpu/drm/i915/i915_drv.h      |   6 +-
 drivers/gpu/drm/i915/i915_irq.c      | 122 +++++++++++++++++++----------------
 drivers/gpu/drm/i915/intel_display.c |   6 +-
 drivers/gpu/drm/i915/intel_drv.h     |   5 +-
 drivers/gpu/drm/i915/intel_pm.c      |  90 +++-----------------------
 6 files changed, 90 insertions(+), 148 deletions(-)

--
1.8.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 5 lines
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#5 lore raw
Quoted 19 lines · Paulo Zanoni

2014-11-05 16:48 GMT-02:00 Imre Deak <[email protected]>:

Quoted 8 lines

While fixing [1] I noticed that we can simplify a couple of things in the RPS enabling/disabling code. So I did that and also fixed one WARN that we can hit with some of the pm_rpm subtests. Hopefully these changes also makes it clearer how we avoid the race during RPS interrupt disabling and makes it less fragile (see the comment in patch 7/8).

[1] https://bugs.freedesktop.org/show_bug.cgi?id=82939

Quoted 9 lines

Imre Deak (8):
drm/i915: unify gen6/gen8 pm irq helpers drm/i915: unify gen6/gen8 rps irq handler drm/i915: unify gen6/gen8 rps irq enable/disable drm/i915: move rps irq enable/disable to i915_irq.c drm/i915: move rps irq disable one level up drm/i915: sanitize rps irq enabling
drm/i915: sanitize rps irq disabling
drm/i915: disable rps irqs earlier during suspend/unload

Quoted 4 lines

With or without my bikesheds, feel free to add "Reviewed-by: Paulo Zanoni <[email protected]>" to:
- new versions of patches 5, 6, and 7
- patch 8

Thanks!

Quoted 2 lines

Although it would be nice to see those "gen != 9" replaced with "gen < 9", but maybe Daniel can do this.

Ok, will resend with those changes.

Quoted 8 lines
Quoted 8 lines
 drivers/gpu/drm/i915/i915_drv.c      |   9 +--
 drivers/gpu/drm/i915/i915_drv.h      |   6 +-
 drivers/gpu/drm/i915/i915_irq.c      | 122 +++++++++++++++++++----------------
 drivers/gpu/drm/i915/intel_display.c |   6 +-
 drivers/gpu/drm/i915/intel_drv.h     |   5 +-
 drivers/gpu/drm/i915/intel_pm.c      |  90 +++-----------------------
 6 files changed, 90 insertions(+), 148 deletions(-)
Quoted 10 lines
Quoted 7 lines

--
1.8.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx