Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2009 21:56:26 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 168798 for review
Message-ID:  <200909222156.n8MLuQOO015301@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=168798

Change 168798 by mav@mav_mavtest on 2009/09/22 21:55:38

	Lock bus scan.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/dev/ppbus/vpo.c#10 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/dev/ppbus/vpo.c#10 (text+ko) ====

@@ -176,9 +176,6 @@
 		return (ENXIO);
 	}
 	ppb_unlock(ppbus);
-
-	/* all went ok */
-
 	vpo_cam_rescan(vpo);	/* have CAM rescan the bus */
 
 	return (0);
@@ -194,12 +191,15 @@
 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 @@
 	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. */
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909222156.n8MLuQOO015301>