Lines Matching full:pci
20 static int check_pci_errors; /* default NO check PCI parity */
21 static int edac_pci_panic_on_pe; /* default NO panic on PCI Parity */
22 static int edac_pci_log_pe = 1; /* log PCI parity errors */
23 static int edac_pci_log_npe = 1; /* log PCI non-parity error errors */
58 /**************************** EDAC PCI sysfs instance *******************/
59 static ssize_t instance_pe_count_show(struct edac_pci_ctl_info *pci, char *data) in instance_pe_count_show() argument
61 return sprintf(data, "%u\n", atomic_read(&pci->counters.pe_count)); in instance_pe_count_show()
64 static ssize_t instance_npe_count_show(struct edac_pci_ctl_info *pci, in instance_npe_count_show() argument
67 return sprintf(data, "%u\n", atomic_read(&pci->counters.npe_count)); in instance_npe_count_show()
76 struct edac_pci_ctl_info *pci; in edac_pci_instance_release() local
80 /* Form pointer to containing struct, the pci control struct */ in edac_pci_instance_release()
81 pci = to_instance(kobj); in edac_pci_instance_release()
86 kfree(pci); /* Free the control struct */ in edac_pci_instance_release()
100 struct edac_pci_ctl_info *pci = to_instance(kobj); in edac_pci_instance_show() local
104 return instance_attr->show(pci, buffer); in edac_pci_instance_show()
113 struct edac_pci_ctl_info *pci = to_instance(kobj); in edac_pci_instance_store() local
117 return instance_attr->store(pci, buffer, count); in edac_pci_instance_store()
137 /* pci instance attributes */
144 /* the ktype for a pci instance */
154 * construct one EDAC PCI instance's kobject for use
156 static int edac_pci_create_instance_kobj(struct edac_pci_ctl_info *pci, int idx) in edac_pci_create_instance_kobj() argument
164 * track the number of PCI instances we have, and thus nest in edac_pci_create_instance_kobj()
174 err = kobject_init_and_add(&pci->kobj, &ktype_pci_instance, in edac_pci_create_instance_kobj()
175 edac_pci_top_main_kobj, "pci%d", idx); in edac_pci_create_instance_kobj()
177 edac_dbg(2, "failed to register instance pci%d\n", idx); in edac_pci_create_instance_kobj()
182 kobject_uevent(&pci->kobj, KOBJ_ADD); in edac_pci_create_instance_kobj()
183 edac_dbg(1, "Register instance 'pci%d' kobject\n", idx); in edac_pci_create_instance_kobj()
195 * unregister the kobj for the EDAC PCI instance
198 struct edac_pci_ctl_info *pci) in edac_pci_unregister_sysfs_instance_kobj() argument
206 kobject_put(&pci->kobj); in edac_pci_unregister_sysfs_instance_kobj()
209 /***************************** EDAC PCI sysfs root **********************/
237 /* Set of show/store abstract level functions for PCI Parity object */
282 /* PCI Parity control files */
311 * This kobj is the 'main' kobject that EDAC PCI instances
320 /* last reference to top EDAC PCI kobject has been removed, in edac_pci_release_main_kobj()
326 /* ktype struct for the EDAC PCI main kobj */
334 * edac_pci_main_kobj_setup: Setup the sysfs for EDAC PCI attributes.
354 * level main kobj for EDAC PCI in edac_pci_main_kobj_setup()
369 /* Instanstiate the pci object */ in edac_pci_main_kobj_setup()
372 &edac_subsys->dev_root->kobj, "pci"); in edac_pci_main_kobj_setup()
374 edac_dbg(1, "Failed to register '.../edac/pci'\n"); in edac_pci_main_kobj_setup()
379 * for EDAC PCI, then edac_pci_main_kobj_teardown() in edac_pci_main_kobj_setup()
383 edac_dbg(1, "Registered '.../edac/pci' kobject\n"); in edac_pci_main_kobj_setup()
404 * if no longer linked (needed) remove the top level EDAC PCI
421 int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci) in edac_pci_create_sysfs() argument
424 struct kobject *edac_kobj = &pci->kobj; in edac_pci_create_sysfs()
426 edac_dbg(0, "idx=%d\n", pci->pci_idx); in edac_pci_create_sysfs()
428 /* create the top main EDAC PCI kobject, IF needed */ in edac_pci_create_sysfs()
434 err = edac_pci_create_instance_kobj(pci, pci->pci_idx); in edac_pci_create_sysfs()
438 err = sysfs_create_link(edac_kobj, &pci->dev->kobj, EDAC_PCI_SYMLINK); in edac_pci_create_sysfs()
448 edac_pci_unregister_sysfs_instance_kobj(pci); in edac_pci_create_sysfs()
456 void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci) in edac_pci_remove_sysfs() argument
458 edac_dbg(0, "index=%d\n", pci->pci_idx); in edac_pci_remove_sysfs()
461 sysfs_remove_link(&pci->kobj, EDAC_PCI_SYMLINK); in edac_pci_remove_sysfs()
463 /* remove this PCI instance's sysfs entries */ in edac_pci_remove_sysfs()
464 edac_pci_unregister_sysfs_instance_kobj(pci); in edac_pci_remove_sysfs()
467 * if this 'pci' is the last instance. in edac_pci_remove_sysfs()
474 /************************ PCI error handling *************************/
484 * pulled but the Linux PCI layer has not yet finished cleaning up. in get_pci_parity_status()
508 /* Clear any PCI parity errors logged by this device. */
523 * PCI Parity polling
546 edac_dbg(4, "PCI STATUS= 0x%04x %s\n", status, dev_name(&dev->dev)); in edac_pci_dev_parity_test()
577 edac_dbg(4, "PCI HEADER TYPE= 0x%02x %s\n", in edac_pci_dev_parity_test()
584 edac_dbg(4, "PCI SEC_STATUS= 0x%04x %s\n", in edac_pci_dev_parity_test()
623 * Scan the PCI device list looking for SERRORs, Master Parity ERRORS or
637 * performs the actual PCI parity check operation
645 /* if policy has PCI check off, leave now */ in edac_pci_do_parity_check()
651 /* scan all PCI devices looking for a Parity Error on devices and in edac_pci_do_parity_check()
658 /* Only if operator has selected panic on PCI Error */ in edac_pci_do_parity_check()
662 panic("EDAC: PCI Parity Error"); in edac_pci_do_parity_check()
669 * function to perform an iteration over the PCI devices
674 /* Clear any PCI bus parity errors that devices initially have logged in edac_pci_clear_parity_errors()
685 void edac_pci_handle_pe(struct edac_pci_ctl_info *pci, const char *msg) in edac_pci_handle_pe() argument
689 atomic_inc(&pci->counters.pe_count); in edac_pci_handle_pe()
692 edac_pci_printk(pci, KERN_WARNING, in edac_pci_handle_pe()
694 pci->ctl_name, pci->pci_idx, msg); in edac_pci_handle_pe()
697 * poke all PCI devices and see which one is the troublemaker in edac_pci_handle_pe()
710 void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg) in edac_pci_handle_npe() argument
714 atomic_inc(&pci->counters.npe_count); in edac_pci_handle_npe()
717 edac_pci_printk(pci, KERN_WARNING, in edac_pci_handle_npe()
719 pci->ctl_name, pci->pci_idx, msg); in edac_pci_handle_npe()
722 * poke all PCI devices and see which one is the troublemaker in edac_pci_handle_npe()
730 * Define the PCI parameter to the module
734 "Check for PCI bus parity errors: 0=off 1=on");
737 "Panic on PCI Bus Parity error: 0=off 1=on");