From patchwork Tue Feb 6 19:14:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 127085 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3210443ljc; Tue, 6 Feb 2018 11:26:33 -0800 (PST) X-Google-Smtp-Source: AH8x2259Bn0mOU1XdqQwoNEpXCEM7nRgJS3e7whiWP34eBtcateNjjUrKMGHdW6cJiezm6L9z1Ca X-Received: by 10.37.8.69 with SMTP id 66mr2185658ybi.433.1517945193571; Tue, 06 Feb 2018 11:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517945193; cv=none; d=google.com; s=arc-20160816; b=PF0/Celc52tPt73I0Y+cX47baBMr77cuU7ShV1d6uH7nBdSpw51VOrQxFeoalsT/Hz rZJhuoUICSctiu5O0R2eoZ5TEM9MKyUMYyHHdg+9LuD46VU8IQ6XV4h4fU+sTcrMy9QX Y+7ew22XIjoC4hlJGDGYABOq7zb0K8+QfRGhoivYanKw/vOs7xDkyuHk11A/DUflzM3C rTN9IpVm6i/KjINwNyqh0CTbrBBCGQQ8vKEvmrguLDjbPfd09JJNTwLz0npc8ig3g+ut CnXmFftquLbH4wNHraCeN3h8tEgqUg3WfU6x2MJUaOMNJV2tOLPJ6Pru4nb9CnMPIqvP MhYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:message-id:mime-version:references :in-reply-to:date:to:from:arc-authentication-results; bh=eKoIn8O0kRWxA6zBurEtPTv8HWe3Iuz9EsVDk1prQTg=; b=QwU8ZQPlWmWM8uxycY0kRmDIuY1zncchkdvHR/9GgAe/sGssTzYVMCxRfBOhwwvti7 tfK7wNiaZKYlkKCnksaqqZrMBYf35rdiuhFY3q0o7ZBNkWr5YncEpQmbPdRCg2aq1ln9 SC2SgokSO+l0+ptzFxSXEZR0AboU/FWi2cmdZ7DkV+cZxIBvk0lCam1ISFVaxThPUAjz H4ZF4cEiavO9o26DHgOMFrYSaFWEHLFss9hvPY6N18rseaV9TKWZssvBGhU12u4VQC9A RiHdd6HyrqVlDAsuixnpliM37m5n43ka9KktRVdmv/sGx64VSpXZTSD9HY5tAiL4uD12 QjHA== 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=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l28si1923980ywh.414.2018.02.06.11.26.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Feb 2018 11:26:33 -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=ibm.com Received: from localhost ([::1]:53384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej8sy-0005Sn-U5 for patch@linaro.org; Tue, 06 Feb 2018 14:26:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej8ie-0005Aa-I9 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:15:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej8ia-0007t8-Jy for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:15:52 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej8iZ-0007ro-Uj for qemu-devel@nongnu.org; Tue, 06 Feb 2018 14:15:48 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w16JFBeN064873 for ; Tue, 6 Feb 2018 14:15:47 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fyhx2hbav-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 06 Feb 2018 14:15:45 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Feb 2018 14:15:44 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Feb 2018 14:15:41 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w16JFeTh47579376; Tue, 6 Feb 2018 19:15:40 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C06DAC041; Tue, 6 Feb 2018 14:17:01 -0500 (EST) Received: from localhost (unknown [9.80.97.150]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 21771AC040; Tue, 6 Feb 2018 14:17:01 -0500 (EST) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 13:14:37 -0600 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180206191515.25830-1-mdroth@linux.vnet.ibm.com> References: <20180206191515.25830-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18020619-0048-0000-0000-000002332F3D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008485; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00985885; UDB=6.00500282; IPR=6.00765252; BA=6.00005813; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019407; XFM=3.00000015; UTC=2018-02-06 19:15:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020619-0049-0000-0000-00004409E74E Message-Id: <20180206191515.25830-17-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-06_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802060241 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id w16JFBeN064873 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 16/54] 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: , Cc: Peter Maydell , qemu-stable@nongnu.org, christian.ehrhardt@canonical.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell 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 (cherry picked from commit 16bf0e0e7aaa8efc0b8ee7e2aecb2fa235f82d38) Signed-off-by: Michael Roth --- hw/sd/milkymist-memcard.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.11.0 diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index 4008c81002..341da88552 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)