/** * aer_isr_one_error - consume an error detected by root port * @p_device: pointer to error root port service device * @e_src: pointer to an error source */ static void aer_isr_one_error(struct pcie_device *p_device, struct aer_err_source *e_src) { struct aer_err_info *e_info; /* struct aer_err_info might be big, so we allocate it with slab */ e_info = kmalloc(sizeof(struct aer_err_info), GFP_KERNEL); if (!e_info) { #ifdef CONFIG_DEBUG_PRINTK dev_printk(KERN_DEBUG, &p_device->port->dev, "Can't allocate mem when processing AER errors\n"); #else dev_; #endif return; } /* * There is a possibility that both correctable error and * uncorrectable error being logged. Report correctable error first. */ if (e_src->status & PCI_ERR_ROOT_COR_RCV) { e_info->id = ERR_COR_ID(e_src->id); e_info->severity = AER_CORRECTABLE; if (e_src->status & PCI_ERR_ROOT_MULTI_COR_RCV) e_info->multi_error_valid = 1; else e_info->multi_error_valid = 0; aer_print_port_info(p_device->port, e_info); if (find_source_device(p_device->port, e_info)) aer_process_err_devices(p_device, e_info); } if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) { e_info->id = ERR_UNCOR_ID(e_src->id); if (e_src->status & PCI_ERR_ROOT_FATAL_RCV) e_info->severity = AER_FATAL; else e_info->severity = AER_NONFATAL; if (e_src->status & PCI_ERR_ROOT_MULTI_UNCOR_RCV) e_info->multi_error_valid = 1; else e_info->multi_error_valid = 0; aer_print_port_info(p_device->port, e_info); if (find_source_device(p_device->port, e_info)) aer_process_err_devices(p_device, e_info); } kfree(e_info); }
/** * aer_isr_one_error - consume an error detected by root port * @p_device: pointer to error root port service device * @e_src: pointer to an error source */ static void aer_isr_one_error(struct pcie_device *p_device, struct aer_err_source *e_src) { struct aer_err_info *e_info; int i; /* struct aer_err_info might be big, so we allocate it with slab */ e_info = kmalloc(sizeof(struct aer_err_info), GFP_KERNEL); if (e_info == NULL) { dev_printk(KERN_DEBUG, &p_device->port->dev, "Can't allocate mem when processing AER errors\n"); return; } /* * There is a possibility that both correctable error and * uncorrectable error being logged. Report correctable error first. */ for (i = 1; i & ROOT_ERR_STATUS_MASKS ; i <<= 2) { if (i > 4) break; if (!(e_src->status & i)) continue; memset(e_info, 0, sizeof(struct aer_err_info)); /* Init comprehensive error information */ if (i & PCI_ERR_ROOT_COR_RCV) { e_info->id = ERR_COR_ID(e_src->id); e_info->severity = AER_CORRECTABLE; } else { e_info->id = ERR_UNCOR_ID(e_src->id); e_info->severity = ((e_src->status >> 6) & 1); } if (e_src->status & (PCI_ERR_ROOT_MULTI_COR_RCV | PCI_ERR_ROOT_MULTI_UNCOR_RCV)) e_info->multi_error_valid = 1; aer_print_port_info(p_device->port, e_info); find_source_device(p_device->port, e_info); aer_process_err_devices(p_device, e_info); } kfree(e_info); }
static void aer_isr_one_error(struct pcie_device *p_device, struct aer_err_source *e_src) { struct aer_err_info *e_info; int i; e_info = kmalloc(sizeof(struct aer_err_info), GFP_KERNEL); if (e_info == NULL) { dev_printk(KERN_DEBUG, &p_device->port->dev, "Can't allocate mem when processing AER errors\n"); return; } for (i = 1; i & ROOT_ERR_STATUS_MASKS ; i <<= 2) { if (i > 4) break; if (!(e_src->status & i)) continue; memset(e_info, 0, sizeof(struct aer_err_info)); if (i & PCI_ERR_ROOT_COR_RCV) { e_info->id = ERR_COR_ID(e_src->id); e_info->severity = AER_CORRECTABLE; } else { e_info->id = ERR_UNCOR_ID(e_src->id); e_info->severity = ((e_src->status >> 6) & 1); } if (e_src->status & (PCI_ERR_ROOT_MULTI_COR_RCV | PCI_ERR_ROOT_MULTI_UNCOR_RCV)) e_info->multi_error_valid = 1; aer_print_port_info(p_device->port, e_info); find_source_device(p_device->port, e_info); aer_process_err_devices(p_device, e_info); } kfree(e_info); }
/** * aer_isr_one_error - consume an error detected by root port * @p_device: pointer to error root port service device * @e_src: pointer to an error source **/ static void aer_isr_one_error(struct pcie_device *p_device, struct aer_err_source *e_src) { struct device *s_device; struct aer_err_info e_info = {0, 0, 0,}; int i; u16 id; /* * There is a possibility that both correctable error and * uncorrectable error being logged. Report correctable error first. */ for (i = 1; i & ROOT_ERR_STATUS_MASKS ; i <<= 2) { if (i > 4) break; if (!(e_src->status & i)) continue; /* Init comprehensive error information */ if (i & PCI_ERR_ROOT_COR_RCV) { id = ERR_COR_ID(e_src->id); e_info.severity = AER_CORRECTABLE; } else { id = ERR_UNCOR_ID(e_src->id); e_info.severity = ((e_src->status >> 6) & 1); } if (e_src->status & (PCI_ERR_ROOT_MULTI_COR_RCV | PCI_ERR_ROOT_MULTI_UNCOR_RCV)) e_info.flags |= AER_MULTI_ERROR_VALID_FLAG; if (!(s_device = find_source_device(p_device->port, id))) { printk(KERN_DEBUG "%s->can't find device of ID%04x\n", __FUNCTION__, id); continue; } if (get_device_error_info(to_pci_dev(s_device), &e_info) == AER_SUCCESS) { aer_print_error(to_pci_dev(s_device), &e_info); handle_error_source(p_device, to_pci_dev(s_device), e_info); } } }