From patchwork Tue Mar 4 12:00:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 14000622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35616C282D9 for ; Tue, 4 Mar 2025 12:10:50 +0000 (UTC) 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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KGYBBpwnt3hWw/5C3fwSPGMNcDYClNDq6N78sbu4zpg=; b=btKLtDQN2+6k51 Run7KfTTmOdg7kvq4A6329MkD+yS6CJwpRblCtYxaRrwNiOrxEifPFZG7+w8xEJhy1ukCzrJNqDMQ PewFZ/qKT+F7IddRZ9XjWUKGaN4B0jBFMVWC8kp1peDJpwMc3XmTurbO5VVIJXRYbbGVBOv20XLoS MF89A1a4Yd9xJKiL0r+OcE1qvJB8ctI8z9my08oSaahpmn0NCJQIjgglNnekb1DabA09G5tTQDGza RSUjlvtMIjWD01skmQvfGFeQ2hwEqdipPYQNL0EJy9JNBWdBsronSmEsu6a9KAWEqscM5kMUmuyxu vHYnccRnGkQAeHmE9t5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tpR6j-00000004Zhc-1vR4; Tue, 04 Mar 2025 12:10:45 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tpQwg-00000004V7u-1Qr5 for linux-riscv@lists.infradead.org; Tue, 04 Mar 2025 12:00:23 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-438a39e659cso37699295e9.2 for ; Tue, 04 Mar 2025 04:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1741089621; x=1741694421; 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=v5+0DAJFyGg9dqAHMt/74M2g7aCiRWRLOEFqoe5G5I8=; b=KGxWbbLwsAQdDJQi8q2Vn7Df2w0luLTHHOKGEmn457XByLwx2ugI2SiqO5eJSFPvKp CCwf8rvdezJd9fluJWrmI4g5fFO+DHLEzrq4GCiLDum7pWexRMmdXa+ar+o1+l1bDSNB vC2S6BCYnyhiWFAZbXEg6MdZvAS7R3ijB8WrqQYa77/ecMEfr6SQbyaVAZmVvFTlAQfs gbS9x757m/59x6W7pZES8bvLcHiL3uKUhb/dU6MMixElOlVYlde1IU5IuEO+Re4Gl2oF Cz1zguEOLE8tFp9sHd6ihOF02U2/v1PKR2V1a12je5YVxkoDSoC8Oj1F8tsSxmGe3vAw EpVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741089621; x=1741694421; 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=v5+0DAJFyGg9dqAHMt/74M2g7aCiRWRLOEFqoe5G5I8=; b=kdmGDrhCl6/VUzyFq/wMxIcwFYHsGBu5nZX8EAT4PVhH+mW7qI+3941ZMS4wsS5UdE LIjzLUwRvz03zC5NIycW5Mpre61wWI1SsJdV/OlkdThu/CrZePwoJjrm0ug1pELi018U jFFsoCf88CVd6kV4Yolwd2tEKdAZjSqAWgnWjMdIXT65VgwGdBhjA2cDOLCfLGEHeXUU ZRn2ztFB02aKGoPwoLVwWRf5rnpZxTuy4UowzTORtzwpERyKMfLdXFqeQRvcl8nc5oUw TKWfOtpLAX/8U5I/DYQ2QQsg9Cxk2oy2OwyhsE9Dj9sGdzTkYxE8Gb7xCNCBul/Cc6ff RCBg== X-Gm-Message-State: AOJu0YyLt3HNZnEjMZ2+RpWdeKy6wHqaiMXh9zJSEFNgkTO3QjjzkSBy w1BjLMZJWJEPkOis9yUzJd9FGtvYmos1wPi2/5Zw1SOnH22AKUPNlPwHWKX/7+jOgLYRQUymbhu e X-Gm-Gg: ASbGncserPuDSD9imBBcdGAvvjiavw2jmY/nTL/8GdqPsyLAM1KHgHz94LbQTcxb3kR 7EeOvcdloxL/hQealPjX2IoQ5zx0cRm9lK3vlxy6Ap3UCGCA8smxS1zx972DesqBbWmYX0HlqBB DKGhPmyIW0GOklhY8k91QDI8W3Sr/JwxvWdHcscoBYtnibOMP6g0JCX/BloACl2bbngIuShFs37 wH5RGmIuvT+eTnv54Ejbg7aQDMhtAwDQeS4CrqfnRHzmF50oLfrF3M5nqMCxk7NH9vcdBRbfngE 0bi29akOUJWf7ykQllqXdONqyWnONZe2 X-Google-Smtp-Source: AGHT+IEqMgV5t8PcK9JSG+SOO4LPXPlwofpngejjCplSgEhGn5nYR0XjUC86Q3nC0sypwkMwdVM5mQ== X-Received: by 2002:a05:600c:4693:b0:439:8523:36cc with SMTP id 5b1f17b1804b1-43ba66e66d7mr161122735e9.11.1741089620734; Tue, 04 Mar 2025 04:00:20 -0800 (PST) Received: from localhost ([2a02:8308:a00c:e200::688c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e4795962sm17966864f8f.13.2025.03.04.04.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 04:00:20 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, charlie@rivosinc.com, cleger@rivosinc.com, alex@ghiti.fr, Anup Patel , corbet@lwn.net, Alexandre Ghiti Subject: [PATCH v3 4/8] riscv: Change check_unaligned_access_speed_all_cpus to void Date: Tue, 4 Mar 2025 13:00:19 +0100 Message-ID: <20250304120014.143628-14-ajones@ventanamicro.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250304120014.143628-10-ajones@ventanamicro.com> References: <20250304120014.143628-10-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250304_040022_379179_F023380F X-CRM114-Status: GOOD ( 12.17 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The return value of check_unaligned_access_speed_all_cpus() is always zero, so make the function void so we don't need to concern ourselves with it. The change also allows us to tidy up check_unaligned_access_all_cpus() a bit. Reviewed-by: Clément Léger Reviewed-by: Alexandre Ghiti Signed-off-by: Andrew Jones --- arch/riscv/kernel/unaligned_access_speed.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 02b485dc4bc4..780f1c5f512a 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -218,7 +218,7 @@ static int riscv_offline_cpu(unsigned int cpu) } /* Measure unaligned access speed on all CPUs present at boot in parallel. */ -static int __init check_unaligned_access_speed_all_cpus(void) +static void __init check_unaligned_access_speed_all_cpus(void) { unsigned int cpu; unsigned int cpu_count = num_possible_cpus(); @@ -226,7 +226,7 @@ static int __init check_unaligned_access_speed_all_cpus(void) if (!bufs) { pr_warn("Allocation failure, not measuring misaligned performance\n"); - return 0; + return; } /* @@ -261,12 +261,10 @@ static int __init check_unaligned_access_speed_all_cpus(void) } kfree(bufs); - return 0; } #else /* CONFIG_RISCV_PROBE_UNALIGNED_ACCESS */ -static int __init check_unaligned_access_speed_all_cpus(void) +static void __init check_unaligned_access_speed_all_cpus(void) { - return 0; } #endif @@ -403,10 +401,10 @@ static int __init vec_check_unaligned_access_speed_all_cpus(void *unused __alway static int __init check_unaligned_access_all_cpus(void) { - bool all_cpus_emulated; int cpu; - all_cpus_emulated = check_unaligned_access_emulated_all_cpus(); + if (!check_unaligned_access_emulated_all_cpus()) + check_unaligned_access_speed_all_cpus(); if (!has_vector()) { for_each_online_cpu(cpu) @@ -417,9 +415,6 @@ static int __init check_unaligned_access_all_cpus(void) NULL, "vec_check_unaligned_access_speed_all_cpus"); } - if (!all_cpus_emulated) - return check_unaligned_access_speed_all_cpus(); - return 0; }