/* This routine is used after a system crash to dump core onto the * swap device. */ static void mpt_poll(struct cam_sim *sim) { mpt_softc_t *mpt = (mpt_softc_t *) cam_sim_softc(sim); MPT_LOCK(mpt); mpt_intr(mpt); MPT_UNLOCK(mpt); }
static void mpt_pci_intr(void *arg) { struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; MPT_LOCK(mpt); mpt_intr(mpt); MPT_UNLOCK(mpt); }
static void mpttimeout2(void *arg) { request_t *req = arg; if (req->debug == REQ_TIMEOUT) { mpt_softc_t *mpt = (mpt_softc_t *) req->link.sle_next; MPT_LOCK(mpt); mpt_free_request(mpt, req); MPT_UNLOCK(mpt); } }
/* * This routine is called if the 9x9 does not return completion status * for a command after a CAM specified time. */ static void mpttimeout(void *arg) { request_t *req; union ccb *ccb = arg; u_int32_t oseq; mpt_softc_t *mpt; mpt = ccb->ccb_h.ccb_mpt_ptr; MPT_LOCK(mpt); req = ccb->ccb_h.ccb_req_ptr; oseq = req->sequence; mpt->timeouts++; if (mpt_intr(mpt)) { if (req->sequence != oseq) { mpt_prt(mpt, "bullet missed in timeout"); MPT_UNLOCK(mpt); return; } mpt_prt(mpt, "bullet U-turned in timeout: got us"); } mpt_prt(mpt, "time out on request index = 0x%02x sequence = 0x%08x", req->index, req->sequence); mpt_check_doorbell(mpt); mpt_prt(mpt, "Status %08x; Mask %08x; Doorbell %08x", mpt_read(mpt, MPT_OFFSET_INTR_STATUS), mpt_read(mpt, MPT_OFFSET_INTR_MASK), mpt_read(mpt, MPT_OFFSET_DOORBELL) ); printf("request state %s\n", mpt_req_state(req->debug)); if (ccb != req->ccb) { printf("time out: ccb %p != req->ccb %p\n", ccb,req->ccb); } mpt_print_scsi_io_request((MSG_SCSI_IO_REQUEST *)req->req_vbuf); req->debug = REQ_TIMEOUT; req->ccb = NULL; req->link.sle_next = (void *) mpt; (void) timeout(mpttimeout2, (caddr_t)req, hz / 10); ccb->ccb_h.status = CAM_CMD_TIMEOUT; ccb->ccb_h.status |= CAM_RELEASE_SIMQ; mpt->outofbeer = 0; MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); MPT_UNLOCK(mpt); }