public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH] Do not register the IDE interrupt handler if host->get_lock is set.
@ 2014-02-01  0:48 Michael Schmitz
  2014-02-01  0:48 ` [PATCH] m68k/atari - ide: do not register interrupt " Michael Schmitz
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Schmitz @ 2014-02-01  0:48 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert, davem, linux-ide

The m68k Atari Falcon IDE driver shares the IDE interrupt with DMA completion,
SCSI and floppy controller. The DMA controller does not provide a way to check
whether it had generated an interrupt, so the shared interrupt has to be
reserved for exclusive use by the respective driver.
To this end, host->get_lock was added to allow both locking the interrupt
and passing the relevant interrupt handler to the machine specific interrupt
code. This feature is used exclusively by the Falcon IDE driver.
Unconditionally registering the IDE interrupt handler in init_irq() when
host->get_lock is set does result in two calls being dispatched to the IDE
handler on each IDE interrupt, and one spurious call on each SCSI, DMA or 
floppy interrupt.

The following patch changes init_irq() to request the IDE interrupt only if
host->get_lock is not set.

Regards,

	Michael Schmitz

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 0/1] m68k/atari - ide: do not register interrupt if host->get_lock is set
@ 2014-01-28  8:07 Michael Schmitz
  2014-01-28  8:07 ` [PATCH] " Michael Schmitz
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Schmitz @ 2014-01-28  8:07 UTC (permalink / raw)
  To: linux-m68k; +Cc: geert

Geert,

as hinted in my earlier patch series, this one bit me while debugging the
SCSI/IDE deadlock on my Falcon. 

On Falcon, registering the IDE interrupt handler is taken care of by
registering stdma_int() in the arch setup code, then passing the relevant
IDE interrupt handler as argument to stdma_lock(). This ensures that the IDE
inthandler is only called if IDE has acquired the ST-DMA lock, and avoids
the IDE handler stepping on the SCSI handlers' toes if the ST-DMA is locked
by SCSI. 

At some point in the past, the IDE interrupt was registered unconditionally
even on m68k, resulting in both stdma_int() and ide_interrupt() being
registered, again opening up the potential of IDE taking interrupts meant to
be handled by SCSI (or floppy). This might result in deadlocking the SCSI
driver if IDE releases the ST-DMA lock in error. 

The next patch changes the IDE core to only register the IDE handler if
host->get_lock is not set - AFAIK m68k is the sole user of host->get_lock
so we can rely on IDE interrupts being handled through the multiplexer
whenever host->get_lock happens to be set. 

Cheers,

	Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-06 17:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-01  0:48 [PATCH] Do not register the IDE interrupt handler if host->get_lock is set Michael Schmitz
2014-02-01  0:48 ` [PATCH] m68k/atari - ide: do not register interrupt " Michael Schmitz
2014-03-04 20:59   ` David Miller
2014-03-06  6:47     ` Michael Schmitz
2014-03-06 17:50       ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2014-01-28  8:07 [PATCH 0/1] " Michael Schmitz
2014-01-28  8:07 ` [PATCH] " Michael Schmitz
2014-01-30 15:03   ` Geert Uytterhoeven
2014-01-30 19:41     ` Michael Schmitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox