diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2018-05-04 10:24:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-05 16:26:47 -0400 |
commit | 47b82e88180c3c6db795a43373beab47cb073f7a (patch) | |
tree | 1ef365d5cbd94830da977107d8f11ebe466610fe | |
parent | ce1e518190ea71d1ecf1a91a8b0794ba9bd78e89 (diff) |
ide: don't enable/disable interrupts in force threaded-IRQ mode
The interrupts are enabled/disabled so the interrupt handler can run
with enabled interrupts while serving the interrupt and not lose other
interrupts especially the timer tick.
If the system runs with force-threaded interrupts then there is no need
to enable the interrupts.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/ide/ide-iops.c | 13 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 2 | ||||
-rw-r--r-- | kernel/irq/manage.c | 1 |
3 files changed, 11 insertions, 5 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 210a0887dd29..d55e9ebd5628 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -108,6 +108,7 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, | |||
108 | ide_hwif_t *hwif = drive->hwif; | 108 | ide_hwif_t *hwif = drive->hwif; |
109 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; | 109 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
110 | unsigned long flags; | 110 | unsigned long flags; |
111 | bool irqs_threaded = force_irqthreads; | ||
111 | int i; | 112 | int i; |
112 | u8 stat; | 113 | u8 stat; |
113 | 114 | ||
@@ -115,8 +116,10 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, | |||
115 | stat = tp_ops->read_status(hwif); | 116 | stat = tp_ops->read_status(hwif); |
116 | 117 | ||
117 | if (stat & ATA_BUSY) { | 118 | if (stat & ATA_BUSY) { |
118 | local_save_flags(flags); | 119 | if (!irqs_threaded) { |
119 | local_irq_enable_in_hardirq(); | 120 | local_save_flags(flags); |
121 | local_irq_enable_in_hardirq(); | ||
122 | } | ||
120 | timeout += jiffies; | 123 | timeout += jiffies; |
121 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { | 124 | while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { |
122 | if (time_after(jiffies, timeout)) { | 125 | if (time_after(jiffies, timeout)) { |
@@ -129,12 +132,14 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, | |||
129 | if ((stat & ATA_BUSY) == 0) | 132 | if ((stat & ATA_BUSY) == 0) |
130 | break; | 133 | break; |
131 | 134 | ||
132 | local_irq_restore(flags); | 135 | if (!irqs_threaded) |
136 | local_irq_restore(flags); | ||
133 | *rstat = stat; | 137 | *rstat = stat; |
134 | return -EBUSY; | 138 | return -EBUSY; |
135 | } | 139 | } |
136 | } | 140 | } |
137 | local_irq_restore(flags); | 141 | if (!irqs_threaded) |
142 | local_irq_restore(flags); | ||
138 | } | 143 | } |
139 | /* | 144 | /* |
140 | * Allow status to settle, then read it again. | 145 | * Allow status to settle, then read it again. |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 14bdab15a454..89b29028d315 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -405,7 +405,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, | |||
405 | return startstop; | 405 | return startstop; |
406 | } | 406 | } |
407 | 407 | ||
408 | if ((drive->dev_flags & IDE_DFLAG_UNMASK) == 0) | 408 | if (!force_irqthreads && (drive->dev_flags & IDE_DFLAG_UNMASK) == 0) |
409 | local_irq_disable(); | 409 | local_irq_disable(); |
410 | 410 | ||
411 | ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE); | 411 | ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE); |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index e3336d904f64..4c2ef8084e32 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #ifdef CONFIG_IRQ_FORCED_THREADING | 25 | #ifdef CONFIG_IRQ_FORCED_THREADING |
26 | __read_mostly bool force_irqthreads; | 26 | __read_mostly bool force_irqthreads; |
27 | EXPORT_SYMBOL_GPL(force_irqthreads); | ||
27 | 28 | ||
28 | static int __init setup_forced_irqthreads(char *arg) | 29 | static int __init setup_forced_irqthreads(char *arg) |
29 | { | 30 | { |