• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/edac/

Lines Matching defs:mci

62 	debugf4("\tcsrow->mci = %p\n\n", csrow->mci);
65 static void edac_mc_dump_mci(struct mem_ctl_info *mci)
67 debugf3("\tmci = %p\n", mci);
68 debugf3("\tmci->mtype_cap = %lx\n", mci->mtype_cap);
69 debugf3("\tmci->edac_ctl_cap = %lx\n", mci->edac_ctl_cap);
70 debugf3("\tmci->edac_cap = %lx\n", mci->edac_cap);
71 debugf4("\tmci->edac_check = %p\n", mci->edac_check);
73 mci->nr_csrows, mci->csrows);
74 debugf3("\tdev = %p\n", mci->dev);
75 debugf3("\tmod_name:ctl_name = %s:%s\n", mci->mod_name, mci->ctl_name);
76 debugf3("\tpvt_info = %p\n\n", mci->pvt_info);
158 struct mem_ctl_info *mci;
171 mci = (struct mem_ctl_info *)0;
172 csi = edac_align_ptr(&mci[1], sizeof(*csi));
177 mci = kzalloc(size, GFP_KERNEL);
178 if (mci == NULL)
184 csi = (struct csrow_info *)(((char *)mci) + ((unsigned long)csi));
185 chi = (struct channel_info *)(((char *)mci) + ((unsigned long)chi));
186 pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL;
189 mci->mc_idx = edac_index;
190 mci->csrows = csi;
191 mci->pvt_info = pvt;
192 mci->nr_csrows = nr_csrows;
197 csrow->mci = mci;
209 mci->op_state = OP_ALLOC;
214 err = edac_mc_register_sysfs_main_kobj(mci);
216 kfree(mci);
226 return mci;
232 * 'Free' a previously allocated 'mci' structure
233 * @mci: pointer to a struct mem_ctl_info structure
235 void edac_mc_free(struct mem_ctl_info *mci)
237 edac_mc_unregister_sysfs_main_kobj(mci);
250 struct mem_ctl_info *mci;
256 mci = list_entry(item, struct mem_ctl_info, link);
258 if (mci->dev == dev)
259 return mci;
288 struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work);
293 if (mci->op_state == OP_OFFLINE) {
299 if (edac_mc_assert_error_check_and_clear() && (mci->edac_check != NULL))
300 mci->edac_check(mci);
305 queue_delayed_work(edac_workqueue, &mci->work,
311 * initialize a workq item for this mci
318 static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
323 if (mci->op_state != OP_RUNNING_POLL)
326 INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
327 queue_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec));
332 * stop the workq processing on this mci
338 static void edac_mc_workq_teardown(struct mem_ctl_info *mci)
342 if (mci->op_state != OP_RUNNING_POLL)
345 status = cancel_delayed_work(&mci->work);
363 struct mem_ctl_info *mci;
371 mci = list_entry(item, struct mem_ctl_info, link);
373 if (mci->op_state == OP_RUNNING_POLL)
374 cancel_delayed_work(&mci->work);
384 mci = list_entry(item, struct mem_ctl_info, link);
386 edac_mc_workq_setup(mci, (unsigned long) value);
396 * assign a unique value to mci->mc_idx.
402 static int add_mc_to_global_list(struct mem_ctl_info *mci)
409 p = find_mci_by_dev(mci->dev);
416 if (p->mc_idx >= mci->mc_idx) {
417 if (unlikely(p->mc_idx == mci->mc_idx))
425 list_add_tail_rcu(&mci->link, insert_before);
432 edac_dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx);
444 struct mem_ctl_info *mci;
446 mci = container_of(head, struct mem_ctl_info, rcu);
447 INIT_LIST_HEAD(&mci->link);
450 static void del_mc_from_global_list(struct mem_ctl_info *mci)
453 list_del_rcu(&mci->link);
454 call_rcu(&mci->rcu, complete_mc_list_del);
469 struct mem_ctl_info *mci;
472 mci = list_entry(item, struct mem_ctl_info, link);
474 if (mci->mc_idx >= idx) {
475 if (mci->mc_idx == idx)
476 return mci;
487 * edac_mc_add_mc: Insert the 'mci' structure into the mci global list and
488 * create sysfs entries associated with mci structure
489 * @mci: pointer to the mci structure to be added to the list
490 * @mc_idx: A unique numeric identifier to be assigned to the 'mci' structure.
497 int edac_mc_add_mc(struct mem_ctl_info *mci)
503 edac_mc_dump_mci(mci);
508 for (i = 0; i < mci->nr_csrows; i++) {
511 edac_mc_dump_csrow(&mci->csrows[i]);
512 for (j = 0; j < mci->csrows[i].nr_channels; j++)
513 edac_mc_dump_channel(&mci->csrows[i].
520 if (add_mc_to_global_list(mci))
524 mci->start_time = jiffies;
526 if (edac_create_sysfs_mci_device(mci)) {
527 edac_mc_printk(mci, KERN_WARNING,
533 if (mci->edac_check != NULL) {
535 mci->op_state = OP_RUNNING_POLL;
537 edac_mc_workq_setup(mci, edac_mc_get_poll_msec());
539 mci->op_state = OP_RUNNING_INTERRUPT;
543 edac_mc_printk(mci, KERN_INFO, "Giving out device to '%s' '%s':"
544 " DEV %s\n", mci->mod_name, mci->ctl_name, edac_dev_name(mci));
550 del_mc_from_global_list(mci);
559 * edac_mc_del_mc: Remove sysfs entries for specified mci structure and
560 * remove mci structure from global list
561 * @pdev: Pointer to 'struct device' representing mci structure to remove.
563 * Return pointer to removed mci structure, or NULL if device not found.
567 struct mem_ctl_info *mci;
573 /* find the requested mci struct in the global list */
574 mci = find_mci_by_dev(dev);
575 if (mci == NULL) {
580 del_mc_from_global_list(mci);
584 edac_mc_workq_teardown(mci);
587 mci->op_state = OP_OFFLINE;
590 edac_remove_sysfs_mci_device(mci);
593 "Removed device %d for %s %s: DEV %s\n", mci->mc_idx,
594 mci->mod_name, mci->ctl_name, edac_dev_name(mci));
596 return mci;
631 int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
633 struct csrow_info *csrows = mci->csrows;
636 debugf1("MC%d: %s(): 0x%lx\n", mci->mc_idx, __func__, page);
639 for (i = 0; i < mci->nr_csrows; i++) {
646 "mask(0x%lx)\n", mci->mc_idx, __func__,
660 edac_mc_printk(mci, KERN_ERR,
668 void edac_mc_handle_ce(struct mem_ctl_info *mci,
675 debugf3("MC%d: %s()\n", mci->mc_idx, __func__);
677 if (row >= mci->nr_csrows || row < 0) {
679 edac_mc_printk(mci, KERN_ERR,
681 "(%d >= %d)\n", row, mci->nr_csrows);
682 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
686 if (channel >= mci->csrows[row].nr_channels || channel < 0) {
688 edac_mc_printk(mci, KERN_ERR,
691 mci->csrows[row].nr_channels);
692 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
697 edac_mc_printk(mci, KERN_WARNING,
701 mci->csrows[row].grain, syndrome, row, channel,
702 mci->csrows[row].channels[channel].label, msg);
704 mci->ce_count++;
705 mci->csrows[row].ce_count++;
706 mci->csrows[row].channels[channel].ce_count++;
708 if (mci->scrub_mode & SCRUB_SW_SRC) {
718 remapped_page = mci->ctl_page_to_phys ?
719 mci->ctl_page_to_phys(mci, page_frame_number) :
723 mci->csrows[row].grain);
728 void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
731 edac_mc_printk(mci, KERN_WARNING,
734 mci->ce_noinfo_count++;
735 mci->ce_count++;
739 void edac_mc_handle_ue(struct mem_ctl_info *mci,
749 debugf3("MC%d: %s()\n", mci->mc_idx, __func__);
751 if (row >= mci->nr_csrows || row < 0) {
753 edac_mc_printk(mci, KERN_ERR,
755 "(%d >= %d)\n", row, mci->nr_csrows);
756 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
761 mci->csrows[row].channels[0].label);
765 for (chan = 1; (chan < mci->csrows[row].nr_channels) && (len > 0);
768 mci->csrows[row].channels[chan].label);
774 edac_mc_printk(mci, KERN_EMERG,
777 offset_in_page, mci->csrows[row].grain, row,
782 "row %d, labels \"%s\": %s\n", mci->mc_idx,
784 mci->csrows[row].grain, row, labels, msg);
786 mci->ue_count++;
787 mci->csrows[row].ue_count++;
791 void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
794 panic("EDAC MC%d: Uncorrected Error", mci->mc_idx);
797 edac_mc_printk(mci, KERN_WARNING,
799 mci->ue_noinfo_count++;
800 mci->ue_count++;
808 void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
818 if (csrow >= mci->nr_csrows) {
820 edac_mc_printk(mci, KERN_ERR,
822 csrow, mci->nr_csrows);
823 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
827 if (channela >= mci->csrows[csrow].nr_channels) {
829 edac_mc_printk(mci, KERN_ERR,
832 channela, mci->csrows[csrow].nr_channels);
833 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
837 if (channelb >= mci->csrows[csrow].nr_channels) {
839 edac_mc_printk(mci, KERN_ERR,
842 channelb, mci->csrows[csrow].nr_channels);
843 edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR");
847 mci->ue_count++;
848 mci->csrows[csrow].ue_count++;
852 mci->csrows[csrow].channels[channela].label);
856 mci->csrows[csrow].channels[channelb].label);
859 edac_mc_printk(mci, KERN_EMERG,
875 void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
880 if (csrow >= mci->nr_csrows) {
882 edac_mc_printk(mci, KERN_ERR,
884 csrow, mci->nr_csrows);
885 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
888 if (channel >= mci->csrows[csrow].nr_channels) {
890 edac_mc_printk(mci, KERN_ERR,
892 channel, mci->csrows[csrow].nr_channels);
893 edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR");
898 edac_mc_printk(mci, KERN_WARNING,
901 mci->csrows[csrow].channels[channel].label, msg);
903 mci->ce_count++;
904 mci->csrows[csrow].ce_count++;
905 mci->csrows[csrow].channels[channel].ce_count++;