Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2013 12:45:42 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255416 - head/sys/powerpc/ofw
Message-ID:  <201309091245.r89CjguR020029@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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