diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-12-12 11:48:32 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-12-16 08:37:54 -0500 |
commit | aa3b7c296732b4351dfdbfe70be6b38a0882be14 (patch) | |
tree | c05230a7a6b82675a8b704cae62ed2af3bf8b19f | |
parent | 99c64b6679c41d8238b154c1a462724d7101765c (diff) |
s390/pci: prevent inadvertently triggered bus scans
Initialization and scanning of the pci bus is omitted on older
machines without pci support or if pci=off was specified. Remember
the fact that we ran without pci support and prevent further bus
scans during resume from hibernate or after receiving hotplug
notifications.
Reported-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/pci.h | 1 | ||||
-rw-r--r-- | arch/s390/pci/pci.c | 10 | ||||
-rw-r--r-- | arch/s390/pci/pci_event.c | 18 |
3 files changed, 24 insertions, 5 deletions
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index c129ab2ac731..2583466f576b 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h | |||
@@ -144,6 +144,7 @@ int clp_disable_fh(struct zpci_dev *); | |||
144 | void zpci_event_error(void *); | 144 | void zpci_event_error(void *); |
145 | void zpci_event_availability(void *); | 145 | void zpci_event_availability(void *); |
146 | void zpci_rescan(void); | 146 | void zpci_rescan(void); |
147 | bool zpci_is_enabled(void); | ||
147 | #else /* CONFIG_PCI */ | 148 | #else /* CONFIG_PCI */ |
148 | static inline void zpci_event_error(void *e) {} | 149 | static inline void zpci_event_error(void *e) {} |
149 | static inline void zpci_event_availability(void *e) {} | 150 | static inline void zpci_event_availability(void *e) {} |
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index bf7c73d71eef..e3265b50f3ae 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c | |||
@@ -920,6 +920,7 @@ static void zpci_mem_exit(void) | |||
920 | } | 920 | } |
921 | 921 | ||
922 | static unsigned int s390_pci_probe; | 922 | static unsigned int s390_pci_probe; |
923 | static unsigned int s390_pci_initialized; | ||
923 | 924 | ||
924 | char * __init pcibios_setup(char *str) | 925 | char * __init pcibios_setup(char *str) |
925 | { | 926 | { |
@@ -930,6 +931,11 @@ char * __init pcibios_setup(char *str) | |||
930 | return str; | 931 | return str; |
931 | } | 932 | } |
932 | 933 | ||
934 | bool zpci_is_enabled(void) | ||
935 | { | ||
936 | return s390_pci_initialized; | ||
937 | } | ||
938 | |||
933 | static int __init pci_base_init(void) | 939 | static int __init pci_base_init(void) |
934 | { | 940 | { |
935 | int rc; | 941 | int rc; |
@@ -961,6 +967,7 @@ static int __init pci_base_init(void) | |||
961 | if (rc) | 967 | if (rc) |
962 | goto out_find; | 968 | goto out_find; |
963 | 969 | ||
970 | s390_pci_initialized = 1; | ||
964 | return 0; | 971 | return 0; |
965 | 972 | ||
966 | out_find: | 973 | out_find: |
@@ -978,5 +985,6 @@ subsys_initcall_sync(pci_base_init); | |||
978 | 985 | ||
979 | void zpci_rescan(void) | 986 | void zpci_rescan(void) |
980 | { | 987 | { |
981 | clp_rescan_pci_devices_simple(); | 988 | if (zpci_is_enabled()) |
989 | clp_rescan_pci_devices_simple(); | ||
982 | } | 990 | } |
diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c index 800f064b0da7..228787a3630a 100644 --- a/arch/s390/pci/pci_event.c +++ b/arch/s390/pci/pci_event.c | |||
@@ -43,9 +43,8 @@ struct zpci_ccdf_avail { | |||
43 | u16 pec; /* PCI event code */ | 43 | u16 pec; /* PCI event code */ |
44 | } __packed; | 44 | } __packed; |
45 | 45 | ||
46 | void zpci_event_error(void *data) | 46 | static void __zpci_event_error(struct zpci_ccdf_err *ccdf) |
47 | { | 47 | { |
48 | struct zpci_ccdf_err *ccdf = data; | ||
49 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); | 48 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); |
50 | 49 | ||
51 | zpci_err("error CCDF:\n"); | 50 | zpci_err("error CCDF:\n"); |
@@ -58,9 +57,14 @@ void zpci_event_error(void *data) | |||
58 | pci_name(zdev->pdev), ccdf->pec, ccdf->fid); | 57 | pci_name(zdev->pdev), ccdf->pec, ccdf->fid); |
59 | } | 58 | } |
60 | 59 | ||
61 | void zpci_event_availability(void *data) | 60 | void zpci_event_error(void *data) |
61 | { | ||
62 | if (zpci_is_enabled()) | ||
63 | __zpci_event_error(data); | ||
64 | } | ||
65 | |||
66 | static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) | ||
62 | { | 67 | { |
63 | struct zpci_ccdf_avail *ccdf = data; | ||
64 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); | 68 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); |
65 | struct pci_dev *pdev = zdev ? zdev->pdev : NULL; | 69 | struct pci_dev *pdev = zdev ? zdev->pdev : NULL; |
66 | int ret; | 70 | int ret; |
@@ -115,3 +119,9 @@ void zpci_event_availability(void *data) | |||
115 | break; | 119 | break; |
116 | } | 120 | } |
117 | } | 121 | } |
122 | |||
123 | void zpci_event_availability(void *data) | ||
124 | { | ||
125 | if (zpci_is_enabled()) | ||
126 | __zpci_event_availability(data); | ||
127 | } | ||