From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 1/3] pci: Rework config space blocking services Date: Wed, 2 Nov 2011 13:59:51 -0700 Message-ID: <20111102135951.3bce8b08@jbarnes-desktop> References: <33234f96f761babf0e61dfe2cb5fe87cadc98d60.1315846441.git.jan.kiszka@siemens.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/i7TBoQ+I71WOB_UzxnFwfE/"; protocol="application/pgp-signature" Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "Hans J. Koch" , Greg Kroah-Hartman , "Michael S. Tsirkin" , kvm@vger.kernel.org, Brian King To: Jan Kiszka Return-path: In-Reply-To: <33234f96f761babf0e61dfe2cb5fe87cadc98d60.1315846441.git.jan.kiszka@siemens.com> Sender: linux-pci-owner@vger.kernel.org List-Id: kvm.vger.kernel.org --Sig_/i7TBoQ+I71WOB_UzxnFwfE/ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 12 Sep 2011 18:54:02 +0200 Jan Kiszka wrote: > pci_block_user_cfg_access was designed for the use case that a single > context, the IPR driver, temporarily delays user space accesses to the > config space via sysfs. This assumption became invalid by the time > pci_dev_reset was added as locking instance. Today, if you run two loops > in parallel that reset the same device via sysfs, you end up with a > kernel BUG as pci_block_user_cfg_access detect the broken assumption. >=20 > This reworks the pci_block_user_cfg_access to a sleeping service > pci_cfg_access_lock and an atomic-compatible variant called > pci_cfg_access_trylock. The former not only blocks user space access as > before but also waits if access was already locked. The latter service > just returns false in this case, allowing the caller to resolve the > conflict instead of raising a BUG. >=20 > Adaptions of the ipr driver were originally written by Brian King. Sorry to ask you to refresh these after so long, Jan, but can you respin against my linux-next branch? My inbox is a poor substitute for patchwork, but that's no excuse for leaving you hanging so long. Sorry! Thanks, --=20 Jesse Barnes, Intel Open Source Technology Center --Sig_/i7TBoQ+I71WOB_UzxnFwfE/ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJOsa9IAAoJEIEoDkX4Qk9hgGgP/jCGby/oBt5DAuS2mmaoGwQc f0+jj1DoVyuKyLl5S7NhmImCVHpkN9ZO4MGpvM0ZFeLCza9TE1J3XEBz5lMNWrgb AaFKo3/bhpvYkyb97C9m3ZPr5B0+RX1asGPGh2r2Zv9/vh/vqDKj/DcasVv1wQNM joAKDvdD6LHeWQqJM1mKyOREYjckuehRv2OtWR7xtmzG4lFfbxQSOwsXJmuLu9Nb hFvCGHTbYbUI5+ePYcZyEh+CTMqndGNRW6pHJ44625WAbvzOZ0wngzlrsZlukccU zhfGC4+tvolxPhANviC/7gefpP2DStMYX65cPp+ANpQ1s5IrNV5AJHSqQ+yQBuZ3 8tw+Bx5QqTRf/vfm60tZiu3vAM8/mGjC6iGSbrZ4Hzx7RAJQzMRoiwnk/kZDDHQ7 TJqdPtRVVfZBGRx3u11+1St/mJULwwKS3XeELpzElZ2xBWq6nfdxdygxH3mZAW+E e4B33rX8WJCxRzO4OoWnZ7XXdJDmcCx/7CG7T6fWFhh1Gk4ArPd32GDQlvId/W4M gndverWe4HPBYAxfGE19Kruogh/v8uJtQKpUk3hjdPjKwMArU5Sjv8fmLNbeZnyF 56YfRUh0ODSBxFOO7xqiCgMUfijJZSTOfu2u/kA48AIFmlNQqgeow4GvhXjyD6t2 koS06VzyJKJFJ/fEjA9S =YoCS -----END PGP SIGNATURE----- --Sig_/i7TBoQ+I71WOB_UzxnFwfE/--