Skip to content

Commit c1101cb

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky: "This is the bulk of the s390 patches for the 3.11 merge window. Notable enhancements are: the block timeout patches for dasd from Hannes, and more work on the PCI support front. In addition some cleanup and the usual bug fixing." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (42 commits) s390/dasd: Fail all requests when DASD_FLAG_ABORTIO is set s390/dasd: Add 'timeout' attribute block: check for timeout function in blk_rq_timed_out() block/dasd: detailed I/O errors s390/dasd: Reduce amount of messages for specific errors s390/dasd: Implement block timeout handling s390/dasd: process all requests in the device tasklet s390/dasd: make number of retries configurable s390/dasd: Clarify comment s390/hwsampler: Updated misleading member names in hws_data_entry s390/appldata_net_sum: do not use static data s390/appldata_mem: do not use static data s390/vmwatchdog: do not use static data s390/airq: simplify adapter interrupt code s390/pci: remove per device debug attribute s390/dma: remove gratuitous brackets s390/facility: decompose test_facility() s390/sclp: remove duplicated include from sclp_ctl.c s390/irq: store interrupt information in pt_regs s390/drivers: Cocci spatch "ptr_ret.spatch" ...
2 parents 1873e50 + 5ea34a0 commit c1101cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1325
-569
lines changed

Documentation/ioctl/ioctl-number.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Code Seq#(hex) Include File Comments
7272
0x06 all linux/lp.h
7373
0x09 all linux/raid/md_u.h
7474
0x10 00-0F drivers/char/s390/vmcp.h
75+
0x10 10-1F arch/s390/include/uapi/sclp_ctl.h
7576
0x12 all linux/fs.h
7677
linux/blkpg.h
7778
0x1b all InfiniBand Subsystem <http://infiniband.sourceforge.net/>

arch/s390/appldata/appldata_mem.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* book:
3333
* http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
3434
*/
35-
static struct appldata_mem_data {
35+
struct appldata_mem_data {
3636
u64 timestamp;
3737
u32 sync_count_1; /* after VM collected the record data, */
3838
u32 sync_count_2; /* sync_count_1 and sync_count_2 should be the
@@ -63,7 +63,7 @@ static struct appldata_mem_data {
6363
u64 pgmajfault; /* page faults (major only) */
6464
// <-- New in 2.6
6565

66-
} __attribute__((packed)) appldata_mem_data;
66+
} __packed;
6767

6868

6969
/*
@@ -118,7 +118,6 @@ static struct appldata_ops ops = {
118118
.record_nr = APPLDATA_RECORD_MEM_ID,
119119
.size = sizeof(struct appldata_mem_data),
120120
.callback = &appldata_get_mem_data,
121-
.data = &appldata_mem_data,
122121
.owner = THIS_MODULE,
123122
.mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */
124123
};
@@ -131,7 +130,17 @@ static struct appldata_ops ops = {
131130
*/
132131
static int __init appldata_mem_init(void)
133132
{
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;
135144
}
136145

137146
/*
@@ -142,6 +151,7 @@ static int __init appldata_mem_init(void)
142151
static void __exit appldata_mem_exit(void)
143152
{
144153
appldata_unregister_ops(&ops);
154+
kfree(ops.data);
145155
}
146156

147157

arch/s390/appldata/appldata_net_sum.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* book:
3030
* http://oss.software.ibm.com/developerworks/opensource/linux390/index.shtml
3131
*/
32-
static struct appldata_net_sum_data {
32+
struct appldata_net_sum_data {
3333
u64 timestamp;
3434
u32 sync_count_1; /* after VM collected the record data, */
3535
u32 sync_count_2; /* sync_count_1 and sync_count_2 should be the
@@ -51,7 +51,7 @@ static struct appldata_net_sum_data {
5151
u64 rx_dropped; /* no space in linux buffers */
5252
u64 tx_dropped; /* no space available in linux */
5353
u64 collisions; /* collisions while transmitting */
54-
} __attribute__((packed)) appldata_net_sum_data;
54+
} __packed;
5555

5656

5757
/*
@@ -121,7 +121,6 @@ static struct appldata_ops ops = {
121121
.record_nr = APPLDATA_RECORD_NET_SUM_ID,
122122
.size = sizeof(struct appldata_net_sum_data),
123123
.callback = &appldata_get_net_sum_data,
124-
.data = &appldata_net_sum_data,
125124
.owner = THIS_MODULE,
126125
.mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */
127126
};
@@ -134,7 +133,17 @@ static struct appldata_ops ops = {
134133
*/
135134
static int __init appldata_net_init(void)
136135
{
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;
138147
}
139148

140149
/*
@@ -145,6 +154,7 @@ static int __init appldata_net_init(void)
145154
static void __exit appldata_net_exit(void)
146155
{
147156
appldata_unregister_ops(&ops);
157+
kfree(ops.data);
148158
}
149159

150160

arch/s390/hypfs/hypfs_diag.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,7 @@ static int hypfs_create_cpu_files(struct super_block *sb,
651651
}
652652
diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer);
653653
rc = hypfs_create_str(sb, cpu_dir, "type", buffer);
654-
if (IS_ERR(rc))
655-
return PTR_ERR(rc);
656-
return 0;
654+
return PTR_RET(rc);
657655
}
658656

659657
static void *hypfs_create_lpar_files(struct super_block *sb,
@@ -702,9 +700,7 @@ static int hypfs_create_phys_cpu_files(struct super_block *sb,
702700
return PTR_ERR(rc);
703701
diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer);
704702
rc = hypfs_create_str(sb, cpu_dir, "type", buffer);
705-
if (IS_ERR(rc))
706-
return PTR_ERR(rc);
707-
return 0;
703+
return PTR_RET(rc);
708704
}
709705

710706
static void *hypfs_create_phys_files(struct super_block *sb,

arch/s390/include/asm/airq.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@
99
#ifndef _ASM_S390_AIRQ_H
1010
#define _ASM_S390_AIRQ_H
1111

12-
typedef void (*adapter_int_handler_t)(void *, void *);
12+
struct 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+
};
1320

14-
void *s390_register_adapter_interrupt(adapter_int_handler_t, void *, u8);
15-
void s390_unregister_adapter_interrupt(void *, u8);
21+
#define AIRQ_PTR_ALLOCATED 0x01
22+
23+
int register_adapter_interrupt(struct airq_struct *airq);
24+
void unregister_adapter_interrupt(struct airq_struct *airq);
1625

1726
#endif /* _ASM_S390_AIRQ_H */

arch/s390/include/asm/dma-mapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
5353
debug_dma_mapping_error(dev, dma_addr);
5454
if (dma_ops->mapping_error)
5555
return dma_ops->mapping_error(dev, dma_addr);
56-
return (dma_addr == DMA_ERROR_CODE);
56+
return dma_addr == DMA_ERROR_CODE;
5757
}
5858

5959
static inline void *dma_alloc_coherent(struct device *dev, size_t size,

arch/s390/include/asm/facility.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@
1313

1414
#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
1515

16+
static 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+
1626
/*
1727
* The test_facility function uses the bit odering where the MSB is bit 0.
1828
* That makes it easier to query facility bits with the bit number as
1929
* documented in the Principles of Operation.
2030
*/
2131
static inline int test_facility(unsigned long nr)
2232
{
23-
unsigned char *ptr;
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;
33+
return __test_facility(nr, &S390_lowcore.stfle_fac_list);
2934
}
3035

3136
/**

arch/s390/include/asm/io.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,6 @@
1313
#include <asm/page.h>
1414
#include <asm/pci_io.h>
1515

16-
/*
17-
* Change virtual addresses to physical addresses and vv.
18-
* These are pretty trivial
19-
*/
20-
static 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-
33-
static inline void * phys_to_virt(unsigned long address)
34-
{
35-
return (void *) address;
36-
}
37-
3816
void *xlate_dev_mem_ptr(unsigned long phys);
3917
#define xlate_dev_mem_ptr xlate_dev_mem_ptr
4018
void unxlate_dev_mem_ptr(unsigned long phys, void *addr);

arch/s390/include/asm/pci.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ struct zpci_dev {
120120

121121
struct dentry *debugfs_dev;
122122
struct dentry *debugfs_perf;
123-
struct dentry *debugfs_debug;
124123
};
125124

126125
struct pci_hp_callback_ops {
@@ -143,7 +142,6 @@ int zpci_enable_device(struct zpci_dev *);
143142
int zpci_disable_device(struct zpci_dev *);
144143
void zpci_stop_device(struct zpci_dev *);
145144
void zpci_free_device(struct zpci_dev *);
146-
int zpci_scan_device(struct zpci_dev *);
147145
int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64);
148146
int zpci_unregister_ioat(struct zpci_dev *, u8);
149147

arch/s390/include/asm/pgalloc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ unsigned long *page_table_alloc(struct mm_struct *, unsigned long);
2222
void page_table_free(struct mm_struct *, unsigned long *);
2323
void page_table_free_rcu(struct mmu_gather *, unsigned long *);
2424

25+
int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
26+
unsigned long key, bool nq);
27+
2528
static inline void clear_table(unsigned long *s, unsigned long val, size_t n)
2629
{
2730
typedef struct { char _[n]; } addrtype;

arch/s390/include/asm/ptrace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct pt_regs
2424
unsigned long gprs[NUM_GPRS];
2525
unsigned long orig_gpr2;
2626
unsigned int int_code;
27+
unsigned int int_parm;
2728
unsigned long int_parm_long;
2829
};
2930

arch/s390/include/uapi/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ header-y += siginfo.h
3535
header-y += signal.h
3636
header-y += socket.h
3737
header-y += sockios.h
38+
header-y += sclp_ctl.h
3839
header-y += stat.h
3940
header-y += statfs.h
4041
header-y += swab.h

arch/s390/include/uapi/asm/chsc.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ struct chsc_async_area {
2929
__u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)];
3030
} __attribute__ ((packed));
3131

32+
struct chsc_header {
33+
__u16 length;
34+
__u16 code;
35+
} __attribute__ ((packed));
36+
37+
struct chsc_sync_area {
38+
struct chsc_header header;
39+
__u8 data[CHSC_SIZE - sizeof(struct chsc_header)];
40+
} __attribute__ ((packed));
41+
3242
struct chsc_response_struct {
3343
__u16 length;
3444
__u16 code;
@@ -126,5 +136,8 @@ struct chsc_cpd_info {
126136
#define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list)
127137
#define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
128138
#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)
129142

130143
#endif

arch/s390/include/uapi/asm/dasd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ struct dasd_snid_ioctl_data {
261261
#define BIODASDQUIESCE _IO(DASD_IOCTL_LETTER,6)
262262
/* Resume IO on device */
263263
#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)
264268

265269

266270
/* retrieve API version number */

arch/s390/include/uapi/asm/sclp_ctl.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* IOCTL interface for SCLP
3+
*
4+
* Copyright IBM Corp. 2012
5+
*
6+
* Author: Michael Holzheu <[email protected]>
7+
*/
8+
9+
#ifndef _ASM_SCLP_CTL_H
10+
#define _ASM_SCLP_CTL_H
11+
12+
#include <linux/types.h>
13+
14+
struct 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

arch/s390/kernel/asm-offsets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ int main(void)
4747
DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs));
4848
DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2));
4949
DEFINE(__PT_INT_CODE, offsetof(struct pt_regs, int_code));
50+
DEFINE(__PT_INT_PARM, offsetof(struct pt_regs, int_parm));
5051
DEFINE(__PT_INT_PARM_LONG, offsetof(struct pt_regs, int_parm_long));
5152
DEFINE(__PT_SIZE, sizeof(struct pt_regs));
5253
BLANK();

arch/s390/kernel/entry.S

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,19 @@ io_skip:
429429
stm %r0,%r7,__PT_R0(%r11)
430430
mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC
431431
stm %r8,%r9,__PT_PSW(%r11)
432+
mvc __PT_INT_CODE(12,%r11),__LC_SUBCHANNEL_ID
432433
TRACE_IRQS_OFF
433434
xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15)
435+
io_loop:
434436
l %r1,BASED(.Ldo_IRQ)
435437
lr %r2,%r11 # pass pointer to pt_regs
436438
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
437445
io_return:
438446
LOCKDEP_SYS_EXIT
439447
TRACE_IRQS_ON
@@ -573,10 +581,10 @@ ext_skip:
573581
stm %r0,%r7,__PT_R0(%r11)
574582
mvc __PT_R8(32,%r11),__LC_SAVE_AREA_ASYNC
575583
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
576586
TRACE_IRQS_OFF
577587
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
580588
l %r1,BASED(.Ldo_extint)
581589
basr %r14,%r1 # call do_extint
582590
j io_return

arch/s390/kernel/entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void handle_signal32(unsigned long sig, struct k_sigaction *ka,
5454
void do_notify_resume(struct pt_regs *regs);
5555

5656
struct ext_code;
57-
void do_extint(struct pt_regs *regs, struct ext_code, unsigned int, unsigned long);
57+
void do_extint(struct pt_regs *regs);
5858
void do_restart(void);
5959
void __init startup_init(void);
6060
void die(struct pt_regs *regs, const char *str);

0 commit comments

Comments
 (0)