summaryrefslogtreecommitdiffstats
path: root/sys/dev/ciss
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-01-28 08:41:30 +0000
committermav <mav@FreeBSD.org>2010-01-28 08:41:30 +0000
commit72062fdcece91a123423691068781de9366fbfaa (patch)
treed7388e60da90bf39b478369ea46d12722c323f78 /sys/dev/ciss
parent973b5fa5f2d400701ce9699f4118bd6ccc5a418c (diff)
downloadFreeBSD-src-72062fdcece91a123423691068781de9366fbfaa.zip
FreeBSD-src-72062fdcece91a123423691068781de9366fbfaa.tar.gz
MFp4: Large set of CAM inprovements.
- Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs.
Diffstat (limited to 'sys/dev/ciss')
-rw-r--r--sys/dev/ciss/ciss.c48
1 files changed, 6 insertions, 42 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index c5ad417..4e336a9 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -173,8 +173,6 @@ static void ciss_unmap_request(struct ciss_request *cr);
static int ciss_cam_init(struct ciss_softc *sc);
static void ciss_cam_rescan_target(struct ciss_softc *sc,
int bus, int target);
-static void ciss_cam_rescan_all(struct ciss_softc *sc);
-static void ciss_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb);
static void ciss_cam_action(struct cam_sim *sim, union ccb *ccb);
static int ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio);
static int ciss_cam_emulate(struct ciss_softc *sc, struct ccb_scsiio *csio);
@@ -2863,13 +2861,6 @@ ciss_cam_init(struct ciss_softc *sc)
mtx_unlock(&sc->ciss_mtx);
}
- /*
- * Initiate a rescan of the bus.
- */
- mtx_lock(&sc->ciss_mtx);
- ciss_cam_rescan_all(sc);
- mtx_unlock(&sc->ciss_mtx);
-
return(0);
}
@@ -2879,53 +2870,26 @@ ciss_cam_init(struct ciss_softc *sc)
static void
ciss_cam_rescan_target(struct ciss_softc *sc, int bus, int target)
{
- struct cam_path *path;
union ccb *ccb;
debug_called(1);
- if ((ccb = malloc(sizeof(union ccb), CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO)) == NULL) {
+ if ((ccb = xpt_alloc_ccb_nowait()) == NULL) {
ciss_printf(sc, "rescan failed (can't allocate CCB)\n");
return;
}
- if (xpt_create_path(&path, xpt_periph, cam_sim_path(sc->ciss_cam_sim[bus]),
- target, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+ if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+ cam_sim_path(sc->ciss_cam_sim[bus]),
+ target, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
ciss_printf(sc, "rescan failed (can't create path)\n");
- free(ccb, CISS_MALLOC_CLASS);
+ xpt_free_ccb(ccb);
return;
}
-
- xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/);
- ccb->ccb_h.func_code = XPT_SCAN_BUS;
- ccb->ccb_h.cbfcnp = ciss_cam_rescan_callback;
- ccb->crcn.flags = CAM_FLAG_NONE;
- xpt_action(ccb);
-
+ xpt_rescan(ccb);
/* scan is now in progress */
}
-static void
-ciss_cam_rescan_all(struct ciss_softc *sc)
-{
- int i;
-
- /* Rescan the logical buses */
- for (i = 0; i < sc->ciss_max_logical_bus; i++)
- ciss_cam_rescan_target(sc, i, CAM_TARGET_WILDCARD);
- /* Rescan the physical buses */
- for (i = CISS_PHYSICAL_BASE; i < sc->ciss_max_physical_bus +
- CISS_PHYSICAL_BASE; i++)
- ciss_cam_rescan_target(sc, i, CAM_TARGET_WILDCARD);
-}
-
-static void
-ciss_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb)
-{
- xpt_free_path(ccb->ccb_h.path);
- free(ccb, CISS_MALLOC_CLASS);
-}
-
/************************************************************************
* Handle requests coming from CAM
*/
OpenPOWER on IntegriCloud