Lines Matching refs:t

200 	int (*alloc)(struct nfit_test *t);
201 void (*setup)(struct nfit_test *t);
231 static int nd_intel_test_get_fw_info(struct nfit_test *t, in nd_intel_test_get_fw_info() argument
235 struct device *dev = &t->pdev.dev; in nd_intel_test_get_fw_info()
236 struct nfit_test_fw *fw = &t->fw[idx]; in nd_intel_test_get_fw_info()
239 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_get_fw_info()
257 static int nd_intel_test_start_update(struct nfit_test *t, in nd_intel_test_start_update() argument
261 struct device *dev = &t->pdev.dev; in nd_intel_test_start_update()
262 struct nfit_test_fw *fw = &t->fw[idx]; in nd_intel_test_start_update()
265 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_start_update()
287 static int nd_intel_test_send_data(struct nfit_test *t, in nd_intel_test_send_data() argument
291 struct device *dev = &t->pdev.dev; in nd_intel_test_send_data()
292 struct nfit_test_fw *fw = &t->fw[idx]; in nd_intel_test_send_data()
296 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_send_data()
338 static int nd_intel_test_finish_fw(struct nfit_test *t, in nd_intel_test_finish_fw() argument
342 struct device *dev = &t->pdev.dev; in nd_intel_test_finish_fw()
343 struct nfit_test_fw *fw = &t->fw[idx]; in nd_intel_test_finish_fw()
346 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_fw()
389 static int nd_intel_test_finish_query(struct nfit_test *t, in nd_intel_test_finish_query() argument
393 struct device *dev = &t->pdev.dev; in nd_intel_test_finish_query()
394 struct nfit_test_fw *fw = &t->fw[idx]; in nd_intel_test_finish_query()
397 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_query()
568 static int nfit_test_cmd_ars_start(struct nfit_test *t, in nfit_test_cmd_ars_start() argument
583 post_ars_status(ars_state, &t->badrange, ars_start->address, in nfit_test_cmd_ars_start()
614 static int nfit_test_cmd_clear_error(struct nfit_test *t, in nfit_test_cmd_clear_error() argument
625 badrange_forget(&t->badrange, clear_err->address, clear_err->length); in nfit_test_cmd_clear_error()
818 struct nfit_test *t = container_of(work, typeof(*t), work); in uc_error_notify() local
820 __acpi_nfit_notify(&t->pdev.dev, t, NFIT_NOTIFY_UC_MEMORY_ERROR); in uc_error_notify()
823 static int nfit_test_cmd_ars_error_inject(struct nfit_test *t, in nfit_test_cmd_ars_error_inject() argument
838 rc = badrange_add(&t->badrange, err_inj->err_inj_spa_range_base, in nfit_test_cmd_ars_error_inject()
844 queue_work(nfit_wq, &t->work); in nfit_test_cmd_ars_error_inject()
854 static int nfit_test_cmd_ars_inject_clear(struct nfit_test *t, in nfit_test_cmd_ars_inject_clear() argument
869 badrange_forget(&t->badrange, err_clr->err_inj_clr_spa_range_base, in nfit_test_cmd_ars_inject_clear()
880 static int nfit_test_cmd_ars_inject_status(struct nfit_test *t, in nfit_test_cmd_ars_inject_status() argument
889 spin_lock(&t->badrange.lock); in nfit_test_cmd_ars_inject_status()
890 list_for_each_entry(be, &t->badrange.list, list) { in nfit_test_cmd_ars_inject_status()
897 spin_unlock(&t->badrange.lock); in nfit_test_cmd_ars_inject_status()
903 static int nd_intel_test_cmd_set_lss_status(struct nfit_test *t, in nd_intel_test_cmd_set_lss_status() argument
906 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_set_lss_status()
942 static int nd_intel_test_cmd_security_status(struct nfit_test *t, in nd_intel_test_cmd_security_status() argument
946 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_security_status()
957 static int nd_intel_test_cmd_unlock_unit(struct nfit_test *t, in nd_intel_test_cmd_unlock_unit() argument
961 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_unlock_unit()
983 static int nd_intel_test_cmd_set_pass(struct nfit_test *t, in nd_intel_test_cmd_set_pass() argument
987 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_set_pass()
1008 static int nd_intel_test_cmd_freeze_lock(struct nfit_test *t, in nd_intel_test_cmd_freeze_lock() argument
1012 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_freeze_lock()
1027 static int nd_intel_test_cmd_disable_pass(struct nfit_test *t, in nd_intel_test_cmd_disable_pass() argument
1031 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_disable_pass()
1051 static int nd_intel_test_cmd_secure_erase(struct nfit_test *t, in nd_intel_test_cmd_secure_erase() argument
1055 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_secure_erase()
1082 static int nd_intel_test_cmd_overwrite(struct nfit_test *t, in nd_intel_test_cmd_overwrite() argument
1086 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_overwrite()
1105 static int nd_intel_test_cmd_query_overwrite(struct nfit_test *t, in nd_intel_test_cmd_query_overwrite() argument
1109 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_query_overwrite()
1128 static int nd_intel_test_cmd_master_set_pass(struct nfit_test *t, in nd_intel_test_cmd_master_set_pass() argument
1132 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_master_set_pass()
1155 static int nd_intel_test_cmd_master_secure_erase(struct nfit_test *t, in nd_intel_test_cmd_master_secure_erase() argument
1159 struct device *dev = &t->pdev.dev; in nd_intel_test_cmd_master_secure_erase()
1185 static int nvdimm_bus_intel_fw_activate_businfo(struct nfit_test *t, in nvdimm_bus_intel_fw_activate_businfo() argument
1194 struct nfit_test_fw *fw = &t->fw[i]; in nvdimm_bus_intel_fw_activate_businfo()
1227 static int nvdimm_bus_intel_fw_activate(struct nfit_test *t, in nvdimm_bus_intel_fw_activate() argument
1235 nvdimm_bus_intel_fw_activate_businfo(t, &info, sizeof(info)); in nvdimm_bus_intel_fw_activate()
1243 dev_dbg(&t->pdev.dev, "status: %d\n", status); in nvdimm_bus_intel_fw_activate()
1250 struct nfit_test_fw *fw = &t->fw[i]; in nvdimm_bus_intel_fw_activate()
1265 static int nd_intel_test_cmd_fw_activate_dimminfo(struct nfit_test *t, in nd_intel_test_cmd_fw_activate_dimminfo() argument
1270 struct nfit_test_fw *fw = &t->fw[dimm]; in nd_intel_test_cmd_fw_activate_dimminfo()
1273 nvdimm_bus_intel_fw_activate_businfo(t, &info, sizeof(info)); in nd_intel_test_cmd_fw_activate_dimminfo()
1301 static int nd_intel_test_cmd_fw_activate_arm(struct nfit_test *t, in nd_intel_test_cmd_fw_activate_arm() argument
1305 struct nfit_test_fw *fw = &t->fw[dimm]; in nd_intel_test_cmd_fw_activate_arm()
1329 struct nfit_test *t = container_of(acpi_desc, typeof(*t), acpi_desc); in nfit_ctl_dbg() local
1341 dev_dbg(&t->pdev.dev, "%s family: %d cmd: %d: func: %d input length: %d\n", in nfit_ctl_dbg()
1353 struct nfit_test *t = container_of(acpi_desc, typeof(*t), acpi_desc); in nfit_test_ctl() local
1383 dev_WARN_ONCE(&t->pdev.dev, 1, in nfit_test_ctl()
1390 rc = nd_intel_test_cmd_security_status(t, in nfit_test_ctl()
1394 rc = nd_intel_test_cmd_unlock_unit(t, in nfit_test_ctl()
1398 rc = nd_intel_test_cmd_set_pass(t, in nfit_test_ctl()
1402 rc = nd_intel_test_cmd_disable_pass(t, in nfit_test_ctl()
1406 rc = nd_intel_test_cmd_freeze_lock(t, in nfit_test_ctl()
1410 rc = nd_intel_test_cmd_secure_erase(t, in nfit_test_ctl()
1414 rc = nd_intel_test_cmd_overwrite(t, in nfit_test_ctl()
1418 rc = nd_intel_test_cmd_query_overwrite(t, in nfit_test_ctl()
1422 rc = nd_intel_test_cmd_master_set_pass(t, in nfit_test_ctl()
1426 rc = nd_intel_test_cmd_master_secure_erase(t, in nfit_test_ctl()
1431 t, buf, buf_len, i); in nfit_test_ctl()
1435 t, buf, buf_len, i); in nfit_test_ctl()
1438 rc = nd_intel_test_cmd_set_lss_status(t, in nfit_test_ctl()
1442 rc = nd_intel_test_get_fw_info(t, buf, in nfit_test_ctl()
1446 rc = nd_intel_test_start_update(t, buf, in nfit_test_ctl()
1450 rc = nd_intel_test_send_data(t, buf, in nfit_test_ctl()
1454 rc = nd_intel_test_finish_fw(t, buf, in nfit_test_ctl()
1458 rc = nd_intel_test_finish_query(t, buf, in nfit_test_ctl()
1463 &t->smart[i]); in nfit_test_ctl()
1468 &t->smart_threshold[i]); in nfit_test_ctl()
1473 &t->smart_threshold[i], in nfit_test_ctl()
1474 &t->smart[i], in nfit_test_ctl()
1475 &t->pdev.dev, t->dimm_dev[i]); in nfit_test_ctl()
1480 &t->smart_threshold[i], in nfit_test_ctl()
1481 &t->smart[i], in nfit_test_ctl()
1482 &t->pdev.dev, t->dimm_dev[i]); in nfit_test_ctl()
1504 t->label[i - t->dcr_idx]); in nfit_test_ctl()
1508 t->label[i - t->dcr_idx]); in nfit_test_ctl()
1515 struct ars_state *ars_state = &t->ars_state; in nfit_test_ctl()
1533 rc = nfit_test_cmd_ars_error_inject(t, buf, in nfit_test_ctl()
1537 rc = nfit_test_cmd_ars_inject_clear(t, buf, in nfit_test_ctl()
1541 rc = nfit_test_cmd_ars_inject_status(t, buf, in nfit_test_ctl()
1555 rc = nvdimm_bus_intel_fw_activate_businfo(t, in nfit_test_ctl()
1559 rc = nvdimm_bus_intel_fw_activate(t, buf, in nfit_test_ctl()
1576 rc = nfit_test_cmd_ars_start(t, ars_state, buf, in nfit_test_ctl()
1584 rc = nfit_test_cmd_clear_error(t, buf, buf_len, cmd_rc); in nfit_test_ctl()
1612 static void *__test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma, in __test_alloc() argument
1615 struct device *dev = &t->pdev.dev; in __test_alloc()
1635 list_add(&nfit_res->list, &t->resources); in __test_alloc()
1648 static void *test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma) in test_alloc() argument
1660 return __test_alloc(t, size, dma, buf); in test_alloc()
1669 struct nfit_test *t = instances[i]; in nfit_test_lookup() local
1671 if (!t) in nfit_test_lookup()
1674 list_for_each_entry(n, &t->resources, list) { in nfit_test_lookup()
1707 struct nfit_test *t = data; in put_dimms() local
1710 for (i = 0; i < t->num_dcr; i++) in put_dimms()
1711 if (t->dimm_dev[i]) in put_dimms()
1712 device_unregister(t->dimm_dev[i]); in put_dimms()
1826 static int nfit_test_dimm_init(struct nfit_test *t) in nfit_test_dimm_init() argument
1830 if (devm_add_action_or_reset(&t->pdev.dev, put_dimms, t)) in nfit_test_dimm_init()
1832 for (i = 0; i < t->num_dcr; i++) { in nfit_test_dimm_init()
1833 t->dimm_dev[i] = device_create_with_groups(nfit_test_dimm, in nfit_test_dimm_init()
1834 &t->pdev.dev, 0, NULL, in nfit_test_dimm_init()
1836 "test_dimm%d", i + t->dcr_idx); in nfit_test_dimm_init()
1837 if (!t->dimm_dev[i]) in nfit_test_dimm_init()
1843 static void nfit_security_init(struct nfit_test *t) in nfit_security_init() argument
1847 for (i = 0; i < t->num_dcr; i++) { in nfit_security_init()
1854 static void smart_init(struct nfit_test *t) in smart_init() argument
1865 for (i = 0; i < t->num_dcr; i++) { in smart_init()
1866 memcpy(&t->smart[i], &smart_def, sizeof(smart_def)); in smart_init()
1867 memcpy(&t->smart_threshold[i], &smart_t_data, in smart_init()
1878 static int nfit_test0_alloc(struct nfit_test *t) in nfit_test0_alloc() argument
1892 t->nfit_buf = test_alloc(t, nfit_size, &t->nfit_dma); in nfit_test0_alloc()
1893 if (!t->nfit_buf) in nfit_test0_alloc()
1895 t->nfit_size = nfit_size; in nfit_test0_alloc()
1897 t->spa_set[0] = test_alloc(t, SPA0_SIZE, &t->spa_set_dma[0]); in nfit_test0_alloc()
1898 if (!t->spa_set[0]) in nfit_test0_alloc()
1901 t->spa_set[1] = test_alloc(t, SPA1_SIZE, &t->spa_set_dma[1]); in nfit_test0_alloc()
1902 if (!t->spa_set[1]) in nfit_test0_alloc()
1905 t->spa_set[2] = test_alloc(t, SPA0_SIZE, &t->spa_set_dma[2]); in nfit_test0_alloc()
1906 if (!t->spa_set[2]) in nfit_test0_alloc()
1909 for (i = 0; i < t->num_dcr; i++) { in nfit_test0_alloc()
1910 t->dimm[i] = test_alloc(t, DIMM_SIZE, &t->dimm_dma[i]); in nfit_test0_alloc()
1911 if (!t->dimm[i]) in nfit_test0_alloc()
1914 t->label[i] = test_alloc(t, LABEL_SIZE, &t->label_dma[i]); in nfit_test0_alloc()
1915 if (!t->label[i]) in nfit_test0_alloc()
1917 sprintf(t->label[i], "label%d", i); in nfit_test0_alloc()
1919 t->flush[i] = test_alloc(t, max(PAGE_SIZE, in nfit_test0_alloc()
1921 &t->flush_dma[i]); in nfit_test0_alloc()
1922 if (!t->flush[i]) in nfit_test0_alloc()
1926 for (i = 0; i < t->num_dcr; i++) { in nfit_test0_alloc()
1927 t->dcr[i] = test_alloc(t, LABEL_SIZE, &t->dcr_dma[i]); in nfit_test0_alloc()
1928 if (!t->dcr[i]) in nfit_test0_alloc()
1932 t->_fit = test_alloc(t, sizeof(union acpi_object **), &t->_fit_dma); in nfit_test0_alloc()
1933 if (!t->_fit) in nfit_test0_alloc()
1936 if (nfit_test_dimm_init(t)) in nfit_test0_alloc()
1938 smart_init(t); in nfit_test0_alloc()
1939 nfit_security_init(t); in nfit_test0_alloc()
1940 return ars_state_init(&t->pdev.dev, &t->ars_state); in nfit_test0_alloc()
1943 static int nfit_test1_alloc(struct nfit_test *t) in nfit_test1_alloc() argument
1951 t->nfit_buf = test_alloc(t, nfit_size, &t->nfit_dma); in nfit_test1_alloc()
1952 if (!t->nfit_buf) in nfit_test1_alloc()
1954 t->nfit_size = nfit_size; in nfit_test1_alloc()
1956 t->spa_set[0] = test_alloc(t, SPA2_SIZE, &t->spa_set_dma[0]); in nfit_test1_alloc()
1957 if (!t->spa_set[0]) in nfit_test1_alloc()
1960 for (i = 0; i < t->num_dcr; i++) { in nfit_test1_alloc()
1961 t->label[i] = test_alloc(t, LABEL_SIZE, &t->label_dma[i]); in nfit_test1_alloc()
1962 if (!t->label[i]) in nfit_test1_alloc()
1964 sprintf(t->label[i], "label%d", i); in nfit_test1_alloc()
1967 t->spa_set[1] = test_alloc(t, SPA_VCD_SIZE, &t->spa_set_dma[1]); in nfit_test1_alloc()
1968 if (!t->spa_set[1]) in nfit_test1_alloc()
1971 if (nfit_test_dimm_init(t)) in nfit_test1_alloc()
1973 smart_init(t); in nfit_test1_alloc()
1974 return ars_state_init(&t->pdev.dev, &t->ars_state); in nfit_test1_alloc()
1987 static void nfit_test0_setup(struct nfit_test *t) in nfit_test0_setup() argument
1993 void *nfit_buf = t->nfit_buf; in nfit_test0_setup()
2012 spa->address = t->spa_set_dma[0]; in nfit_test0_setup()
2026 spa->address = t->spa_set_dma[1]; in nfit_test0_setup()
2036 spa->address = t->dcr_dma[0]; in nfit_test0_setup()
2046 spa->address = t->dcr_dma[1]; in nfit_test0_setup()
2056 spa->address = t->dcr_dma[2]; in nfit_test0_setup()
2066 spa->address = t->dcr_dma[3]; in nfit_test0_setup()
2076 spa->address = t->dimm_dma[0]; in nfit_test0_setup()
2086 spa->address = t->dimm_dma[1]; in nfit_test0_setup()
2096 spa->address = t->dimm_dma[2]; in nfit_test0_setup()
2106 spa->address = t->dimm_dma[3]; in nfit_test0_setup()
2505 flush->hint_address[i] = t->flush_dma[0] + i * sizeof(u64); in nfit_test0_setup()
2515 flush->hint_address[i] = t->flush_dma[1] + i * sizeof(u64); in nfit_test0_setup()
2525 flush->hint_address[i] = t->flush_dma[2] + i * sizeof(u64); in nfit_test0_setup()
2535 flush->hint_address[i] = t->flush_dma[3] + i * sizeof(u64); in nfit_test0_setup()
2546 if (t->setup_hotplug) { in nfit_test0_setup()
2593 spa->address = t->dcr_dma[4]; in nfit_test0_setup()
2607 spa->address = t->spa_set_dma[2]; in nfit_test0_setup()
2617 spa->address = t->dimm_dma[4]; in nfit_test0_setup()
2677 flush->hint_address[i] = t->flush_dma[4] in nfit_test0_setup()
2682 WARN_ON(offset != t->nfit_size); in nfit_test0_setup()
2685 t->nfit_filled = offset; in nfit_test0_setup()
2687 post_ars_status(&t->ars_state, &t->badrange, t->spa_set_dma[0], in nfit_test0_setup()
2690 acpi_desc = &t->acpi_desc; in nfit_test0_setup()
2735 static void nfit_test1_setup(struct nfit_test *t) in nfit_test1_setup() argument
2738 void *nfit_buf = t->nfit_buf; in nfit_test1_setup()
2751 spa->address = t->spa_set_dma[0]; in nfit_test1_setup()
2761 spa->address = t->spa_set_dma[1]; in nfit_test1_setup()
2825 WARN_ON(offset != t->nfit_size); in nfit_test1_setup()
2827 t->nfit_filled = offset; in nfit_test1_setup()
2829 post_ars_status(&t->ars_state, &t->badrange, t->spa_set_dma[0], in nfit_test1_setup()
2832 acpi_desc = &t->acpi_desc; in nfit_test1_setup()