From 81babfd043a80f2149d6a6f0e9bf2434dcd3ff6f Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Sat, 2 Dec 2000 18:08:35 +0000 Subject: Make the Not RESPONSE in RESPONSE QUEUE message have a bit more info (specifically, how many entries we've looked at so far). Maintain interrupt instrumentation. Use USEC_SLEEP instead of USEC_DELAY in a number of places (this allows us to drop locks and sleep instead of spin). Track changes to configuration options for topology preference. Fix botched order of printout for Channel, Target, Lun. --- sys/dev/isp/isp.c | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index 604e06573bfc..8384f378f81f 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -89,7 +89,7 @@ static char *ldumped = "Target %d (Loop ID 0x%x) Port 0x%x dumped after login info mismatch"; #endif static char *notresp = - "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d)"; + "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d"; static char *xact1 = "HBA attempted queued transaction with disconnect not set for %d.%d.%d"; static char *xact2 = @@ -375,6 +375,11 @@ isp_reset(isp) } + /* + * Clear instrumentation + */ + isp->isp_intcnt = isp->isp_intbogus = 0; + /* * Do MD specific pre initialization */ @@ -609,7 +614,7 @@ again: mbs.param[1] = ISP_CODE_ORG; isp_mboxcmd(isp, &mbs, MBLOGNONE); /* give it a chance to start */ - USEC_DELAY(500); + USEC_SLEEP(isp, 500); if (IS_SCSI(isp)) { /* @@ -1078,10 +1083,20 @@ isp_fibre_init(isp) /* * Prefer or force Point-To-Point instead Loop? */ - if (isp->isp_confopts & ISP_CFG_NPORT) + switch(isp->isp_confopts & ISP_CFG_PORT_PREF) { + case ISP_CFG_NPORT: icbp->icb_xfwoptions = ICBXOPT_PTP_2_LOOP; - else + break; + case ISP_CFG_NPORT_ONLY: + icbp->icb_xfwoptions = ICBXOPT_PTP_ONLY; + break; + case ISP_CFG_LPORT_ONLY: + icbp->icb_xfwoptions = ICBXOPT_LOOP_ONLY; + break; + default: icbp->icb_xfwoptions = ICBXOPT_LOOP_2_PTP; + break; + } } icbp->icb_logintime = 60; /* 60 second login timeout */ @@ -1291,11 +1306,11 @@ isp_fclink_test(isp, usdelay) count += 1000; enano = (1000 * 1000) - enano; while (enano > (u_int64_t) 4000000000U) { - USEC_DELAY(4000000); + USEC_SLEEP(isp, 4000000); enano -= (u_int64_t) 4000000000U; } wrk = enano; - USEC_DELAY(wrk/1000); + USEC_SLEEP(isp, wrk/1000); } else { while (enano > (u_int64_t) 4000000000U) { count += 4000000; @@ -2487,7 +2502,9 @@ isp_intr(arg) isp_prt(isp, ISP_LOGDEBUG3, "isp_intr isr %x sem %x", isr, sema); isr &= INT_PENDING_MASK(isp); sema &= BIU_SEMA_LOCK; + isp->isp_intcnt++; if (isr == 0 && sema == 0) { + isp->isp_intbogus++; return (0); } @@ -2622,7 +2639,12 @@ isp_intr(arg) */ if (sp->req_header.rqs_entry_type != RQSTYPE_REQUEST) { isp_prt(isp, ISP_LOGERR, notresp, - sp->req_header.rqs_entry_type, oop, optr); + sp->req_header.rqs_entry_type, oop, optr, + nlooked); + if (isp->isp_dblev & ISP_LOGDEBUG0) { + isp_print_bytes(isp, "Queue Entry", + QENTRY_LEN, sp); + } MEMZERO(sp, sizeof (isphdr_t)); continue; } @@ -2850,6 +2872,9 @@ isp_parse_async(isp, mbox) isp_prt(isp, ISP_LOGERR, "Internal FW Error @ RISC Addr 0x%x", mbox); isp_reinit(isp); +#ifdef ISP_TARGET_MODE + isp_target_async(isp, bus, mbox); +#endif /* no point continuing after this */ return (-1); @@ -3054,6 +3079,9 @@ isp_parse_async(isp, mbox) case ISP_CONN_FATAL: isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR"); isp_reinit(isp); +#ifdef ISP_TARGET_MODE + isp_target_async(isp, bus, ASYNC_SYSTEM_ERROR); +#endif /* no point continuing after this */ return (-1); @@ -3127,7 +3155,7 @@ isp_parse_status(isp, sp, xs) if ((sp->req_state_flags & RQSF_GOT_TARGET) == 0) { isp_prt(isp, ISP_LOGDEBUG1, "Selection Timeout for %d.%d.%d", - XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs)); + XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); if (XS_NOERR(xs)) { XS_SETERR(xs, HBA_SELTIMEOUT); } @@ -3995,12 +4023,6 @@ isp_mboxcmd(isp, mbp, logmask) */ ISP_WRITE(isp, HCCR, HCCR_CMD_SET_HOST_INT); - /* - * Give the f/w a chance to pick this up. - */ - USEC_DELAY(250); - - /* * While we haven't finished the command, spin our wheels here. */ -- cgit v1.3