Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1527535rwb; Wed, 16 Nov 2022 20:12:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cgYkGsnrqtS1qJ5iONDJ7Sg54jNnUEw4YcySFGjIfnTWmJDxmsTi0GgjoygoDMI6FyF4G X-Received: by 2002:a17:90a:9313:b0:213:2168:1c78 with SMTP id p19-20020a17090a931300b0021321681c78mr1004649pjo.72.1668658323838; Wed, 16 Nov 2022 20:12:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668658323; cv=none; d=google.com; s=arc-20160816; b=Ysa3blAuwyn+IvtyAV42fBJg/kgCWBnBCcDSzGfT5ylNIWbPKyVIZkKeTEpykUko3A yCYhh1rn5srmfGTJMM+qLkSqk21FWUrR8SbuFaHpKoyE9oI42s7HcsMMMfsdrG6+hADs Yb00QRaAM1EfM+UtTQRzKcF6R/O+Doaq2q0tPduUa7amHz1byuF+eqIJVz5eKqhJKnDD QP/GE1J6WQf5OmhYgawVVLkiy+qtO81tpxKmDpzzu0DC2YkpK3Mr85eNLuYiY47LP2HF bJBlVcI1sYYObU7xEnThXowdJXls1KE/hpxcreQOK/ECgIQLdetMSRVQrFIGW6zD4ZgI +L+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NTJMj4RLR/HJciLindSBahxT883h+xnRH2Ms8fM9j9s=; b=R/WRCPiskB74+H74dS4ZNeLDFzn2ucLCjOLaA2rN4yX4I+2eye6kOzB3eeSSHXaUBk sesBecXFp+cdC1NXomcbXk1medWunQzYDIxharoUQyinHQCbPXAr1RGun5onTOVs/DPa zNldMG/Kxj4+58T3VZgoq20YxUorNA5bYf5CiFWVq+Is+4v/YbQeritMtrVt2gXQtXlP /vtI/F9RGYX1sYEnuanNWQauMsKpz6WBrw5XnilClBs/ulKvq8VdGb9KmUlK5PaWfURo s6csJhD66DZA97wR8AWJa6srIyCAdI86ArPV1scmPWJhuKsYq6yI4UNpnugIAfRUEoKm XOqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="LNe8Ziz/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s33-20020a63ff61000000b0046f63d17422si17585593pgk.359.2022.11.16.20.11.51; Wed, 16 Nov 2022 20:12:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="LNe8Ziz/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239146AbiKQEBY (ORCPT + 91 others); Wed, 16 Nov 2022 23:01:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233725AbiKQEA6 (ORCPT ); Wed, 16 Nov 2022 23:00:58 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E3D49B5D; Wed, 16 Nov 2022 20:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668657657; x=1700193657; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lLTFw+V6vyszKv4M2RjEw7P6+Set2pKhk2NNretCihw=; b=LNe8Ziz/krf930Q7OiDT+I6HjH1iyV1e31cS3tu8YeIQZYPdzxIqYohL IwEsX2hE3exH6PhVw4HRNVmFUKR9EFmz/yUaWutKCHFAZoFPS03RLg9/v YdmcTIpW4LD4nZXlKN57MFHXi0IN5i2hMCeipZxtEJC+gGK6gUNhQZ5DO LfgUkFZkfeFAK4/mIxuXhJSkhPzkSNrRYNTgNt/49jaEfPoMHWj3U5hFL Qr89p9Wj1AtaHGm04YJ34NpHJv3mUBrYi1NodYjsGYFnYtHo9un0aUOJK GT8I8P/cZFq6fCLdLgDvILZrvoM3CQXfEtvD05ogOZL8PzZV7OS7jE7vO Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="292455956" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="292455956" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:00:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="590462670" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="590462670" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:00:56 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 03/16] platform/x86/intel/ifs: Remove image loading during init Date: Wed, 16 Nov 2022 19:59:22 -0800 Message-Id: <20221117035935.4136738-4-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221117035935.4136738-1-jithu.joseph@intel.com> References: <20221107225323.2733518-1-jithu.joseph@intel.com> <20221117035935.4136738-1-jithu.joseph@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IFS test image is unnecessarily loaded during driver initialization. Drop image loading during ifs_init() and improve module load time. With this change, user has to load one when starting the tests. As a consequence, make ifs_sem static as it is only used within sysfs.c Reviewed-by: Tony Luck Reviewed-by: Sohil Mehta Reviewed-by: Hans de Goede Suggested-by: Hans de Goede Signed-off-by: Jithu Joseph --- drivers/platform/x86/intel/ifs/ifs.h | 2 -- drivers/platform/x86/intel/ifs/core.c | 6 +----- drivers/platform/x86/intel/ifs/sysfs.c | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 73c8e91cf144..3ff1d9aaeaa9 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -229,6 +229,4 @@ void ifs_load_firmware(struct device *dev); int do_core_test(int cpu, struct device *dev); const struct attribute_group **ifs_get_groups(void); -extern struct semaphore ifs_sem; - #endif diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index 27204e3d674d..5fb7f655c291 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -51,12 +51,8 @@ static int __init ifs_init(void) ifs_device.misc.groups = ifs_get_groups(); if ((msrval & BIT(ifs_device.data.integrity_cap_bit)) && - !misc_register(&ifs_device.misc)) { - down(&ifs_sem); - ifs_load_firmware(ifs_device.misc.this_device); - up(&ifs_sem); + !misc_register(&ifs_device.misc)) return 0; - } return -ENODEV; } diff --git a/drivers/platform/x86/intel/ifs/sysfs.c b/drivers/platform/x86/intel/ifs/sysfs.c index 37d8380d6fa8..65dd6fea5342 100644 --- a/drivers/platform/x86/intel/ifs/sysfs.c +++ b/drivers/platform/x86/intel/ifs/sysfs.c @@ -13,7 +13,7 @@ * Protects against simultaneous tests on multiple cores, or * reloading can file while a test is in progress */ -DEFINE_SEMAPHORE(ifs_sem); +static DEFINE_SEMAPHORE(ifs_sem); /* * The sysfs interface to check additional details of last test -- 2.25.1