From patchwork Mon Sep 16 22:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13805818 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 C2ED2C3ABCB for ; Mon, 16 Sep 2024 22:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0Rdh1UtV0ISLWgljmUYN+jVRg7/e+nyofo+nzkzNMog=; b=tjNQziAW/KvHgmoHXvdRKKa3WO 2mKSaW4WrBvKLXkjJr3Juz+YBLVoR37JIjiEHGf+lhhKfZe8fP7n8JWocSMnsxliic9iGGUzTZDI9 tMfzVdBPdnMT4dKO6ZPfnYjCwyf9MlwQVidKDa3EBz9t3hRKYhihEzFrZPlVn6GuqsErAEH0ibe+L h7ChkUK+MmmfZiAcRnTpWLMh98mXopM7wEdS/XLBETd+I1IReKH+UZuLkJT2nIZ78Nnt7e9wm0FcT CprV6tNXk2/Vi6TH+O/RUyQOUzBbRR+/hj+EBJHCwwY1HB2cGpqytRRTwTgSUH3zjXmaCtbz+b0ZW 9D/nErGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqKYS-0000000525H-1Doo; Mon, 16 Sep 2024 22:50:48 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqKXJ-000000051e5-2MDV for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2024 22:49:39 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 867D55C1363; Mon, 16 Sep 2024 22:49:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFA79C4CEC5; Mon, 16 Sep 2024 22:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726526975; bh=0P3cw1hR9bRTtfA3GkNVPSqmTI3laEGRCvS0ucnfa+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGeYvanql6Br+UdwFEhFyLgvO0ID7xr5o0ZW2NwP+6N0n7XpmiJZOgkmhOjZkI6Uj YMBmJj1+6FM6ute8bBCSY4BTzFPsw+bq12Up6mxhrPNKPfqsnMeUMBoBan/qVYZ2XF CmU9i0CmDKfgtBcjIKkYUnnnhW1YknTojcYzKAyo86D7+WaOGhEZXGWe4f69Tyskoz WXQGsn+tyBKJUHPAELkAI8gNj4tQfrsvOFlVPdNxdJu+PGcNMwfJJGENS8CMfMEi0X TDP09T+F5EV4RvY3+ou0CFJixTMqSK8pJTy6bROMUP02AqBMg9xDrExeL15Rg2GAox lDOSXQKve1kWQ== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Russell King , linux-arm-kernel@lists.infradead.org, Andrew Morton , Peter Zijlstra , Thomas Gleixner , Dave Martin , Nicolas Pitre Subject: [PATCH 01/19] arm/bL_switcher: Use kthread_run_on_cpu() Date: Tue, 17 Sep 2024 00:49:05 +0200 Message-ID: <20240916224925.20540-2-frederic@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240916224925.20540-1-frederic@kernel.org> References: <20240916224925.20540-1-frederic@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_154937_678680_50CF9829 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the proper API instead of open coding it. Reviewed-by: Dave Martin Acked-by: Nicolas Pitre Signed-off-by: Frederic Weisbecker --- arch/arm/common/bL_switcher.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c index 9a9aa53547a6..d1e82a318e3b 100644 --- a/arch/arm/common/bL_switcher.c +++ b/arch/arm/common/bL_switcher.c @@ -307,13 +307,11 @@ static struct task_struct *bL_switcher_thread_create(int cpu, void *arg) { struct task_struct *task; - task = kthread_create_on_node(bL_switcher_thread, arg, - cpu_to_node(cpu), "kswitcher_%d", cpu); - if (!IS_ERR(task)) { - kthread_bind(task, cpu); - wake_up_process(task); - } else + task = kthread_run_on_cpu(bL_switcher_thread, arg, + cpu, "kswitcher_%d"); + if (IS_ERR(task)) pr_err("%s failed for CPU %d\n", __func__, cpu); + return task; } From patchwork Mon Sep 16 22:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13805819 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 855F9C3ABB2 for ; Mon, 16 Sep 2024 22:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5r3VXIp0XmMBXAlxSwILes2Jqbowq2uwAxf2gqQQs9w=; b=4MJqYdM0jkuHlXfSt7m32VtZwF SZnxIoCn68YhTpyCl3+byIt0CL7QknpQFWJ65vM2kZAiYmc1/p1PK3U2P2zTUf7b8GAzdLqHiel1W jssv8U/D4x78ZbyOfyh+M7LIZtqHuwWX85Oj0FNU23Ft+O70O62YUpi11OTv8qkOTuvIswdhNCR9Q RHGoUjA9hBKcizqgEvFVUmtCAo2NTDvxTu6l3kb3JLdVC0b+4IuErRmIVLNqgkEy318PznA7dzMYb NbDr+oMVn5N/rkqktqPJNvt7GHrXHRS/FCQnjOqxqk4T5+lG+3Eo4m7EjIxhfBUHlXMNO0RnhsCBy vv2EVmvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqKZW-000000052NG-00wb; Mon, 16 Sep 2024 22:51:54 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqKXZ-000000051kH-2Elj for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2024 22:49:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 26EA25C1FDF; Mon, 16 Sep 2024 22:49:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D31DFC4CEC4; Mon, 16 Sep 2024 22:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726526992; bh=bRL09e91cC7LQEEs/ysPp5d5gcrpXYKGy36AOC6GrXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a1Xe10SjRDFp1Tnjo4rEV1qSSh5I/fFYmkJvMjVN/tBBFXbHuDqfW2ZKpbL9bTGkv U7tz8C47kArBx6KohU4yk94kVLrNEyfFFoMtu3sI1rGeB601xnuvrdFUb86o5jzxaw pXK9Bd6V1qDtIWeD9jqJCTq9qnaq9XQo//DpeB/mhKF+NNXs+gr/abL/4fyQmiGxSq mF4B31rqHLk0PajC+YeepD7dpn398dZY0XD8DZ9EJZmJhGVNOybAq569O4+8DOqx4+ 6VPjKNaq3VbbLRUMck9HsrMHITLQNGh6AadX2R8FQiIm+M39JtECZI8lyhca0jGq8O B0iU4+iN5HyLQ== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Andrew Morton , Peter Zijlstra , Thomas Gleixner Subject: [PATCH 07/19] soc/qman: test: Use kthread_run_on_cpu() Date: Tue, 17 Sep 2024 00:49:11 +0200 Message-ID: <20240916224925.20540-8-frederic@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240916224925.20540-1-frederic@kernel.org> References: <20240916224925.20540-1-frederic@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_154953_705601_47ECE8DF X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the proper API instead of open coding it. However it looks like kthreads here could be replaced by the use of a per-cpu workqueue instead. Signed-off-by: Frederic Weisbecker --- drivers/soc/fsl/qbman/qman_test_stash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c index b7e8e5ec884c..f4d3c2146f4f 100644 --- a/drivers/soc/fsl/qbman/qman_test_stash.c +++ b/drivers/soc/fsl/qbman/qman_test_stash.c @@ -108,14 +108,12 @@ static int on_all_cpus(int (*fn)(void)) .fn = fn, .started = ATOMIC_INIT(0) }; - struct task_struct *k = kthread_create(bstrap_fn, &bstrap, - "hotpotato%d", cpu); + struct task_struct *k = kthread_run_on_cpu(bstrap_fn, &bstrap, + cpu, "hotpotato%d"); int ret; if (IS_ERR(k)) return -ENOMEM; - kthread_bind(k, cpu); - wake_up_process(k); /* * If we call kthread_stop() before the "wake up" has had an * effect, then the thread may exit with -EINTR without ever