From b598979dc9d2a73cbbd9ed3c0bb579133a099f7e Mon Sep 17 00:00:00 2001 From: Vinod Kashyap Date: Fri, 29 Apr 2005 20:03:20 +0000 Subject: [PATCH] Make call to tw_cl_deferred_interrupt in twa_poll, not dependent on the return value from tw_cl_interrupt. --- sys/dev/twa/tw_osl_cam.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c index 39277bdc823e..1480cd026207 100644 --- a/sys/dev/twa/tw_osl_cam.c +++ b/sys/dev/twa/tw_osl_cam.c @@ -482,8 +482,18 @@ twa_poll(struct cam_sim *sim) struct twa_softc *sc = (struct twa_softc *)(cam_sim_softc(sim)); tw_osli_dbg_dprintf(3, sc, "entering; sc = %p", sc); - if (tw_cl_interrupt(&(sc->ctlr_handle))) - tw_cl_deferred_interrupt(&(sc->ctlr_handle)); + /* + * It's been observed that twa_poll can get called (from + * dashutdown --> xpt_polled_action) even when interrupts are + * active, in which case, the ISR might clear the interrupt, + * leaving the call to tw_cl_interrupt below, no way of determining + * that the response from firmware is ready, resulting in + * tw_cl_deferred_interrupt never getting called. To cover this case, + * we will make the call to tw_cl_deferred_interrupt not dependent + * on the return value from tw_cl_interrupt. + */ + tw_cl_interrupt(&(sc->ctlr_handle)); + tw_cl_deferred_interrupt(&(sc->ctlr_handle)); tw_osli_dbg_dprintf(3, sc, "exiting; sc = %p", sc); }