From patchwork Wed Aug 7 16:02:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13756476 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 AE2EFC52D73 for ; Wed, 7 Aug 2024 16:03:34 +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=qPtYt2OCSkytpqAZG8R7F1eWCUH8mV4oiNa2w0dfYR4=; b=JY4YAeEdIbz5cdjTIqzMKepvyy RbIlWrbifPUfFAbAH51B39L45FRMceEZO34YMsSi3VjId6VSBYkl83P8xOC+qFe7e1nQ4ZQl1nnOH /Ze7bqXK1vHN+Qy+psiWwtPmMHFi2mk1JM3JU4tN9FwDnvYFnk6144WqX8l0C9inu5Pd7HxOuHovZ 1ql6a6NbsOHwHF+cNvzUUt9UyHVFs+4lydpkH4BJH6FvSl2q/KVbr10TqqW0ISiePpPPot8DBvwI0 NsALONtugJJbr76dJ1XTIugSqox6Y4SH4VxwErlvmIPhJ5fq8UUUor/dl6eNS4muT2OkuOFcOD96m wNsHJl4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbj8B-00000005bS9-15bl; Wed, 07 Aug 2024 16:03:19 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbj7b-00000005bBX-0FdJ for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 16:02:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 175D3611E2; Wed, 7 Aug 2024 16:02:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE907C4AF0E; Wed, 7 Aug 2024 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723046561; bh=XJLOQaKXEoWZZ3EpAMdxxdBt/6PlHqDp/TaZaQ4iKag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uzBWgCMadGLAhjdhdjo9rQFyp89GkSQQPkhbenkJ2Ut9VytdXvHbE8DwjZmkruk2N WUM86oa5GJe4r/yZg5qL7um+MyyCaXmCFIRIdx0Vw1MR9phfzlA2EssmLDYULZp0HJ NBH54CRvWCmrTdcX1MvAu/oexmxITN9Pxwb/rKvSWKQimQlk4dTl0jUCRItMuorUin 1z2OyYesJxOikp9yTD0+BkxF6Q8OE6WTMNMNi00Eca8Rh6cuxw8IbhAv3n46/PyvQP ZEExDe6tjZ8jT4oLWab1b4ycIYJebf+doAS9iB7YTMmN5M7Z48UBVhiDMee1wgy04N gtD7zH+ciYB3Q== 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: Wed, 7 Aug 2024 18:02:07 +0200 Message-ID: <20240807160228.26206-2-frederic@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807160228.26206-1-frederic@kernel.org> References: <20240807160228.26206-1-frederic@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_090243_174522_E0520850 X-CRM114-Status: GOOD ( 12.14 ) 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 Wed Aug 7 16:02:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13756477 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 8B1ADC3DA7F for ; Wed, 7 Aug 2024 16:04:04 +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=8nZLWCmhXrmYUcbWpC3fz65qVeODiDrBacSCpc6CkS0=; b=cnwVCs15z24tgHsOn8RvYwUG0u +EliCtwAoS1NTnc8pZQI6SgJm44VZmu9oOw4G1iz6yjYYB21odOQwnGjlFejxXj5CljytNGiBiHQ4 t4HZZmWGcKjApYhdNCwZYqf0kZ3dSBNFLW5/MPxHILZ/oeJijAmzRSfUa3dVfFM5SjeK9BY1Xy97p eYSzgl1LIuUtMdEKUjGCrbgJqnlOxt5rL8j+qzhtl45eztHooQCQSjGNYe2hBBEbv4oaoCQV09t3F jvBtjlh0HkDg+SvslfOgfINTo+S+DR8Snomlz2jJeesci02JTFsbjFMiDVNxQ2JZ/6ZamLq8Hv7lZ XkNIetBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbj8i-00000005bfv-0neK; Wed, 07 Aug 2024 16:03:52 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbj7p-00000005bIU-3Kra for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 16:02:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 48B45611E7; Wed, 7 Aug 2024 16:02:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77541C4AF0D; Wed, 7 Aug 2024 16:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723046577; bh=KUPM3WCD3VyrnlEzvVZNfdnolRYrDWJJnT+Gw+3b/Oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hxgdW86VQjHpSGHUf98BWxrZRkD06R6Ccu0cv6cOX9CckYr5DL6WgCHyUJPITgw1u GOMp68XGvI7fa0AuF88644G5HoAo+GwSKJcZk7fSrHsuuIbc6P2c4iVx/DAmdajH8M usbOEnUEt/Kns2x6r3YPU5krR83VwF4izoG6zusRFlvlIZUZQYhGFmtVJHHSeauKWr ORcjrgt8H/gBJmRX1776nfNMVHWqyrwVMqVZdpAf51nkrhB3e7oGlPIZutgYstmY0n nU3uBXr0XgyGJCWkXNs+qgL+yUYFjWfl+t1ACXpOJU7P+M3PGYiYpxk6nvplPijJZQ NFd/CUyO3Ic+w== 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: Wed, 7 Aug 2024 18:02:13 +0200 Message-ID: <20240807160228.26206-8-frederic@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807160228.26206-1-frederic@kernel.org> References: <20240807160228.26206-1-frederic@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_090257_892259_D29FA7BC X-CRM114-Status: GOOD ( 12.70 ) 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