From 00f50ce889a3147ded7f811ebae18002aebeb346 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Wed, 16 Sep 1998 19:52:22 +0000 Subject: [PATCH] Fix the (unported) resource shortage case- I'd done a xpt_freeze_simq but had never done a CAM_RELEASE_SIMQ to restart the queues. --- sys/dev/isp/isp_freebsd.c | 12 +++++++++--- sys/dev/isp/isp_freebsd_cam.h | 7 ++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d9f7ff49c794..a6ef17c67354 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $Id: isp_freebsd.c,v 1.3 1998/09/15 08:42:55 gibbs Exp $ */ +/* $Id: isp_freebsd.c,v 1.4 1998/09/16 16:42:40 mjacob Exp $ */ /* * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. * @@ -213,10 +213,15 @@ isp_action(sim, ccb) ccb->ccb_h.status |= CAM_SIM_QUEUED; break; case CMD_EAGAIN: +#if 0 printf("%s: EAGAINed %d.%d\n", isp->isp_name, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); printf("%s: %d EAGAIN\n", __FILE__, __LINE__); - xpt_freeze_simq(sim, 1); +#endif + if (isp->isp_osinfo.simqfrozen == 0) { + xpt_freeze_simq(sim, 1); + isp->isp_osinfo.simqfrozen = 1; + } ccb->ccb_h.status &= ~CAM_STATUS_MASK; ccb->ccb_h.status |= CAM_REQUEUE_REQ; xpt_done(ccb); @@ -248,7 +253,8 @@ isp_action(sim, ccb) case XPT_RESET_DEV: /* BDR the specified SCSI device */ tgt = ccb->ccb_h.target_id; s = splcam(); - error = isp_control(isp, ISPCTL_RESET_DEV, (void *)(intptr_t) tgt); + error = + isp_control(isp, ISPCTL_RESET_DEV, (void *)(intptr_t) tgt); (void) splx(s); if (error) { ccb->ccb_h.status = CAM_REQ_CMP_ERR; diff --git a/sys/dev/isp/isp_freebsd_cam.h b/sys/dev/isp/isp_freebsd_cam.h index d1c868490311..d5629d3227bb 100644 --- a/sys/dev/isp/isp_freebsd_cam.h +++ b/sys/dev/isp/isp_freebsd_cam.h @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $Id: isp_freebsd_cam.h,v 1.2 1998/09/15 09:59:37 gibbs Exp $ */ +/* $Id: isp_freebsd_cam.h,v 1.3 1998/09/16 16:42:40 mjacob Exp $ */ /* * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions (CAM version) *--------------------------------------- @@ -70,6 +70,7 @@ struct isposinfo { struct cam_sim *sim; struct cam_path *path; struct callout_handle watchid; + volatile char simqfrozen; }; #define isp_sim isp_osinfo.sim @@ -165,6 +166,10 @@ struct isposinfo { (sccb)->ccb_h.status |= CAM_DEV_QFRZN; \ } \ } \ + if ((XS_ISP((sccb)))->isp_osinfo.simqfrozen) { \ + (sccb)->ccb_h.status |= CAM_RELEASE_SIMQ; \ + (XS_ISP((sccb)))->isp_osinfo.simqfrozen = 0; \ + } \ (sccb)->ccb_h.status &= ~CAM_SIM_QUEUED; \ xpt_done((union ccb *)(sccb))