/** * zpci_report_status - Report the status of operations on a PCI device * @zdev: The PCI device for which to report status * @operation: A string representing the operation reported * @status: A string representing the status of the operation * * This function creates a human readable report about an operation such as * PCI device recovery and forwards this to the platform using the SCLP Write * Event Data mechanism. Besides the operation and status strings the report * also contains additional information about the device deemed useful for * debug such as the currently bound device driver, if any, and error state. * Additionally a string representation of pci_debug_msg_id, or as much as fits, * is also included. * * Return: 0 on success an error code < 0 otherwise.
*/ int zpci_report_status(struct zpci_dev *zdev, constchar *operation, constchar *status)
{ struct zpci_report_error *report; struct pci_driver *driver = NULL; struct pci_dev *pdev = NULL; char *buf, *end; int ret;
if (!zdev || !zdev->zbus) return -ENODEV;
/* Protected virtualization hosts get nothing from us */ if (prot_virt_guest) return -ENODATA;
report = (void *)get_zeroed_page(GFP_KERNEL); if (!report) return -ENOMEM; if (zdev->zbus->bus)
pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); if (pdev)
driver = to_pci_driver(pdev->dev.driver);
buf = report->data.log_data;
end = report->data.log_data + ZPCI_REPORT_DATA_SIZE;
buf += scnprintf(buf, end - buf, "report: %s\n", operation);
buf += scnprintf(buf, end - buf, "status: %s\n", status);
buf += scnprintf(buf, end - buf, "state: %s\n",
(pdev) ? zpci_state_str(pdev->error_state) : "n/a");
buf += scnprintf(buf, end - buf, "driver: %s\n", (driver) ? driver->name : "n/a");
ret = debug_dump(pci_debug_msg_id, &debug_log_view, buf, end - buf, true); if (ret < 0)
pr_err("Reading PCI debug messages failed with code %d\n", ret); else
buf += ret;
ret = sclp_pci_report(&report->header, zdev->fh, zdev->fid); if (ret)
pr_err("Reporting PCI status failed with code %d\n", ret); else
pr_info("Reported PCI device status\n");
free_page((unsignedlong)report);
return ret;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.