diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-12-28 02:43:55 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-12-28 02:43:55 +0000 |
commit | 8d453ee5a037af528b2f4b5b1268af76ad5950ed (patch) | |
tree | c4fb1629dd4f37ad649e2c541f1a3aa19ebf3072 /sys/dev/ic/aic79xx_openbsd.c | |
parent | 4ee994b018af2aa3ef2c9440c80b27cefbfd4808 (diff) |
Strip out fancy timeout code that attempts to mimic FreeBSD's thread
based timeout handling. Use the simple timeout == bus reset model
instead. Also move verbose debug output inside #ifdef/#endif.
Fixes immediate crashes on encountering a timeout.
Noted by per englebrecht when trying 'smartctl -d scsi -a /dev/rsd0c'.
Thanks to per englebrecht and luiz gustavo for testing.
Should only impact timeout handling. No change to normal processing.
ok marco@
Diffstat (limited to 'sys/dev/ic/aic79xx_openbsd.c')
-rw-r--r-- | sys/dev/ic/aic79xx_openbsd.c | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index f16aaceab30..d973286d26b 100644 --- a/sys/dev/ic/aic79xx_openbsd.c +++ b/sys/dev/ic/aic79xx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.c,v 1.22 2005/11/02 03:27:39 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.23 2005/12/28 02:43:54 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -170,7 +170,6 @@ void ahd_done(struct ahd_softc *ahd, struct scb *scb) { struct scsi_xfer *xs = scb->xs; - struct scb *list_scb; int s; /* XXX in ahc there is some bus_dmamap_sync(PREREAD|PREWRITE); */ @@ -191,36 +190,6 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) bus_dmamap_unload(ahd->parent_dmat, scb->dmamap); } - /* - * If the recovery SCB completes, we have to be - * out of our timeout. - */ - if ((scb->flags & SCB_RECOVERY_SCB) != 0) { - ahd->scb_data.recovery_scbs--; - - if (aic_get_transaction_status(scb) == CAM_BDR_SENT - || aic_get_transaction_status(scb) == CAM_REQ_ABORTED) - aic_set_transaction_status(scb, CAM_CMD_TIMEOUT); - - if (ahd->scb_data.recovery_scbs == 0) { - /* - * All recovery actions have completed successfully, - * so reinstate the timeouts for all other pending - * commands. - */ - LIST_FOREACH(list_scb, &ahd->pending_scbs, - pending_links) { - if (!(list_scb->xs->flags & SCSI_POLL)) - aic_scb_timer_reset(list_scb, - aic_get_timeout(list_scb)); - } - - ahd_print_path(ahd, scb); - printf("%s: no longer in timeout, status = %x\n", - ahd_name(ahd), aic_get_transaction_status(scb)); - } - } - /* Translate the CAM status code to a SCSI error code. */ switch (xs->error) { case CAM_SCSI_STATUS_ERROR: @@ -790,8 +759,7 @@ aic_platform_scb_free(struct ahd_softc *ahd, struct scb *scb) ahd_lock(ahd, &s); - if ((ahd->flags & AHD_RESOURCE_SHORTAGE) != 0 || - (scb->flags & SCB_RECOVERY_SCB) != 0) { + if ((ahd->flags & AHD_RESOURCE_SHORTAGE) != 0) { ahd->flags &= ~AHD_RESOURCE_SHORTAGE; } @@ -821,25 +789,3 @@ void ahd_platform_flushwork(struct ahd_softc *ahd) { } - -void -ahd_set_recoveryscb(struct ahd_softc *ahd, struct scb *scb) -{ - - if ((scb->flags & SCB_RECOVERY_SCB) == 0) { - struct scb *list_scb; - - scb->flags |= SCB_RECOVERY_SCB; - - AIC_SCB_DATA(ahd)->recovery_scbs++; - - /* - * Go through all of our pending SCBs and remove - * any scheduled timeouts for them. We will reschedule - * them after we've successfully fixed this problem. - */ - LIST_FOREACH(list_scb, &ahd->pending_scbs, pending_links) { - timeout_del(&list_scb->xs->stimeout); - } - } -} |