aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/appldata/appldata_mem.c18
-rw-r--r--arch/s390/appldata/appldata_net_sum.c18
-rw-r--r--arch/s390/hypfs/hypfs_diag.c8
-rw-r--r--arch/s390/include/asm/airq.h15
-rw-r--r--arch/s390/include/asm/dma-mapping.h2
-rw-r--r--arch/s390/include/asm/facility.h17
-rw-r--r--arch/s390/include/asm/io.h22
-rw-r--r--arch/s390/include/asm/pci.h2
-rw-r--r--arch/s390/include/asm/pgalloc.h3
-rw-r--r--arch/s390/include/asm/ptrace.h1
-rw-r--r--arch/s390/include/uapi/asm/Kbuild1
-rw-r--r--arch/s390/include/uapi/asm/chsc.h13
-rw-r--r--arch/s390/include/uapi/asm/dasd.h4
-rw-r--r--arch/s390/include/uapi/asm/sclp_ctl.h24
-rw-r--r--arch/s390/kernel/asm-offsets.c1
-rw-r--r--arch/s390/kernel/entry.S12
-rw-r--r--arch/s390/kernel/entry.h2
-rw-r--r--arch/s390/kernel/entry64.S16
-rw-r--r--arch/s390/kernel/irq.c8
-rw-r--r--arch/s390/kernel/smp.c5
-rw-r--r--arch/s390/mm/pgtable.c48
-rw-r--r--arch/s390/oprofile/hwsampler.h4
-rw-r--r--arch/s390/pci/pci.c83
-rw-r--r--arch/s390/pci/pci_clp.c1
-rw-r--r--arch/s390/pci/pci_debug.c29
-rw-r--r--arch/s390/pci/pci_dma.c6
-rw-r--r--arch/s390/pci/pci_sysfs.c20
27 files changed, 228 insertions, 155 deletions
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index 7ef60b52d6e0..42be53743133 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -32,7 +32,7 @@
32 * book: 32 * book:
33 * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml 33 * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
34 */ 34 */
35static struct appldata_mem_data { 35struct appldata_mem_data {
36 u64 timestamp; 36 u64 timestamp;
37 u32 sync_count_1; /* after VM collected the record data, */ 37 u32 sync_count_1; /* after VM collected the record data, */
38 u32 sync_count_2; /* sync_count_1 and sync_count_2 should be the 38 u32 sync_count_2; /* sync_count_1 and sync_count_2 should be the
@@ -63,7 +63,7 @@ static struct appldata_mem_data {
63 u64 pgmajfault; /* page faults (major only) */ 63 u64 pgmajfault; /* page faults (major only) */
64// <-- New in 2.6 64// <-- New in 2.6
65 65
66} __attribute__((packed)) appldata_mem_data; 66} __packed;
67 67
68 68
69/* 69/*
@@ -118,7 +118,6 @@ static struct appldata_ops ops = {
118 .record_nr = APPLDATA_RECORD_MEM_ID, 118 .record_nr = APPLDATA_RECORD_MEM_ID,
119 .size = sizeof(struct appldata_mem_data), 119 .size = sizeof(struct appldata_mem_data),
120 .callback = &appldata_get_mem_data, 120 .callback = &appldata_get_mem_data,
121 .data = &appldata_mem_data,
122 .owner = THIS_MODULE, 121 .owner = THIS_MODULE,
123 .mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */ 122 .mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */
124}; 123};
@@ -131,7 +130,17 @@ static struct appldata_ops ops = {
131 */ 130 */
132static int __init appldata_mem_init(void) 131static int __init appldata_mem_init(void)
133{ 132{
134 return appldata_register_ops(&ops); 133 int ret;
134
135 ops.data = kzalloc(sizeof(struct appldata_mem_data), GFP_KERNEL);
136 if (!ops.data)
137 return -ENOMEM;
138
139 ret = appldata_register_ops(&ops);
140 if (ret)
141 kfree(ops.data);
142
143 return ret;
135} 144}
136 145
137/* 146/*
@@ -142,6 +151,7 @@ static int __init appldata_mem_init(void)
142static void __exit appldata_mem_exit(void) 151static void __exit appldata_mem_exit(void)
143{ 152{
144 appldata_unregister_ops(&ops); 153 appldata_unregister_ops(&ops);
154 kfree(ops.data);
145} 155}
146 156
147 157
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index 2d224b945355..66037d2622b4 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -29,7 +29,7 @@
29 * book: 29 * book:
30 * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml 30 * http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
31 */ 31 */
32static struct appldata_net_sum_data { 32struct appldata_net_sum_data {
33 u64 timestamp; 33 u64 timestamp;
34 u32 sync_count_1; /* after VM collected the record data, */ 34 u32 sync_count_1; /* after VM collected the record data, */
35 u32 sync_count_2; /* sync_count_1 and sync_count_2 should be the 35 u32 sync_count_2; /* sync_count_1 and sync_count_2 should be the
@@ -51,7 +51,7 @@ static struct appldata_net_sum_data {
51 u64 rx_dropped; /* no space in linux buffers */ 51 u64 rx_dropped; /* no space in linux buffers */
52 u64 tx_dropped; /* no space available in linux */ 52 u64 tx_dropped; /* no space available in linux */
53 u64 collisions; /* collisions while transmitting */ 53 u64 collisions; /* collisions while transmitting */
54} __attribute__((packed)) appldata_net_sum_data; 54} __packed;
55 55
56 56
57/* 57/*
@@ -121,7 +121,6 @@ static struct appldata_ops ops = {
121 .record_nr = APPLDATA_RECORD_NET_SUM_ID, 121 .record_nr = APPLDATA_RECORD_NET_SUM_ID,
122 .size = sizeof(struct appldata_net_sum_data), 122 .size = sizeof(struct appldata_net_sum_data),
123 .callback = &appldata_get_net_sum_data, 123 .callback = &appldata_get_net_sum_data,
124 .data = &appldata_net_sum_data,
125 .owner = THIS_MODULE, 124 .owner = THIS_MODULE,
126 .mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */ 125 .mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */
127}; 126};
@@ -134,7 +133,17 @@ static struct appldata_ops ops = {
134 */ 133 */
135static int __init appldata_net_init(void) 134static int __init appldata_net_init(void)
136{ 135{
137 return appldata_register_ops(&ops); 136 int ret;
137
138 ops.data = kzalloc(sizeof(struct appldata_net_sum_data), GFP_KERNEL);
139 if (!ops.data)
140 return -ENOMEM;
141
142 ret = appldata_register_ops(&ops);
143 if (ret)
144 kfree(ops.data);
145
146 return ret;
138} 147}
139 148
140/* 149/*
@@ -145,6 +154,7 @@ static int __init appldata_net_init(void)
145static void __exit appldata_net_exit(void) 154static void __exit appldata_net_exit(void)
146{ 155{
147 appldata_unregister_ops(&ops); 156 appldata_unregister_ops(&ops);
157 kfree(ops.data);
148} 158}
149 159
150 160
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 7fd3690b6760..138893e5f736 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -651,9 +651,7 @@ static int hypfs_create_cpu_files(struct super_block *sb,
651 } 651 }
652 diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer); 652 diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer);
653 rc = hypfs_create_str(sb, cpu_dir, "type", buffer); 653 rc = hypfs_create_str(sb, cpu_dir, "type", buffer);
654 if (IS_ERR(rc)) 654 return PTR_RET(rc);
655 return PTR_ERR(rc);
656 return 0;
657} 655}
658 656
659static void *hypfs_create_lpar_files(struct super_block *sb, 657static void *hypfs_create_lpar_files(struct super_block *sb,
@@ -702,9 +700,7 @@ static int hypfs_create_phys_cpu_files(struct super_block *sb,
702 return PTR_ERR(rc); 700 return PTR_ERR(rc);
703 diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer); 701 diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer);
704 rc = hypfs_create_str(sb, cpu_dir, "type", buffer); 702 rc = hypfs_create_str(sb, cpu_dir, "type", buffer);
705 if (IS_ERR(rc)) 703 return PTR_RET(rc);
706 return PTR_ERR(rc);
707 return 0;
708} 704}
709 705
710static void *hypfs_create_phys_files(struct super_block *sb, 706static void *hypfs_create_phys_files(struct super_block *sb,
diff --git a/arch/s390/include/asm/airq.h b/arch/s390/include/asm/airq.h
index 9819891ed7a2..4066cee0c2d2 100644
--- a/arch/s390/include/asm/airq.h
+++ b/arch/s390/include/asm/airq.h
@@ -9,9 +9,18 @@
9#ifndef _ASM_S390_AIRQ_H 9#ifndef _ASM_S390_AIRQ_H
10#define _ASM_S390_AIRQ_H 10#define _ASM_S390_AIRQ_H
11 11
12typedef void (*adapter_int_handler_t)(void *, void *); 12struct airq_struct {
13 struct hlist_node list; /* Handler queueing. */
14 void (*handler)(struct airq_struct *); /* Thin-interrupt handler */
15 u8 *lsi_ptr; /* Local-Summary-Indicator pointer */
16 u8 lsi_mask; /* Local-Summary-Indicator mask */
17 u8 isc; /* Interrupt-subclass */
18 u8 flags;
19};
13 20
14void *s390_register_adapter_interrupt(adapter_int_handler_t, void *, u8); 21#define AIRQ_PTR_ALLOCATED 0x01
15void s390_unregister_adapter_interrupt(void *, u8); 22
23int register_adapter_interrupt(struct airq_struct *airq);
24void unregister_adapter_interrupt(struct airq_struct *airq);
16 25
17#endif /* _ASM_S390_AIRQ_H */ 26#endif /* _ASM_S390_AIRQ_H */
diff --git a/arch/s390/include/asm/dma-mapping.h b/arch/s390/include/asm/dma-mapping.h
index 2f8c1abeb086..3fbc67d9e197 100644
--- a/arch/s390/include/asm/dma-mapping.h
+++ b/arch/s390/include/asm/dma-mapping.h
@@ -53,7 +53,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
53 debug_dma_mapping_error(dev, dma_addr); 53 debug_dma_mapping_error(dev, dma_addr);
54 if (dma_ops->mapping_error) 54 if (dma_ops->mapping_error)
55 return dma_ops->mapping_error(dev, dma_addr); 55 return dma_ops->mapping_error(dev, dma_addr);
56 return (dma_addr == DMA_ERROR_CODE); 56 return dma_addr == DMA_ERROR_CODE;
57} 57}
58 58
59static inline void *dma_alloc_coherent(struct device *dev, size_t size, 59static inline void *dma_alloc_coherent(struct device *dev, size_t size,
diff --git a/arch/s390/include/asm/facility.h b/arch/s390/include/asm/facility.h
index 2ee66a65f2d4..0aa6a7ed95a3 100644
--- a/arch/s390/include/asm/facility.h
+++ b/arch/s390/include/asm/facility.h
@@ -13,6 +13,16 @@
13 13
14#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */ 14#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
15 15
16static inline int __test_facility(unsigned long nr, void *facilities)
17{
18 unsigned char *ptr;
19
20 if (nr >= MAX_FACILITY_BIT)
21 return 0;
22 ptr = (unsigned char *) facilities + (nr >> 3);
23 return (*ptr & (0x80 >> (nr & 7))) != 0;
24}
25
16/* 26/*
17 * The test_facility function uses the bit odering where the MSB is bit 0. 27 * The test_facility function uses the bit odering where the MSB is bit 0.
18 * That makes it easier to query facility bits with the bit number as 28 * That makes it easier to query facility bits with the bit number as
@@ -20,12 +30,7 @@
20 */ 30 */
21static inline int test_facility(unsigned long nr) 31static inline int test_facility(unsigned long nr)
22{ 32{
23 unsigned char *ptr; 33 return __test_facility(nr, &S390_lowcore.stfle_fac_list);
24
25 if (nr >= MAX_FACILITY_BIT)
26 return 0;
27 ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
28 return (*ptr & (0x80 >> (nr & 7))) != 0;
29} 34}
30 35
31/** 36/**
diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index fd9be010f9b2..cd6b9ee7b69c 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -13,28 +13,6 @@
13#include <asm/page.h> 13#include <asm/page.h>
14#include <asm/pci_io.h> 14#include <asm/pci_io.h>
15 15
16/*
17 * Change virtual addresses to physical addresses and vv.
18 * These are pretty trivial
19 */
20static inline unsigned long virt_to_phys(volatile void * address)
21{
22 unsigned long real_address;
23 asm volatile(
24 " lra %0,0(%1)\n"
25 " jz 0f\n"
26 " la %0,0\n"
27 "0:"
28 : "=a" (real_address) : "a" (address) : "cc");
29 return real_address;
30}
31#define virt_to_phys virt_to_phys
32
33static inline void * phys_to_virt(unsigned long address)
34{
35 return (void *) address;
36}
37
38void *xlate_dev_mem_ptr(unsigned long phys); 16void *xlate_dev_mem_ptr(unsigned long phys);
39#define xlate_dev_mem_ptr xlate_dev_mem_ptr 17#define xlate_dev_mem_ptr xlate_dev_mem_ptr
40void unxlate_dev_mem_ptr(unsigned long phys, void *addr); 18void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
index 6c1801235db9..6e577ba0e5da 100644
--- a/arch/s390/include/asm/pci.h
+++ b/arch/s390/include/asm/pci.h
@@ -120,7 +120,6 @@ struct zpci_dev {
120 120
121 struct dentry *debugfs_dev; 121 struct dentry *debugfs_dev;
122 struct dentry *debugfs_perf; 122 struct dentry *debugfs_perf;
123 struct dentry *debugfs_debug;
124}; 123};
125 124
126struct pci_hp_callback_ops { 125struct pci_hp_callback_ops {
@@ -143,7 +142,6 @@ int zpci_enable_device(struct zpci_dev *);
143int zpci_disable_device(struct zpci_dev *); 142int zpci_disable_device(struct zpci_dev *);
144void zpci_stop_device(struct zpci_dev *); 143void zpci_stop_device(struct zpci_dev *);
145void zpci_free_device(struct zpci_dev *); 144void zpci_free_device(struct zpci_dev *);
146int zpci_scan_device(struct zpci_dev *);
147int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); 145int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64);
148int zpci_unregister_ioat(struct zpci_dev *, u8); 146int zpci_unregister_ioat(struct zpci_dev *, u8);
149 147
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index 590c3219c634..e1408ddb94f8 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -22,6 +22,9 @@ unsigned long *page_table_alloc(struct mm_struct *, unsigned long);
22void page_table_free(struct mm_struct *, unsigned long *); 22void page_table_free(struct mm_struct *, unsigned long *);
23void page_table_free_rcu(struct mmu_gather *, unsigned long *); 23void page_table_free_rcu(struct mmu_gather *, unsigned long *);
24 24
25int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
26 unsigned long key, bool nq);
27
25static inline void clear_table(unsigned long *s, unsigned long val, size_t n) 28static inline void clear_table(unsigned long *s, unsigned long val, size_t n)
26{ 29{
27 typedef struct { char _[n]; } addrtype; 30 typedef struct { char _[n]; } addrtype;
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index 559512a455da..52b56533c57c 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -24,6 +24,7 @@ struct pt_regs
24 unsigned long gprs[NUM_GPRS]; 24 unsigned long gprs[NUM_GPRS];
25 unsigned long orig_gpr2; 25 unsigned long orig_gpr2;
26 unsigned int int_code; 26 unsigned int int_code;
27 unsigned int int_parm;
27 unsigned long int_parm_long; 28 unsigned long int_parm_long;
28}; 29};
29 30
diff --git a/arch/s390/include/uapi/asm/Kbuild b/arch/s390/include/uapi/asm/Kbuild
index 9ccd1905bdad..6a9a9eb645f5 100644
--- a/arch/s390/include/uapi/asm/Kbuild
+++ b/arch/s390/include/uapi/asm/Kbuild
@@ -35,6 +35,7 @@ header-y += siginfo.h
35header-y += signal.h 35header-y += signal.h
36header-y += socket.h 36header-y += socket.h
37header-y += sockios.h 37header-y += sockios.h
38header-y += sclp_ctl.h
38header-y += stat.h 39header-y += stat.h
39header-y += statfs.h 40header-y += statfs.h
40header-y += swab.h 41header-y += swab.h
diff --git a/arch/s390/include/uapi/asm/chsc.h b/arch/s390/include/uapi/asm/chsc.h
index 1c6a7f85a581..65dc694725a8 100644
--- a/arch/s390/include/uapi/asm/chsc.h
+++ b/arch/s390/include/uapi/asm/chsc.h
@@ -29,6 +29,16 @@ struct chsc_async_area {
29 __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)]; 29 __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)];
30} __attribute__ ((packed)); 30} __attribute__ ((packed));
31 31
32struct chsc_header {
33 __u16 length;
34 __u16 code;
35} __attribute__ ((packed));
36
37struct chsc_sync_area {
38 struct chsc_header header;
39 __u8 data[CHSC_SIZE - sizeof(struct chsc_header)];
40} __attribute__ ((packed));
41
32struct chsc_response_struct { 42struct chsc_response_struct {
33 __u16 length; 43 __u16 length;
34 __u16 code; 44 __u16 code;
@@ -126,5 +136,8 @@ struct chsc_cpd_info {
126#define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list) 136#define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list)
127#define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info) 137#define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
128#define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal) 138#define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)
139#define CHSC_START_SYNC _IOWR(CHSC_IOCTL_MAGIC, 0x89, struct chsc_sync_area)
140#define CHSC_ON_CLOSE_SET _IOWR(CHSC_IOCTL_MAGIC, 0x8a, struct chsc_async_area)
141#define CHSC_ON_CLOSE_REMOVE _IO(CHSC_IOCTL_MAGIC, 0x8b)
129 142
130#endif 143#endif
diff --git a/arch/s390/include/uapi/asm/dasd.h b/arch/s390/include/uapi/asm/dasd.h
index 38eca3ba40e2..5812a3b2df9e 100644
--- a/arch/s390/include/uapi/asm/dasd.h
+++ b/arch/s390/include/uapi/asm/dasd.h
@@ -261,6 +261,10 @@ struct dasd_snid_ioctl_data {
261#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6) 261#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)
262/* Resume IO on device */ 262/* Resume IO on device */
263#define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7) 263#define BIODASDRESUME _IO(DASD_IOCTL_LETTER,7)
264/* Abort all I/O on a device */
265#define BIODASDABORTIO _IO(DASD_IOCTL_LETTER, 240)
266/* Allow I/O on a device */
267#define BIODASDALLOWIO _IO(DASD_IOCTL_LETTER, 241)
264 268
265 269
266/* retrieve API version number */ 270/* retrieve API version number */
diff --git a/arch/s390/include/uapi/asm/sclp_ctl.h b/arch/s390/include/uapi/asm/sclp_ctl.h
new file mode 100644
index 000000000000..f2818613ee41
--- /dev/null
+++ b/arch/s390/include/uapi/asm/sclp_ctl.h
@@ -0,0 +1,24 @@
1/*
2 * IOCTL interface for SCLP
3 *
4 * Copyright IBM Corp. 2012
5 *
6 * Author: Michael Holzheu <holzheu@linux.vnet.ibm.com>
7 */
8
9#ifndef _ASM_SCLP_CTL_H
10#define _ASM_SCLP_CTL_H
11
12#include <linux/types.h>
13
14struct sclp_ctl_sccb {
15 __u32 cmdw;
16 __u64 sccb;
17} __attribute__((packed));
18
19#define SCLP_CTL_IOCTL_MAGIC 0x10
20
21#define SCLP_CTL_SCCB \
22 _IOWR(SCLP_CTL_IOCTL_MAGIC, 0x10, struct sclp_ctl_sccb)
23
24#endif
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index 7a82f9f70100..d6de844bc30a 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -47,6 +47,7 @@ int main(void)
47 DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs)); 47 DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs));
48 DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2)); 48 DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2));
49 DEFINE(__PT_INT_CODE, offsetof(struct pt_regs, int_code)); 49 DEFINE(__PT_INT_CODE, offsetof(struct pt_regs, int_code));
50 DEFINE(__PT_INT_PARM, offsetof(struct pt_regs, int_parm));
50 DEFINE(__PT_INT_PARM_LONG, offsetof(struct pt_regs, int_parm_long)); 51 DEFINE(__PT_INT_PARM_LONG, offsetof(struct pt_regs, int_parm_long));
51 DEFINE(__PT_SIZE, sizeof(struct pt_regs)); 52 DEFINE(__PT_SIZE, sizeof(struct pt_regs));
52 BLANK(); 53 BLANK();
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 4d5e6f8a7978..be7a408be7a1 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -429,11 +429,19 @@ io_skip:
429 stm %r0,%r7,__PT_R0(%r11) 429 stm %r0,%r7,__PT_R0(%r11)
430 mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC 430 mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC
431 stm %r8,%r9,__PT_PSW(%r11) 431 stm %r8,%r9,__PT_PSW(%r11)
432 mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
432 TRACE_IRQS_OFF 433 TRACE_IRQS_OFF
433 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) 434 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15)
435io_loop:
434 l %r1,BASED(.Ldo_IRQ) 436 l %r1,BASED(.Ldo_IRQ)
435 lr %r2,%r11 # pass pointer to pt_regs 437 lr %r2,%r11 # pass pointer to pt_regs
436 basr %r14,%r1 # call do_IRQ 438 basr %r14,%r1 # call do_IRQ
439 tm __LC_MACHINE_FLAGS+2,0x10 # MACHINE_FLAG_LPAR
440 jz io_return
441 tpi 0
442 jz io_return
443 mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
444 j io_loop
437io_return: 445io_return:
438 LOCKDEP_SYS_EXIT 446 LOCKDEP_SYS_EXIT
439 TRACE_IRQS_ON 447 TRACE_IRQS_ON
@@ -573,10 +581,10 @@ ext_skip:
573 stm %r0,%r7,__PT_R0(%r11) 581 stm %r0,%r7,__PT_R0(%r11)
574 mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC 582 mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC
575 stm %r8,%r9,__PT_PSW(%r11) 583 stm %r8,%r9,__PT_PSW(%r11)
584 mvc __PT_INT_CODE(4,%r11),__LC_EXT_CPU_ADDR
585 mvc __PT_INT_PARM(4,%r11),__LC_EXT_PARAMS
576 TRACE_IRQS_OFF 586 TRACE_IRQS_OFF
577 lr %r2,%r11 # pass pointer to pt_regs 587 lr %r2,%r11 # pass pointer to pt_regs
578 l %r3,__LC_EXT_CPU_ADDR # get cpu address + interruption code
579 l %r4,__LC_EXT_PARAMS # get external parameters
580 l %r1,BASED(.Ldo_extint) 588 l %r1,BASED(.Ldo_extint)
581 basr %r14,%r1 # call do_extint 589 basr %r14,%r1 # call do_extint
582 j io_return 590 j io_return
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index aa0ab02e9595..3ddbc26d246e 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -54,7 +54,7 @@ void handle_signal32(unsigned long sig, struct k_sigaction *ka,
54void do_notify_resume(struct pt_regs *regs); 54void do_notify_resume(struct pt_regs *regs);
55 55
56struct ext_code; 56struct ext_code;
57void do_extint(struct pt_regs *regs, struct ext_code, unsigned int, unsigned long); 57void do_extint(struct pt_regs *regs);
58void do_restart(void); 58void do_restart(void);
59void __init startup_init(void); 59void __init startup_init(void);
60void die(struct pt_regs *regs, const char *str); 60void die(struct pt_regs *regs, const char *str);
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 4c17eece707e..bc5864c5148b 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -460,10 +460,18 @@ io_skip:
460 stmg %r0,%r7,__PT_R0(%r11) 460 stmg %r0,%r7,__PT_R0(%r11)
461 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC 461 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC
462 stmg %r8,%r9,__PT_PSW(%r11) 462 stmg %r8,%r9,__PT_PSW(%r11)
463 mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
463 TRACE_IRQS_OFF 464 TRACE_IRQS_OFF
464 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) 465 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
466io_loop:
465 lgr %r2,%r11 # pass pointer to pt_regs 467 lgr %r2,%r11 # pass pointer to pt_regs
466 brasl %r14,do_IRQ 468 brasl %r14,do_IRQ
469 tm __LC_MACHINE_FLAGS+6,0x10 # MACHINE_FLAG_LPAR
470 jz io_return
471 tpi 0
472 jz io_return
473 mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
474 j io_loop
467io_return: 475io_return:
468 LOCKDEP_SYS_EXIT 476 LOCKDEP_SYS_EXIT
469 TRACE_IRQS_ON 477 TRACE_IRQS_ON
@@ -605,13 +613,13 @@ ext_skip:
605 stmg %r0,%r7,__PT_R0(%r11) 613 stmg %r0,%r7,__PT_R0(%r11)
606 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC 614 mvc __PT_R8(64,%r11),__LC_SAVE_AREA_ASYNC
607 stmg %r8,%r9,__PT_PSW(%r11) 615 stmg %r8,%r9,__PT_PSW(%r11)
616 lghi %r1,__LC_EXT_PARAMS2
617 mvc __PT_INT_CODE(4,%r11),__LC_EXT_CPU_ADDR
618 mvc __PT_INT_PARM(4,%r11),__LC_EXT_PARAMS
619 mvc __PT_INT_PARM_LONG(8,%r11),0(%r1)
608 TRACE_IRQS_OFF 620 TRACE_IRQS_OFF
609 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) 621 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
610 lghi %r1,4096
611 lgr %r2,%r11 # pass pointer to pt_regs 622 lgr %r2,%r11 # pass pointer to pt_regs
612 llgf %r3,__LC_EXT_CPU_ADDR # get cpu address + interruption code
613 llgf %r4,__LC_EXT_PARAMS # get external parameter
614 lg %r5,__LC_EXT_PARAMS2-4096(%r1) # get 64 bit external parameter
615 brasl %r14,do_extint 623 brasl %r14,do_extint
616 j io_return 624 j io_return
617 625
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index dd3c1994b8bd..54b0995514e8 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -234,9 +234,9 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler)
234} 234}
235EXPORT_SYMBOL(unregister_external_interrupt); 235EXPORT_SYMBOL(unregister_external_interrupt);
236 236
237void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code, 237void __irq_entry do_extint(struct pt_regs *regs)
238 unsigned int param32, unsigned long param64)
239{ 238{
239 struct ext_code ext_code;
240 struct pt_regs *old_regs; 240 struct pt_regs *old_regs;
241 struct ext_int_info *p; 241 struct ext_int_info *p;
242 int index; 242 int index;
@@ -248,6 +248,7 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code,
248 clock_comparator_work(); 248 clock_comparator_work();
249 } 249 }
250 kstat_incr_irqs_this_cpu(EXTERNAL_INTERRUPT, NULL); 250 kstat_incr_irqs_this_cpu(EXTERNAL_INTERRUPT, NULL);
251 ext_code = *(struct ext_code *) &regs->int_code;
251 if (ext_code.code != 0x1004) 252 if (ext_code.code != 0x1004)
252 __get_cpu_var(s390_idle).nohz_delay = 1; 253 __get_cpu_var(s390_idle).nohz_delay = 1;
253 254
@@ -255,7 +256,8 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code,
255 rcu_read_lock(); 256 rcu_read_lock();
256 list_for_each_entry_rcu(p, &ext_int_hash[index], entry) 257 list_for_each_entry_rcu(p, &ext_int_hash[index], entry)
257 if (likely(p->code == ext_code.code)) 258 if (likely(p->code == ext_code.code))
258 p->handler(ext_code, param32, param64); 259 p->handler(ext_code, regs->int_parm,
260 regs->int_parm_long);
259 rcu_read_unlock(); 261 rcu_read_unlock();
260 irq_exit(); 262 irq_exit();
261 set_irq_regs(old_regs); 263 set_irq_regs(old_regs);
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 4f977d0d25c2..15a016c10563 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -49,7 +49,6 @@
49 49
50enum { 50enum {
51 ec_schedule = 0, 51 ec_schedule = 0,
52 ec_call_function,
53 ec_call_function_single, 52 ec_call_function_single,
54 ec_stop_cpu, 53 ec_stop_cpu,
55}; 54};
@@ -438,8 +437,6 @@ static void smp_handle_ext_call(void)
438 smp_stop_cpu(); 437 smp_stop_cpu();
439 if (test_bit(ec_schedule, &bits)) 438 if (test_bit(ec_schedule, &bits))
440 scheduler_ipi(); 439 scheduler_ipi();
441 if (test_bit(ec_call_function, &bits))
442 generic_smp_call_function_interrupt();
443 if (test_bit(ec_call_function_single, &bits)) 440 if (test_bit(ec_call_function_single, &bits))
444 generic_smp_call_function_single_interrupt(); 441 generic_smp_call_function_single_interrupt();
445} 442}
@@ -456,7 +453,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
456 int cpu; 453 int cpu;
457 454
458 for_each_cpu(cpu, mask) 455 for_each_cpu(cpu, mask)
459 pcpu_ec_call(pcpu_devices + cpu, ec_call_function); 456 pcpu_ec_call(pcpu_devices + cpu, ec_call_function_single);
460} 457}
461 458
462void arch_send_call_function_single_ipi(int cpu) 459void arch_send_call_function_single_ipi(int cpu)
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index a938b548f07e..74c29d922458 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -771,6 +771,54 @@ static inline void page_table_free_pgste(unsigned long *table)
771 __free_page(page); 771 __free_page(page);
772} 772}
773 773
774int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
775 unsigned long key, bool nq)
776{
777 spinlock_t *ptl;
778 pgste_t old, new;
779 pte_t *ptep;
780
781 down_read(&mm->mmap_sem);
782 ptep = get_locked_pte(current->mm, addr, &ptl);
783 if (unlikely(!ptep)) {
784 up_read(&mm->mmap_sem);
785 return -EFAULT;
786 }
787
788 new = old = pgste_get_lock(ptep);
789 pgste_val(new) &= ~(PGSTE_GR_BIT | PGSTE_GC_BIT |
790 PGSTE_ACC_BITS | PGSTE_FP_BIT);
791 pgste_val(new) |= (key & (_PAGE_CHANGED | _PAGE_REFERENCED)) << 48;
792 pgste_val(new) |= (key & (_PAGE_ACC_BITS | _PAGE_FP_BIT)) << 56;
793 if (!(pte_val(*ptep) & _PAGE_INVALID)) {
794 unsigned long address, bits;
795 unsigned char skey;
796
797 address = pte_val(*ptep) & PAGE_MASK;
798 skey = page_get_storage_key(address);
799 bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED);
800 /* Set storage key ACC and FP */
801 page_set_storage_key(address,
802 (key & (_PAGE_ACC_BITS | _PAGE_FP_BIT)),
803 !nq);
804
805 /* Merge host changed & referenced into pgste */
806 pgste_val(new) |= bits << 52;
807 /* Transfer skey changed & referenced bit to kvm user bits */
808 pgste_val(new) |= bits << 45; /* PGSTE_UR_BIT & PGSTE_UC_BIT */
809 }
810 /* changing the guest storage key is considered a change of the page */
811 if ((pgste_val(new) ^ pgste_val(old)) &
812 (PGSTE_ACC_BITS | PGSTE_FP_BIT | PGSTE_GR_BIT | PGSTE_GC_BIT))
813 pgste_val(new) |= PGSTE_UC_BIT;
814
815 pgste_set_unlock(ptep, new);
816 pte_unmap_unlock(*ptep, ptl);
817 up_read(&mm->mmap_sem);
818 return 0;
819}
820EXPORT_SYMBOL(set_guest_storage_key);
821
774#else /* CONFIG_PGSTE */ 822#else /* CONFIG_PGSTE */
775 823
776static inline unsigned long *page_table_alloc_pgste(struct mm_struct *mm, 824static inline unsigned long *page_table_alloc_pgste(struct mm_struct *mm,
diff --git a/arch/s390/oprofile/hwsampler.h b/arch/s390/oprofile/hwsampler.h
index 1912f3bb190c..0022e1ebfbde 100644
--- a/arch/s390/oprofile/hwsampler.h
+++ b/arch/s390/oprofile/hwsampler.h
@@ -81,8 +81,8 @@ struct hws_data_entry {
81 unsigned int:16; 81 unsigned int:16;
82 unsigned int prim_asn:16; /* primary ASN */ 82 unsigned int prim_asn:16; /* primary ASN */
83 unsigned long long ia; /* Instruction Address */ 83 unsigned long long ia; /* Instruction Address */
84 unsigned long long lpp; /* Logical-Partition Program Param. */ 84 unsigned long long gpp; /* Guest Program Parameter */
85 unsigned long long vpp; /* Virtual-Machine Program Param. */ 85 unsigned long long hpp; /* Host Program Parameter */
86}; 86};
87 87
88struct hws_trailer_entry { 88struct hws_trailer_entry {
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index f1e5be85d592..e2956ad39a4f 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -82,10 +82,13 @@ struct intr_bucket {
82 82
83static struct intr_bucket *bucket; 83static struct intr_bucket *bucket;
84 84
85/* Adapter local summary indicator */ 85/* Adapter interrupt definitions */
86static u8 *zpci_irq_si; 86static void zpci_irq_handler(struct airq_struct *airq);
87 87
88static atomic_t irq_retries = ATOMIC_INIT(0); 88static struct airq_struct zpci_airq = {
89 .handler = zpci_irq_handler,
90 .isc = PCI_ISC,
91};
89 92
90/* I/O Map */ 93/* I/O Map */
91static DEFINE_SPINLOCK(zpci_iomap_lock); 94static DEFINE_SPINLOCK(zpci_iomap_lock);
@@ -404,7 +407,7 @@ static struct pci_ops pci_root_ops = {
404/* store the last handled bit to implement fair scheduling of devices */ 407/* store the last handled bit to implement fair scheduling of devices */
405static DEFINE_PER_CPU(unsigned long, next_sbit); 408static DEFINE_PER_CPU(unsigned long, next_sbit);
406 409
407static void zpci_irq_handler(void *dont, void *need) 410static void zpci_irq_handler(struct airq_struct *airq)
408{ 411{
409 unsigned long sbit, mbit, last = 0, start = __get_cpu_var(next_sbit); 412 unsigned long sbit, mbit, last = 0, start = __get_cpu_var(next_sbit);
410 int rescan = 0, max = aisb_max; 413 int rescan = 0, max = aisb_max;
@@ -452,7 +455,6 @@ scan:
452 max = aisb_max; 455 max = aisb_max;
453 sbit = find_first_bit_left(bucket->aisb, max); 456 sbit = find_first_bit_left(bucket->aisb, max);
454 if (sbit != max) { 457 if (sbit != max) {
455 atomic_inc(&irq_retries);
456 rescan++; 458 rescan++;
457 goto scan; 459 goto scan;
458 } 460 }
@@ -565,7 +567,21 @@ static void zpci_map_resources(struct zpci_dev *zdev)
565 pr_debug("BAR%i: -> start: %Lx end: %Lx\n", 567 pr_debug("BAR%i: -> start: %Lx end: %Lx\n",
566 i, pdev->resource[i].start, pdev->resource[i].end); 568 i, pdev->resource[i].start, pdev->resource[i].end);
567 } 569 }
568}; 570}
571
572static void zpci_unmap_resources(struct zpci_dev *zdev)
573{
574 struct pci_dev *pdev = zdev->pdev;
575 resource_size_t len;
576 int i;
577
578 for (i = 0; i < PCI_BAR_COUNT; i++) {
579 len = pci_resource_len(pdev, i);
580 if (!len)
581 continue;
582 pci_iounmap(pdev, (void *) pdev->resource[i].start);
583 }
584}
569 585
570struct zpci_dev *zpci_alloc_device(void) 586struct zpci_dev *zpci_alloc_device(void)
571{ 587{
@@ -701,25 +717,20 @@ static int __init zpci_irq_init(void)
701 goto out_alloc; 717 goto out_alloc;
702 } 718 }
703 719
704 isc_register(PCI_ISC); 720 rc = register_adapter_interrupt(&zpci_airq);
705 zpci_irq_si = s390_register_adapter_interrupt(&zpci_irq_handler, NULL, PCI_ISC); 721 if (rc)
706 if (IS_ERR(zpci_irq_si)) {
707 rc = PTR_ERR(zpci_irq_si);
708 zpci_irq_si = NULL;
709 goto out_ai; 722 goto out_ai;
710 } 723 /* Set summary to 1 to be called every time for the ISC. */
724 *zpci_airq.lsi_ptr = 1;
711 725
712 for_each_online_cpu(cpu) 726 for_each_online_cpu(cpu)
713 per_cpu(next_sbit, cpu) = 0; 727 per_cpu(next_sbit, cpu) = 0;
714 728
715 spin_lock_init(&bucket->lock); 729 spin_lock_init(&bucket->lock);
716 /* set summary to 1 to be called every time for the ISC */
717 *zpci_irq_si = 1;
718 set_irq_ctrl(SIC_IRQ_MODE_SINGLE, NULL, PCI_ISC); 730 set_irq_ctrl(SIC_IRQ_MODE_SINGLE, NULL, PCI_ISC);
719 return 0; 731 return 0;
720 732
721out_ai: 733out_ai:
722 isc_unregister(PCI_ISC);
723 free_page((unsigned long) bucket->alloc); 734 free_page((unsigned long) bucket->alloc);
724out_alloc: 735out_alloc:
725 free_page((unsigned long) bucket->aisb); 736 free_page((unsigned long) bucket->aisb);
@@ -732,21 +743,10 @@ static void zpci_irq_exit(void)
732{ 743{
733 free_page((unsigned long) bucket->alloc); 744 free_page((unsigned long) bucket->alloc);
734 free_page((unsigned long) bucket->aisb); 745 free_page((unsigned long) bucket->aisb);
735 s390_unregister_adapter_interrupt(zpci_irq_si, PCI_ISC); 746 unregister_adapter_interrupt(&zpci_airq);
736 isc_unregister(PCI_ISC);
737 kfree(bucket); 747 kfree(bucket);
738} 748}
739 749
740void zpci_debug_info(struct zpci_dev *zdev, struct seq_file *m)
741{
742 if (!zdev)
743 return;
744
745 seq_printf(m, "global irq retries: %u\n", atomic_read(&irq_retries));
746 seq_printf(m, "aibv[0]:%016lx aibv[1]:%016lx aisb:%016lx\n",
747 get_imap(0)->aibv, get_imap(1)->aibv, *bucket->aisb);
748}
749
750static struct resource *zpci_alloc_bus_resource(unsigned long start, unsigned long size, 750static struct resource *zpci_alloc_bus_resource(unsigned long start, unsigned long size,
751 unsigned long flags, int domain) 751 unsigned long flags, int domain)
752{ 752{
@@ -810,6 +810,16 @@ int pcibios_add_device(struct pci_dev *pdev)
810 return 0; 810 return 0;
811} 811}
812 812
813void pcibios_release_device(struct pci_dev *pdev)
814{
815 struct zpci_dev *zdev = get_zdev(pdev);
816
817 zpci_unmap_resources(zdev);
818 zpci_fmb_disable_device(zdev);
819 zpci_debug_exit_device(zdev);
820 zdev->pdev = NULL;
821}
822
813static int zpci_scan_bus(struct zpci_dev *zdev) 823static int zpci_scan_bus(struct zpci_dev *zdev)
814{ 824{
815 struct resource *res; 825 struct resource *res;
@@ -950,25 +960,6 @@ void zpci_stop_device(struct zpci_dev *zdev)
950} 960}
951EXPORT_SYMBOL_GPL(zpci_stop_device); 961EXPORT_SYMBOL_GPL(zpci_stop_device);
952 962
953int zpci_scan_device(struct zpci_dev *zdev)
954{
955 zdev->pdev = pci_scan_single_device(zdev->bus, ZPCI_DEVFN);
956 if (!zdev->pdev) {
957 pr_err("pci_scan_single_device failed for fid: 0x%x\n",
958 zdev->fid);
959 goto out;
960 }
961
962 pci_bus_add_devices(zdev->bus);
963
964 return 0;
965out:
966 zpci_dma_exit_device(zdev);
967 clp_disable_fh(zdev);
968 return -EIO;
969}
970EXPORT_SYMBOL_GPL(zpci_scan_device);
971
972static inline int barsize(u8 size) 963static inline int barsize(u8 size)
973{ 964{
974 return (size) ? (1 << size) >> 10 : 0; 965 return (size) ? (1 << size) >> 10 : 0;
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index bd34359d1546..2e9539625d93 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -236,7 +236,6 @@ int clp_disable_fh(struct zpci_dev *zdev)
236 if (!zdev_enabled(zdev)) 236 if (!zdev_enabled(zdev))
237 return 0; 237 return 0;
238 238
239 dev_info(&zdev->pdev->dev, "disabling fn handle: 0x%x\n", fh);
240 rc = clp_set_pci_fn(&fh, 0, CLP_SET_DISABLE_PCI_FN); 239 rc = clp_set_pci_fn(&fh, 0, CLP_SET_DISABLE_PCI_FN);
241 if (!rc) 240 if (!rc)
242 /* Success -> store disabled handle in zdev */ 241 /* Success -> store disabled handle in zdev */
diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c
index 771b82359af4..75c69b402e05 100644
--- a/arch/s390/pci/pci_debug.c
+++ b/arch/s390/pci/pci_debug.c
@@ -115,27 +115,6 @@ static const struct file_operations debugfs_pci_perf_fops = {
115 .release = single_release, 115 .release = single_release,
116}; 116};
117 117
118static int pci_debug_show(struct seq_file *m, void *v)
119{
120 struct zpci_dev *zdev = m->private;
121
122 zpci_debug_info(zdev, m);
123 return 0;
124}
125
126static int pci_debug_seq_open(struct inode *inode, struct file *filp)
127{
128 return single_open(filp, pci_debug_show,
129 file_inode(filp)->i_private);
130}
131
132static const struct file_operations debugfs_pci_debug_fops = {
133 .open = pci_debug_seq_open,
134 .read = seq_read,
135 .llseek = seq_lseek,
136 .release = single_release,
137};
138
139void zpci_debug_init_device(struct zpci_dev *zdev) 118void zpci_debug_init_device(struct zpci_dev *zdev)
140{ 119{
141 zdev->debugfs_dev = debugfs_create_dir(dev_name(&zdev->pdev->dev), 120 zdev->debugfs_dev = debugfs_create_dir(dev_name(&zdev->pdev->dev),
@@ -149,19 +128,11 @@ void zpci_debug_init_device(struct zpci_dev *zdev)
149 &debugfs_pci_perf_fops); 128 &debugfs_pci_perf_fops);
150 if (IS_ERR(zdev->debugfs_perf)) 129 if (IS_ERR(zdev->debugfs_perf))
151 zdev->debugfs_perf = NULL; 130 zdev->debugfs_perf = NULL;
152
153 zdev->debugfs_debug = debugfs_create_file("debug",
154 S_IFREG | S_IRUGO | S_IWUSR,
155 zdev->debugfs_dev, zdev,
156 &debugfs_pci_debug_fops);
157 if (IS_ERR(zdev->debugfs_debug))
158 zdev->debugfs_debug = NULL;
159} 131}
160 132
161void zpci_debug_exit_device(struct zpci_dev *zdev) 133void zpci_debug_exit_device(struct zpci_dev *zdev)
162{ 134{
163 debugfs_remove(zdev->debugfs_perf); 135 debugfs_remove(zdev->debugfs_perf);
164 debugfs_remove(zdev->debugfs_debug);
165 debugfs_remove(zdev->debugfs_dev); 136 debugfs_remove(zdev->debugfs_dev);
166} 137}
167 138
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
index f8e69d5bc0a9..a2343c1f6e04 100644
--- a/arch/s390/pci/pci_dma.c
+++ b/arch/s390/pci/pci_dma.c
@@ -263,7 +263,7 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,
263 enum dma_data_direction direction, 263 enum dma_data_direction direction,
264 struct dma_attrs *attrs) 264 struct dma_attrs *attrs)
265{ 265{
266 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 266 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
267 unsigned long nr_pages, iommu_page_index; 267 unsigned long nr_pages, iommu_page_index;
268 unsigned long pa = page_to_phys(page) + offset; 268 unsigned long pa = page_to_phys(page) + offset;
269 int flags = ZPCI_PTE_VALID; 269 int flags = ZPCI_PTE_VALID;
@@ -304,7 +304,7 @@ static void s390_dma_unmap_pages(struct device *dev, dma_addr_t dma_addr,
304 size_t size, enum dma_data_direction direction, 304 size_t size, enum dma_data_direction direction,
305 struct dma_attrs *attrs) 305 struct dma_attrs *attrs)
306{ 306{
307 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 307 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
308 unsigned long iommu_page_index; 308 unsigned long iommu_page_index;
309 int npages; 309 int npages;
310 310
@@ -323,7 +323,7 @@ static void *s390_dma_alloc(struct device *dev, size_t size,
323 dma_addr_t *dma_handle, gfp_t flag, 323 dma_addr_t *dma_handle, gfp_t flag,
324 struct dma_attrs *attrs) 324 struct dma_attrs *attrs)
325{ 325{
326 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 326 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
327 struct page *page; 327 struct page *page;
328 unsigned long pa; 328 unsigned long pa;
329 dma_addr_t map; 329 dma_addr_t map;
diff --git a/arch/s390/pci/pci_sysfs.c b/arch/s390/pci/pci_sysfs.c
index a42cce69d0a0..e99a2557f186 100644
--- a/arch/s390/pci/pci_sysfs.c
+++ b/arch/s390/pci/pci_sysfs.c
@@ -15,40 +15,36 @@
15static ssize_t show_fid(struct device *dev, struct device_attribute *attr, 15static ssize_t show_fid(struct device *dev, struct device_attribute *attr,
16 char *buf) 16 char *buf)
17{ 17{
18 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 18 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
19 19
20 sprintf(buf, "0x%08x\n", zdev->fid); 20 return sprintf(buf, "0x%08x\n", zdev->fid);
21 return strlen(buf);
22} 21}
23static DEVICE_ATTR(function_id, S_IRUGO, show_fid, NULL); 22static DEVICE_ATTR(function_id, S_IRUGO, show_fid, NULL);
24 23
25static ssize_t show_fh(struct device *dev, struct device_attribute *attr, 24static ssize_t show_fh(struct device *dev, struct device_attribute *attr,
26 char *buf) 25 char *buf)
27{ 26{
28 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 27 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
29 28
30 sprintf(buf, "0x%08x\n", zdev->fh); 29 return sprintf(buf, "0x%08x\n", zdev->fh);
31 return strlen(buf);
32} 30}
33static DEVICE_ATTR(function_handle, S_IRUGO, show_fh, NULL); 31static DEVICE_ATTR(function_handle, S_IRUGO, show_fh, NULL);
34 32
35static ssize_t show_pchid(struct device *dev, struct device_attribute *attr, 33static ssize_t show_pchid(struct device *dev, struct device_attribute *attr,
36 char *buf) 34 char *buf)
37{ 35{
38 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 36 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
39 37
40 sprintf(buf, "0x%04x\n", zdev->pchid); 38 return sprintf(buf, "0x%04x\n", zdev->pchid);
41 return strlen(buf);
42} 39}
43static DEVICE_ATTR(pchid, S_IRUGO, show_pchid, NULL); 40static DEVICE_ATTR(pchid, S_IRUGO, show_pchid, NULL);
44 41
45static ssize_t show_pfgid(struct device *dev, struct device_attribute *attr, 42static ssize_t show_pfgid(struct device *dev, struct device_attribute *attr,
46 char *buf) 43 char *buf)
47{ 44{
48 struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev)); 45 struct zpci_dev *zdev = get_zdev(to_pci_dev(dev));
49 46
50 sprintf(buf, "0x%02x\n", zdev->pfgid); 47 return sprintf(buf, "0x%02x\n", zdev->pfgid);
51 return strlen(buf);
52} 48}
53static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL); 49static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL);
54 50