From patchwork Sat Oct 2 02:26:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 12531913 X-Patchwork-Delegate: kuba@kernel.org 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 177C0C433F5 for ; Sat, 2 Oct 2021 02:27:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F20CD617E1 for ; Sat, 2 Oct 2021 02:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbhJBC24 (ORCPT ); Fri, 1 Oct 2021 22:28:56 -0400 Received: from pi.codeconstruct.com.au ([203.29.241.158]:33956 "EHLO codeconstruct.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232278AbhJBC2z (ORCPT ); Fri, 1 Oct 2021 22:28:55 -0400 Received: by codeconstruct.com.au (Postfix, from userid 10000) id EEBBE20166; Sat, 2 Oct 2021 10:27:05 +0800 (AWST) From: Jeremy Kerr To: netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Matt Johnston , Brendan Higgins , linux-kselftest@vger.kernel.org Subject: [PATCH net-next 1/2] mctp: test: disallow MCTP_TEST when building as a module Date: Sat, 2 Oct 2021 10:26:55 +0800 Message-Id: <20211002022656.1681956-1-jk@codeconstruct.com.au> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The current kunit infrastructure defines its own module_init() when built as a module, which conflicts with the mctp core's own. So, only allow MCTP_TEST when both MCTP and KUNIT are built-in. Reported-by: kernel test robot Signed-off-by: Jeremy Kerr Reviewed-by: David Gow --- net/mctp/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mctp/Kconfig b/net/mctp/Kconfig index 15267a5043d9..868c92272cbd 100644 --- a/net/mctp/Kconfig +++ b/net/mctp/Kconfig @@ -13,6 +13,6 @@ menuconfig MCTP channel. config MCTP_TEST - tristate "MCTP core tests" if !KUNIT_ALL_TESTS - depends on MCTP && KUNIT + bool "MCTP core tests" if !KUNIT_ALL_TESTS + depends on MCTP=y && KUNIT=y default KUNIT_ALL_TESTS From patchwork Sat Oct 2 02:26:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 12531915 X-Patchwork-Delegate: kuba@kernel.org 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CB1AC433EF for ; Sat, 2 Oct 2021 02:27:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 078D561390 for ; Sat, 2 Oct 2021 02:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbhJBC25 (ORCPT ); Fri, 1 Oct 2021 22:28:57 -0400 Received: from pi.codeconstruct.com.au ([203.29.241.158]:33964 "EHLO codeconstruct.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbhJBC2z (ORCPT ); Fri, 1 Oct 2021 22:28:55 -0400 Received: by codeconstruct.com.au (Postfix, from userid 10000) id 5717E20272; Sat, 2 Oct 2021 10:27:06 +0800 (AWST) From: Jeremy Kerr To: netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Matt Johnston , Brendan Higgins , linux-kselftest@vger.kernel.org Subject: [PATCH net-next 2/2] mctp: test: defer mdev setup until we've registered Date: Sat, 2 Oct 2021 10:26:56 +0800 Message-Id: <20211002022656.1681956-2-jk@codeconstruct.com.au> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211002022656.1681956-1-jk@codeconstruct.com.au> References: <20211002022656.1681956-1-jk@codeconstruct.com.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The MCTP device isn't available until we've registered the netdev, so defer storing our convenience pointer. Signed-off-by: Jeremy Kerr Reviewed-by: David Gow --- net/mctp/test/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c index e2ab1f3da357..cc6b8803aa9d 100644 --- a/net/mctp/test/utils.c +++ b/net/mctp/test/utils.c @@ -46,17 +46,17 @@ struct mctp_test_dev *mctp_test_create_dev(void) dev = netdev_priv(ndev); dev->ndev = ndev; - rcu_read_lock(); - dev->mdev = __mctp_dev_get(ndev); - mctp_dev_hold(dev->mdev); - rcu_read_unlock(); - rc = register_netdev(ndev); if (rc) { free_netdev(ndev); return NULL; } + rcu_read_lock(); + dev->mdev = __mctp_dev_get(ndev); + mctp_dev_hold(dev->mdev); + rcu_read_unlock(); + return dev; }