From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUPf9-0003UU-BX for qemu-devel@nongnu.org; Wed, 08 Jun 2011 16:47:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUPf6-0008Ek-DN for qemu-devel@nongnu.org; Wed, 08 Jun 2011 16:47:39 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:37014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUPf5-0008EE-SV for qemu-devel@nongnu.org; Wed, 08 Jun 2011 16:47:36 -0400 Message-ID: <4DEFDFE6.6020707@web.de> Date: Wed, 08 Jun 2011 22:47:34 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <291996e698d5e68a44576f32c2b5fc2f1c2fa86a.1307550106.git.jan.kiszka@siemens.com> <20110608195923.GE30805@redhat.com> In-Reply-To: <20110608195923.GE30805@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF49369F71107C2420024A29F" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH v2 5/9] msi: Invoke msi/msix_reset from PCI core List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Isaku Yamahata , Alexander Graf , Gerd Hoffmann , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF49369F71107C2420024A29F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-06-08 21:59, Michael S. Tsirkin wrote: > On Wed, Jun 08, 2011 at 06:21:48PM +0200, Jan Kiszka wrote: >> There is no point in pushing this burden to the devices, they may rath= er >> forget to call them (like intel-hda and ahci ATM). Instead, reset >> functions are now called from pci_device_reset and pci_bridge_reset. >> They do nothing if the MSI/MSI-X is not in use. >> >> CC: Alexander Graf >> CC: Gerd Hoffmann >> CC: Isaku Yamahata >> Signed-off-by: Jan Kiszka >> --- >> hw/ioh3420.c | 2 +- >> hw/pci.c | 5 +++++ >> hw/pci_bridge.c | 4 ++++ >> hw/virtio-pci.c | 1 - >> hw/xio3130_downstream.c | 2 +- >> hw/xio3130_upstream.c | 1 - >> 6 files changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/hw/ioh3420.c b/hw/ioh3420.c >> index 95adf09..73bc55f 100644 >> --- a/hw/ioh3420.c >> +++ b/hw/ioh3420.c >> @@ -81,7 +81,7 @@ static void ioh3420_write_config(PCIDevice *d, >> static void ioh3420_reset(DeviceState *qdev) >> { >> PCIDevice *d =3D DO_UPCAST(PCIDevice, qdev, qdev); >> - msi_reset(d); >> + >> ioh3420_aer_vector_update(d); >> pcie_cap_root_reset(d); >> pcie_cap_deverr_reset(d); >> diff --git a/hw/pci.c b/hw/pci.c >> index 1d297d6..967f812 100644 >> --- a/hw/pci.c >> +++ b/hw/pci.c >> @@ -31,6 +31,8 @@ >> #include "loader.h" >> #include "qemu-objects.h" >> #include "range.h" >> +#include "msi.h" >> +#include "msix.h" >> =20 >> //#define DEBUG_PCI >> #ifdef DEBUG_PCI >> @@ -191,6 +193,9 @@ void pci_device_reset(PCIDevice *dev) >> } >> } >> pci_update_mappings(dev); >> + >> + msi_reset(dev); >> + msix_reset(dev); >> } >> =20 >> /* >=20 > I am reluctant to add this dependency in pci.c: > this goes against the efforts to modularise the > pci subsystem. As I see it, pci.c should really only handle the common > header. Instead I would like to add pci_caps.c and have > that call out to all the capabilities (not just reset, same > applies to other caps really). Yeah, true. The result should just remain that devices no longer need to worry about this. >=20 > I started doing that, if no one beats me to it, > I'll try to dust off that patch and post it next week. Would be welcome. Jan --------------enigF49369F71107C2420024A29F 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.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk3v3+YACgkQitSsb3rl5xQi9QCgwBMNzAetgnMHvi7MKZ8Y0sUI cVQAniWB4hjQonWRHXCfRuCb0u/KxrH3 =Uvm7 -----END PGP SIGNATURE----- --------------enigF49369F71107C2420024A29F--