From patchwork Thu Sep 26 22:48:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13813720 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 C1603CDE03E for ; Thu, 26 Sep 2024 22:50:52 +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=KckQC6/zC2llX7+fvRUMsUz3EB fO958bas8GWRb6MOlezsrFFp+Lie3asL/bEwjOTVfk0vTZxiiaAnWpFNGC/IWaR5h1T6rLVc4Dwot wF96/RBoLwQRRFZzDxhAhtT/v2T05kcOa3DOmA81iWL+T38Bs2/hEsFMPqB86rNiwEr30kwsKFdyk 7+H6iJOWIvZ3dZxGVCAHjoU6w+qX1qA1ZLA12ckPy3FKlCaLzYkvCa3PMv00/azPZHQXvqNg22mYL Ezx91QhR6sCkGGt7Wv8Bd5eRmfz89YaIv68DknFwNH9h3y7ij0DwFszwTfeIpDVXcYYJWB367Kbox v5IkSJOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stxJm-00000009VUB-1SWf; Thu, 26 Sep 2024 22:50:38 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stxIV-00000009Uxz-0WNl for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 22:49:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 0416EA4082A; Thu, 26 Sep 2024 22:49:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 370C1C4CECE; Thu, 26 Sep 2024 22:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727390958; bh=0P3cw1hR9bRTtfA3GkNVPSqmTI3laEGRCvS0ucnfa+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CSRjgxaKBDq9huQ+NP2aSSsEPA4znsDF9fYKi49YQHnimwX6ef7noEMc3hgoh4447 RB21Nw0zRgwENDf2H8AQtWYmAA7ARhsEgxhZZNz8XmrFXtl91KGGX87ihKgXKKZMmR mwX0c/TR/Z/I0LIgL9mcLOZfzYa3MfXGpyRmNRdD5Wzz+X30XLqJUl+zEnbLSOhc5Y QoncazrS/qKejP96Akq7cQzDVRf4pM2mLMf0unlx6vXwttpuIN7lk8Kv+bCGXbQIye 1rFxnPTN9D8Wzimkbc4cY2By3ax614PPe4nTHEokLqg5uFbqG0hAP8YaJyedYNqvwH nXxLIJTPR5PVQ== 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/20] arm/bL_switcher: Use kthread_run_on_cpu() Date: Fri, 27 Sep 2024 00:48:49 +0200 Message-ID: <20240926224910.11106-2-frederic@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240926224910.11106-1-frederic@kernel.org> References: <20240926224910.11106-1-frederic@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240926_154919_253526_00D2E9AD X-CRM114-Status: GOOD ( 11.93 ) 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 Thu Sep 26 22:48:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13813721 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 B0FAECDE03E for ; Thu, 26 Sep 2024 22:51:59 +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=1t9B8AqNMpmGbLHdAifKeSgalH K7uluTnjcq26KZO7a+adheH7TOQqVCrtBGTIoYS05caMca4/a19rW1OslMmuZk0H9QfTSEaPeZfUz ao896GHBBrEJK1amyNhWoYPFrIVwbufe5ucp3z14CfotetKT/Oz0kYb9epL52+mt4a9m01dqffHwY ezsyDLrvms0faRlQoLGR42Yb9ZMKorvSma30FSXxuefaKnp104DzRZ6gYY3O/mpXiNdTwanAqnPHs XxW3VBdtF4vCs+RZlfMX/t+G3Dt93uDm5fCEgL+tIir1O+PG9tPizONrEx6Zt5C9BlvoR0naCD92r IahEBDiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stxKw-00000009Vos-19ex; Thu, 26 Sep 2024 22:51:50 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stxIj-00000009V3i-2DB8 for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 22:49:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C7F505C5758; Thu, 26 Sep 2024 22:49:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5459C4CEC5; Thu, 26 Sep 2024 22:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727390972; bh=bRL09e91cC7LQEEs/ysPp5d5gcrpXYKGy36AOC6GrXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jDZdbpy4WqqifeDkegM8x1sVTl+yI6iQ0P8bBrCuvgR1jYI1u6GHF6NzZa0ERvibI cAkhHAH8POAjsMrWv8dUzeYrp7H2lW1xLce+GVcY0pLcxBKiCOZ2QSeSYanU76SraB IZBNevGY31bNGdaOCTyF2PZz+cIa9D1f+oAxxrdyywwWBtq2xFfddeIVVA5tdgy2VB 5VbETBCp8ypSUyBL5sVZzchrOvhIngYb38QGkAPgQs55AXjpxGQybbuhvuMqpZnC3Q xS+tZyEcX27kdmIVc/JQekudFEh4jPBZBZemzhpPuY/XXDC1dD7CiBeQ6fdw/enqkP hUzv6Z71aJMOA== 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/20] soc/qman: test: Use kthread_run_on_cpu() Date: Fri, 27 Sep 2024 00:48:55 +0200 Message-ID: <20240926224910.11106-8-frederic@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240926224910.11106-1-frederic@kernel.org> References: <20240926224910.11106-1-frederic@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240926_154933_632420_71332550 X-CRM114-Status: GOOD ( 12.11 ) 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