Blame SOURCES/0012-Expose-ndctl_bus_nfit_translate_spa-as-a-public-func.patch

2eb93d
From c81fa15bafb1295aaa7d7f09500c3fbdd68b0011 Mon Sep 17 00:00:00 2001
2eb93d
From: "Tsaur, Erwin" <erwin.tsaur@intel.com>
2eb93d
Date: Thu, 4 Mar 2021 17:18:04 -0800
2eb93d
Subject: [PATCH 012/217] Expose ndctl_bus_nfit_translate_spa as a public
2eb93d
 function.
2eb93d
2eb93d
The motivation is to allow access to ACPI defined NVDIMM Root Device
2eb93d
_DSM Function Index 5(Translate SPA).  The rest of the _DSM functions,
2eb93d
which are mostly ARS related, are already public.
2eb93d
2eb93d
Basically move ndctl_bus_nfit_translate_spa declaration from private.h
2eb93d
to libndctl.h.
2eb93d
2eb93d
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
2eb93d
Signed-off-by: "Tsaur, Erwin" <erwin.tsaur@intel.com>
2eb93d
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
2eb93d
Link: https://lore.kernel.org/r/20210305011804.3573-1-erwin.tsaur@intel.com
2eb93d
---
2eb93d
 ndctl/lib/libndctl.sym | 4 ++++
2eb93d
 ndctl/lib/nfit.c       | 2 +-
2eb93d
 ndctl/lib/private.h    | 2 --
2eb93d
 ndctl/libndctl.h       | 2 ++
2eb93d
 4 files changed, 7 insertions(+), 3 deletions(-)
2eb93d
2eb93d
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
2eb93d
index 0a82616..58afb74 100644
2eb93d
--- a/ndctl/lib/libndctl.sym
2eb93d
+++ b/ndctl/lib/libndctl.sym
2eb93d
@@ -451,3 +451,7 @@ LIBNDCTL_25 {
2eb93d
 	ndctl_bus_clear_fw_activate_nosuspend;
2eb93d
 	ndctl_bus_activate_firmware;
2eb93d
 } LIBNDCTL_24;
2eb93d
+
2eb93d
+LIBNDCTL_26 {
2eb93d
+	ndctl_bus_nfit_translate_spa;
2eb93d
+} LIBNDCTL_25;
2eb93d
diff --git a/ndctl/lib/nfit.c b/ndctl/lib/nfit.c
2eb93d
index 6f68fcf..d85682f 100644
2eb93d
--- a/ndctl/lib/nfit.c
2eb93d
+++ b/ndctl/lib/nfit.c
2eb93d
@@ -114,7 +114,7 @@ static int is_valid_spa(struct ndctl_bus *bus, unsigned long long spa)
2eb93d
  *
2eb93d
  * If success, returns zero, store dimm's @handle, and @dpa.
2eb93d
  */
2eb93d
-int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus,
2eb93d
+NDCTL_EXPORT int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus,
2eb93d
 	unsigned long long address, unsigned int *handle, unsigned long long *dpa)
2eb93d
 {
2eb93d
 
2eb93d
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
2eb93d
index ede1300..8f4510e 100644
2eb93d
--- a/ndctl/lib/private.h
2eb93d
+++ b/ndctl/lib/private.h
2eb93d
@@ -370,8 +370,6 @@ static inline int check_kmod(struct kmod_ctx *kmod_ctx)
2eb93d
 	return kmod_ctx ? 0 : -ENXIO;
2eb93d
 }
2eb93d
 
2eb93d
-int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus, unsigned long long addr,
2eb93d
-		unsigned int *handle, unsigned long long *dpa);
2eb93d
 struct ndctl_cmd *ndctl_bus_cmd_new_err_inj(struct ndctl_bus *bus);
2eb93d
 struct ndctl_cmd *ndctl_bus_cmd_new_err_inj_clr(struct ndctl_bus *bus);
2eb93d
 struct ndctl_cmd *ndctl_bus_cmd_new_err_inj_stat(struct ndctl_bus *bus,
2eb93d
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
2eb93d
index 60e1288..87d07b7 100644
2eb93d
--- a/ndctl/libndctl.h
2eb93d
+++ b/ndctl/libndctl.h
2eb93d
@@ -152,6 +152,8 @@ int ndctl_bus_clear_fw_activate_noidle(struct ndctl_bus *bus);
2eb93d
 int ndctl_bus_set_fw_activate_nosuspend(struct ndctl_bus *bus);
2eb93d
 int ndctl_bus_clear_fw_activate_nosuspend(struct ndctl_bus *bus);
2eb93d
 int ndctl_bus_activate_firmware(struct ndctl_bus *bus, enum ndctl_fwa_method method);
2eb93d
+int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus, unsigned long long addr,
2eb93d
+		unsigned int *handle, unsigned long long *dpa);
2eb93d
 
2eb93d
 struct ndctl_dimm;
2eb93d
 struct ndctl_dimm *ndctl_dimm_get_first(struct ndctl_bus *bus);
2eb93d
-- 
2eb93d
2.27.0
2eb93d