aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hptiop
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2010-01-28 08:41:30 +0000
committerAlexander Motin <mav@FreeBSD.org>2010-01-28 08:41:30 +0000
commit83c5d981ac176d1cfae8d6dab3c0420ed9d43477 (patch)
treed7388e60da90bf39b478369ea46d12722c323f78 /sys/dev/hptiop
parente59faa5014f233788065a5306b0bdd22343ec2cf (diff)
downloadsrc-83c5d981ac176d1cfae8d6dab3c0420ed9d43477.tar.gz
src-83c5d981ac176d1cfae8d6dab3c0420ed9d43477.zip
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.
Notes
Notes: svn path=/head/; revision=203108
Diffstat (limited to 'sys/dev/hptiop')
-rw-r--r--sys/dev/hptiop/hptiop.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c
index 7218bc504425..1ea257becc33 100644
--- a/sys/dev/hptiop/hptiop.c
+++ b/sys/dev/hptiop/hptiop.c
@@ -79,7 +79,6 @@ __FBSDID("$FreeBSD$");
#include <cam/cam_sim.h>
#include <cam/cam_xpt_sim.h>
#include <cam/cam_debug.h>
-#include <cam/cam_xpt_periph.h>
#include <cam/cam_periph.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
@@ -105,7 +104,6 @@ static int hptiop_do_ioctl_itl(struct hpt_iop_hba *hba,
struct hpt_iop_ioctl_param *pParams);
static int hptiop_do_ioctl_mv(struct hpt_iop_hba *hba,
struct hpt_iop_ioctl_param *pParams);
-static void hptiop_bus_scan_cb(struct cam_periph *periph, union ccb *ccb);
static int hptiop_rescan_bus(struct hpt_iop_hba *hba);
static int hptiop_alloc_pci_res_itl(struct hpt_iop_hba *hba);
static int hptiop_alloc_pci_res_mv(struct hpt_iop_hba *hba);
@@ -1035,28 +1033,19 @@ invalid:
static int hptiop_rescan_bus(struct hpt_iop_hba * hba)
{
- struct cam_path *path;
union ccb *ccb;
- if (xpt_create_path(&path, xpt_periph, cam_sim_path(hba->sim),
- CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)
- return(EIO);
- if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL)
+
+ if ((ccb = xpt_alloc_ccb()) == NULL)
return(ENOMEM);
- bzero(ccb, sizeof(union ccb));
- xpt_setup_ccb(&ccb->ccb_h, path, 5);
- ccb->ccb_h.func_code = XPT_SCAN_BUS;
- ccb->ccb_h.cbfcnp = hptiop_bus_scan_cb;
- ccb->crcn.flags = CAM_FLAG_NONE;
- xpt_action(ccb);
+ if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(hba->sim),
+ CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+ xpt_free_ccb(ccb);
+ return(EIO);
+ }
+ xpt_rescan(ccb);
return(0);
}
-static void hptiop_bus_scan_cb(struct cam_periph *periph, union ccb *ccb)
-{
- xpt_free_path(ccb->ccb_h.path);
- free(ccb, M_TEMP);
-}
-
static bus_dmamap_callback_t hptiop_map_srb;
static bus_dmamap_callback_t hptiop_post_scsi_command;
static bus_dmamap_callback_t hptiop_mv_map_ctlcfg;
@@ -1539,8 +1528,6 @@ static int hptiop_attach(device_t dev)
hba->ioctl_dev->si_drv1 = hba;
#endif
- hptiop_rescan_bus(hba);
-
return 0;