Gentoo Archives: gentoo-commits

From: Doug Goldstein <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qemu-kvm:qemu-kvm-1.1.2-gentoo commit in: hw/
Date: Wed, 21 Nov 2012 20:51:33
Message-Id: 1351062589.6cee76f006e97a30d3d5723d707d24d2ebd5f36d.cardoe@gentoo
1 commit: 6cee76f006e97a30d3d5723d707d24d2ebd5f36d
2 Author: Michael Tokarev <mjt <AT> tls <DOT> msk <DOT> ru>
3 AuthorDate: Thu Sep 27 18:50:22 2012 +0000
4 Commit: Doug Goldstein <cardoe <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 24 07:09:49 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qemu-kvm.git;a=commit;h=6cee76f0
7
8 intel_hda: do not call msi_reset when only device state needs resetting
9
10 Commit 8e729e3b521d9 "intel-hda: Fix reset of MSI function"
11 (applied to 1.1.1 as 0ec39075710) added a call to msi_reset()
12 into intel_hda_reset() function. But this function is called
13 not only from PCI bus reset method, but also from device init
14 method (intel_hda_set_g_ctl()), and there, we should not reset
15 msi state. For this, split intel_hda_reset() into two halves,
16 one common part with device reset, and one with msi reset,
17 intel_hda_reset_msi(), which also calls the common part, for
18 the bus method.
19
20 This is only needed for 1.1.x series, since in 1.2+, MSI reset
21 is called in proper places by the PCI code already.
22
23 Signed-off-by: Michael Tokarev <mjt <AT> tls.msk.ru>
24 Cc: Jan Kiszka <jan.kiszka <AT> siemens.com>
25 Cc: Michael S. Tsirkin <mst <AT> redhat.com>
26 Cc: 688964 <AT> bugs.debian.org
27
28 ---
29 hw/intel-hda.c | 14 ++++++++++----
30 1 files changed, 10 insertions(+), 4 deletions(-)
31
32 diff --git a/hw/intel-hda.c b/hw/intel-hda.c
33 index e38861e..da61323 100644
34 --- a/hw/intel-hda.c
35 +++ b/hw/intel-hda.c
36 @@ -1107,9 +1107,6 @@ static void intel_hda_reset(DeviceState *dev)
37 DeviceState *qdev;
38 HDACodecDevice *cdev;
39
40 - if (d->msi) {
41 - msi_reset(&d->pci);
42 - }
43 intel_hda_regs_reset(d);
44 d->wall_base_ns = qemu_get_clock_ns(vm_clock);
45
46 @@ -1122,6 +1119,15 @@ static void intel_hda_reset(DeviceState *dev)
47 intel_hda_update_irq(d);
48 }
49
50 +static void intel_hda_reset_msi(DeviceState *dev)
51 +{
52 + IntelHDAState *d = DO_UPCAST(IntelHDAState, pci.qdev, dev);
53 + if (d->msi) {
54 + msi_reset(&d->pci);
55 + }
56 + intel_hda_reset(dev);
57 +}
58 +
59 static int intel_hda_init(PCIDevice *pci)
60 {
61 IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci);
62 @@ -1261,7 +1267,7 @@ static void intel_hda_class_init(ObjectClass *klass, void *data)
63 k->revision = 1;
64 k->class_id = PCI_CLASS_MULTIMEDIA_HD_AUDIO;
65 dc->desc = "Intel HD Audio Controller";
66 - dc->reset = intel_hda_reset;
67 + dc->reset = intel_hda_reset_msi;
68 dc->vmsd = &vmstate_intel_hda;
69 dc->props = intel_hda_properties;
70 }