Commit bd3a1725 authored by Martin Schwidefsky's avatar Martin Schwidefsky

s390/pci: add zpci_report_error interface

The 'report_error' interface for PCI devices found on s390 can be
used by a user space program to inject an adapter error notification.
Add a new kernel interface zpci_report_error to allow a PCI device
driver to inject these error notifications without a detour over
user space.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 6c295885
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <asm-generic/pci.h> #include <asm-generic/pci.h>
#include <asm/pci_clp.h> #include <asm/pci_clp.h>
#include <asm/pci_debug.h> #include <asm/pci_debug.h>
#include <asm/sclp.h>
#define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000 #define PCIBIOS_MIN_MEM 0x10000000
...@@ -216,6 +217,9 @@ void zpci_debug_init_device(struct zpci_dev *, const char *); ...@@ -216,6 +217,9 @@ void zpci_debug_init_device(struct zpci_dev *, const char *);
void zpci_debug_exit_device(struct zpci_dev *); void zpci_debug_exit_device(struct zpci_dev *);
void zpci_debug_info(struct zpci_dev *, struct seq_file *); void zpci_debug_info(struct zpci_dev *, struct seq_file *);
/* Error reporting */
int zpci_report_error(struct pci_dev *, struct zpci_report_error_header *);
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
/* Returns the node based on PCI bus */ /* Returns the node based on PCI bus */
......
...@@ -854,6 +854,15 @@ void zpci_stop_device(struct zpci_dev *zdev) ...@@ -854,6 +854,15 @@ void zpci_stop_device(struct zpci_dev *zdev)
} }
EXPORT_SYMBOL_GPL(zpci_stop_device); EXPORT_SYMBOL_GPL(zpci_stop_device);
int zpci_report_error(struct pci_dev *pdev,
struct zpci_report_error_header *report)
{
struct zpci_dev *zdev = to_zpci(pdev);
return sclp_pci_report(report, zdev->fh, zdev->fid);
}
EXPORT_SYMBOL(zpci_report_error);
static inline int barsize(u8 size) static inline int barsize(u8 size)
{ {
return (size) ? (1 << size) >> 10 : 0; return (size) ? (1 << size) >> 10 : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment