From nobody Mon Nov 17 09:50:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) client-ip=209.85.221.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1603710224; cv=none; d=zohomail.com; s=zohoarc; b=HxYzadVj+QmfPXnPTly/DZkF8/BKnsoky9BVQYm596hyxjW/qGOCS6HCdgMNy+o6cQpodZJIbPxeb3jh61styOwO0N6vATvwvfvwaqLcpNFNOrhI6zVoYJuZu3JofBKIER3bDD272LSQHvI5+w0B3irilbymKvYibdkeazWpmvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603710224; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5U8VWtvmcB+mOzFUXcILRLEPHX5B//Lhi6i5VjZPllk=; b=aG1bCx7+62afmuZe/cp5KzOxfBP3dLoyw4/be7yZ6XF+lLgOZ53yt9ikQWcllUedriBTKZSvvbN+tBbZqqPGxw8NudcDMM1/9YK67h3Oqs1/H5UkUEkV90VhbUh2pwCxoVBl9eVyzAA89tPQLhJYK1RA7TdtAVHG1ALM4ak/5fw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.zohomail.com with SMTPS id 1603710224257257.9755012282425; Mon, 26 Oct 2020 04:03:44 -0700 (PDT) Received: by mail-wr1-f67.google.com with SMTP id n15so11934884wrq.2 for ; Mon, 26 Oct 2020 04:03:43 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id k18sm21141582wrx.96.2020.10.26.04.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 04:03:41 -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=5U8VWtvmcB+mOzFUXcILRLEPHX5B//Lhi6i5VjZPllk=; b=UOj5nkljlDKhYh9w621rfwoxMHKbnxCtTvOi7lU7FI8flRBUzf+nAAxVssUzllX74M PrCAc78J5684apPjU6UYhL/KuhuqY71UuKKAmwdwasNwnpmi2JJmnl13dCB7XcPNolFx 6mXVG1h5iHavMb7U0Y+fe1SIPZvB+a6MjUuDLLrocZXZVKZbaCDMCG9jxyhM+u7eTzGM JMMgD/clOYZ9B0CvxBUSnMZpCh5Hbwt4bWfrDCTDgQ/zP5UArL/awQw9T+ug6dNFp0np 0gvos3DU+wxUabBMgH770AGviFtwxcmGng2NjgVv2S8kReNsACBy+W/d5LhxvmuFpeIZ pKRA== 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=5U8VWtvmcB+mOzFUXcILRLEPHX5B//Lhi6i5VjZPllk=; b=faiubiCqkc0neyyd5O0ZR3+s333sDvbn2a8HyRtfscm3gjszw4yrtXe6oxAoTjk0/R KQbJbikOZ3CsK2wB0nfgJCGkxGsw7mES3UrWKNOOD3f7wHVnB6fin54kwtAwSQuOYbLf D9w1xQDHViIUdH80E/nOBQyHZkW+pzr5KijJmTfxmyUr/1ylKDGzMV1zCcPu9pC7MXJD 8cR5oUDjMYcdZFbxXPcEMwuM5uO2pYRj+e+j4Y6C5v/9z04EHASKYVENDq1RQg1q3F6r jJbPhxDoa5/WQw20dHzU8GEzEML1ilRm8oyun8L8+a579FHBzJRqd1M/N15GF6TfHeJ1 ywdA== X-Gm-Message-State: AOAM531kVL0VIi+T3rjMqGRyDEGozSuknqZlHT8suhfbIkPN/tdwQ2jN wSInME078BKVSV9mTk0qRPrt8zNheDE= X-Google-Smtp-Source: ABdhPJwIJMSkzJ9ZdoIAXXHOUZikvdrmcf4UsVi4o8MR3oHqi50bixMugLvnZ1sXYwCqLf/R1z5AIg== X-Received: by 2002:a5d:6551:: with SMTP id z17mr17252423wrv.266.1603710222066; Mon, 26 Oct 2020 04:03: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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Bin Meng , Michael Roth Subject: [PULL 5/5] hw/sd/sdcard: Zero out function selection fields before being populated Date: Mon, 26 Oct 2020 12:03:15 +0100 Message-Id: <20201026110315.4026183-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201026110315.4026183-1-f4bug@amsat.org> References: <20201026110315.4026183-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: Bin Meng The function selection fields (399:376) should be zeroed out to prevent leftover from being or'ed into the switch function status data structure. This fixes the boot failure as seen in the acceptance testing on the orangepi target. Fixes: b638627c723a ("hw/sd: Fix incorrect populated function switch status= data structure") Reported-by: Michael Roth Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201024014954.21330-1-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index fcbc1fd9d6e..30913826145 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -827,6 +827,7 @@ static void sd_function_switch(SDState *sd, uint32_t ar= g) sd->data[12] =3D 0x80; /* Supported group 1 functions */ sd->data[13] =3D 0x03; =20 + memset(&sd->data[14], 0, 3); for (i =3D 0; i < 6; i ++) { new_func =3D (arg >> (i * 4)) & 0x0f; if (mode && new_func !=3D 0x0f) --=20 2.26.2