From owner-svn-src-head@FreeBSD.ORG Thu Feb 21 13:14:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 109422A7 for ; Thu, 21 Feb 2013 13:14:26 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7E7190 for ; Thu, 21 Feb 2013 13:14:25 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id s4so6734725lbc.21 for ; Thu, 21 Feb 2013 05:14:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=FMJ1vB+frPpl12CTbpW/YkoL73+oo8CyJx7RhTyURCs=; b=Gwz1v1IWsQZ6eYzJrz73GYQEsvqTF0qnA4vewNuPqnmwWNem1XyWhklm6tzgYsViw3 43yAh/BUYV7sL9WUUrfzKD6xF8IJ/ng3b/RjpS8AOQADUu59gJBlLNCFzrnAZWxQTcfI p+781dODnW2mqUV2yGcYdPvLcDqTJRMH71vz4y6hqg+Bvv/ZlOCaigK/T5Tkqw71Sof9 kfqPk19gimEM3/LZJqeK2MQQDY9lzWbxHrhrVgxuiMkcQ759cuFwJtLWArpqbE5cKvbr 8Vqi86JX6zBKXkDB99dMqXu5DZvk0TNuuP/SrhWM0jDHRDNnB4jqNDUoAzqdic0tTQlN Z93A== X-Received: by 10.152.46.131 with SMTP id v3mr20363877lam.57.1361437804317; Thu, 21 Feb 2013 01:10:04 -0800 (PST) Received: from dhcp170-82-red.yandex.net ([2a02:6b8:0:401:b5cf:be6b:fd46:fbdb]) by mx.google.com with ESMTPS id oy10sm40534963lab.8.2013.02.21.01.10.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Feb 2013 01:10:02 -0800 (PST) Sender: Andrey Zonov Message-ID: <5125E465.20700@FreeBSD.org> Date: Thu, 21 Feb 2013 13:09:57 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r247066 - head/sys/dev/ppc References: <201302210027.r1L0Rqv3091748@svn.freebsd.org> In-Reply-To: <201302210027.r1L0Rqv3091748@svn.freebsd.org> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2NJGJKOPHNWNMLRTIMJXK" X-Gm-Message-State: ALoCoQmIpc75Udfa1wCLq2XPMICJ2NmFZMGOhC9q3Ubd2pPWJ3hDWMkmXS3nBpq0r63tTFirQF76 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 13:14:26 -0000 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--