qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 2/2] sdhci: add quirk property for card inser


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 2/2] sdhci: add quirk property for card insert interrupt status on Raspberry Pi
Date: Thu, 25 Feb 2016 19:17:02 +0000

On 25 February 2016 at 19:00, Andrew Baumann
<address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]