Commit 47b82e88 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by David S. Miller

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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ce1e5181
...@@ -108,6 +108,7 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, ...@@ -108,6 +108,7 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad,
ide_hwif_t *hwif = drive->hwif; ide_hwif_t *hwif = drive->hwif;
const struct ide_tp_ops *tp_ops = hwif->tp_ops; const struct ide_tp_ops *tp_ops = hwif->tp_ops;
unsigned long flags; unsigned long flags;
bool irqs_threaded = force_irqthreads;
int i; int i;
u8 stat; u8 stat;
...@@ -115,8 +116,10 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, ...@@ -115,8 +116,10 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad,
stat = tp_ops->read_status(hwif); stat = tp_ops->read_status(hwif);
if (stat & ATA_BUSY) { if (stat & ATA_BUSY) {
local_save_flags(flags); if (!irqs_threaded) {
local_irq_enable_in_hardirq(); local_save_flags(flags);
local_irq_enable_in_hardirq();
}
timeout += jiffies; timeout += jiffies;
while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) {
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
...@@ -129,12 +132,14 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, ...@@ -129,12 +132,14 @@ int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad,
if ((stat & ATA_BUSY) == 0) if ((stat & ATA_BUSY) == 0)
break; break;
local_irq_restore(flags); if (!irqs_threaded)
local_irq_restore(flags);
*rstat = stat; *rstat = stat;
return -EBUSY; return -EBUSY;
} }
} }
local_irq_restore(flags); if (!irqs_threaded)
local_irq_restore(flags);
} }
/* /*
* Allow status to settle, then read it again. * Allow status to settle, then read it again.
......
...@@ -405,7 +405,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, ...@@ -405,7 +405,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive,
return startstop; return startstop;
} }
if ((drive->dev_flags & IDE_DFLAG_UNMASK) == 0) if (!force_irqthreads && (drive->dev_flags & IDE_DFLAG_UNMASK) == 0)
local_irq_disable(); local_irq_disable();
ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE); ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifdef CONFIG_IRQ_FORCED_THREADING #ifdef CONFIG_IRQ_FORCED_THREADING
__read_mostly bool force_irqthreads; __read_mostly bool force_irqthreads;
EXPORT_SYMBOL_GPL(force_irqthreads);
static int __init setup_forced_irqthreads(char *arg) static int __init setup_forced_irqthreads(char *arg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment