From patchwork Thu Nov 23 04:03:49 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: 168689 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp207525vqx; Wed, 22 Nov 2023 20:05:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwY0zO9lUze6xLDpfn9xu12jfBcdvVAcmzEBbW5Ih1Z5rF9r3SN+UnABmEGgxEfujVWIWe X-Received: by 2002:a05:6358:a084:b0:16e:283:665d with SMTP id u4-20020a056358a08400b0016e0283665dmr2882925rwn.15.1700712310807; Wed, 22 Nov 2023 20:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712310; cv=none; d=google.com; s=arc-20160816; b=TfqrXedx9f8ijaad8bMokZmCAJLjsePFzWR3tM2agKjrqHT8cr1c0OhVNdqIGbiR5S IrsFQdV7P2kN0IfnnMFtltWPpVjpgz8XGIn4bdY3GY72KUEyJXO65lYkKqiD8Xn3Xojl eittrbMXAMpvdYvr17kEET+YGhble6LZtoRsNvMiWoPrCs3oWtp2UGm0ebxlh1ih8EHU oRpASMnvWfCZejQimj6EeB07nj5VgJvAdwriqu5G621oeVBqpxquI7G+Y4inrqdz/Kpr ExhsHpMNIiIRsYv21xfXV1/zCZMkRX9LY4idsUrcTdGLyGsu82p8omGYDvlyxxw99b9l i4pA== 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 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h12-20020a65518c000000b005b86119661esi507246pgq.86.2023.11.22.20.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:05:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; 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 2620:137:e000::3:3 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 A08708261002; Wed, 22 Nov 2023 20:05:01 -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 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:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783326111732036443 X-GMAIL-MSGID: 1783326111732036443 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 Reviewed-by: Ilpo Järvinen --- 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)