On 25 February 2016 at 19:00, Andrew Baumann <andrew.baum...@microsoft.com> wrote: > Hmm. This thought had occurred to me, but I could not find any > system reset logic in sdhci.c -- sdhci_reset() is only referenced > by the code path for a guest-initiated write to the reset register. > There is no system reset handler logic anywhere that I can see, so > the sdhci state would be the same after reset, unless something > else completely tears down and re-inits the device, in which case > my property trick should work. Is this a bug, or am I missing something?
Yes, that's a bug. The device should register a reset function via dc->reset. This should generally have power-on-reset semantics. (For PCI devices it also gets called on PCI bus reset. Hopefully those two sets of reset semantics are the same for this card...) Missing reset implementation is a fairly common bug in QEMU devices; it often goes unnoticed because of some combination of "reset state is not well defined anyway" and "guest OS fully programs the device and doesn't rely on whatever its reset state happens to be" and "people don't often try to reset QEMU in the middle of guest operation". Unfortunately it's awkward to find devices that need fixing, because it's hard to distinguish "this device is missing a reset function" from "this device genuinely doesn't need a reset function because it has no internal state of its own"... thanks -- PMM