• Home
  • Raw
  • Download

Lines Matching refs:ndd

44 static int validate_dimm(struct nvdimm_drvdata *ndd)  in validate_dimm()  argument
48 if (!ndd) in validate_dimm()
51 rc = nvdimm_check_config_data(ndd->dev); in validate_dimm()
53 dev_dbg(ndd->dev, "%ps: %s error: %d\n", in validate_dimm()
62 int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd) in nvdimm_init_nsarea() argument
64 struct nd_cmd_get_config_size *cmd = &ndd->nsarea; in nvdimm_init_nsarea()
65 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev); in nvdimm_init_nsarea()
67 int rc = validate_dimm(ndd); in nvdimm_init_nsarea()
78 rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev), in nvdimm_init_nsarea()
85 int nvdimm_get_config_data(struct nvdimm_drvdata *ndd, void *buf, in nvdimm_get_config_data() argument
88 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev); in nvdimm_get_config_data()
90 int rc = validate_dimm(ndd), cmd_rc = 0; in nvdimm_get_config_data()
97 if (offset + len > ndd->nsarea.config_size) in nvdimm_get_config_data()
100 max_cmd_size = min_t(u32, len, ndd->nsarea.max_xfer); in nvdimm_get_config_data()
114 rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev), in nvdimm_get_config_data()
131 int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset, in nvdimm_set_config_data() argument
136 int rc = validate_dimm(ndd), cmd_rc = 0; in nvdimm_set_config_data()
137 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev); in nvdimm_set_config_data()
143 if (offset + len > ndd->nsarea.config_size) in nvdimm_set_config_data()
146 max_cmd_size = min_t(u32, len, ndd->nsarea.max_xfer); in nvdimm_set_config_data()
162 rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev), in nvdimm_set_config_data()
242 struct nvdimm_drvdata *ndd = container_of(kref, typeof(*ndd), kref); in nvdimm_drvdata_release() local
243 struct device *dev = ndd->dev; in nvdimm_drvdata_release()
248 for_each_dpa_resource_safe(ndd, res, _r) in nvdimm_drvdata_release()
249 nvdimm_free_dpa(ndd, res); in nvdimm_drvdata_release()
252 kvfree(ndd->data); in nvdimm_drvdata_release()
253 kfree(ndd); in nvdimm_drvdata_release()
257 void get_ndd(struct nvdimm_drvdata *ndd) in get_ndd() argument
259 kref_get(&ndd->kref); in get_ndd()
262 void put_ndd(struct nvdimm_drvdata *ndd) in put_ndd() argument
264 if (ndd) in put_ndd()
265 kref_put(&ndd->kref, nvdimm_drvdata_release); in put_ndd()
338 static ssize_t __available_slots_show(struct nvdimm_drvdata *ndd, char *buf) in __available_slots_show() argument
344 if (!ndd) in __available_slots_show()
347 dev = ndd->dev; in __available_slots_show()
349 nfree = nd_label_nfree(ndd); in __available_slots_show()
717 struct nvdimm_drvdata *ndd; in alias_dpa_busy() local
735 ndd = to_ndd(nd_mapping); in alias_dpa_busy()
761 for_each_dpa_resource(ndd, res) { in alias_dpa_busy()
804 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_blk_available_dpa() local
813 if (!ndd) in nd_blk_available_dpa()
822 for_each_dpa_resource(ndd, res) { in nd_blk_available_dpa()
847 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_pmem_max_contiguous_dpa() local
854 if (!ndd) in nd_pmem_max_contiguous_dpa()
861 nvdimm_bus = walk_to_nvdimm_bus(ndd->dev); in nd_pmem_max_contiguous_dpa()
864 for_each_dpa_resource(ndd, res) { in nd_pmem_max_contiguous_dpa()
900 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping); in nd_pmem_available_dpa() local
905 if (!ndd) in nd_pmem_available_dpa()
915 for_each_dpa_resource(ndd, res) { in nd_pmem_available_dpa()
953 nd_dbg_dpa(nd_region, ndd, res, "%s\n", reason); in nd_pmem_available_dpa()
957 void nvdimm_free_dpa(struct nvdimm_drvdata *ndd, struct resource *res) in nvdimm_free_dpa() argument
959 WARN_ON_ONCE(!is_nvdimm_bus_locked(ndd->dev)); in nvdimm_free_dpa()
961 __release_region(&ndd->dpa, res->start, resource_size(res)); in nvdimm_free_dpa()
964 struct resource *nvdimm_allocate_dpa(struct nvdimm_drvdata *ndd, in nvdimm_allocate_dpa() argument
974 WARN_ON_ONCE(!is_nvdimm_bus_locked(ndd->dev)); in nvdimm_allocate_dpa()
975 res = __request_region(&ndd->dpa, start, n, name, 0); in nvdimm_allocate_dpa()
986 resource_size_t nvdimm_allocated_dpa(struct nvdimm_drvdata *ndd, in nvdimm_allocated_dpa() argument
992 for_each_dpa_resource(ndd, res) in nvdimm_allocated_dpa()