From patchwork Fri Dec 8 21:22:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1873939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=M+F6huix; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=kSMxt+Fo; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sn3yx6q4zz23nb for ; Sat, 9 Dec 2023 08:23:21 +1100 (AEDT) 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:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VPctXFqU/EbspxJsKgw3LRwdF/0zdHnz7p1ID/lrru0=; b=M+F6huixU8b74V YXSqRkXTpQYXLFN7byjro1aowDXtwsi8uV0Esw+JhUTOdQwg4N2bS3d7yyOps0FmF5AyJDXqXeZfS 7FtvYRHKOmyIJzIoTKsSh0pHMh9846WoO4BjZ3RqSD9RbYUEDmQmaQniMOhN+5iD+Ra+dMvHnJyXB 9suJoyuKFm5AEwpqsTo4XFW33li21BxSu6DIIBoCUgQeyVJbTyMcDpWTMmiXqUXyrzYeDaHhVmWUQ nv+tkMTPPtOwUuoLVEaV/5vEcntL30SU1vT2OOTBEHEHwTaGkDQ/Pj8E6VdTct4lPZyAxczeqnZn9 i49nqVv0T7t+75Q+Kezg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBiJR-00Gas2-32; Fri, 08 Dec 2023 21:23:09 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBiJO-00GaqV-1M for opensbi@lists.infradead.org; Fri, 08 Dec 2023 21:23:07 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d0a7b72203so22556075ad.2 for ; Fri, 08 Dec 2023 13:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1702070585; x=1702675385; darn=lists.infradead.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=JMO7g6ZRO1HSGO0+pqrhdifqpghBmQVHO0AFuPi9f9s=; b=kSMxt+FosNmyQwe+c6IAzGLkRxiWB6j5kIa3L+TCCYeoisbwV17gVB0VMcVcyIDtBW vybp1hFyToPCNgzswDGceoYHOzo34pCgg2NCvsTadvaNTQQjojLJyriNKu8bWhVlQsWz OT/xU6w8iJ+iEHl1Y21WHg6YqT6FUptt+7lPpq9UicrxvPCThPJm89VX9Xyue7CmkTtA p2fIc6K0+wjzcI6oY3tyqnhofQD7sD79MnZN41B1WVIJKc3J1/7UC8dW+t08wTBmuhIg CEqcYOnR7P0kUJhj3JC/nKaZS2O3AOctu7ImHxyMMyAfqD0Yz7pJB/fqfVpzmioi7/RA 0fbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702070585; x=1702675385; 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=JMO7g6ZRO1HSGO0+pqrhdifqpghBmQVHO0AFuPi9f9s=; b=bb+zSXwfwJQQkGD2Hu/tGaNcZ06VOhOkuo5W7cYNwrxkXICSlCMrRcrK1BgZe1I7MO JJJsQH2HobSrolaguk8qoRKCOhmTjWctutlFE26ux1r0/O8CTRSMDEhE/VND1ZTmyBh3 F+Lg56wcuUNsTXPGc7zhFy6WMWgcMIM4Dpvx7cxptdLh+Bo9eWB1DoIjPK4VZQAhVPXp dx5SBcKeqyDcxVnv70nOG6JyTJLdLs9PJXsXWYwDl0PgH4fkjs6dtb7FczV+Pps/cO5z yEDtw5b+mqyjTGSB3DZ/LjcoTBH1qpZ3AE3bNvTwR0cPBVZkXb/UqYBuaPW+M+Pl9emL +F+w== X-Gm-Message-State: AOJu0YxH2pxpxnGAygrMffQu3wFWcWPBDOFoXkdTPqndIrVYTqTsJIYp pbPZwF8wdE6WGQrIzmv2+/PpYXnuDcGG84Z07I7UHndYZKvDXw/RyTRrrmq+9aV9XRY3LMh6V3/ J5RZm0YHygiSAbeA64DtjkXvF+sMPtjC/o/T8geYhK0ntmY7weZ+kvQsupe1s/sCVu98J60ejhR Ibvi4H2B5hGA4UHA== X-Google-Smtp-Source: AGHT+IHia0V56nPE07CWHVGfMoQ3gazqyX4l2qrcuougcEYnxRv5PIZdOLcko/DZIYyu63MMjGWSQw== X-Received: by 2002:a17:902:728e:b0:1d0:98bf:f9ff with SMTP id d14-20020a170902728e00b001d098bff9ffmr715052pll.117.1702070584874; Fri, 08 Dec 2023 13:23:04 -0800 (PST) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id b23-20020a170902b61700b001d0ca40158dsm2121008pls.280.2023.12.08.13.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 13:23:04 -0800 (PST) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 1/3] lib: sbi_ipi: Do not ignore errors from sbi_ipi_send() Date: Fri, 8 Dec 2023 13:22:57 -0800 Message-ID: <20231208212301.3649930-2-samuel.holland@sifive.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231208212301.3649930-1-samuel.holland@sifive.com> References: <20231208212301.3649930-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231208_132306_462771_A6794974 X-CRM114-Status: GOOD ( 12.49 ) 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: Currently, failures in sbi_ipi_send() are silently ignored, which makes them difficult to debug. Instead, abort sending the IPI and pass back the error, but still synchronize any IPIs already sent. This requires changing the value of SBI_IPI_UPDATE_BREAK to 0, since sbi_ipi_send() returning that value should not be treated as an error. 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 [2607:f8b0:4864:20:0:0:0:632 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 Currently, failures in sbi_ipi_send() are silently ignored, which makes them difficult to debug. Instead, abort sending the IPI and pass back the error, but still synchronize any IPIs already sent. This requires changing the value of SBI_IPI_UPDATE_BREAK to 0, since sbi_ipi_send() returning that value should not be treated as an error. Signed-off-by: Samuel Holland --- include/sbi/sbi_ipi.h | 2 +- lib/sbi/sbi_ipi.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/sbi/sbi_ipi.h b/include/sbi/sbi_ipi.h index d3962334..e81d9352 100644 --- a/include/sbi/sbi_ipi.h +++ b/include/sbi/sbi_ipi.h @@ -31,9 +31,9 @@ struct sbi_ipi_device { }; enum sbi_ipi_update_type { - SBI_IPI_UPDATE_SUCCESS, SBI_IPI_UPDATE_BREAK, SBI_IPI_UPDATE_RETRY, + SBI_IPI_UPDATE_SUCCESS, }; struct sbi_scratch; diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index 5c33a78b..1fd24228 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -101,7 +101,7 @@ static int sbi_ipi_sync(struct sbi_scratch *scratch, u32 event) */ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) { - int rc; + int rc = 0; bool retry_needed; ulong i, m; struct sbi_hartmask target_mask = {0}; @@ -137,6 +137,8 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) rc = sbi_ipi_send(scratch, i, event, data); if (rc == SBI_IPI_UPDATE_RETRY) retry_needed = true; + else if (rc) + break; else sbi_hartmask_clear_hartindex(i, &target_mask); } @@ -145,7 +147,7 @@ int sbi_ipi_send_many(ulong hmask, ulong hbase, u32 event, void *data) /* Sync IPIs */ sbi_ipi_sync(scratch, event); - return 0; + return rc; } int sbi_ipi_event_create(const struct sbi_ipi_event_ops *ops)