From nobody Mon Feb 9 23:40:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) client-ip=209.85.128.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1603301744; cv=none; d=zohomail.com; s=zohoarc; b=h1Pwvmc2ZP9wfu8z9x6YVmmvdE87yGlnftGz4de+tmdkglRJ4Fxa9cSsUB+ILotvQntqxmUn1AjOPG6F9d3aX2xqEn4uBa5EvAer/+vMFOlRJoUlv0Y7WLX8lE5UNzH6GNE/PDXPPGrhh2NYWohB2ACxgvp/oXoFsHxd0dX0yFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603301744; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nLgO4iC9rtoBp7o///HfhJ9kAvL116nD5opOCzZ6+ao=; b=Fthv21mkKkuhqRQdyE4rBIxHrPsnA8qJpqs9tfcacXm1pq2VQ593bSOSISGigQGeNgRpKoed5g6c3D0M7OqWFd5ZE0SKSjR/rQuQ7C/m1+Yna3rx2uJYDv9nu42R/F/45z7MCnHSVyTricKUT2q9Rw7SquX+Ds9Xis5jaWtkO5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.zohomail.com with SMTPS id 1603301744868578.8363379229052; Wed, 21 Oct 2020 10:35:44 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id c194so3000034wme.2 for ; Wed, 21 Oct 2020 10:35:44 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id t5sm5109398wrb.21.2020.10.21.10.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 10:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nLgO4iC9rtoBp7o///HfhJ9kAvL116nD5opOCzZ6+ao=; b=jFCZPQqJ209NEKWXn0BkP4Wuv7Qtgx/48M0Jz/CsKKETc+CqIBhLa339Fpbdy/hlvF VgjHiK20NVHJfvo8PWP0+sbBzOe36FIoOFTPb9ymmkGukT/Mii5obS1Dbv00ZXYnuqqp O5GHuRL5zKuaJCXUIGvqthSrspQUSwccfGD4qilJYf8loPbt8Ds22KDouYhYVFl4wpyq sfj0a7CsBrtUTH2Km2MKe66TQmo3ZK94YavP4Cb4jQfXhrlnw20OByIhDfdPMHnxONeJ igCrnOqKt8HZP3Ph9BpUjEs49PGAVFNn3kSLIInAJ0X3p/y7XWTqUL05BI44uJTuxMgV z2Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nLgO4iC9rtoBp7o///HfhJ9kAvL116nD5opOCzZ6+ao=; b=W0QzgHgxNfFQ3ykCNBKI/4Vd1foXwlkQTISITd/Vg/0H9XQmf0HT51XwKTg7skdX+j 8ibJttEBRc+uH+Yw3jmoMg2QpMuFLqY6/GG3ZAYH08sDjVC+TkbCI5KVv7kh8xBjI7jE LAeRzfwNWB4Q93aJYkbQ0mo9kepmr4wYjrRGOwqo6EBSwcwl4aiSKCNdSQCl5lMuOw7S NHrp2jye0byktZEP+8GI2j6b0m8HUtTOC6X/a3vsQwDEzFyuuHems4qM5kK0vBW93Oqo jXQke8NHBgIid3N5cFKyy7QHQ4irGKVLvUZGQ5I2XatAVjVHYUjq5WKnqHEyUw2AZsMG Bdhw== X-Gm-Message-State: AOAM530vbBCoX46Lab8y31DDJiCrbnIWQAtziBgWeRJkIlIeeApxadQH PAsbYPAkannqJ140tWEkUFx2XfUO23w= X-Google-Smtp-Source: ABdhPJxXoJ2CcbAWr0w4/cwwBibCbVaK1KDBdRv5MXEg5zmw9vDYjk5LsVSQ87yiPgVxsx/MXTlgRA== X-Received: by 2002:a1c:3d7:: with SMTP id 206mr4828393wmd.155.1603301742991; Wed, 21 Oct 2020 10:35:42 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 11/13] hw/sd/sdcard: Reset both start/end addresses on error Date: Wed, 21 Oct 2020 19:34:48 +0200 Message-Id: <20201021173450.2616910-12-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021173450.2616910-1-f4bug@amsat.org> References: <20201021173450.2616910-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) From the Spec "4.3.5 Erase": The host should adhere to the following command sequence: ERASE_WR_BLK_START, ERASE_WR_BLK_END and ERASE (CMD38). If an erase (CMD38) or address setting (CMD32, 33) command is received out of sequence, the card shall set the ERASE_SEQ_ERROR bit in the status register and reset the whole sequence. Reset both addresses if the ERASE command occured out of sequence (one of the start/end address is not set). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Alexander Bulekov Message-Id: <20201015063824.212980-5-f4bug@amsat.org> --- hw/sd/sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 4c05152f189..ee7b64023aa 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -755,6 +755,8 @@ static void sd_erase(SDState *sd) if (sd->erase_start =3D=3D INVALID_ADDRESS || sd->erase_end =3D=3D INVALID_ADDRESS) { sd->card_status |=3D ERASE_SEQ_ERROR; + sd->erase_start =3D INVALID_ADDRESS; + sd->erase_end =3D INVALID_ADDRESS; return; } =20 --=20 2.26.2