Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Feb 2013 13:09:57 +0400
From:      Andrey Zonov <zont@FreeBSD.org>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r247066 - head/sys/dev/ppc
Message-ID:  <5125E465.20700@FreeBSD.org>
In-Reply-To: <201302210027.r1L0Rqv3091748@svn.freebsd.org>
References:  <201302210027.r1L0Rqv3091748@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 2/21/13 4:27 AM, Warner Losh wrote:
> Author: imp
> Date: Thu Feb 21 00:27:51 2013
> New Revision: 247066
> URL: http://svnweb.freebsd.org/changeset/base/247066
> 
> Log:
>   Replace splhigh() with critical_enter()/leave() to ensure we write the
>   config mode unlock sequence quickly enough. This likely isn't too critical,
>   since splhigh() has been a noop for a decade...
> 
> Modified:
>   head/sys/dev/ppc/ppc.c
> 
> Modified: head/sys/dev/ppc/ppc.c
> ==============================================================================
> --- head/sys/dev/ppc/ppc.c	Thu Feb 21 00:26:31 2013	(r247065)
> +++ head/sys/dev/ppc/ppc.c	Thu Feb 21 00:27:51 2013	(r247066)
> @@ -74,6 +74,22 @@ static void ppcintr(void *arg);
>  
>  #define DEVTOSOFTC(dev) ((struct ppc_data *)device_get_softc(dev))
>  
> +/*
> + * We use critical enter/leave for the simple config locking needed to
> + * detect the devices. We just want to make sure that both of our writes
> + * happen without someone else also writing to those config registers. Since
> + * we just do this at startup, Giant keeps multiple threads from executing,
> + * and critical_enter() then is all that's needed to keep us from being preempted
> + * during the critical sequences with the hardware.
> + *
> + * Note: this doesn't prevent multiple threads from putting the chips into
> + * config mode, but since we only do that to detect the type at startup the
> + * extra overhead isn't needed since Giant protects us from multiple entry
> + * and no other code changes these registers.
> + */
> +#define PPC_CONFIG_LOCK(ppc)		critical_enter()
> +#define PPC_CONFIG_UNLOCK(ppc)		critical_leave()
> +

s/critical_leave/critical_exit/?

-- 
Andrey Zonov


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJRJeRoAAoJEBWLemxX/CvTo7EIAI0Bb6+R6ilQNSpqpDFZzcof
09nTBgZ+CehLpsijnmghoRRg04dZHlkJN8EqNNXSOpOM+uMtMahr178VV6lgNg+J
flB+fAm5ior9sm+muTz2BCJPNeyzRgZnbS2eiIZXP6gDKeYGZW2cxo+DLNpIOHHt
bs50QNUvFNiBzqAY//KC2a/iw3T7rG6+C5F9M2Y+mhFmawfKJQz21pU5u4srpQqr
7EJAcKHPdD0Fw/nOnzOzeREQvaRH2PB/0sJ//s2k1CRecDBnNykVfA2CIOj879Kx
T/6N3odkVIqnXC8fck8gDOoMKMuvTzPjRhtwQVbFvWN0MYwEMQaNBXKW/hWsdT4=
=JJwj
-----END PGP SIGNATURE-----

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