From owner-svn-src-all@FreeBSD.ORG Thu Apr 14 09:11:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA9A41065674; Thu, 14 Apr 2011 09:11:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D85788FC18; Thu, 14 Apr 2011 09:11:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3E9Bolq027076; Thu, 14 Apr 2011 09:11:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3E9BooX027074; Thu, 14 Apr 2011 09:11:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201104140911.p3E9BooX027074@svn.freebsd.org> From: Alexander Motin Date: Thu, 14 Apr 2011 09:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220618 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 09:11:51 -0000 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),