[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/7] hw/audio/intel-hda: don't reset codecs twice
From: |
Gerd Hoffmann |
Subject: |
[PULL 6/7] hw/audio/intel-hda: don't reset codecs twice |
Date: |
Wed, 23 Nov 2022 15:44:35 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
Currently the intel-hda device has a reset method which manually
resets all the codecs by calling device_legacy_reset() on them. This
means they get reset twice, once because child devices on a qbus get
reset before the parent device's reset method is called, and then
again because we're manually resetting them.
Drop the manual reset call, and ensure that codecs are still reset
when the guest does a reset via ICH6_GCTL_RESET by using
device_cold_reset() (which resets all the devices on the qbus as well
as the device itself) instead of a direct call to the reset function.
This is a slight ordering change because the (only) codec reset now
happens before the controller registers etc are reset, rather than
once before and then once after, but the codec reset function
hda_audio_reset() doesn't care.
This lets us drop a use of device_legacy_reset(), which is
deprecated.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221014142632.2092404-2-peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/audio/intel-hda.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index f38117057b9b..38cfa20262e2 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -516,7 +516,7 @@ static void intel_hda_notify_codecs(IntelHDAState *d,
uint32_t stream, bool runn
static void intel_hda_set_g_ctl(IntelHDAState *d, const IntelHDAReg *reg,
uint32_t old)
{
if ((d->g_ctl & ICH6_GCTL_RESET) == 0) {
- intel_hda_reset(DEVICE(d));
+ device_cold_reset(DEVICE(d));
}
}
@@ -1083,11 +1083,9 @@ static void intel_hda_reset(DeviceState *dev)
intel_hda_regs_reset(d);
d->wall_base_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
- /* reset codecs */
QTAILQ_FOREACH(kid, &d->codecs.qbus.children, sibling) {
DeviceState *qdev = kid->child;
cdev = HDA_CODEC_DEVICE(qdev);
- device_legacy_reset(DEVICE(cdev));
d->state_sts |= (1 << cdev->cad);
}
intel_hda_update_irq(d);
--
2.38.1
- [PULL 0/7] Fixes 20221123 patches, Gerd Hoffmann, 2022/11/23
- [PULL 1/7] Revert "usbredir: avoid queuing hello packet on snapshot restore", Gerd Hoffmann, 2022/11/23
- [PULL 5/7] hw/usb/hcd-xhci: Reset the XHCIState with device_cold_reset(), Gerd Hoffmann, 2022/11/23
- [PULL 3/7] hw/usb/hcd-xhci.c: spelling: tranfer, Gerd Hoffmann, 2022/11/23
- [PULL 4/7] ui/gtk: prevent ui lock up when dpy_gl_update called again before current draw event occurs, Gerd Hoffmann, 2022/11/23
- [PULL 6/7] hw/audio/intel-hda: don't reset codecs twice,
Gerd Hoffmann <=
- [PULL 7/7] hw/audio/intel-hda: Drop unnecessary prototype, Gerd Hoffmann, 2022/11/23
- [PULL 2/7] gtk: disable GTK Clipboard with a new meson option, Gerd Hoffmann, 2022/11/23
- Re: [PULL 0/7] Fixes 20221123 patches, Peter Maydell, 2022/11/23
- Re: [PULL 0/7] Fixes 20221123 patches, Stefan Hajnoczi, 2022/11/23