From nobody Mon Nov 25 02:01:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1719295894; cv=none; d=zohomail.com; s=zohoarc; b=RjMv2z+Czgk3n/WHBuydV4/T25k51wTF8m84nu30obq7qdhcMZFc+uCFyKI0ZJuy/JlFsT2GOitbyxnrS04xM5isPLaQoW9JwJ56CVA60Ude5GRYZk11002SEvL28NM59huwbwcbYTDqOmDwy7K1BYR0U9hnS4XGZP4QgXoR3QY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719295894; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Rg76PJz13yQ4blnaKM+Id2Hp7ZcBNraiQTaF1NSzcFU=; b=nxsgIHtGVQhh8raYO/aGngw51hgI/Zompn/a0k3DN5dZ9BWD/nyhxjs0Vc9Tci7WLcbsHpvpPYDzrvoUx16sxz2CH9xMF4idyldwIWppRWVkg/1WTuy14cFPuEP9iUwHCSRfTY7SjqiaB3MlbQ6eOmLYoNCx90zfMDbj0fhQgT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719295894910180.30283708320928; Mon, 24 Jun 2024 23:11:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLzOi-0001Ss-B5; Tue, 25 Jun 2024 02:11:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLzOg-0001Bx-9G for qemu-devel@nongnu.org; Tue, 25 Jun 2024 02:11:18 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLzOd-0005kl-BK for qemu-devel@nongnu.org; Tue, 25 Jun 2024 02:11:16 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so29938225e9.1 for ; Mon, 24 Jun 2024 23:11:14 -0700 (PDT) Received: from m1x-phil.lan (bd137-h02-176-184-46-22.dsl.sta.abo.bbox.fr. [176.184.46.22]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366388c401asm11961960f8f.45.2024.06.24.23.11.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Jun 2024 23:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719295873; x=1719900673; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rg76PJz13yQ4blnaKM+Id2Hp7ZcBNraiQTaF1NSzcFU=; b=QOTsUU4VQcBwK7n8esfW1nxdufy5YhdUcB1fc3KlQIUYiGyDyyEWu0eR+JnjpCc60F fNWXBp0vFqnS8u2n7PkONOuVTVN4igHPDBiKcsShsRQ3vjKdNmwWEnPq1x7bYQ+wO+nY AlFWPLoA8yIrri3q/FugMp5GOgXhuBVA5itRH95NHGv2x4HTLEQq+EJyp0WlNbCVVAIO XqoecCWlv8NmO6FSjVkLeyP9QHBS6A3ncefQQoE0KQbiRB/i68tr0XaXl5jZGUR8orM0 Erom7e3bSm33QQj+I79gQdRrSJ6xjkLWH3oDBqjhqgSdwjFLmYzso6hoeGW4IugimtbW J1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719295873; x=1719900673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rg76PJz13yQ4blnaKM+Id2Hp7ZcBNraiQTaF1NSzcFU=; b=fSvayi9842VfWLS4RlZwK+QepXIFKroYVPsr5auVIbSSn8Me/qh96VeGcIxAv8zKFv 32SOyS8p4nx5xE87jV8hEjc8jno4Q4Kur1nKqeEHYHinfwJSA+bCbY2IPSPOHt6INeQ2 TGZtctX8XeFAUVt5+hg3ozNljrWsOH8PW+Kl/RehBLb0c3vwq2q9gU9lWuyY+wRUbiMV vgEL/f/XTJ0J5acYlK9q2qcpm7JnBidwsGB0KxRtdZRPh/9DBJtO5NuflvZX1Jaedb/+ o+kl/TMH/V/dIzgf+qpc50IxoQtxnBYs6iKRI/9MwB3HHuFfTP5M21r0xPIn0YcS6Lyn 14qw== X-Gm-Message-State: AOJu0Ywh5+diO6uPPoqiQ+4CFMbXm8F+zMlWhygLLxBIcmwIVa3YxLVM 4fWag+JqcpxiVHPWgguRbwT+IdnKSqPfDawaAHwMWIG/MytoVrcek6/Ra2NyphxNS3u3koQUJqN E X-Google-Smtp-Source: AGHT+IGOmRdWsjs5kouN242tEwSKZULjp8WvVNUV7EPm9THpWZ65THgIAidMXcSl2zjyJ6H3LrE+Bw== X-Received: by 2002:a05:600c:1c03:b0:424:895c:b84b with SMTP id 5b1f17b1804b1-424895cb8afmr68828375e9.4.1719295873296; Mon, 24 Jun 2024 23:11:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Bin Meng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 09/11] hw/sd/sdcard: Convert SD_STATUS to generic_read_byte (ACMD13) Date: Tue, 25 Jun 2024 08:10:13 +0200 Message-ID: <20240625061015.24095-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240625061015.24095-1-philmd@linaro.org> References: <20240625061015.24095-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1719295895239100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index bf78f06b5c..2f00184bb3 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1681,10 +1681,9 @@ static sd_rsp_type_t sd_app_command(SDState *sd, case 13: /* ACMD13: SD_STATUS */ switch (sd->state) { case sd_transfer_state: - sd->state =3D sd_sendingdata_state; - sd->data_start =3D 0; - sd->data_offset =3D 0; - return sd_r1; + return sd_cmd_to_sendingdata(sd, req, 0, + sd->sd_status, + sizeof(sd->sd_status)); =20 default: break; @@ -2114,6 +2113,7 @@ uint8_t sd_read_byte(SDState *sd) case 6: /* CMD6: SWITCH_FUNCTION */ case 9: /* CMD9: SEND_CSD */ case 10: /* CMD10: SEND_CID */ + case 13: /* ACMD13: SD_STATUS */ case 17: /* CMD17: READ_SINGLE_BLOCK */ case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */ case 30: /* CMD30: SEND_WRITE_PROT */ @@ -2121,13 +2121,6 @@ uint8_t sd_read_byte(SDState *sd) sd_generic_read_byte(sd, &ret); break; =20 - case 13: /* ACMD13: SD_STATUS */ - ret =3D sd->sd_status[sd->data_offset ++]; - - if (sd->data_offset >=3D sizeof(sd->sd_status)) - sd->state =3D sd_transfer_state; - break; - case 18: /* CMD18: READ_MULTIPLE_BLOCK */ if (sd->data_offset =3D=3D 0) { if (!address_in_range(sd, "READ_MULTIPLE_BLOCK", --=20 2.41.0