From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdgxS-0000BH-41 for qemu-devel@nongnu.org; Sun, 10 Jun 2012 08:09:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SdgxQ-00053w-4B for qemu-devel@nongnu.org; Sun, 10 Jun 2012 08:09:25 -0400 Received: from mout.web.de ([212.227.17.12]:53225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdgxP-00053k-Qo for qemu-devel@nongnu.org; Sun, 10 Jun 2012 08:09:24 -0400 Message-ID: <4FD48E70.3080406@web.de> Date: Sun, 10 Jun 2012 14:09:20 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <73f236cab517fc5b2c2ba332e9efe2acbe727151.1338799936.git.jan.kiszka@siemens.com> <20120610094840.GC6250@redhat.com> <4FD47156.3020200@web.de> <20120610103352.GE6250@redhat.com> <4FD47A75.4020706@web.de> <20120610111149.GJ6250@redhat.com> <4FD48277.60704@web.de> <20120610113922.GO6250@redhat.com> In-Reply-To: <20120610113922.GO6250@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8E63E7BDC9B385B0F2CB547A" Subject: Re: [Qemu-devel] [PATCH 06/13] pci: Add INTx routing notifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Alex Williamson , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8E63E7BDC9B385B0F2CB547A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-06-10 13:39, Michael S. Tsirkin wrote: > It's OK to use recursion but when done through a callback > like this it's unreadable. Isn't the alternative poking into foreign bridge device states for their secondary buses? > Also, you need to setup you cache after intx cache has been > initialized, and you provide no clean way to do that. Once a PCI device is registered, the INTx route can be queried. So the device user will call pci_device_route_intx_to_irq once (e.g. in the device init function which is invoked afterward) to fill its cache and receive a notification if an update is needed. I do not see why, and specifically how you could query the route earlier or register a callback= =2E >=20 > One way to fix all this is call the notifier for devices, if set, from > pci_set_bus_intx_routing. > Then assume that intx to irq translations can be cached > even though they aren't now. So you will need to invoke > pci_set_bus_intx_routing on intx to irq mapping changes, > and that fires the notifier for free. pci_set_bus_intx_routing is really only for the initial setup of the static INTx pin routes. And this happens on pci_bus_irqs/pci_register_bus, ie. triggered by the host bridge. By that time, there can't be any notifier listeners - as there are no devices yet= =2E Jan --------------enig8E63E7BDC9B385B0F2CB547A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/UjnAACgkQitSsb3rl5xRxsgCeOAoXnRgThudDCs/bOuaeK6Zh DIkAoMGlI4ZFhSkIpEk3zGVM1argqvyc =Z8ol -----END PGP SIGNATURE----- --------------enig8E63E7BDC9B385B0F2CB547A--