From patchwork Wed Oct 18 23:16:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "David E. Box" X-Patchwork-Id: 155213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp51912vqb; Wed, 18 Oct 2023 16:17:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTfe9noN+ydgfgO4wf/tapZ60zmSFjO5I/hbvPRIivypO7tjgoGrVmXQzxFbpPlbXN8Thy X-Received: by 2002:a05:6870:1315:b0:1d5:a303:5f39 with SMTP id 21-20020a056870131500b001d5a3035f39mr883379oab.49.1697671057344; Wed, 18 Oct 2023 16:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697671057; cv=none; d=google.com; s=arc-20160816; b=VkK5AUuq8dF8rupwS9d8nJ3oBZzEge49t089UnOSu0+6bSZV4cRbFi00h/k2GRs4Ab ZZmNS2VpSJLCml6eK48SA3073bQLYUOYmqqS35bfpfdM5AKPKk8O3UZYywGi4HnCW5pm Bcrk50fuc+zIK/KGZJM/sQBbj6fsLvMbtetMOnWxZ0ewszl+ObroYCT8OtkBwZuiJhl4 JDDQgfAlr6Nc24j92lg7nuZNjpc1+HUFWx261Ldq+WnCEMl12pbpkQYwW4TMemdQiLkk ocgyo3rEFZZnQNYHhXHX4UEld5zJ1dvVlsBCmRy/Ma1Qy+2jz9tmf6AY8mWPy7kKX/K2 aLkQ== 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:to:from :dkim-signature; bh=4kMKts4VgR+pPXJsw/ZMwItZ/h9RntW+QNzsZ9iVH/s=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=dtlKQHGb716s+4+Eo1g8sDkq8A0vcq7PkodLphpqTSYie4JPcVPmBfhGsKHQYNy0I4 6Rnz0vNPV3WYYhVXfyvH6hq7tDIjUbNYNU7ZQgru5+V755vFGLtN4kdBkCMSSDYK74xP FANf4F2AfwX6fteIJNcmKIX8bbvN9XuZt0A15zyHk2Ao2juuI/bEOi0v9ognABbQGr3q A2mN5reHv+X6Udn0ZMXHg9zJ6kJU86oC63ISuX+hyUSYotU9VTCX6ptndh4HYC5DinGH GSWELu9hkmis0iQ3Vth9uL9UuIHwCsehQzFAuTOOp/OH2fF8pJuiYa9KkIbTf75IDj++ /o/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VjjNvP8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b13-20020a6567cd000000b00588d84b1215si3229097pgs.876.2023.10.18.16.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 16:17:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VjjNvP8G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3E3B58253FE0; Wed, 18 Oct 2023 16:17:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232434AbjJRXQo (ORCPT + 24 others); Wed, 18 Oct 2023 19:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231828AbjJRXQ2 (ORCPT ); Wed, 18 Oct 2023 19:16:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A478118; Wed, 18 Oct 2023 16:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697670986; x=1729206986; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=3kIeeePd9Sa8P17qqM631pQDAW3Hx4V3pJa7j4Rsss8=; b=VjjNvP8GcQINPd7vVl31j021SH+UYMaVJORkiOyVFjgMdhMGKIVP+4yO YFpRfU2NLqjrUWKG3UuDTLqyHOP5wC7CgflbrAeKJR6mbRVdbt3RGeQJ+ MR1kxeAJHyEuKnisizAI/h8+jF+KYoF332W0r7WaoXDJzM38f1EB6Pmn+ 2dNE1bG1/Zseurjw2tpli8HcCCPFQ+oO12WOWoGG8DpuzscAHhkrKvRh3 Oi2t5su9mK54uPv52KrTZC7nRVz96nbDzyBFYfb1EqxtgKIjnx3J/nBYE lZv/EUDNw/UK+BMU2j87wdkawkY7SFCiHkG3RlgOGKFPx1vVssorwRjo7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="452605953" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="452605953" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 16:16:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="756782168" X-IronPort-AV: E=Sophos;i="6.03,236,1694761200"; d="scan'208";a="756782168" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 16:16:24 -0700 Received: from debox1-desk4.lan (unknown [10.209.71.91]) by linux.intel.com (Postfix) with ESMTP id D2492580DAE; Wed, 18 Oct 2023 16:16:24 -0700 (PDT) From: "David E. Box" To: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, ilpo.jarvinen@linux.intel.com, rajvi.jingar@linux.intel.com Subject: [PATCH V4 02/17] platform/x86/intel/vsec: remove platform_info from vsec device structure Date: Wed, 18 Oct 2023 16:16:09 -0700 Message-Id: <20231018231624.1044633-3-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018231624.1044633-1-david.e.box@linux.intel.com> References: <20231018231624.1044633-1-david.e.box@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 16:17:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780137126348177647 X-GMAIL-MSGID: 1780137126348177647 In preparation for exporting an API to register Intel Vendor Specific Extended Capabilities (VSEC) from other drivers, remove the pointer to platform_info from intel_vsec_device. This prevents a potential page fault when auxiliary drivers probe and attempt to dereference this pointer to access the needed quirks field. Instead, just add the quirks to intel_vsec_device. Signed-off-by: David E. Box Reviewed-by: Ilpo Järvinen --- V4 - No change V3 - No change V2 - New patch splitting previous PATCH 1 drivers/platform/x86/intel/pmt/class.c | 2 +- drivers/platform/x86/intel/vsec.c | 2 +- drivers/platform/x86/intel/vsec.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/intel/pmt/class.c index f32a233470de..2ad91d2fd954 100644 --- a/drivers/platform/x86/intel/pmt/class.c +++ b/drivers/platform/x86/intel/pmt/class.c @@ -31,7 +31,7 @@ bool intel_pmt_is_early_client_hw(struct device *dev) * differences from the server platforms (which use the Out Of Band * Management Services Module OOBMSM). */ - return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW); + return !!(ivdev->quirks & VSEC_QUIRK_EARLY_HW); } EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, INTEL_PMT); diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index e82a009be630..b14eba545770 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -193,7 +193,7 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he intel_vsec_dev->pcidev = pdev; intel_vsec_dev->resource = res; intel_vsec_dev->num_resources = header->num_entries; - intel_vsec_dev->info = info; + intel_vsec_dev->quirks = info->quirks; if (header->id == VSEC_ID_SDSI) intel_vsec_dev->ida = &intel_vsec_sdsi_ida; diff --git a/drivers/platform/x86/intel/vsec.h b/drivers/platform/x86/intel/vsec.h index 8900cb95afd3..d3fefba3e623 100644 --- a/drivers/platform/x86/intel/vsec.h +++ b/drivers/platform/x86/intel/vsec.h @@ -79,10 +79,10 @@ struct intel_vsec_device { struct pci_dev *pcidev; struct resource *resource; struct ida *ida; - struct intel_vsec_platform_info *info; int num_resources; void *priv_data; size_t priv_data_size; + unsigned long quirks; }; int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,