Skip to content

genirq: Cleanups and conversion to lock guards

Thomas Gleixner linux-tegra lkml 2 versions – Applied

Status from this message: The following commit has been merged into the irq/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest45 patches 25 repliesApplied
  2. v146 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Rebase on latest tip irq/core

- Make coding style consistent (Jiri, Shrikanth)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/45genirq: Provide conditional lock guardskernel/irq/internals.h+29 -60 replies
2/45genirq/irqdesc: Switch to lock guardskernel/irq/irqdesc.c+43 -841 reply
2/45genirq/irqdesc: Switch to lock guardskernel/irq/irqdesc.c+44 -851 reply
3/45genirq/autoprobe: Switch to lock guardskernel/irq/autoprobe.c+9 -170 replies
4/45genirq/pm: Switch to lock guardskernel/irq/pm.c+13 -250 replies
5/45genirq/resend: Switch to lock guardskernel/irq/resend.c+21 -290 replies
6/45genirq/proc: Switch to lock guardskernel/irq/proc.c+24 -415 replies
7/45genirq/spurious: Cleanup codekernel/irq/spurious.c+28 -460 replies
8/45genirq/spurious: Switch to lock guardskernel/irq/spurious.c+12 -180 replies
9/45genirq/cpuhotplug: Convert to lock guardskernel/irq/cpuhotplug.c+4 -62 replies
10/45genirq/debugfs: Convert to lock guardskernel/irq/debugfs.c+1 -20 replies
11/45genirq/chip: Prepare for code reductionkernel/irq/chip.c+27 -80 replies
12/45genirq/chip: Rework handle_nested_irq()kernel/irq/chip.c+36 -422 replies
13/45genirq/chip: Rework handle_simple_irq()kernel/irq/chip.c+10 -200 replies
14/45genirq/chip: Rework handle_untracked_irq()kernel/irq/chip.c+16 -270 replies
15/45genirq/chip: Rework handle_level_irq()kernel/irq/chip.c+9 -230 replies
16/45genirq/chip: Rework handle_eoi_irq()kernel/irq/chip.c+18 -240 replies
17/45genirq/chip: Rework handle_edge_irq()kernel/irq/chip.c+16 -330 replies
18/45genirq/chip: Rework handle_fasteoi_ack_irq()kernel/irq/chip.c+13 -260 replies
19/45genirq/chip: Rework handle_fasteoi_mask_irq()kernel/irq/chip.c+9 -290 replies
20/45genirq/chip: Use lock guards where applicablekernel/irq/chip.c+8 -160 replies
21/45genirq/chip: Rework irq_set_chip()kernel/irq/chip.c+12 -160 replies
22/45genirq/chip: Rework irq_set_irq_type()kernel/irq/chip.c+6 -130 replies
23/45genirq/chip: Rework irq_set_handler_data()kernel/irq/chip.c+9 -120 replies
24/45genirq/chip: Rework irq_set_msi_desc_off()kernel/irq/chip.c+17 -210 replies
25/45genirq/chip: Rework irq_set_chip_data()kernel/irq/chip.c+9 -120 replies
26/45genirq/chip: Rework irq_set_handler() variantskernel/irq/chip.c+11 -237 replies
27/45genirq/chip: Rework irq_modify_status()kernel/irq/chip.c+27 -310 replies
28/45genirq/manage: Cleanup kernel doc commentskernel/irq/manage.c+276 -2940 replies
29/45genirq/manage: Convert to lock guardskernel/irq/manage.c+58 -970 replies
30/45genirq/manage: Rework irq_update_affinity_desc()kernel/irq/manage.c+32 -440 replies
31/45genirq/manage: Rework __irq_apply_affinity_hint()kernel/irq/manage.c+10 -120 replies
32/45genirq/manage: Rework irq_set_vcpu_affinity()kernel/irq/manage.c+17 -231 reply
32/45genirq/manage: Rework irq_set_vcpu_affinity()kernel/irq/manage.c+16 -230 replies
33/45genirq/manage: Rework __disable_irq_nosync()kernel/irq/manage.c+5 -80 replies
34/45genirq/manage: Rework enable_irq()kernel/irq/manage.c+6 -110 replies
35/45genirq/manage: Rework irq_set_irq_wake()kernel/irq/manage.c+28 -332 replies
35/45genirq/manage: Rework irq_set_irq_wake()kernel/irq/manage.c+30 -353 replies
36/45genirq/manage: Rework can_request_irq()include/linux/irq.h kernel/irq/manage.c+9 -140 replies
37/45genirq/manage: Rework irq_set_parent()kernel/irq/manage.c+5 -100 replies
38/45genirq/manage: Rework enable_percpu_irq()kernel/irq/manage.c+16 -260 replies
39/45genirq/manage: Rework irq_percpu_is_enabled()kernel/irq/manage.c+3 -130 replies
40/45genirq/manage: Rework disable_percpu_irq()kernel/irq/manage.c+2 -90 replies
41/45genirq/manage: Rework prepare_percpu_nmi()kernel/irq/manage.c+9 -220 replies
42/45genirq/manage: Rework teardown_percpu_nmi()kernel/irq/manage.c+5 -140 replies
43/45genirq/manage: Rework irq_get_irqchip_state()kernel/irq/manage.c+6 -160 replies
44/45genirq/manage: Rework irq_set_irqchip_state()kernel/irq/manage.c+20 -330 replies
45/45genirq: Remove irq_[get|put]_desc*()kernel/irq/internals.h+0 -240 replies

Reviews trailers per patch

2 of 48 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJiri SlabyPeter Zijlstra (Intel)
SeriesA-b
1/45
2/45R-b
2/45R-b
3/45
4/45
5/45
6/45
7/45
8/45
9/45
10/45
11/45
12/45
13/45
14/45
15/45
16/45
17/45
18/45
19/45
20/45
21/45
22/45
23/45
24/45
25/45
26/45
27/45
28/45
29/45
30/45
31/45
32/45
32/45
33/45
34/45
35/45
35/45
36/45
37/45
38/45
39/45
40/45
41/45
42/45
43/45
44/45
45/45

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [patch V2 00/45] genirq: Cleanups and conversion to lock guards

This is V2 of the generic interrupt locking overhaul. V1 can be found here:

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

The generic interrupt core code has accumulated quite some inconsistencies over time and a common pattern in various API functions is:

    unsigned long flags;
    struct irq_desc *desc = irq_get_desc_[bus]lock(irq, &flags, mode);

    if (!desc)
       return -EINVAL;
    ....
    irq_put_desc_[bus]unlock(desc, flags);

That's awkward and requires gotos in failure paths.

This series provides conditional lock guards and converts the core code over to use those guards. Along with that it converts the other open coded lock/unlock pairs and fixes up coding and kernel doc formatting. The conversions were partially done with Coccinelle where possible.

Changes vs. V1:

- Rebase on latest tip irq/core

- Make coding style consistent (Jiri, Shrikanth)

The series applies on

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core

and is also available from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/core

Thanks,

tglx

---
 include/linux/irq.h     |    2 
 kernel/irq/autoprobe.c  |   26 -
 kernel/irq/chip.c       |  609 ++++++++++---------------
 kernel/irq/cpuhotplug.c |   10 
 kernel/irq/debugfs.c    |    3 
 kernel/irq/internals.h  |   47 -
 kernel/irq/irqdesc.c    |  127 +----
 kernel/irq/manage.c     | 1154 ++++++++++++++++++++----------------------------
 kernel/irq/pm.c         |   38 -
 kernel/irq/proc.c       |   65 --
 kernel/irq/resend.c     |   50 --
 kernel/irq/spurious.c   |  104 +---
 12 files changed, 913 insertions(+), 1322 deletions(-)