From patchwork Tue Jan 16 13:34:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 124671 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1015950lje; Tue, 16 Jan 2018 05:35:14 -0800 (PST) X-Google-Smtp-Source: ACJfBovmgJEsh36b9w8FbInVMW1ejHqg5EtcKHWe5YPYaZiJ34El8aQw/8V3sUeFUJKDED2HXWu9 X-Received: by 10.37.190.7 with SMTP id h7mr17597819ybk.354.1516109713885; Tue, 16 Jan 2018 05:35:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516109713; cv=none; d=google.com; s=arc-20160816; b=flLUunmAqbT1x1YTNcUKU9V7fbhxGTGYY8A19fSc+sNzNVbY1FOeQZY8LKtLfQ+0tx wWwp9g8tLKOsRm8qZBQMRNADAjRaEcMhJIkNmOCkmGJreHGcBNmuHRw9JD1jRrFcWurr r0nvCA4TL6Rbc4WCZdo1ZXflo0J3TVx3qVPWCaRzva9/xLaxakKiqHqt0wwbMiRnAH5g HnbPRWpGcsPrpN3QVTZ05IQS1Otgoq8j+9LycynkQpsgL5oMRqPsnKnNJhWxyxrt0Hml eJSvHofoySDi9E6ZEm+1StB8Wdv6nhRSUQHvrf+r4X0kkrbRrWEIQZf/rLdtTpL9bD13 0kmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=h1eNDHlPJDAS7Jh6+g2UvDONyAOVfE8gj9USc3mXxx4=; b=YFOS4MHX0BNqL4ayZ85NJfw8Je5R3pPFsUCIjDtJlOIxQ7RCgAm4mjqTLMewLsC8nt eTrRswmkFOaar0mSEWkYS6/VBs6ZqlDDObQNE//6eQOttFNxBKs7OZ52+OXLAa+JWI1e 4RCmL9Q5fDdLsKhkif342U+blyD8EG5Q+81g/PKtJqpnFIXCSdQ/gKKZD4sd1knxSkBE Ct0sBFh/JKrnBMc695QiXALixykOo8Q/tFOVU+U3ZQfhWAsBmvigI4VIbbqej5DD1rXk DbzT/YzmhnsKmnmqhWWs6rshtEDjcr8cDRAecgBOPmeSjg6fB//Ev6lMap2cPDVpHcei wjfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w1si504503yba.363.2018.01.16.05.35.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 16 Jan 2018 05:35:13 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebROT-0008Hj-9I for patch@linaro.org; Tue, 16 Jan 2018 08:35:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRNt-0008AZ-DX for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:34:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRNs-0002o6-EM for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:34:37 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:45888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRNs-0002ll-82 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:34:36 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1ebRNm-0002ra-CI for qemu-devel@nongnu.org; Tue, 16 Jan 2018 13:34:30 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:34:01 +0000 Message-Id: <1516109659-1557-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516109659-1557-1-git-send-email-peter.maydell@linaro.org> References: <1516109659-1557-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 06/24] hw/sd/milkymist-memcard: Reset SD card on controller reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-id: 1515506513-31961-3-git-send-email-peter.maydell@linaro.org --- hw/sd/milkymist-memcard.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 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)