summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2013-07-22 18:37:07 +0000
committerken <ken@FreeBSD.org>2013-07-22 18:37:07 +0000
commit71b805798bf6d7e4be7d593becfe3bcd5c3bdbf6 (patch)
tree77211383dc82348bbf872d5f98a05aec3b005e86 /sys/cam/cam_xpt.c
parenta3c7be9ea206456b081437f5ab7e0de097f4c3d8 (diff)
downloadFreeBSD-src-71b805798bf6d7e4be7d593becfe3bcd5c3bdbf6.zip
FreeBSD-src-71b805798bf6d7e4be7d593becfe3bcd5c3bdbf6.tar.gz
CAM and mps(4) driver scanning changes.
Add a PIM_NOSCAN flag to the CAM path inquiry CCB. This tells CAM not to perform a rescan on a bus when it is registered. We now use this flag in the mps(4) driver. Since it knows what devices it has attached, it is more efficient for it to just issue a target rescan on the targets that are attached. Also, remove the private rescan thread from the mps(4) driver in favor of the rescan thread already built into CAM. Without this change, but with the change above, the MPS scanner could run before or during CAM's initial setup, which would cause duplicate device reprobes and announcements. sys/param.h: Bump __FreeBSD_version to 1000039 for the inclusion of the PIM_RESCAN CAM path inquiry flag. sys/cam/cam_ccb.h: sys/cam/cam_xpt.c: Added a PIM_NOSCAN flag. If a SIM sets this in the path inquiry ccb, then CAM won't rescan the bus in xpt_bus_regsister. sys/dev/mps/mps_sas.c For versions of FreeBSD that have the PIM_NOSCAN path inquiry flag, don't freeze the sim queue during scanning, because CAM won't be scanning this bus. Instead, hold up the boot. Don't call mpssas_rescan_target in mpssas_startup_decrement; it's redundant and I don't know why it was in there. Set PIM_NOSCAN in path inquiry CCBs. Remove methods related to the internal rescan daemon. Always use async events to trigger a probe for EEDP support. In older versions of FreeBSD where AC_ADVINFO_CHANGED is not available, use AC_FOUND_DEVICE and issue the necessary READ CAPACITY manually. Provide a path to xpt_register_async() so that we only receive events for our own SCSI domain. Improve error reporting in cases where setup for EEDP detection fails. sys/dev/mps/mps_sas.h: Remove softc flags and data related to the scanner thread. sys/dev/mps/mps_sas_lsi.c: Unconditionally rescan the target whenever a device is added. Sponsored by: Spectra Logic MFC after: 1 week
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 8f2c93e..aac1be2 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -3895,18 +3895,23 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus)
/* Notify interested parties */
if (sim->path_id != CAM_XPT_PATH_ID) {
- union ccb *scan_ccb;
xpt_async(AC_PATH_REGISTERED, path, &cpi);
- /* Initiate bus rescan. */
- scan_ccb = xpt_alloc_ccb_nowait();
- if (scan_ccb != NULL) {
- scan_ccb->ccb_h.path = path;
- scan_ccb->ccb_h.func_code = XPT_SCAN_BUS;
- scan_ccb->crcn.flags = 0;
- xpt_rescan(scan_ccb);
+ if ((cpi.hba_misc & PIM_NOSCAN) == 0) {
+ union ccb *scan_ccb;
+
+ /* Initiate bus rescan. */
+ scan_ccb = xpt_alloc_ccb_nowait();
+ if (scan_ccb != NULL) {
+ scan_ccb->ccb_h.path = path;
+ scan_ccb->ccb_h.func_code = XPT_SCAN_BUS;
+ scan_ccb->crcn.flags = 0;
+ xpt_rescan(scan_ccb);
+ } else
+ xpt_print(path,
+ "Can't allocate CCB to scan bus\n");
} else
- xpt_print(path, "Can't allocate CCB to scan bus\n");
+ xpt_free_path(path);
} else
xpt_free_path(path);
return (CAM_SUCCESS);
OpenPOWER on IntegriCloud