svn commit: r315980 - stable/10/sys/dev/isp
Alexander Motin
mav at FreeBSD.org
Sun Mar 26 08:54:10 UTC 2017
Author: mav
Date: Sun Mar 26 08:54:08 2017
New Revision: 315980
URL: https://svnweb.freebsd.org/changeset/base/315980
Log:
MFC r315161: Try to slight untangle I/O and loop status handling.
Modified:
stable/10/sys/dev/isp/isp.c
stable/10/sys/dev/isp/isp_freebsd.c
stable/10/sys/dev/isp/isp_freebsd.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/isp/isp.c
==============================================================================
--- stable/10/sys/dev/isp/isp.c Sun Mar 26 08:53:29 2017 (r315979)
+++ stable/10/sys/dev/isp/isp.c Sun Mar 26 08:54:08 2017 (r315980)
@@ -4343,13 +4343,6 @@ isp_start(XS_T *xs)
return (CMD_COMPLETE);
}
- /*
- * Try again later.
- */
- if (fcp->isp_loopstate != LOOP_READY) {
- return (CMD_RQLATER);
- }
-
isp_prt(isp, ISP_LOGDEBUG2, "XS_TGT(xs)=%d", target);
lp = &fcp->portdb[target];
if (target < 0 || target >= MAX_FC_TARG ||
@@ -4357,6 +4350,12 @@ isp_start(XS_T *xs)
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
}
+ if (fcp->isp_loopstate != LOOP_READY) {
+ isp_prt(isp, ISP_LOGDEBUG1,
+ "%d.%d.%jx loop is not ready",
+ XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs));
+ return (CMD_RQLATER);
+ }
if (lp->state == FC_PORTDB_STATE_ZOMBIE) {
isp_prt(isp, ISP_LOGDEBUG1,
"%d.%d.%jx target zombie",
@@ -6544,7 +6543,8 @@ isp_parse_status(ispsoftc_t *isp, ispsta
case RQCS_PORT_CHANGED:
isp_prt(isp, ISP_LOGWARN, "port changed for target %d", XS_TGT(xs));
if (XS_NOERR(xs)) {
- XS_SETERR(xs, HBA_SELTIMEOUT);
+ *XS_STSP(xs) = SCSI_BUSY;
+ XS_SETERR(xs, HBA_TGTBSY);
}
return;
@@ -6693,11 +6693,11 @@ isp_parse_status_24xx(ispsoftc_t *isp, i
case RQCS_PORT_CHANGED:
isp_prt(isp, ISP_LOGWARN, "port changed for target %d chan %d", XS_TGT(xs), chan);
if (XS_NOERR(xs)) {
- XS_SETERR(xs, HBA_SELTIMEOUT);
+ *XS_STSP(xs) = SCSI_BUSY;
+ XS_SETERR(xs, HBA_TGTBSY);
}
return;
-
case RQCS_24XX_ENOMEM: /* f/w resource unavailable */
isp_prt(isp, ISP_LOGWARN, "f/w resource unavailable for target %d chan %d", XS_TGT(xs), chan);
if (XS_NOERR(xs)) {
Modified: stable/10/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:53:29 2017 (r315979)
+++ stable/10/sys/dev/isp/isp_freebsd.c Sun Mar 26 08:54:08 2017 (r315980)
@@ -3029,7 +3029,6 @@ isp_loop_changed(ispsoftc_t *isp, int ch
isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop changed", chan);
if (fcp->role & ISP_ROLE_INITIATOR)
isp_freeze_loopdown(isp, chan);
- fc->loop_dead = 0;
fc->loop_down_time = time_uptime;
wakeup(fc);
}
@@ -3041,7 +3040,6 @@ isp_loop_up(ispsoftc_t *isp, int chan)
isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop is up", chan);
fc->loop_seen_once = 1;
- fc->loop_dead = 0;
fc->loop_down_time = 0;
isp_unfreeze_loopdown(isp, chan);
}
@@ -3105,7 +3103,6 @@ isp_loop_dead(ispsoftc_t *isp, int chan)
}
isp_unfreeze_loopdown(isp, chan);
- fc->loop_dead = 1;
fc->loop_down_time = 0;
}
@@ -3333,18 +3330,6 @@ isp_action(struct cam_sim *sim, union cc
callout_reset(&PISP_PCMD(ccb)->wdog, ts, isp_watchdog, ccb);
break;
case CMD_RQLATER:
- /*
- * We get this result if the loop isn't ready
- * or if the device in question has gone zombie.
- */
- if (ISP_FC_PC(isp, bus)->loop_dead) {
- isp_prt(isp, ISP_LOGDEBUG0,
- "%d.%jx loop is dead",
- XS_TGT(ccb), (uintmax_t)XS_LUN(ccb));
- ccb->ccb_h.status = CAM_SEL_TIMEOUT;
- isp_done((struct ccb_scsiio *) ccb);
- break;
- }
isp_prt(isp, ISP_LOGDEBUG0, "%d.%jx retry later",
XS_TGT(ccb), (uintmax_t)XS_LUN(ccb));
cam_freeze_devq(ccb->ccb_h.path);
@@ -3868,8 +3853,6 @@ isp_action(struct cam_sim *sim, union cc
}
}
-#define ISPDDB (CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB)
-
void
isp_done(XS_T *sccb)
{
@@ -3890,27 +3873,10 @@ isp_done(XS_T *sccb)
sccb->ccb_h.status &= ~CAM_SIM_QUEUED;
status = sccb->ccb_h.status & CAM_STATUS_MASK;
- if (status != CAM_REQ_CMP) {
- if (status != CAM_SEL_TIMEOUT)
- isp_prt(isp, ISP_LOGDEBUG0,
- "target %d lun %jx CAM status 0x%x SCSI status 0x%x",
- XS_TGT(sccb), (uintmax_t)XS_LUN(sccb),
- sccb->ccb_h.status, sccb->scsi_status);
- else if ((IS_FC(isp))
- && (XS_TGT(sccb) < MAX_FC_TARG)) {
- fcparam *fcp;
-
- fcp = FCPARAM(isp, XS_CHANNEL(sccb));
- fcp->portdb[XS_TGT(sccb)].is_target = 0;
- }
- if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
- sccb->ccb_h.status |= CAM_DEV_QFRZN;
- xpt_freeze_devq(sccb->ccb_h.path, 1);
- }
- }
-
- if ((CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB)) && (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
- xpt_print(sccb->ccb_h.path, "cam completion status 0x%x\n", sccb->ccb_h.status);
+ if (status != CAM_REQ_CMP &&
+ (sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
+ sccb->ccb_h.status |= CAM_DEV_QFRZN;
+ xpt_freeze_devq(sccb->ccb_h.path, 1);
}
if (ISP_PCMD(sccb)) {
Modified: stable/10/sys/dev/isp/isp_freebsd.h
==============================================================================
--- stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:53:29 2017 (r315979)
+++ stable/10/sys/dev/isp/isp_freebsd.h Sun Mar 26 08:54:08 2017 (r315980)
@@ -225,8 +225,6 @@ struct isp_fc {
simqfrozen : 3,
default_id : 8,
def_role : 2, /* default role */
- gdt_running : 1,
- loop_dead : 1,
loop_seen_once : 1,
fcbsy : 1,
ready : 1;
More information about the svn-src-stable-10
mailing list