From d8a4660643d8a33583be4e5affb1a00ebb42e534 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Mon, 20 Sep 1999 19:04:22 +0000 Subject: [PATCH] Clear the SELINGO bit after a selection timeout occurs. SELINGO is usually cleared by a successful selection, but there is no guarantee that a future successful selection will ever occur (e.g. empty bus). The driver never looks at SELINGO, but the busy LED does, so this change has the cosmetic effect of fixing the rare instance where the busy LED was left on, confusing the user. --- sys/dev/aic7xxx/aic7xxx.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c index d8278b2c1b4..8117a8c3cd1 100644 --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -2661,12 +2661,22 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) /* Stop the selection */ ahc_outb(ahc, SCSISEQ, 0); + /* No more pending messages */ ahc_clear_msg_state(ahc); + /* + * Although the driver does not care about the + * 'Selection in Progress' status bit, the busy + * LED does. SELINGO is only cleared by a sucessful + * selection, so we must manually clear it to ensure + * the LED turns off just incase no future successful + * selections occur (e.g. no devices on the bus). + */ + ahc_outb(ahc, CLRSINT0, CLRSELINGO); + + /* Clear interrupt state */ ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRBUSFREE); - ahc_outb(ahc, CLRINT, CLRSCSIINT); - restart_sequencer(ahc); } else if (scb == NULL) { printf("%s: ahc_intr - referenced scb not " @@ -4536,9 +4546,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb) xpt_done(ccb); break; } - if (ccb->ccb_h.func_code == XPT_NOTIFY_ACK) { - /* Clear notification state */ - } SLIST_INSERT_HEAD(&lstate->immed_notifies, &ccb->ccb_h, sim_links.sle); ccb->ccb_h.status = CAM_REQ_INPROG; @@ -5872,9 +5879,7 @@ ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel, { struct ccb_hdr *ccb_h; - ccb_h = ahc->pending_ccbs.lh_first; - while (ccb_h != NULL) { scbp = (struct scb *)ccb_h->ccb_scb_ptr; ccb_h = ccb_h->sim_links.le.le_next;