Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp93875rdh; Wed, 22 Nov 2023 20:05:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvDXwXTnWIV2ynkmk5Su2LrG2Tc9IxW8HBLEqxdUXdHaM4C7pbnPR5jVZlRBrSWX8pLPsE X-Received: by 2002:a17:903:2351:b0:1cf:6e9e:aa19 with SMTP id c17-20020a170903235100b001cf6e9eaa19mr4581286plh.7.1700712324556; Wed, 22 Nov 2023 20:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712324; cv=none; d=google.com; s=arc-20160816; b=B0W1kBuTg8yrLkkFUKXChAS54N6XO8o08+qeYU1XY4S1myCITkMYtoogvmQHqQur+k ZGsn9jHz7pwUy5nc7v9BGrSPFYtLdU0C3KsuISGm49f1a5ucWdKABu/P/DZ65tFaHeQs ACFFh9ZeyXXTXaDTXg1fmLWFcp43Q5wUxilVtkRtkr8mTXubYptuq9OyQMyUTD39Nnqj EsfwwP8raJ9T0CqSoojp5XyoZwrbrZhaK5wx8ZAKfRimLHNbH0ctlQbW1akZaM2aayWx KtaMRF0+jybThzlvit/0bCElQCd/PuUtEtWlRtJHBTPUT3WydXKgGb7I7935/kcF/PRS Z0Bw== 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=hMxyMG5gEXVrK5RbMghd6zua3F/Ej44SDM63dOkjorM=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=KCYdaUdmL29lwcRr+WA9B6tfIBSheRwIdpC/eNuWI24bTHi2Low45zdNLqXq9tx0BH 5fIJ2O6il+rGDBaxB7FiyC1QFwjRnNH3ZyvcCXgEfFvajc3twqDXGK2nnWH4HQajVI4Y MCnu4mYs4vBymRPjeOT2lSZcfF6vIrAvIVqj/uG8fkMmxo9eRqQntGYmqfMpxdV+WHOH jdEG0rvpTugkJRAwIgyqb5Lkfa6eAgnxr1WHX1eJerPCBdrBhbv1uIFZQVXncpeF5/CR az7FEOpTGwRhwsXnbRjjpYwkg30sW3JSDFHf6sh2ABER1KK4Dx1AifV5fOQoU732PbH0 uSjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="nmL1X/Ve"; 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u9-20020a170902bf4900b001bde9e8a29fsi332281pls.183.2023.11.22.20.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:05:24 -0800 (PST) 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="nmL1X/Ve"; 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 6973F8261027; Wed, 22 Nov 2023 20:05:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344616AbjKWEEw (ORCPT + 99 others); Wed, 22 Nov 2023 23:04:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233111AbjKWEDx (ORCPT ); Wed, 22 Nov 2023 23:03:53 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 580E21B6; Wed, 22 Nov 2023 20:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700712241; x=1732248241; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=6wOAYg5B96EPZlKq34DSSYjbIZg9BCveMrrLsV0j/bk=; b=nmL1X/VeWOBuyxRWJe3UQnJzFMafvTZtTYRA1OVHpAmizThUlevVUEY2 ms1OLTpZTZanwSKiQb8lMihs9YelUcP4QXunksnyjslTMgi0TPMYOmCEy O1CuwY/7jS5oASKlF31FnNgAWamlV2JeVqny9qL3aGplUqlgf5uuUfD0J L+dcCpmZAmR4YlYUNqbzxspBgD6z/KPO3LWmCu+UB35Iz9i62cRVhobWA N4TbVTN0/fy5BBFJF6b8JLlkyq39X+5ePLPkc90oBwlwoThjHpvbuTPy1 O50Sr4jlJv6rzlAo7rRCtLScwfRaE50idT0jXjVZD83SWJ6o9OAqGGD8P g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="5334665" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="5334665" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="837671157" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="837671157" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:57 -0800 Received: from debox1-desk4.lan (snpatel1-mobl.amr.corp.intel.com [10.209.89.91]) by linux.intel.com (Postfix) with ESMTP id 133F9580CA4; Wed, 22 Nov 2023 20:03:57 -0800 (PST) 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 V5 14/20] platform/x86/intel/pmc/mtl: Use return value from pmc_core_ssram_init() Date: Wed, 22 Nov 2023 20:03:49 -0800 Message-Id: <20231123040355.82139-15-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123040355.82139-1-david.e.box@linux.intel.com> References: <20231123040355.82139-1-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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, 22 Nov 2023 20:05:16 -0800 (PST) Instead of checking for a NULL regbase, use the return value from pmc_core_ssram_init() to check if PMC discovery was successful. If not, use the legacy enumeration method (which only works for the primary PMC). Signed-off-by: David E. Box --- V5 - New patch. Split from previous. drivers/platform/x86/intel/pmc/mtl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index c3b5f4fe01d1..d1d3d33fb4b8 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -990,12 +990,16 @@ int mtl_core_init(struct pmc_dev *pmcdev) mtl_d3_fixup(); pmcdev->resume = mtl_resume; - pmcdev->regmap_list = mtl_pmc_info_list; - pmc_core_ssram_init(pmcdev); - /* If regbase not assigned, set map and discover using legacy method */ - if (!pmc->regbase) { + /* + * If ssram init fails use legacy method to at least get the + * primary PMC + */ + ret = pmc_core_ssram_init(pmcdev); + if (ret) { + dev_warn(&pmcdev->pdev->dev, + "ssram init failed, %d, using legacy init\n", ret); pmc->map = &mtl_socm_reg_map; ret = get_primary_reg_base(pmc); if (ret) -- 2.34.1