From owner-svn-src-all@FreeBSD.ORG Mon Sep 9 12:45:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 90479E7B; Mon, 9 Sep 2013 12:45:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B94E21CB; Mon, 9 Sep 2013 12:45:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89CjgjL020030; Mon, 9 Sep 2013 12:45:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CjguR020029; Mon, 9 Sep 2013 12:45:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201309091245.r89CjguR020029@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 9 Sep 2013 12:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255416 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 09 Sep 2013 12:45:42 -0000 Author: nwhitehorn Date: Mon Sep 9 12:45:41 2013 New Revision: 255416 URL: http://svnweb.freebsd.org/changeset/base/255416 Log: Use a spin lock instead of a mutex to gate RTAS. This is required if RTAS calls are involved in interrupt handling. Approved by: re (kib) Modified: head/sys/powerpc/ofw/rtas.c Modified: head/sys/powerpc/ofw/rtas.c ============================================================================== --- head/sys/powerpc/ofw/rtas.c Mon Sep 9 12:44:48 2013 (r255415) +++ head/sys/powerpc/ofw/rtas.c Mon Sep 9 12:45:41 2013 (r255416) @@ -93,7 +93,7 @@ rtas_setup(void *junk) return; } - mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0); + mtx_init(&rtas_mtx, "RTAS", NULL, MTX_SPIN); /* RTAS must be called with everything turned off in MSR */ rtasmsr = mfmsr(); @@ -208,7 +208,7 @@ rtas_call_method(cell_t token, int nargs args.token = token; va_start(ap, nreturns); - mtx_lock(&rtas_mtx); + mtx_lock_spin(&rtas_mtx); rtas_bounce_offset = 0; args.nargs = nargs; @@ -232,7 +232,7 @@ rtas_call_method(cell_t token, int nargs __asm __volatile ("sync"); rtas_real_unmap(argsptr, &args, sizeof(args)); - mtx_unlock(&rtas_mtx); + mtx_unlock_spin(&rtas_mtx); if (result < 0) return (result);