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
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NJGJKOPHNWNMLRTIMJXK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 >=20 > Log: > Replace splhigh() with critical_enter()/leave() to ensure we write th= e > config mode unlock sequence quickly enough. This likely isn't too cri= tical, > since splhigh() has been a noop for a decade... >=20 > Modified: > head/sys/dev/ppc/ppc.c >=20 > Modified: head/sys/dev/ppc/ppc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- 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); > =20 > #define DEVTOSOFTC(dev) ((struct ppc_data *)device_get_softc(dev)) > =20 > +/* > + * 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 writ= es > + * happen without someone else also writing to those config registers.= Since > + * we just do this at startup, Giant keeps multiple threads from execu= ting, > + * and critical_enter() then is all that's needed to keep us from bein= g 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 startu= p the > + * extra overhead isn't needed since Giant protects us from multiple e= ntry > + * 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/? --=20 Andrey Zonov ------enig2NJGJKOPHNWNMLRTIMJXK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----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----- ------enig2NJGJKOPHNWNMLRTIMJXK--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5125E465.20700>