[qemu-xen master] hw/sd/milkymist-memcard: Reset SD card on controller reset

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[qemu-xen master] hw/sd/milkymist-memcard: Reset SD card on controller reset

patchbot
commit a22b8096b60431d32e7b6bbef0ccb1ff1c984ed5
Author:     Peter Maydell <[hidden email]>
AuthorDate: Tue Jan 16 13:28:12 2018 +0000
Commit:     Michael Roth <[hidden email]>
CommitDate: Tue Jan 23 16:33:50 2018 -0600

    hw/sd/milkymist-memcard: Reset SD card on controller reset
   
    Since milkymist-memcard is still using the legacy SD card API,
    the SD card created by sd_init() is not plugged into any bus.
    This means that the controller has to reset it manually.
   
    Failing to do this mostly didn't affect the guest since the
    guest typically does a programmed SD card reset as part of
    its SD controller driver initialization, but meant that
    migration failed because it's only in sd_reset() that we
    set up the wpgrps_size field.
   
    Cc: [hidden email]
    Signed-off-by: Peter Maydell <[hidden email]>
    Reviewed-by: Philippe Mathieu-Daudé <[hidden email]>
    Tested-by: Philippe Mathieu-Daudé <[hidden email]>
    Message-id: [hidden email]
    (cherry picked from commit 16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38)
    Signed-off-by: Michael Roth <[hidden email]>
---
 hw/sd/milkymist-memcard.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index 4008c81..341da88 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -248,6 +248,10 @@ static void milkymist_memcard_reset(DeviceState *d)
     for (i = 0; i < R_MAX; i++) {
         s->regs[i] = 0;
     }
+    /* Since we're still using the legacy SD API the card is not plugged
+     * into any bus, and we must reset it manually.
+     */
+    device_reset(DEVICE(s->card));
 }
 
 static int milkymist_memcard_init(SysBusDevice *dev)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog