lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1516352307-20123-2-git-send-email-rajneesh.bhardwaj@intel.com>
Date:   Fri, 19 Jan 2018 14:28:20 +0530
From:   Rajneesh Bhardwaj <rajneesh.bhardwaj@...el.com>
To:     platform-driver-x86@...r.kernel.org
Cc:     dvhart@...radead.org, andy@...radead.org,
        linux-kernel@...r.kernel.org, vishwanath.somayaji@...el.com,
        srinivas.pandruvada@...ux.intel.com,
        Rajneesh Bhardwaj <rajneesh.bhardwaj@...el.com>
Subject: [Patch v1 1/8] platform/x86: intel_pmc_core: Refactor debugfs entries

When on a platform if we can't show MPHY and PLL status, don't even bother
to create a debugfs entry as it will fail anyway. In fact unless OEM builds
a special BIOS for test, it will fail on every production system.

This will help to add future platform support where we can't support these
entries.

Suggested-by: Andriy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@...el.com>
---
 drivers/platform/x86/intel_pmc_core.c | 44 +++++++++++++----------------------
 1 file changed, 16 insertions(+), 28 deletions(-)

diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c
index cf8b3b34a979..43cee8877ee3 100644
--- a/drivers/platform/x86/intel_pmc_core.c
+++ b/drivers/platform/x86/intel_pmc_core.c
@@ -407,43 +407,31 @@ static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
 
 static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
 {
-	struct dentry *dir, *file;
 
-	dir = debugfs_create_dir("pmc_core", NULL);
-	if (!dir)
-		return -ENOMEM;
+	pmcdev->dbgfs_dir = debugfs_create_dir("pmc_core", NULL);
 
-	pmcdev->dbgfs_dir = dir;
-	file = debugfs_create_file("slp_s0_residency_usec", 0444,
-				   dir, pmcdev, &pmc_core_dev_state);
-	if (!file)
-		goto err;
+	if (!pmcdev->dbgfs_dir)
+		return -ENOMEM;
 
-	file = debugfs_create_file("pch_ip_power_gating_status", 0444,
-				   dir, pmcdev, &pmc_core_ppfear_ops);
-	if (!file)
-		goto err;
+	debugfs_create_file("slp_s0_residency_usec", 0444, pmcdev->dbgfs_dir,
+			    pmcdev, &pmc_core_dev_state);
 
-	file = debugfs_create_file("mphy_core_lanes_power_gating_status", 0444,
-				   dir, pmcdev, &pmc_core_mphy_pg_ops);
-	if (!file)
-		goto err;
+	debugfs_create_file("pch_ip_power_gating_status", 0444,
+			    pmcdev->dbgfs_dir, pmcdev, &pmc_core_ppfear_ops);
 
-	file = debugfs_create_file("pll_status", 0444, dir, pmcdev,
-				   &pmc_core_pll_ops);
-	if (!file)
-		goto err;
+	debugfs_create_file("ltr_ignore", 0644, pmcdev->dbgfs_dir, pmcdev,
+			    &pmc_core_ltr_ignore_ops);
 
-	file = debugfs_create_file("ltr_ignore", 0644, dir, pmcdev,
-				   &pmc_core_ltr_ignore_ops);
+	if (pmcdev->map->pll_sts)
+		debugfs_create_file("pll_status", 0444, pmcdev->dbgfs_dir,
+				    pmcdev, &pmc_core_pll_ops);
 
-	if (!file)
-		goto err;
+	if (pmcdev->map->mphy_sts)
+		debugfs_create_file("mphy_core_lanes_power_gating_status",
+				    0444, pmcdev->dbgfs_dir, pmcdev,
+				    &pmc_core_mphy_pg_ops);
 
 	return 0;
-err:
-	pmc_core_dbgfs_unregister(pmcdev);
-	return -ENODEV;
 }
 #else
 static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ