]> git.baikalelectronics.ru Git - kernel.git/commit
libata: ignore EH scheduling during initialization
authorTejun Heo <htejun@gmail.com>
Tue, 1 May 2007 09:50:15 +0000 (11:50 +0200)
committerJeff Garzik <jeff@garzik.org>
Fri, 11 May 2007 22:09:18 +0000 (18:09 -0400)
commit236c78c0673c6e9da1e19421b02f98980713128b
tree60a0ec3c2872f1f21c2b546af3e04990b3bfa60b
parent043f42e2d9fdccabd13b9b7141bdc30842cc4823
libata: ignore EH scheduling during initialization

libata enables SCSI host during ATA host activation which happens
after IRQ handler is registered and IRQ is enabled.  All ATA ports are
in frozen state when IRQ is enabled but frozen ports may raise limited
number of IRQs after being frozen - IOW, ->freeze() is not responsible
for clearing pending IRQs.  During normal operation, the IRQ handler
is responsible for clearing spurious IRQs on frozen ports and it
usually doesn't require any extra code.

Unfortunately, during host initialization, the IRQ handler can end up
scheduling EH for a port whose SCSI host isn't initialized yet.  This
results in OOPS in the SCSI midlayer.  This is relatively short window
and scheduling EH for probing is the first thing libata does after
initialization, so ignoring EH scheduling until initialization is
complete solves the problem nicely.

This problem was spotted by Berck E. Nash in the following thread.

  http://thread.gmane.org/gmane.linux.kernel/519412

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Berck E. Nash <flyboy@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
include/linux/libata.h