Message ID | 20240625055354.23273-12-philmd@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp2195648wrt; Mon, 24 Jun 2024 22:55:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUaC3J5BVnhVyT3Xn6SCjA41udxCRMnTlqah3iOERo3OhtXp32I0IGGEXg05JVCzWTmSlhpDqYEme4htrETULq4 X-Google-Smtp-Source: AGHT+IGZjIqwCz8bvgyRYfnABMhXxJAI1AoqOeM4O+lsnH++lBhzlWSeMmIp8aippKPfW8dyAbdS X-Received: by 2002:a05:622a:1a13:b0:444:e8e2:29a8 with SMTP id d75a77b69052e-444e8e22ce5mr56293091cf.7.1719294921388; Mon, 24 Jun 2024 22:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719294921; cv=none; d=google.com; s=arc-20160816; b=Jm2/GOiC/LMe1wBGhIh9dYiSIAfhyvk1PoxCUFSRq0Jp6feXcaYJCtcNq6z6RyWj7Y R9aStpAxrdSVNzt+tsxgmS9oZxzt8/YKCaJpB6lrLsib20KD7jH/5B7GHyWsRWxw8Dv4 5GxNrzbbBNlR7e5Y8AUe48fKsOP9F9GOZ9JIHkqhNVhxvFYtDEFXNUWjeHXd7pzDkZ4J cmc5mWC4lSEWT3CpU/MqK+OovkVpemam1X3vUeDOOJg2vgVJLo+IWMqd/jKSUVc2HHfR T2gEudtzJdiNyTUsoFf8tINCInhxU7qXXBp9+E1Ta4aEokIpBJNS/jGZWeE/jt7DLWCt 5oWA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YAYGjbFJNuy9OHUJ805jrPNXsWJBhB1UqPytiuUZXwI=; fh=quH1+0vgULqv3LP6tEyzMNyrHO9n10VlAKocz0j0xjQ=; b=qcLP2KffpdS/ecBwCoSDmks1oxuvsNaZ0e2SZMBNgv6kSD2KueSl9o4KWg6F5K4WpY M6QK0BpX/bcWaAugvlIaoqqToCmIGmSHmMk9FMZFMdl+ty66u+vg15wkVaZVGGCtK+MS yCTJxn14Ck/tnIAHu4i5XcRy3JFJl2SbUOBMwBR4x3hTTBQ0pe1tYnGZZxIpoZxPY7xv K9luFcQfjj2VPVCj3i5TRYSCJaoiINbH+THuH/a4uCLZtkB7IZnYdtsJAV0iflp5Chfe 2ukKsBU2tZh91VE49BKBfMoCGFyuvl5q2RZ/iAOdv4BLBNY8n8+Vn+0kvE0LUNlYu0jM wxxQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H/vF1o+b"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-444c2b4d721si109666091cf.109.2024.06.24.22.55.21 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2024 22:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H/vF1o+b"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1sLz8y-0002ts-Os; Tue, 25 Jun 2024 01:55:04 -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 <philmd@linaro.org>) id 1sLz8x-0002tK-6N for qemu-devel@nongnu.org; Tue, 25 Jun 2024 01:55:03 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1sLz8v-0001i0-H2 for qemu-devel@nongnu.org; Tue, 25 Jun 2024 01:55:02 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-363bd55bcc2so4213353f8f.2 for <qemu-devel@nongnu.org>; Mon, 24 Jun 2024 22:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719294899; x=1719899699; 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=YAYGjbFJNuy9OHUJ805jrPNXsWJBhB1UqPytiuUZXwI=; b=H/vF1o+bAUQ7usNqJVvrFJDQXQIdCn9NqVcABKWJ8wnAsksNvH93KZPJZbbWqDimxC JG9YOxtPlWTmtUFe1q20dtLWwWsqsE0gKXlRmegWim5hXEwKEaneeMmWpwdqwh2PXZQY sJKXt3iedv2l+OJyy0yuG0V8x01JiRpDUFNDCws1hg8DUSg7hGRQCHRWdf8LGNp/ZvO4 gmdgKVJcQ3lJ8DNb8N11ug5Kg7f9A/nY+UeHy12VPbz/bmJsKwt8FrjP17iLisBxHtjN EyXRIccDnvJPHIo9SBRL1K+sRDA8/yGSUBu1pE86Q7a2f4t/v2H6esqnRA81DMosm7ih SibA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719294899; x=1719899699; 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=YAYGjbFJNuy9OHUJ805jrPNXsWJBhB1UqPytiuUZXwI=; b=RkpXsUdN573ncezqXLzy21wVMZv+OsbwvZanHolJHBZK8DdhZqWnzHuOrOECkxtAtF kyJNix7LpBBtNjD1z0Kk4I19JJhYZSLsBWwMNW2AfftmscLEswpTNA7J8nmozTXHzXhg 66N3zjwce/3Wk+CelduyqeudgjnsrWmNbInZVNtHW7oZEP917rumnfZhLXfSU6iyMdsU Fy+9mvB101XbzL16/aKOINFdRy+6o5EOinIuqaShGKvsuCvKl7CREcq4kERZxWSTrqCF CUYr4ddRqjzvHt1zkiTsX7tZmO6MqmHDtlq5uvBIi1jWcR5Nh+h0MRsosCEIJ2vPLFjl 5Vtw== X-Gm-Message-State: AOJu0YwYzNZqeof3Q9XOdWzCBGISY0I5VF3tjFx/ztAVQ5lhXAsa/EJg qYLjKaG4YHXNXt5mr/WB+P8fVw1uTHnEsbVKSLn0J6KR8G0o6Ix9z1LLx7K2uq1EilEmWO5L3si O X-Received: by 2002:adf:a21a:0:b0:362:8918:1830 with SMTP id ffacd0b85a97d-366e94ee0d8mr3348812f8f.42.1719294899468; Mon, 24 Jun 2024 22:54:59 -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-366f624cdacsm3996960f8f.70.2024.06.24.22.54.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Jun 2024 22:54:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= <clg@redhat.com>, Bin Meng <bmeng.cn@gmail.com> Subject: [PATCH v2 11/12] hw/sd/sdcard: Restrict SWITCH_FUNCTION to sd_transfer_state (CMD6) Date: Tue, 25 Jun 2024 07:53:52 +0200 Message-ID: <20240625055354.23273-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240625055354.23273-1-philmd@linaro.org> References: <20240625055354.23273-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/sd/sdcard: Accumulation of cleanups and fixes
|
expand
|
diff --git a/hw/sd/sd.c b/hw/sd/sd.c index fce99d655d..3b885ba8a0 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1196,6 +1196,10 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) if (sd->mode != sd_data_transfer_mode) { return sd_invalid_mode_for_cmd(sd, req); } + if (sd->state != sd_transfer_state) { + return sd_invalid_state_for_cmd(sd, req); + } + sd_function_switch(sd, req.arg); sd->state = sd_sendingdata_state; sd->data_start = 0;
SWITCH_FUNCTION is only allowed in TRANSFER state (See 4.8 "Card State Transition Table). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/sd/sd.c | 4 ++++ 1 file changed, 4 insertions(+)