Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 2009 12:16:04 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 169516 for review
Message-ID:  <200910151216.n9FCG4F6005949@repoman.freebsd.org>

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

Change 169516 by mav@mav_mavtest on 2009/10/15 12:15:49

	Use only cam_periph_acquire() instead of cam_periph_hold() on
	init and device reset async. We can't sleep in async handler.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#29 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#29 (text+ko) ====

@@ -555,13 +555,16 @@
 	{
 		struct ada_softc *softc = (struct ada_softc *)periph->softc;
 
+		cam_periph_async(periph, code, path, arg);
+		if (softc->state != ADA_STATE_NORMAL)
+			break;
 		/*
 		 * Restore device configuration.
 		 */
 		softc->state = ADA_STATE_SET_MULTI;
-		(void)cam_periph_hold(periph, PRIBIO);
+		cam_periph_acquire(periph);
 		xpt_schedule(periph, CAM_PRIORITY_DEV);
-		/* FALLTHROUGH*/
+		break;
 	}
 	default:
 		cam_periph_async(periph, code, path, arg);
@@ -737,7 +740,7 @@
 	 * to finish the probe.  The reference will be dropped in adadone at
 	 * the end of probe.
 	 */
-	(void)cam_periph_hold(periph, PRIBIO);
+	cam_periph_acquire(periph);
 	xpt_schedule(periph, CAM_PRIORITY_DEV);
 
 	/*
@@ -1020,7 +1023,11 @@
 		 * operation.
 		 */
 		xpt_release_ccb(done_ccb);
-		cam_periph_unhold(periph);
+		if (bioq_first(&softc->bio_queue) != NULL) {
+			/* Have more work to do, so ensure we stay scheduled */
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
+		}
+		cam_periph_release_locked(periph);
 		return;
 	}
 	case ADA_CCB_DUMP:



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