From patchwork Thu Jul 20 15:48:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 1810538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=F/6EEUJ+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=ShJFgqMf; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R6HDD1zvQz1yXp for ; Fri, 21 Jul 2023 01:49:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=T6bDVVkJNEI2ZAAbrHZj1K5JIV0v0ZHC8+aalaBkFlg=; b=F/6EEUJ+5x/1DW mJPirdcun79Eaf7/2+NbUaxcokSSGA88sPP80y4R4NwbS1//ULuOx0rb0hlzDnzNfIpv3tD5RyvSK jMtkGpFXWO56JlpqiZ9eKc6MV5qzxuYTJZJBvYP4sjWGZUvQ7xDU5o4RCc0kj1icDXGeQGcg504s/ /kzreXRPADrcbllVuaJmPDJFwkjKKZ4TQpH8qgq8AywIjdRI7v2bp52lcaS1NSNJb0kJb3nBhksaH dU35ChGGkHdmnZFXBNITWIxdbfOhxIFJBeqICMKdNDBbvB84PqmTvTS0dA0AcHQYXwfVwRUKB9/13 0m9GUMWhOWGAoVGQYejw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMVtU-00BaGW-1m; Thu, 20 Jul 2023 15:48:44 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMVtS-00BaFH-0B for opensbi@lists.infradead.org; Thu, 20 Jul 2023 15:48:43 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc59de009so7881095e9.3 for ; Thu, 20 Jul 2023 08:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689868118; x=1690472918; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sXctj5sojSK9KZixVfl3hL/5yqDgdPoMrUPPKIqelpo=; b=ShJFgqMfrY5f70S/DLFWXuJf8h3qJprKT9f9nM9nwm1pAB6Jj63GPFTi+Llxh1K4Gx q3LSdV2+QZsEfxKvw2piOSiy4wQu1StmjsPwTONSPjHK4cwLJRCQtyjkR+TmZFDLJwDy jEDyLB7ztg2wOlZ3LBK+09sBeBVfubKAAIlvyKG0b4DMw8RUn5VR7iVDpBTzOCVrC+Lg 1dGHx78dSJfzkxTcq8iVK/gRvJGFWS4uIArPwrPagXbkfXLooBU6Lf55gYsjy3UfzX0n h/Vj8OR89+JVXI+DU4T0ofBunNguQrIDsQaob1y3fvvGFxAoTol4iNMItPIRTT9eNk+z lZNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689868118; x=1690472918; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sXctj5sojSK9KZixVfl3hL/5yqDgdPoMrUPPKIqelpo=; b=Istp9aVOenX6gNipaI1G/u4XlFS57RDYTMMklrNeh5ZILIcf0wgcEEBOPhIeg5IHe1 N/MwrymoW+CWL9fEtFE3xF8y/6bn1IvjSHGHYV2/PRutZqJWs7/KHi0sAO6j30oG1V5t mwkZ0h28uu45vJK6VJlZuCAYojG18GexhlMS9ylCLYnNYvh2TLbZsz18ZUl/rVCQECre vfdW3QlYSUcUiBVDhtmWpDRiq3V9luXujw11KHXysOiC92LNZC1TAcH+N4SfiN8jJGmH DMWd/SjoKyfvflayh5DcLahU6GoglYzoy6XPPC7rnbyajhL+GKKevDzU/nMEHPM0Mak8 CSDg== X-Gm-Message-State: ABy/qLaOTtlb5ZYWq+tLm3kbISCEg2AFMvi2tHQ5FLuptcLZYgf4tBMr wHm7pWotU35FumWdxhMig64Uhv82CDlVx8WSLgw= X-Google-Smtp-Source: APBJJlGkrVbAUbM/puZq9vZrg73rKtHZXuKzROcn4TY9+s8K/tr5gtes1h2FlMxxTZKVEWMZchD3eg== X-Received: by 2002:adf:cd0d:0:b0:314:34dd:aaec with SMTP id w13-20020adfcd0d000000b0031434ddaaecmr2498746wrm.8.1689868117657; Thu, 20 Jul 2023 08:48:37 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id t7-20020a5d6a47000000b00313f7b077fesm1691360wrw.59.2023.07.20.08.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 08:48:37 -0700 (PDT) From: Andrew Jones To: opensbi@lists.infradead.org Cc: anup@brainfault.org, atishp@atishpatra.org Subject: [PATCH] lib: sbi: Update system suspend to spec Date: Thu, 20 Jul 2023 17:48:37 +0200 Message-ID: <20230720154836.110674-2-ajones@ventanamicro.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230720_084842_102994_A013DA87 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: commit 68e66106120f ("SUSP: Add SBI_ERR_DENIED") of the SBI spec adds a new error code, SBI_ERR_DENIED, which is returned when entry criteria has not be meant. Update the system suspend implementation [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:335 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org commit 68e66106120f ("SUSP: Add SBI_ERR_DENIED") of the SBI spec adds a new error code, SBI_ERR_DENIED, which is returned when entry criteria has not be meant. Update the system suspend implementation to return this error when it has detected that not all harts are in the STOPPED state. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel --- lib/sbi/sbi_system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index d803ffa84189..2e917c9e9130 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -174,7 +174,7 @@ int sbi_system_suspend(u32 sleep_type, ulong resume_addr, ulong opaque) if (i == hartid) continue; if (__sbi_hsm_hart_get_state(i) != SBI_HSM_STATE_STOPPED) - return SBI_EFAIL; + return SBI_ERR_DENIED; } if (!sbi_domain_check_addr(dom, resume_addr, prev_mode,