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

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



commit a22b8096b60431d32e7b6bbef0ccb1ff1c984ed5
Author:     Peter Maydell <peter.maydell@xxxxxxxxxx>
AuthorDate: Tue Jan 16 13:28:12 2018 +0000
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
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: qemu-stable@xxxxxxxxxx
    Signed-off-by: Peter Maydell <peter.maydell@xxxxxxxxxx>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
    Tested-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
    Message-id: 1515506513-31961-3-git-send-email-peter.maydell@xxxxxxxxxx
    (cherry picked from commit 16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 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
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.