diff options
author | des <des@FreeBSD.org> | 2009-09-25 22:45:59 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2009-09-25 22:45:59 +0000 |
commit | bf5117185e83a178d672946c3f7053d0ef92be27 (patch) | |
tree | 394fcfe01b613c0b5b5edbfc414a17c73481ad5d /sys/dev/ppbus/vpo.c | |
parent | b79ff8160af6fa640e29ce784e59acd49cd1e7fc (diff) | |
parent | 5c2742e3dae3ef549329b770ec44b16ca930dc1f (diff) | |
download | FreeBSD-src-bf5117185e83a178d672946c3f7053d0ef92be27.zip FreeBSD-src-bf5117185e83a178d672946c3f7053d0ef92be27.tar.gz |
Sync with head
Diffstat (limited to 'sys/dev/ppbus/vpo.c')
-rw-r--r-- | sys/dev/ppbus/vpo.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c index 4009178..673a785 100644 --- a/sys/dev/ppbus/vpo.c +++ b/sys/dev/ppbus/vpo.c @@ -176,9 +176,6 @@ vpo_attach(device_t dev) return (ENXIO); } ppb_unlock(ppbus); - - /* all went ok */ - vpo_cam_rescan(vpo); /* have CAM rescan the bus */ return (0); @@ -194,12 +191,15 @@ vpo_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb) static void vpo_cam_rescan(struct vpo_data *vpo) { + device_t ppbus = device_get_parent(vpo->vpo_dev); struct cam_path *path; union ccb *ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK | M_ZERO); + ppb_lock(ppbus); if (xpt_create_path(&path, xpt_periph, cam_sim_path(vpo->sim), 0, 0) != CAM_REQ_CMP) { /* A failure is benign as the user can do a manual rescan */ + ppb_unlock(ppbus); free(ccb, M_TEMP); return; } @@ -209,6 +209,7 @@ vpo_cam_rescan(struct vpo_data *vpo) ccb->ccb_h.cbfcnp = vpo_cam_rescan_callback; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); + ppb_unlock(ppbus); /* The scan is in progress now. */ } |