[PATCH] AHA152x driver hangs on PCMCIA card eject, kernel 2.4.22-pre6

From: Bhavesh P. Davda (bhavesh@avaya.com)
Date: Tue Jul 15 2003 - 16:56:49 EST


Juergen, David; please review this patch, and recommend that Marcelo apply
this patch if you think it is okay... Thanks!

Attached is a patch against linux-2.4.22-pre6, to fix a hang problem when an
Adaptec SlimSCSI (PCMCIA) adapter is ejected from a PCMCIA card reader (e.g.
yenta/TI1225 based).

The fix involves:

1. A change to the common aha152x driver to ignore an interrupt in the
top-half handler if it cannot read valid data from the I/O ports (possibly
due to a bad host-adapter chip or an ejected PCMCIA card). This way, a
shared interrupt handler (e.g. yenta) can pick up the interrupt if the IRQ
is really meant for it. This is where the original hang was taking place;
the aha152x bottom half was getting into an infinite loop, though the
SlimSCSI card had been ejected, and the actual IRQ was meant for yenta.

2. A change to the aha152x_cs stub driver to not use the SCSI error-handling
thread code. The aha152x_cs driver calls scsi_unregister_module() as a
queued timer task when it gets a CS_EVENT_CARD_REMOVAL event, which causes
scsi_unregister_host() to do a down() on a semaphore, calling schedule(),
when executing the timer_bh for the timer.

Thanks!

- Bhavesh

--
Bhavesh P. Davda     E-mail    : bhavesh@avaya.com
Avaya Inc.           Phone/Fax : (303) 538-4438
Room B3-B03, 1300 West 120th Avenue
Westminster, CO 80234


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:01:00 EST