diff --git a/sys/bus/cam/cam_xpt.c b/sys/bus/cam/cam_xpt.c index fae2c8b9a0..fbf844f938 100644 --- a/sys/bus/cam/cam_xpt.c +++ b/sys/bus/cam/cam_xpt.c @@ -2870,6 +2870,8 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) struct ccb_getdev cgd; struct async_node *cur_entry; + kprintf("%s: ENTER\n", __func__); + cur_entry = (struct async_node *)arg; /* @@ -2878,8 +2880,10 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) * that have been invalidated but are waiting for * their last reference count to be released). */ - if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) + if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) { + kprintf("%s: dev unconfigured for sim %s\n", __func__, device->target->bus->sim->sim_name); return (1); + } xpt_compile_path(&path, NULL, @@ -2889,6 +2893,7 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) xpt_setup_ccb(&cgd.ccb_h, &path, /*priority*/1); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); + kprintf("%s: calling cur_entry->callback\n", __func__); cur_entry->callback(cur_entry->callback_arg, AC_FOUND_DEVICE, &path, &cgd); @@ -2937,6 +2942,7 @@ xpt_action_sasync_cb(void *context, int pending) * Get this peripheral up to date with all * the currently existing devices. */ + kprintf("%s: call xpt_for_all_devices\n", __func__); xpt_for_all_devices(xptsetasyncfunc, cur_entry); } if ((added & AC_PATH_REGISTERED) != 0) { @@ -2944,6 +2950,7 @@ xpt_action_sasync_cb(void *context, int pending) * Get this peripheral up to date with all * the currently existing busses. */ + kprintf("%s: call xpt_for_all_busses\n", __func__); xpt_for_all_busses(xptsetasyncbusfunc, cur_entry); } kfree(task, M_CAMXPT); @@ -2952,7 +2959,8 @@ xpt_action_sasync_cb(void *context, int pending) void xpt_action(union ccb *start_ccb) { - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_action func_code=%x\n", start_ccb->ccb_h.func_code)); start_ccb->ccb_h.status = CAM_REQ_INPROG; @@ -3311,6 +3319,8 @@ xpt_action(union ccb *start_ccb) struct async_list *async_head; u_int32_t added; + kprintf("%s: XPT_SASYNC_CB\n", __func__); + csa = &start_ccb->csa; added = csa->event_enable; async_head = &csa->ccb_h.path->device->asyncs; @@ -3334,15 +3344,18 @@ xpt_action(union ccb *start_ccb) */ added &= ~cur_entry->event_enable; if (csa->event_enable == 0) { + kprintf("%s: request without flags\n", __func__); SLIST_REMOVE(async_head, cur_entry, async_node, links); atomic_add_int( &csa->ccb_h.path->device->refcount, -1); kfree(cur_entry, M_CAMXPT); } else { + kprintf("%s: event enabled\n", __func__); cur_entry->event_enable = csa->event_enable; } } else { + kprintf("%s: allocating new entry\n", __func__); cur_entry = kmalloc(sizeof(*cur_entry), M_CAMXPT, M_INTWAIT); cur_entry->event_enable = csa->event_enable; @@ -3365,10 +3378,12 @@ xpt_action(union ccb *start_ccb) TASK_INIT(&task->task, 0, xpt_action_sasync_cb, task); task->data1 = cur_entry; task->data2 = added; + kprintf("%s: taskqueue_enqueue\n", __func__); taskqueue_enqueue(taskqueue_thread[mycpuid], &task->task); } + kprintf("%s: status set to CAM_REQ_CMP\n", __func__); start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -4260,10 +4275,15 @@ xpt_release_ccb(union ccb *free_ccb) /* XXX Turn this into an inline function - xpt_run_device?? */ if ((device_is_alloc_queued(device) == 0) && (device->drvq.entries > 0)) { + kprintf("%s: Calling xpt_schedule_dev_allocq for %d devices\n", + __func__, device->drvq.entries); xpt_schedule_dev_allocq(bus, device); } - if (dev_allocq_is_runnable(sim->devq)) + + if (dev_allocq_is_runnable(sim->devq)) { + kprintf("%s: Calling xpt_run_dev_allocq\n", __func__); xpt_run_dev_allocq(bus); + } } /* Functions accessed by SIM drivers */ @@ -6389,7 +6409,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) */ if (softc->action == PROBE_TUR_FOR_NEGOTIATION && done_ccb->ccb_h.target_lun == 0 - && (path->device->inq_data.flags & SID_Sync) != 0 +/* && (path->device->inq_data.flags & SID_Sync) != 0 */ && (path->device->flags & CAM_DEV_IN_DV) == 0) { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Begin Domain Validation\n")); @@ -6421,6 +6441,8 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) struct ccb_scsiio *csio; if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("PROBE_INQUIRY_BASIC_DV2: CAM_DEV_QFRZN\n")); /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, /*run_queue*/TRUE); @@ -6432,10 +6454,14 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) "inquiry data fails comparison at DV%d step\n", softc->action == PROBE_INQUIRY_BASIC_DV1 ? 1 : 2); if (proberequestbackoff(periph, path->device)) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("PROBE_INQUIRY_BASIC_DV2: setting action PROBE_TUR_FOR_NEGOTIATION\n")); path->device->flags &= ~CAM_DEV_IN_DV; PROBE_SET_ACTION(softc, PROBE_TUR_FOR_NEGOTIATION); } else { /* give up */ + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("PROBE_INQUIRY_BASIC_DV2: setting action PROBE_DV_EXIT\n")); PROBE_SET_ACTION(softc, PROBE_DV_EXIT); } kfree(nbuf, M_CAMXPT); @@ -6445,6 +6471,8 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) } kfree(nbuf, M_CAMXPT); if (softc->action == PROBE_INQUIRY_BASIC_DV1) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("PROBE_INQUIRY_BASIC_DV2: setting action PROBE_INQUIRY_BASIC_DV2\n")); PROBE_SET_ACTION(softc, PROBE_INQUIRY_BASIC_DV2); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -6458,6 +6486,8 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) ~(CAM_DEV_UNCONFIGURED|CAM_DEV_IN_DV|CAM_DEV_DV_HIT_BOTTOM); if ((softc->flags & PROBE_NO_ANNOUNCE) == 0) { /* Inform the XPT that a new device has been found */ + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + ("PROBE_INQUIRY_BASIC_DV2: Announce new device has been found\n")); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, @@ -7143,6 +7173,7 @@ xpt_finishconfig_task(void *context, int pending) /* XXX This will have to change when we have loadable modules */ p_drv = periph_drivers; for (i = 0; p_drv[i] != NULL; i++) { + kprintf("%s: DEVICE DRIVER %s\n", __func__, p_drv[i]->driver_name); (*p_drv[i]->init)(); } diff --git a/sys/bus/cam/scsi/scsi_da.c b/sys/bus/cam/scsi/scsi_da.c index e8d0d98e63..f0b6847534 100644 --- a/sys/bus/cam/scsi/scsi_da.c +++ b/sys/bus/cam/scsi/scsi_da.c @@ -836,6 +836,8 @@ dainit(void) { cam_status status; + kprintf("%s: ENTER\n", __func__); + /* * Create our extend array for storing the devices we attach to. */ @@ -937,6 +939,8 @@ daasync(void *callback_arg, u_int32_t code, { struct cam_periph *periph; + kprintf("%s: ENTER\n", __func__); + periph = (struct cam_periph *)callback_arg; switch (code) { @@ -944,7 +948,9 @@ daasync(void *callback_arg, u_int32_t code, { struct ccb_getdev *cgd; cam_status status; - + + kprintf("%s: AC_FOUND_DEVICE\n", __func__); + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -984,6 +990,7 @@ daasync(void *callback_arg, u_int32_t code, struct da_softc *softc; struct ccb_hdr *ccbh; + kprintf("%s: AC_BUS_RESET AC_SENT_BDR\n", __func__); softc = (struct da_softc *)periph->softc; /* * Don't fail on the expected unit attention @@ -994,10 +1001,12 @@ daasync(void *callback_arg, u_int32_t code, ccbh->ccb_state |= DA_CCB_RETRY_UA; /* FALLTHROUGH*/ } - default: + default: { + kprintf("%s: default\n", __func__); cam_periph_async(periph, code, path, arg); break; } + } } static void diff --git a/sys/bus/cam/scsi/scsi_pass.c b/sys/bus/cam/scsi/scsi_pass.c index 5bb6b5702e..8c0545523b 100644 --- a/sys/bus/cam/scsi/scsi_pass.c +++ b/sys/bus/cam/scsi/scsi_pass.c @@ -121,6 +121,7 @@ static void passinit(void) { cam_status status; + kprintf("%s: ENTER\n", __func__); /* * Create our extend array for storing the devices we attach to. @@ -190,12 +191,16 @@ passasync(void *callback_arg, u_int32_t code, periph = (struct cam_periph *)callback_arg; + kprintf("%s: ENTER\n", __func__); + switch (code) { case AC_FOUND_DEVICE: { struct ccb_getdev *cgd; cam_status status; - + + kprintf("%s: AC_FOUND_DEVICE\n", __func__); + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -230,9 +235,12 @@ passasync(void *callback_arg, u_int32_t code, break; } default: + { + kprintf("%s: default\n", __func__); cam_periph_async(periph, code, path, arg); break; } + } } static cam_status diff --git a/sys/bus/cam/scsi/scsi_sg.c b/sys/bus/cam/scsi/scsi_sg.c index 313f7f975a..cf895438f1 100644 --- a/sys/bus/cam/scsi/scsi_sg.c +++ b/sys/bus/cam/scsi/scsi_sg.c @@ -152,6 +152,7 @@ sginit(void) { cam_status status; + kprintf("%s: ENTER\n", __func__); /* * Install a global async callback. This callback will receive aync * callbacks like "new device found". @@ -211,12 +212,16 @@ sgasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) periph = (struct cam_periph *)callback_arg; + kprintf("%s: ENTER\n", __func__); + switch (code) { case AC_FOUND_DEVICE: { struct ccb_getdev *cgd; cam_status status; + kprintf("%s: AC_FOUND_DEVICE\n", __func__); + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -245,9 +250,12 @@ sgasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) break; } default: + { + kprintf("%s: default\n", __func__); cam_periph_async(periph, code, path, arg); break; } + } } static cam_status