qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] hw/audio/intel-hda: Don't use device_legacy_reset()
@ 2022-10-14 14:26 Peter Maydell
  2022-10-14 14:26 ` [PATCH 1/2] hw/audio/intel-hda: don't reset codecs twice Peter Maydell
  2022-10-14 14:26 ` [PATCH 2/2] hw/audio/intel-hda: Drop unnecessary prototype Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2022-10-14 14:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-17 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-14 14:26 [PATCH 0/2] hw/audio/intel-hda: Don't use device_legacy_reset() Peter Maydell
2022-10-14 14:26 ` [PATCH 1/2] hw/audio/intel-hda: don't reset codecs twice Peter Maydell
2022-10-17 21:05   ` Philippe Mathieu-Daudé
2022-10-14 14:26 ` [PATCH 2/2] hw/audio/intel-hda: Drop unnecessary prototype Peter Maydell
2022-10-17 21:05   ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).