Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2151961rdb; Tue, 3 Oct 2023 11:49:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMNaRbWpIRDlBuSP9Q0R8CGsIoDxbTImlZ3ziOFFwPnpJ0jbU1H200uPri5awSE3Ite3oS X-Received: by 2002:a05:6a20:2445:b0:14e:3ba7:2933 with SMTP id t5-20020a056a20244500b0014e3ba72933mr273143pzc.54.1696358967490; Tue, 03 Oct 2023 11:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696358967; cv=none; d=google.com; s=arc-20160816; b=ub2UCZDbVLQKxG0w7Okz4p4ZWB/mCbWhSPXa9P+rnPACd9otHnLlmpHQCiIxFRZ7sZ FMRpjpaBQAGEGBn8SRzbbW7gyQmhvuS5eY08Ag6zKEM+81iFT4NYPKK0xE/lo3E0Fn02 c7ViZDr48KxPCD6EDFNxxjHcoMXo1uk2/CsMVUbYsfef2PqeNzjX14QdwP4KYG9ac6uz Av770fnLo3wa/I8a2/7e2XgN0yG6P8/AVQDcsJ4AnKyZm6KO0gm/nSnDTw00yVrdOEeB hU0R0V74+6A9lbqIMh8rxZv+Q1UKHELSjvgdBfVn9mfaaekeDpsEqwp9PkJNdkqlhvjR IjhQ== 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=FYsNpLr6ZS17xn3FV8XolmFl0O9m1aJ07j9xKW0nAm0=; fh=WxcXzAXi1awalX5nBNdKiu2pCszhVA/a0vtqlN5we7w=; b=mwH2wIg3LaE6gvGP8fqwzm4M7HZ6ghhY0IsBVZpXE595tHDioLIXRZAQKyUFu4o5Yh LJmJuendYOJiDzl770/dQYzYUwNxQhAvS9Y5K0oLKcBM8PxQEZPSPlVevY3yICUtBGKq kdbn3amRQxzgrfXVNGX5vbNhsgW37L65b03sx1Q5+vcohF28fXzjZ/H+moekxjv4sdwS Ug6zsRbL+eYFZb8Zb1ciItxzFZb0+2FXyWpsf3m/3jzoF2D4rVdUABgVSP1lgXCAaPOj 88KlViu+nArm8QMLxeC0Upj2dxh4bi4npTK9707IKlkHOMzZkieK75bte3RTKOXAj6HU s37A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KIW/CSQ8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b005859c8462f5si2075883pgb.268.2023.10.03.11.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 11:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KIW/CSQ8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 9583681B6AAD; Tue, 3 Oct 2023 11:49:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232160AbjJCSt0 (ORCPT + 99 others); Tue, 3 Oct 2023 14:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231938AbjJCStY (ORCPT ); Tue, 3 Oct 2023 14:49:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 109FAAB; Tue, 3 Oct 2023 11:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696358962; x=1727894962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DehzMPWOQhRRRY3Bff94fnYSIwTrRyTbhg10vaC1+Ro=; b=KIW/CSQ8lREhQeFWGAcrJLKIFIOHmAFLbz6R5BgCn0Mgk8WYIGoydAbX XyyQHEiP99/eKA2q/wtnNhNkWTQEt+APoOQ81UZIzYeIygpFUSl4tMk5L usWNUzA68lMX1qyM6r1Wj6aXn4C77AQGSjd3UKz5lhwqw6MzQ6dubo5WY u1jkLRpnBQk4//a3z89PouK6gPmMCUfMdXPEokJJxRmQ+PPmg4a9mkrL9 IDkqbVH+4VlsXs7vYwyYudc1T+SRGunUUj/j0NZePjSV/D1jo3x0f4Afy M/hrkPZdilQodosAPot41I4YpNcZlvvLwOzPDeUhrWQHfnIZ+fO1BSJcj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="363221958" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="363221958" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 11:49:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="700814542" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="700814542" Received: from spandruv-desk.jf.intel.com ([10.54.75.14]) by orsmga003.jf.intel.com with ESMTP; 03 Oct 2023 11:49:20 -0700 From: Srinivas Pandruvada To: hdegoede@redhat.com, markgross@kernel.org, ilpo.jarvinen@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH v2 2/3] platform/x86: ISST: Ignore minor version change Date: Tue, 3 Oct 2023 11:49:15 -0700 Message-Id: <20231003184916.1860084-3-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231003184916.1860084-1-srinivas.pandruvada@linux.intel.com> References: <20231003184916.1860084-1-srinivas.pandruvada@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 11:49:26 -0700 (PDT) The hardware definition of every TPMI feature contains a major and minor version. When there is a change in the MMIO offset or change in the definition of a field, hardware will change major version. For addition of new fields without modifying existing MMIO offsets or fields, only the minor version is changed. Driver is developed to support SST functionality for a major and minor version. If the hardware changes major version, since offsets and definitions are changed, driver cannot continue to provide SST interface to users. Driver can still function with a minor version change as it will just miss the new functionality added by the hardware. The current implementation doesn't ignore any version change. If there is mismatch with the minor version, continue with an information log message. If there is mismatch with the major version, log error and exit. Signed-off-by: Srinivas Pandruvada --- v2 - Commit description and header change as suggested by llpo - Change log level for minor version mismatch .../x86/intel/speed_select_if/isst_tpmi_core.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c index ac5c6a812592..0b6d2c864437 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c @@ -30,7 +30,8 @@ #include "isst_if_common.h" /* Supported SST hardware version by this driver */ -#define ISST_HEADER_VERSION 1 +#define ISST_MAJOR_VERSION 0 +#define ISST_MINOR_VERSION 1 /* * Used to indicate if value read from MMIO needs to get multiplied @@ -352,12 +353,19 @@ static int sst_main(struct auxiliary_device *auxdev, struct tpmi_per_power_domai pd_info->sst_header.cp_offset *= 8; pd_info->sst_header.pp_offset *= 8; - if (pd_info->sst_header.interface_version != ISST_HEADER_VERSION) { - dev_err(&auxdev->dev, "SST: Unsupported version:%x\n", - pd_info->sst_header.interface_version); + if (pd_info->sst_header.interface_version == TPMI_VERSION_INVALID) + return -ENODEV; + + if (TPMI_MAJOR_VERSION(pd_info->sst_header.interface_version) != ISST_MAJOR_VERSION) { + dev_err(&auxdev->dev, "SST: Unsupported major version:%lx\n", + TPMI_MAJOR_VERSION(pd_info->sst_header.interface_version)); return -ENODEV; } + if (TPMI_MINOR_VERSION(pd_info->sst_header.interface_version) != ISST_MINOR_VERSION) + dev_info(&auxdev->dev, "SST: Ignore: Unsupported minor version:%lx\n", + TPMI_MINOR_VERSION(pd_info->sst_header.interface_version)); + /* Read SST CP Header */ *((u64 *)&pd_info->cp_header) = readq(pd_info->sst_base + pd_info->sst_header.cp_offset); -- 2.41.0