Skip to content

Commit a259d53

Browse files
Michael Schmitzdavem330
authored andcommitted
m68k/atari - ide: do not register interrupt if host->get_lock is set
On m68k, host->get_lock is used to both lock and register the interrupt that the IDE host shares with other device drivers. Registering the IDE interrupt handler in ide-probe.c results in duplicating the interrupt registered (once via host->get lock, and also via init_irq()), and may result in IDE accepting interrupts even when another driver has locked the interrupt hardware. This opens the whole locking scheme up to races. host->get_lock is set on m68k only, so other drivers' behaviour is not changed. Signed-off-by: Michael Schmitz <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 0c0bd34 commit a259d53

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/ide/ide-probe.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,9 @@ static int init_irq (ide_hwif_t *hwif)
853853
if (irq_handler == NULL)
854854
irq_handler = ide_intr;
855855

856-
if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
857-
goto out_up;
856+
if (!host->get_lock)
857+
if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
858+
goto out_up;
858859

859860
#if !defined(__mc68000__)
860861
printk(KERN_INFO "%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name,
@@ -1533,7 +1534,8 @@ static void ide_unregister(ide_hwif_t *hwif)
15331534

15341535
ide_proc_unregister_port(hwif);
15351536

1536-
free_irq(hwif->irq, hwif);
1537+
if (!hwif->host->get_lock)
1538+
free_irq(hwif->irq, hwif);
15371539

15381540
device_unregister(hwif->portdev);
15391541
device_unregister(&hwif->gendev);

0 commit comments

Comments
 (0)