summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2011-04-14 09:11:50 +0000
committermav <mav@FreeBSD.org>2011-04-14 09:11:50 +0000
commit94d28ce852e38855f83bbc8ce84af8aeba66b11c (patch)
tree560298d3926ccfa127f909ffdd7a5012018608c1 /sys/cam
parent1263a866ca30936495cad00dcc511efb07928fe9 (diff)
downloadFreeBSD-src-94d28ce852e38855f83bbc8ce84af8aeba66b11c.zip
FreeBSD-src-94d28ce852e38855f83bbc8ce84af8aeba66b11c.tar.gz
Fix typo in write_cache tunable name and move TUNABLE_INT_FETCH() out of
the SIM lock to fix WITNESS warning. Reported by: jh
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ata/ata_da.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 945f13e..8f5d53e 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -773,10 +773,6 @@ adaregister(struct cam_periph *periph, void *arg)
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, void *arg)
/*
* 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, void *arg)
disk_create(softc->disk, DISK_VERSION);
mtx_lock(periph->sim->mtx);
+ cam_periph_unhold(periph);
dp = &softc->params;
snprintf(announce_buf, sizeof(announce_buf),
OpenPOWER on IntegriCloud