Skip to content

Commit fb457e0

Browse files
committed
Merge tag 'exynos-drm-next-for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
One cleanup - Based on the patch[1], clean up the use of request_irq function series. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next-history.git/commit/?id=cbe16f35bee6880becca6f20d2ebf6b457148552 Signed-off-by: Dave Airlie <[email protected]> From: Inki Dae <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2f835b5 + a4e5eed commit fb457e0

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

drivers/gpu/drm/exynos/exynos5433_drm_decon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,8 @@ static int decon_conf_irq(struct decon_context *ctx, const char *name,
775775
return irq;
776776
}
777777
}
778-
irq_set_status_flags(irq, IRQ_NOAUTOEN);
779-
ret = devm_request_irq(ctx->dev, irq, handler, flags, "drm_decon", ctx);
778+
ret = devm_request_irq(ctx->dev, irq, handler,
779+
flags | IRQF_NO_AUTOEN, "drm_decon", ctx);
780780
if (ret < 0) {
781781
dev_err(ctx->dev, "IRQ %s request failed\n", name);
782782
return ret;

drivers/gpu/drm/exynos/exynos_drm_dsi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,10 +1352,9 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi,
13521352
}
13531353

13541354
te_gpio_irq = gpio_to_irq(dsi->te_gpio);
1355-
irq_set_status_flags(te_gpio_irq, IRQ_NOAUTOEN);
13561355

13571356
ret = request_threaded_irq(te_gpio_irq, exynos_dsi_te_irq_handler, NULL,
1358-
IRQF_TRIGGER_RISING, "TE", dsi);
1357+
IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, "TE", dsi);
13591358
if (ret) {
13601359
dev_err(dsi->dev, "request interrupt failed with %d\n", ret);
13611360
gpio_free(dsi->te_gpio);
@@ -1802,9 +1801,9 @@ static int exynos_dsi_probe(struct platform_device *pdev)
18021801
if (dsi->irq < 0)
18031802
return dsi->irq;
18041803

1805-
irq_set_status_flags(dsi->irq, IRQ_NOAUTOEN);
18061804
ret = devm_request_threaded_irq(dev, dsi->irq, NULL,
1807-
exynos_dsi_irq, IRQF_ONESHOT,
1805+
exynos_dsi_irq,
1806+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
18081807
dev_name(dev), dsi);
18091808
if (ret) {
18101809
dev_err(dev, "failed to request dsi irq\n");

include/linux/interrupt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
* interrupt handler after suspending interrupts. For system
6262
* wakeup devices users need to implement wakeup detection in
6363
* their interrupt handlers.
64+
* IRQF_NO_AUTOEN - Don't enable IRQ or NMI automatically when users request it.
65+
* Users will enable it explicitly by enable_irq() or enable_nmi()
66+
* later.
6467
*/
6568
#define IRQF_SHARED 0x00000080
6669
#define IRQF_PROBE_SHARED 0x00000100
@@ -74,6 +77,7 @@
7477
#define IRQF_NO_THREAD 0x00010000
7578
#define IRQF_EARLY_RESUME 0x00020000
7679
#define IRQF_COND_SUSPEND 0x00040000
80+
#define IRQF_NO_AUTOEN 0x00080000
7781

7882
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
7983

kernel/irq/manage.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
16931693
irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
16941694
}
16951695

1696-
if (irq_settings_can_autoenable(desc)) {
1696+
if (!(new->flags & IRQF_NO_AUTOEN) &&
1697+
irq_settings_can_autoenable(desc)) {
16971698
irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
16981699
} else {
16991700
/*
@@ -2086,10 +2087,15 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
20862087
* which interrupt is which (messes up the interrupt freeing
20872088
* logic etc).
20882089
*
2090+
* Also shared interrupts do not go well with disabling auto enable.
2091+
* The sharing interrupt might request it while it's still disabled
2092+
* and then wait for interrupts forever.
2093+
*
20892094
* Also IRQF_COND_SUSPEND only makes sense for shared interrupts and
20902095
* it cannot be set along with IRQF_NO_SUSPEND.
20912096
*/
20922097
if (((irqflags & IRQF_SHARED) && !dev_id) ||
2098+
((irqflags & IRQF_SHARED) && (irqflags & IRQF_NO_AUTOEN)) ||
20932099
(!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) ||
20942100
((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND)))
20952101
return -EINVAL;
@@ -2245,7 +2251,8 @@ int request_nmi(unsigned int irq, irq_handler_t handler,
22452251

22462252
desc = irq_to_desc(irq);
22472253

2248-
if (!desc || irq_settings_can_autoenable(desc) ||
2254+
if (!desc || (irq_settings_can_autoenable(desc) &&
2255+
!(irqflags & IRQF_NO_AUTOEN)) ||
22492256
!irq_settings_can_request(desc) ||
22502257
WARN_ON(irq_settings_is_per_cpu_devid(desc)) ||
22512258
!irq_supports_nmi(desc))

0 commit comments

Comments
 (0)