Skip to content

Commit

Permalink
Merge tag 'irq_urgent_for_v6.9_rc2' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tip/tip

Pull irq fixes from Borislav Petkov:

 - Fix an unused function warning on irqchip/irq-armada-370-xp

 - Fix the IRQ sharing with pinctrl-amd and ACPI OSL

* tag 'irq_urgent_for_v6.9_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip/armada-370-xp: Suppress unused-function warning
  genirq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd
  • Loading branch information
Linus Torvalds committed Mar 31, 2024
2 parents 448f828 + 9e81e32 commit 5dad262
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-armada-370-xp.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int armada_370_xp_msi_init(struct device_node *node,
return 0;
}
#else
static void armada_370_xp_msi_reenable_percpu(void) {}
static __maybe_unused void armada_370_xp_msi_reenable_percpu(void) {}

static inline int armada_370_xp_msi_init(struct device_node *node,
phys_addr_t main_int_phys_base)
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinctrl-amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
}

ret = devm_request_irq(&pdev->dev, gpio_dev->irq, amd_gpio_irq_handler,
IRQF_SHARED | IRQF_ONESHOT, KBUILD_MODNAME, gpio_dev);
IRQF_SHARED | IRQF_COND_ONESHOT, KBUILD_MODNAME, gpio_dev);
if (ret)
goto out2;

Expand Down
3 changes: 3 additions & 0 deletions include/linux/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
* later.
* IRQF_NO_DEBUG - Exclude from runnaway detection for IPI and similar handlers,
* depends on IRQF_PERCPU.
* IRQF_COND_ONESHOT - Agree to do IRQF_ONESHOT if already set for a shared
* interrupt.
*/
#define IRQF_SHARED 0x00000080
#define IRQF_PROBE_SHARED 0x00000100
Expand All @@ -82,6 +84,7 @@
#define IRQF_COND_SUSPEND 0x00040000
#define IRQF_NO_AUTOEN 0x00080000
#define IRQF_NO_DEBUG 0x00100000
#define IRQF_COND_ONESHOT 0x00200000

#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)

Expand Down
9 changes: 7 additions & 2 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,8 +1643,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
}

if (!((old->flags & new->flags) & IRQF_SHARED) ||
(oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||
((old->flags ^ new->flags) & IRQF_ONESHOT))
(oldtype != (new->flags & IRQF_TRIGGER_MASK)))
goto mismatch;

if ((old->flags & IRQF_ONESHOT) &&
(new->flags & IRQF_COND_ONESHOT))
new->flags |= IRQF_ONESHOT;
else if ((old->flags ^ new->flags) & IRQF_ONESHOT)
goto mismatch;

/* All handlers must agree on per-cpuness */
Expand Down

0 comments on commit 5dad262

Please sign in to comment.