Lines Matching full:mci
410 * Nothing to do, just unregister sysfs here. The mci in csrow_release()
426 static int edac_create_csrow_object(struct mem_ctl_info *mci, in edac_create_csrow_object() argument
435 csrow->dev.parent = &mci->dev; in edac_create_csrow_object()
436 csrow->mci = mci; in edac_create_csrow_object()
453 static int edac_create_csrow_objects(struct mem_ctl_info *mci) in edac_create_csrow_objects() argument
458 for (i = 0; i < mci->nr_csrows; i++) { in edac_create_csrow_objects()
459 csrow = mci->csrows[i]; in edac_create_csrow_objects()
462 err = edac_create_csrow_object(mci, mci->csrows[i], i); in edac_create_csrow_objects()
470 if (device_is_registered(&mci->csrows[i]->dev)) in edac_create_csrow_objects()
471 device_unregister(&mci->csrows[i]->dev); in edac_create_csrow_objects()
477 static void edac_delete_csrow_objects(struct mem_ctl_info *mci) in edac_delete_csrow_objects() argument
481 for (i = 0; i < mci->nr_csrows; i++) { in edac_delete_csrow_objects()
482 if (device_is_registered(&mci->csrows[i]->dev)) in edac_delete_csrow_objects()
483 device_unregister(&mci->csrows[i]->dev); in edac_delete_csrow_objects()
634 * Nothing to do, just unregister sysfs here. The mci in dimm_release()
640 static int edac_create_dimm_object(struct mem_ctl_info *mci, in edac_create_dimm_object() argument
644 dimm->mci = mci; in edac_create_dimm_object()
650 dimm->dev.parent = &mci->dev; in edac_create_dimm_object()
651 if (mci->csbased) in edac_create_dimm_object()
656 pm_runtime_forbid(&mci->dev); in edac_create_dimm_object()
686 struct mem_ctl_info *mci = to_mci(dev); in mci_reset_counters_store() local
690 mci->ue_mc = 0; in mci_reset_counters_store()
691 mci->ce_mc = 0; in mci_reset_counters_store()
692 mci->ue_noinfo_count = 0; in mci_reset_counters_store()
693 mci->ce_noinfo_count = 0; in mci_reset_counters_store()
695 for (row = 0; row < mci->nr_csrows; row++) { in mci_reset_counters_store()
696 struct csrow_info *ri = mci->csrows[row]; in mci_reset_counters_store()
705 mci_for_each_dimm(mci, dimm) { in mci_reset_counters_store()
710 mci->start_time = jiffies; in mci_reset_counters_store()
727 struct mem_ctl_info *mci = to_mci(dev); in mci_sdram_scrub_rate_store() local
734 new_bw = mci->set_sdram_scrub_rate(mci, bandwidth); in mci_sdram_scrub_rate_store()
751 struct mem_ctl_info *mci = to_mci(dev); in mci_sdram_scrub_rate_show() local
754 bandwidth = mci->get_sdram_scrub_rate(mci); in mci_sdram_scrub_rate_show()
763 /* default attribute files for the MCI object */
768 struct mem_ctl_info *mci = to_mci(dev); in mci_ue_count_show() local
770 return sysfs_emit(data, "%u\n", mci->ue_mc); in mci_ue_count_show()
777 struct mem_ctl_info *mci = to_mci(dev); in mci_ce_count_show() local
779 return sysfs_emit(data, "%u\n", mci->ce_mc); in mci_ce_count_show()
786 struct mem_ctl_info *mci = to_mci(dev); in mci_ce_noinfo_show() local
788 return sysfs_emit(data, "%u\n", mci->ce_noinfo_count); in mci_ce_noinfo_show()
795 struct mem_ctl_info *mci = to_mci(dev); in mci_ue_noinfo_show() local
797 return sysfs_emit(data, "%u\n", mci->ue_noinfo_count); in mci_ue_noinfo_show()
804 struct mem_ctl_info *mci = to_mci(dev); in mci_seconds_show() local
806 return sysfs_emit(data, "%ld\n", (jiffies - mci->start_time) / HZ); in mci_seconds_show()
813 struct mem_ctl_info *mci = to_mci(dev); in mci_ctl_name_show() local
815 return sysfs_emit(data, "%s\n", mci->ctl_name); in mci_ctl_name_show()
822 struct mem_ctl_info *mci = to_mci(dev); in mci_size_mb_show() local
825 for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) { in mci_size_mb_show()
826 struct csrow_info *csrow = mci->csrows[csrow_idx]; in mci_size_mb_show()
842 struct mem_ctl_info *mci = to_mci(dev); in mci_max_location_show() local
847 for (i = 0; i < mci->n_layers; i++) { in mci_max_location_show()
849 edac_layer_name[mci->layers[i].type], in mci_max_location_show()
850 mci->layers[i].size - 1); in mci_max_location_show()
898 struct mem_ctl_info *mci = to_mci(dev); in mci_attr_is_visible() local
903 if (mci->get_sdram_scrub_rate) in mci_attr_is_visible()
905 if (mci->set_sdram_scrub_rate) in mci_attr_is_visible()
932 int edac_create_sysfs_mci_device(struct mem_ctl_info *mci, in edac_create_sysfs_mci_device() argument
939 mci->dev.type = &mci_attr_type; in edac_create_sysfs_mci_device()
940 mci->dev.parent = mci_pdev; in edac_create_sysfs_mci_device()
941 mci->dev.groups = groups; in edac_create_sysfs_mci_device()
942 dev_set_name(&mci->dev, "mc%d", mci->mc_idx); in edac_create_sysfs_mci_device()
943 dev_set_drvdata(&mci->dev, mci); in edac_create_sysfs_mci_device()
944 pm_runtime_forbid(&mci->dev); in edac_create_sysfs_mci_device()
946 err = device_add(&mci->dev); in edac_create_sysfs_mci_device()
948 edac_dbg(1, "failure: create device %s\n", dev_name(&mci->dev)); in edac_create_sysfs_mci_device()
949 /* no put_device() here, free mci with _edac_mc_free() */ in edac_create_sysfs_mci_device()
953 edac_dbg(0, "device %s created\n", dev_name(&mci->dev)); in edac_create_sysfs_mci_device()
958 mci_for_each_dimm(mci, dimm) { in edac_create_sysfs_mci_device()
963 err = edac_create_dimm_object(mci, dimm); in edac_create_sysfs_mci_device()
969 err = edac_create_csrow_objects(mci); in edac_create_sysfs_mci_device()
974 edac_create_debugfs_nodes(mci); in edac_create_sysfs_mci_device()
978 edac_remove_sysfs_mci_device(mci); in edac_create_sysfs_mci_device()
986 void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) in edac_remove_sysfs_mci_device() argument
990 if (!device_is_registered(&mci->dev)) in edac_remove_sysfs_mci_device()
996 edac_debugfs_remove_recursive(mci->debugfs); in edac_remove_sysfs_mci_device()
999 edac_delete_csrow_objects(mci); in edac_remove_sysfs_mci_device()
1002 mci_for_each_dimm(mci, dimm) { in edac_remove_sysfs_mci_device()
1009 /* only remove the device, but keep mci */ in edac_remove_sysfs_mci_device()
1010 device_del(&mci->dev); in edac_remove_sysfs_mci_device()
1016 * There's no container structure here, as this is just the mci in mc_attr_release()