Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1852927imm; Mon, 3 Sep 2018 11:07:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYgxZSu8aDBBKpS34TRv7wP2RMPRYNuhLmWpu8nW0wDCiYNALlJ59OvpiPjrPlpT3NfI+fh X-Received: by 2002:a65:5c4b:: with SMTP id v11-v6mr26767675pgr.98.1535998070004; Mon, 03 Sep 2018 11:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535998069; cv=none; d=google.com; s=arc-20160816; b=GQeqh+ErXbwMvWQIVEJi+I0SLWikvAVHtPC1zf94+UKynBW6YlgvywaTy7VabaXjVC pm/GnsBfU55azA+M4QT1pExJmjmlrOrUlTuyi8BlTG116IS1lDlMxBDDPSPVU8eMQtt9 81d3vC+VNiV8eBAGdboYaI+W9ffs5fWIM81MirsTtGHL7U5VM3okno4CHSpkWx+ji6Bz wUiI3d+RjDxREnN7cFfZLE4h+zkGSbKBXDXf+FggZ5qLXoUDK7EAne1aO9HjpG8tU+Ta 7+QfuLZiJrheqfHs5fSBicloNtrDMOHJLhDNz6QHaxqpgsFb842n4hoxk/rANTIQcSqp zXvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=sbziBI0b3zMdjgTGPqEpgtSMlVhI07hwq32cY0Z5B5M=; b=G+mqS6tqEZFb0YcXSxcon/aP2FlzEOMTiWuCrd7RLsCz4Ngo4qvdBrXgXtlC6pwe49 ihfFmNlYDudNDDpIlF976qAqj8fqrFIM1myWH1W6NU4hJVY7QFxSYdwBKh8ahmdVKj2w p+7aK5gEfqVQ8dLICzKqCjdv6A7S3uyhnROZAOMSqVS5dJBs6979+PkiMNEVSflvCAdv IO9cNq+RoYzMiQadsCV2t3GMhOZ8zhCsqoCDkgbxVN/P/tKeWh9lmEQgFRJwtNwTl/Ja XdAYU2pzCEfG5L0JJo5ps7vv6W1HcOyHi1DzITaTITsaWDjbStmwh27ZYQXwNY+GcSrT 51BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si17624734pge.585.2018.09.03.11.07.34; Mon, 03 Sep 2018 11:07:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728532AbeICW0Y (ORCPT + 99 others); Mon, 3 Sep 2018 18:26:24 -0400 Received: from mga05.intel.com ([192.55.52.43]:31017 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbeICW0X (ORCPT ); Mon, 3 Sep 2018 18:26:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2018 11:05:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,326,1531810800"; d="scan'208";a="88629547" Received: from rajneesh-desk.iind.intel.com ([10.223.86.34]) by orsmga002.jf.intel.com with ESMTP; 03 Sep 2018 11:05:02 -0700 From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, rajneesh.bhardwaj@intel.com, souvik.k.chakravarty@intel.com, Rajneesh Bhardwaj , Matt Turner , Len Brown , Kuppuswamy Sathyanarayanan Subject: [PATCH 4/4] platform/x86: intel_telemetry: report debugfs failure Date: Mon, 3 Sep 2018 23:34:15 +0530 Message-Id: <20180903180415.31575-4-rajneesh.bhardwaj@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903180415.31575-1-rajneesh.bhardwaj@linux.intel.com> References: <20180903180415.31575-1-rajneesh.bhardwaj@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On some Goldmont based systems such as ASRock J3455M the BIOS may not enable the IPC1 device that provides access to the PMC and PUNIT. In such scenarios, the ioss and pss resources from the platform device can not be obtained and result in a invalid telemetry_plt_config. This is also applicable to the platforms where the BIOS supports IPC1 device under debug configurations but IPC1 is disabled by user or the policy. This change allows user to know the reason for not seeing entries under /sys/kernel/debug/telemetry/* when there is no apparent failure at boot. Cc: Matt Turner Cc: Len Brown Cc: Souvik Kumar Chakravarty Cc: Kuppuswamy Sathyanarayanan Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198779 Acked-by: Matt Turner Signed-off-by: Rajneesh Bhardwaj --- drivers/platform/x86/intel_telemetry_debugfs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c index ffd0474b0531..77212e9b22d6 100644 --- a/drivers/platform/x86/intel_telemetry_debugfs.c +++ b/drivers/platform/x86/intel_telemetry_debugfs.c @@ -951,12 +951,16 @@ static int __init telemetry_debugfs_init(void) debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data; err = telemetry_pltconfig_valid(); - if (err < 0) - return -ENODEV; + if (err < 0) { + pr_debug("Invalid pltconfig, ensure IPC1 device is enabled in BIOS\n"); + goto exit; + } err = telemetry_debugfs_check_evts(); - if (err < 0) - return -EINVAL; + if (err < 0) { + pr_debug("telemetry_debugfs_check_evts failed\n"); + goto exit; + } register_pm_notifier(&pm_notifier); @@ -1020,6 +1024,8 @@ static int __init telemetry_debugfs_init(void) debugfs_conf->telemetry_dbg_dir = NULL; out_pm: unregister_pm_notifier(&pm_notifier); +exit: + pr_debug(pr_fmt(DRIVER_NAME) " Failed\n"); return err; } -- 2.17.1