Daniel Braniss
2010-Jul-23 09:54 UTC
WITNESS is the culprit was Re: latest 8.1 hangs on xpt_config
> That's hardly a solution or reason.of course it's not, just that last successful boot had WITNESS configured, and with the latest patches it hang, compiling without WITNESS allowed the boot to proceed.> Still please try the patch (or fresh > 8-STABLE with it), may be it tell more. >according to my logs (i do some hulahups sync'ing via svn/hg which makes it abit of a problem following versions :-) your patch seems to be all ready in my kernel: hg log ata_xpt.c -p changeset: 2939:440362ab79cb branch: 8 tag: tip parent: 2938:fc1c9d5f4b38 parent: 2937:846cb2242d34 user: danny@cs.huji.ac.il date: Fri Jul 23 08:41:24 2010 +0300 summary: -- merge from head -- diff -r fc1c9d5f4b38 -r 440362ab79cb sys/cam/ata/ata_xpt.c --- a/sys/cam/ata/ata_xpt.c Fri Jul 23 08:40:46 2010 +0300 +++ b/sys/cam/ata/ata_xpt.c Fri Jul 23 08:41:24 2010 +0300 @@ -134,6 +134,7 @@ uint32_t pm_prv; int restart; int spinup; + int faults; u_int caps; struct cam_periph *periph; } probe_softc; @@ -738,14 +739,28 @@ ident_buf = &path->device->ident_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { -device_fail: if ((!softc->restart) && - cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) { + if (softc->restart) { + if (bootverbose) { + cam_error_print(done_ccb, + CAM_ESF_ALL, CAM_EPF_ALL); + } + } else if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) return; - } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, /*run_queue*/TRUE); } + if (softc->restart) { + softc->faults++; + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) =+ CAM_CMD_TIMEOUT) + softc->faults += 4; + if (softc->faults < 10) + goto done; + else + softc->restart = 0; + } else /* Old PIO2 devices may not support mode setting. */ if (softc->action == PROBE_SETMODE && ata_max_pmode(ident_buf) <= ATA_PIO2 && @@ -761,7 +776,7 @@ * already marked unconfigured, notify the peripheral * drivers that this device is no more. */ - if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) +device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_async(AC_LOST_DEVICE, path, NULL); found = 0; goto done; @@ -1209,6 +1224,12 @@ !(work_ccb->cpi.hba_misc & PIM_NOBUSRESET) && !timevalisset(&request_ccb->ccb_h.path->bus->last_reset)) { reset_ccb = xpt_alloc_ccb_nowait(); + if (reset_ccb == NULL) { + request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + xpt_free_ccb(work_ccb); + xpt_done(request_ccb); + return; + } xpt_setup_ccb(&reset_ccb->ccb_h, request_ccb-> ccb_h.path, CAM_PRIORITY_NONE); reset_ccb->ccb_h.func_code = XPT_RESET_BUS; @@ -1228,6 +1249,7 @@ malloc(sizeof(ata_scan_bus_info), M_CAMXPT, M_NOWAIT); if (scan_info == NULL) { request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + xpt_free_ccb(work_ccb); xpt_done(request_ccb); return; } cheers, danny