From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 11:48:54 2009 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 0C7DD1065670; Sun, 6 Dec 2009 11:48:54 +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 EF91A8FC08; Sun, 6 Dec 2009 11:48:53 +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 nB6Bmru0020121; Sun, 6 Dec 2009 11:48:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6BmruQ020118; Sun, 6 Dec 2009 11:48:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912061148.nB6BmruQ020118@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Dec 2009 11:48:53 +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: r200180 - in 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: Sun, 06 Dec 2009 11:48:54 -0000 Author: mav Date: Sun Dec 6 11:48:53 2009 New Revision: 200180 URL: http://svn.freebsd.org/changeset/base/200180 Log: MFp4: If we panicked with SIM lock held, do not try to flush caches. Extra lock recursing will not make debugging easier. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_periph.h Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Dec 6 09:36:11 2009 (r200179) +++ head/sys/cam/ata/ata_da.c Sun Dec 6 11:48:53 2009 (r200180) @@ -1040,6 +1040,9 @@ adashutdown(void * arg, int howto) TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; cam_periph_lock(periph); softc = (struct ada_softc *)periph->softc; /* Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Sun Dec 6 09:36:11 2009 (r200179) +++ head/sys/cam/cam_periph.h Sun Dec 6 11:48:53 2009 (r200180) @@ -190,5 +190,11 @@ cam_periph_unlock(struct cam_periph *per mtx_unlock(periph->sim->mtx); } +static __inline int +cam_periph_owned(struct cam_periph *periph) +{ + return (mtx_owned(periph->sim->mtx)); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */