mbox series

[0/2] hw/audio/intel-hda: Don't use device_legacy_reset()

Message ID 20221014142632.2092404-1-peter.maydell@linaro.org
Headers show
Series hw/audio/intel-hda: Don't use device_legacy_reset() | expand

Message

Peter Maydell Oct. 14, 2022, 2:26 p.m. UTC
This patchset removes a use of device_legacy_reset() from the
intel-hda audio device, and removes a duplicated reset of the
codec devices.

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.

Patch 1 drops the manual reset call.  To ensure that codecs are still
reset when the guest does a reset via ICH6_GCTL_RESET we make that
codepath call device_cold_reset() on the HDA device (which resets all
the devices on the qbus as well as the device itself) instead of
making 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.

Patch 2 is a trivial cleanup I noticed while I was there.

The patchset has been tested with 'make check' and
'make check-avocado' (and a little bit of use of gdb to confirm
that the reset functions still get called as expected).

thanks
-- PMM

Peter Maydell (2):
  hw/audio/intel-hda: don't reset codecs twice
  hw/audio/intel-hda: Drop unnecessary prototype

 hw/audio/intel-hda.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)