Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a259d532 authored by Michael Schmitz's avatar Michael Schmitz Committed by David S. Miller
Browse files

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: default avatarMichael Schmitz <schmitz@debian.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c0bd34a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -853,6 +853,7 @@ static int init_irq (ide_hwif_t *hwif)
	if (irq_handler == NULL)
		irq_handler = ide_intr;

	if (!host->get_lock)
		if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
			goto out_up;

@@ -1533,6 +1534,7 @@ static void ide_unregister(ide_hwif_t *hwif)

	ide_proc_unregister_port(hwif);

	if (!hwif->host->get_lock)
		free_irq(hwif->irq, hwif);

	device_unregister(hwif->portdev);