Lines Matching refs:mci
427 static int edac_create_csrow_object(struct mem_ctl_info *mci, in edac_create_csrow_object() argument
436 csrow->dev.parent = &mci->dev; in edac_create_csrow_object()
437 csrow->mci = mci; in edac_create_csrow_object()
454 static int edac_create_csrow_objects(struct mem_ctl_info *mci) in edac_create_csrow_objects() argument
459 for (i = 0; i < mci->nr_csrows; i++) { in edac_create_csrow_objects()
460 csrow = mci->csrows[i]; in edac_create_csrow_objects()
463 err = edac_create_csrow_object(mci, mci->csrows[i], i); in edac_create_csrow_objects()
471 if (device_is_registered(&mci->csrows[i]->dev)) in edac_create_csrow_objects()
472 device_unregister(&mci->csrows[i]->dev); in edac_create_csrow_objects()
478 static void edac_delete_csrow_objects(struct mem_ctl_info *mci) in edac_delete_csrow_objects() argument
482 for (i = 0; i < mci->nr_csrows; i++) { in edac_delete_csrow_objects()
483 if (device_is_registered(&mci->csrows[i]->dev)) in edac_delete_csrow_objects()
484 device_unregister(&mci->csrows[i]->dev); in edac_delete_csrow_objects()
641 static int edac_create_dimm_object(struct mem_ctl_info *mci, in edac_create_dimm_object() argument
645 dimm->mci = mci; in edac_create_dimm_object()
651 dimm->dev.parent = &mci->dev; in edac_create_dimm_object()
652 if (mci->csbased) in edac_create_dimm_object()
657 pm_runtime_forbid(&mci->dev); in edac_create_dimm_object()
687 struct mem_ctl_info *mci = to_mci(dev); in mci_reset_counters_store() local
691 mci->ue_mc = 0; in mci_reset_counters_store()
692 mci->ce_mc = 0; in mci_reset_counters_store()
693 mci->ue_noinfo_count = 0; in mci_reset_counters_store()
694 mci->ce_noinfo_count = 0; in mci_reset_counters_store()
696 for (row = 0; row < mci->nr_csrows; row++) { in mci_reset_counters_store()
697 struct csrow_info *ri = mci->csrows[row]; in mci_reset_counters_store()
706 mci_for_each_dimm(mci, dimm) { in mci_reset_counters_store()
711 mci->start_time = jiffies; in mci_reset_counters_store()
728 struct mem_ctl_info *mci = to_mci(dev); in mci_sdram_scrub_rate_store() local
735 new_bw = mci->set_sdram_scrub_rate(mci, bandwidth); in mci_sdram_scrub_rate_store()
752 struct mem_ctl_info *mci = to_mci(dev); in mci_sdram_scrub_rate_show() local
755 bandwidth = mci->get_sdram_scrub_rate(mci); in mci_sdram_scrub_rate_show()
769 struct mem_ctl_info *mci = to_mci(dev); in mci_ue_count_show() local
771 return sprintf(data, "%u\n", mci->ue_mc); in mci_ue_count_show()
778 struct mem_ctl_info *mci = to_mci(dev); in mci_ce_count_show() local
780 return sprintf(data, "%u\n", mci->ce_mc); in mci_ce_count_show()
787 struct mem_ctl_info *mci = to_mci(dev); in mci_ce_noinfo_show() local
789 return sprintf(data, "%u\n", mci->ce_noinfo_count); in mci_ce_noinfo_show()
796 struct mem_ctl_info *mci = to_mci(dev); in mci_ue_noinfo_show() local
798 return sprintf(data, "%u\n", mci->ue_noinfo_count); in mci_ue_noinfo_show()
805 struct mem_ctl_info *mci = to_mci(dev); in mci_seconds_show() local
807 return sprintf(data, "%ld\n", (jiffies - mci->start_time) / HZ); in mci_seconds_show()
814 struct mem_ctl_info *mci = to_mci(dev); in mci_ctl_name_show() local
816 return sprintf(data, "%s\n", mci->ctl_name); in mci_ctl_name_show()
823 struct mem_ctl_info *mci = to_mci(dev); in mci_size_mb_show() local
826 for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) { in mci_size_mb_show()
827 struct csrow_info *csrow = mci->csrows[csrow_idx]; in mci_size_mb_show()
843 struct mem_ctl_info *mci = to_mci(dev); in mci_max_location_show() local
848 for (i = 0; i < mci->n_layers; i++) { in mci_max_location_show()
850 edac_layer_name[mci->layers[i].type], in mci_max_location_show()
851 mci->layers[i].size - 1); in mci_max_location_show()
899 struct mem_ctl_info *mci = to_mci(dev); in mci_attr_is_visible() local
904 if (mci->get_sdram_scrub_rate) in mci_attr_is_visible()
906 if (mci->set_sdram_scrub_rate) in mci_attr_is_visible()
933 int edac_create_sysfs_mci_device(struct mem_ctl_info *mci, in edac_create_sysfs_mci_device() argument
940 mci->dev.type = &mci_attr_type; in edac_create_sysfs_mci_device()
941 mci->dev.parent = mci_pdev; in edac_create_sysfs_mci_device()
942 mci->dev.groups = groups; in edac_create_sysfs_mci_device()
943 dev_set_name(&mci->dev, "mc%d", mci->mc_idx); in edac_create_sysfs_mci_device()
944 dev_set_drvdata(&mci->dev, mci); in edac_create_sysfs_mci_device()
945 pm_runtime_forbid(&mci->dev); in edac_create_sysfs_mci_device()
947 err = device_add(&mci->dev); in edac_create_sysfs_mci_device()
949 edac_dbg(1, "failure: create device %s\n", dev_name(&mci->dev)); in edac_create_sysfs_mci_device()
954 edac_dbg(0, "device %s created\n", dev_name(&mci->dev)); in edac_create_sysfs_mci_device()
959 mci_for_each_dimm(mci, dimm) { in edac_create_sysfs_mci_device()
964 err = edac_create_dimm_object(mci, dimm); in edac_create_sysfs_mci_device()
970 err = edac_create_csrow_objects(mci); in edac_create_sysfs_mci_device()
975 edac_create_debugfs_nodes(mci); in edac_create_sysfs_mci_device()
979 edac_remove_sysfs_mci_device(mci); in edac_create_sysfs_mci_device()
987 void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) in edac_remove_sysfs_mci_device() argument
991 if (!device_is_registered(&mci->dev)) in edac_remove_sysfs_mci_device()
997 edac_debugfs_remove_recursive(mci->debugfs); in edac_remove_sysfs_mci_device()
1000 edac_delete_csrow_objects(mci); in edac_remove_sysfs_mci_device()
1003 mci_for_each_dimm(mci, dimm) { in edac_remove_sysfs_mci_device()
1011 device_del(&mci->dev); in edac_remove_sysfs_mci_device()