Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2011 09:11:50 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220618 - head/sys/cam/ata
Message-ID:  <201104140911.p3E9BooX027074@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Apr 14 09:11:50 2011
New Revision: 220618
URL: http://svn.freebsd.org/changeset/base/220618

Log:
  Fix typo in write_cache tunable name and move TUNABLE_INT_FETCH() out of
  the SIM lock to fix WITNESS warning.
  
  Reported by:	jh

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Thu Apr 14 08:53:04 2011	(r220617)
+++ head/sys/cam/ata/ata_da.c	Thu Apr 14 09:11:50 2011	(r220618)
@@ -773,10 +773,6 @@ adaregister(struct cam_periph *periph, v
 		softc->quirks = ((struct ada_quirk_entry *)match)->quirks;
 	else
 		softc->quirks = ADA_Q_NONE;
-	softc->write_cache = -1;
-	snprintf(announce_buf, sizeof(announce_buf),
-	    "kern.cam.ada.%d.writa_cache", periph->unit_number);
-	TUNABLE_INT_FETCH(announce_buf, &softc->write_cache);
 
 	bzero(&cpi, sizeof(cpi));
 	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE);
@@ -788,7 +784,12 @@ adaregister(struct cam_periph *periph, v
 	/*
 	 * Register this media as a disk
 	 */
+	(void)cam_periph_hold(periph, PRIBIO);
 	mtx_unlock(periph->sim->mtx);
+	softc->write_cache = -1;
+	snprintf(announce_buf, sizeof(announce_buf),
+	    "kern.cam.ada.%d.write_cache", periph->unit_number);
+	TUNABLE_INT_FETCH(announce_buf, &softc->write_cache);
 	adagetparams(periph, cgd);
 	softc->disk = disk_alloc();
 	softc->disk->d_open = adaopen;
@@ -841,6 +842,7 @@ adaregister(struct cam_periph *periph, v
 
 	disk_create(softc->disk, DISK_VERSION);
 	mtx_lock(periph->sim->mtx);
+	cam_periph_unhold(periph);
 
 	dp = &softc->params;
 	snprintf(announce_buf, sizeof(announce_buf),



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