Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp272923rdh; Mon, 18 Dec 2023 20:23:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+3if5U4hR93NwLV8aG+Wh7+YUzoNTYgwToA0LhiFsOfxjHW9Wwq7izao9F5jQW/DCE0RI X-Received: by 2002:a05:6a00:270b:b0:6d9:31a0:c3bd with SMTP id x11-20020a056a00270b00b006d931a0c3bdmr383124pfv.6.1702959819077; Mon, 18 Dec 2023 20:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702959819; cv=none; d=google.com; s=arc-20160816; b=SX+7/VBkQXUKoYYMAEJjr+rNmHdvbFARMscuU/S8Dn9ildx7JRcs9SmZqxJamUCzLU 3lD7Hsjtfu3TdpHD65tX+1bbVCwioGOCJ3DN1vYZVSl55teIyhFCHwpb/j53c4UAsDua aX20RlPFW+OMhXvXK1tUZzO4d73qKjtLpoy0SCqbP8VmgBky+cA0lHbIb3sD2K2oczkr +VsTAImDg0CubP6qBvG/eza5zo1XwIVXtd4G8cM9c6XL1va9/bDMWkXKg9H3mVXJMeQq l2y4jtCpkbTeQreOhqfjFNR62hUy2ooDp3rS4FtW/dFoB4PeziAUxYPFeSSXDfHLAMpF Hc/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YlJueKFIBQl4zHVr9pc+vVVHiwMlXEpekLK3wmddpVE=; fh=bwOTmuPm4Qwa90FsyEJN8f+rOpKaop2vGXMZlgN+vfc=; b=XVGv2gXq2TC2nVAqLcsK0IPP/PtBzaQMELUGJEij3om1YKJHvIh8su9pEonCMmQXYD /CsZh26gFMvCK4FkFYH/nu7iZshot45hOtcNQX+XQV/J50KSCf1MLX9kSHXp6/YO8dK1 y8ZNUE7oEGBu5TPbHclHQ3KpzfQwOtCCnX+yFzAgHSGnjPVXI78GcLsLeQ/4E0+F1sY6 x//i8vPjDkN0yC/T/wPQn8vBdmg6n36rWPSWT/bcPxrvomjAqJDenoRPhXriWlTvOT6j 68R1KemfWssp0rcNVG5853BSLXj4Hq3BWniXwmkWCSQN87/lq5ntac5pSx5GO6dyw9uz KD7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FZUzpkRw; spf=pass (google.com: domain of linux-kernel+bounces-4673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p3-20020a631e43000000b005c701bf0e27si16672523pgm.79.2023.12.18.20.23.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 20:23:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FZUzpkRw; spf=pass (google.com: domain of linux-kernel+bounces-4673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B95D8286520 for ; Tue, 19 Dec 2023 04:23:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E8D1F9E2; Tue, 19 Dec 2023 04:22:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FZUzpkRw" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6952779F6; Tue, 19 Dec 2023 04:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702959756; x=1734495756; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HcJNEX6TY0JDIkG3oUHhh/95hAwtSa+S5zZq/pwDtr8=; b=FZUzpkRwwnalxbG5bsfu82ctPBSTNVC53remWlBE5B8E0/SRXF5Qi7UB 2pkdayOuMYmJBAeG+21KEhsJGLGwjkJt+22p6eqibcA++e0mTj1m5CfdK IGrS2eABGJvb14TWMbtXmOUNmTGqChR1Ii/7/bgyy4Y2yb8jpm+YozdCX QPd4Ealq/AZE4ZOQu2aipyjp7nl2Gjcfn7kAhsZukm1yfUiXULho5GUGb 2iZRCweXVRuFsVTrtRydH0kxCjVwS12ZlHFc2PDDMutZQC17xfszgYLIW vZDawsHf4nTYhU0FcYL1OI2DwQ4yP7ely2yoP0A0DtL+kc/wmr9XpjrzV Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="2455990" X-IronPort-AV: E=Sophos;i="6.04,287,1695711600"; d="scan'208";a="2455990" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 20:22:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="919503119" X-IronPort-AV: E=Sophos;i="6.04,287,1695711600"; d="scan'208";a="919503119" Received: from mnichels-mobl1.amr.corp.intel.com (HELO rjingar-desk5.intel.com) ([10.212.29.225]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 20:22:31 -0800 From: rjingar To: irenic.rajneesh@gmail.com, david.e.box@intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: rajvi.jingar@linux.intel.com Subject: [PATCH 6/8] platform/x86/intel/pmc: Add ssram_init flag in PMC discovery in Meteor Lake Date: Mon, 18 Dec 2023 20:22:14 -0800 Message-Id: <20231219042216.2592029-6-rajvi.jingar@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219042216.2592029-1-rajvi.jingar@linux.intel.com> References: <20231219042216.2592029-1-rajvi.jingar@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Rajvi Jingar If PMC discovery using pmc_core_ssram_init() was unsuccessful for the Meteor Lake platform, the legacy enumeration method is used. In this case pci device struct for the PMC SSRAM is not available and pmc_core_ssram_get_lpm_reqs() will not work. Add ssram_init flag to indicate if the PMC SSRAM initialization was successful or not. Call pmc_core_ssram_get_lpm_reqs() only if the ssram_init flag is set to true. Signed-off-by: Rajvi Jingar --- drivers/platform/x86/intel/pmc/mtl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index d2470f800298..e75431325dda 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -994,6 +994,7 @@ int mtl_core_init(struct pmc_dev *pmcdev) struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC]; int ret; int func = 2; + bool ssram_init = true; mtl_d3_fixup(); @@ -1006,6 +1007,7 @@ int mtl_core_init(struct pmc_dev *pmcdev) */ ret = pmc_core_ssram_init(pmcdev, func); if (ret) { + ssram_init = false; dev_warn(&pmcdev->pdev->dev, "ssram init failed, %d, using legacy init\n", ret); pmc->map = &mtl_socm_reg_map; @@ -1023,5 +1025,8 @@ int mtl_core_init(struct pmc_dev *pmcdev) dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n"); pmc_core_send_ltr_ignore(pmcdev, 3); - return pmc_core_ssram_get_lpm_reqs(pmcdev); + if (ssram_init) + return pmc_core_ssram_get_lpm_reqs(pmcdev); + + return 0; } -- 2.34.1