1 |
Author: dsd |
2 |
Date: 2008-12-30 20:30:00 +0000 (Tue, 30 Dec 2008) |
3 |
New Revision: 1452 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.27/1705_s390-00.patch |
7 |
genpatches-2.6/trunk/2.6.27/1710_s390-01.patch |
8 |
Modified: |
9 |
genpatches-2.6/trunk/2.6.27/0000_README |
10 |
Log: |
11 |
Fixes for s390 architecture |
12 |
|
13 |
Modified: genpatches-2.6/trunk/2.6.27/0000_README |
14 |
=================================================================== |
15 |
--- genpatches-2.6/trunk/2.6.27/0000_README 2008-12-25 01:56:17 UTC (rev 1451) |
16 |
+++ genpatches-2.6/trunk/2.6.27/0000_README 2008-12-30 20:30:00 UTC (rev 1452) |
17 |
@@ -83,6 +83,14 @@ |
18 |
From: http://bugs.gentoo.org/229441 |
19 |
Desc: Fix shutdown hang on Sun Blade 100 |
20 |
|
21 |
+Patch: 1705_s390-00.patch |
22 |
+From: http://bugs.gentoo.org/252421 |
23 |
+Desc: IBM's s390-00 fixes for s390 architecture |
24 |
+ |
25 |
+Patch: 1710_s390-01.patch |
26 |
+From: http://bugs.gentoo.org/252421 |
27 |
+Desc: IBM's s390-01 fixes for s390 architecture |
28 |
+ |
29 |
Patch: 2500_pentax-k10d-wrong-capacity.patch |
30 |
From: http://bugs.gentoo.org/250406 |
31 |
Desc: Fix capacity reported by Pentax K10D camera |
32 |
|
33 |
Added: genpatches-2.6/trunk/2.6.27/1705_s390-00.patch |
34 |
=================================================================== |
35 |
--- genpatches-2.6/trunk/2.6.27/1705_s390-00.patch (rev 0) |
36 |
+++ genpatches-2.6/trunk/2.6.27/1705_s390-00.patch 2008-12-30 20:30:00 UTC (rev 1452) |
37 |
@@ -0,0 +1,5873 @@ |
38 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/include/asm/qdio.h |
39 |
+=================================================================== |
40 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/include/asm/qdio.h |
41 |
++++ linux-2.6.27-gentoo-r7/arch/s390/include/asm/qdio.h |
42 |
+@@ -367,16 +367,16 @@ struct qdio_initialize { |
43 |
+ #define QDIO_FLAG_SYNC_OUTPUT 0x02 |
44 |
+ #define QDIO_FLAG_PCI_OUT 0x10 |
45 |
+ |
46 |
+-extern int qdio_initialize(struct qdio_initialize *init_data); |
47 |
+-extern int qdio_allocate(struct qdio_initialize *init_data); |
48 |
+-extern int qdio_establish(struct qdio_initialize *init_data); |
49 |
++extern int qdio_initialize(struct qdio_initialize *); |
50 |
++extern int qdio_allocate(struct qdio_initialize *); |
51 |
++extern int qdio_establish(struct qdio_initialize *); |
52 |
+ extern int qdio_activate(struct ccw_device *); |
53 |
+ |
54 |
+-extern int do_QDIO(struct ccw_device*, unsigned int flags, |
55 |
+- int q_nr, int qidx, int count); |
56 |
+-extern int qdio_cleanup(struct ccw_device*, int how); |
57 |
+-extern int qdio_shutdown(struct ccw_device*, int how); |
58 |
++extern int do_QDIO(struct ccw_device *cdev, unsigned int callflags, |
59 |
++ int q_nr, int bufnr, int count); |
60 |
++extern int qdio_cleanup(struct ccw_device*, int); |
61 |
++extern int qdio_shutdown(struct ccw_device*, int); |
62 |
+ extern int qdio_free(struct ccw_device *); |
63 |
+-extern struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev); |
64 |
++extern int qdio_get_ssqd_desc(struct ccw_device *dev, struct qdio_ssqd_desc*); |
65 |
+ |
66 |
+ #endif /* __QDIO_H__ */ |
67 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/entry.S |
68 |
+=================================================================== |
69 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/entry.S |
70 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/entry.S |
71 |
+@@ -61,22 +61,25 @@ STACK_SIZE = 1 << STACK_SHIFT |
72 |
+ |
73 |
+ #ifdef CONFIG_TRACE_IRQFLAGS |
74 |
+ .macro TRACE_IRQS_ON |
75 |
+- l %r1,BASED(.Ltrace_irq_on) |
76 |
++ basr %r2,%r0 |
77 |
++ l %r1,BASED(.Ltrace_irq_on_caller) |
78 |
+ basr %r14,%r1 |
79 |
+ .endm |
80 |
+ |
81 |
+ .macro TRACE_IRQS_OFF |
82 |
+- l %r1,BASED(.Ltrace_irq_off) |
83 |
++ basr %r2,%r0 |
84 |
++ l %r1,BASED(.Ltrace_irq_off_caller) |
85 |
+ basr %r14,%r1 |
86 |
+ .endm |
87 |
+ |
88 |
+ .macro TRACE_IRQS_CHECK |
89 |
++ basr %r2,%r0 |
90 |
+ tm SP_PSW(%r15),0x03 # irqs enabled? |
91 |
+ jz 0f |
92 |
+- l %r1,BASED(.Ltrace_irq_on) |
93 |
++ l %r1,BASED(.Ltrace_irq_on_caller) |
94 |
+ basr %r14,%r1 |
95 |
+ j 1f |
96 |
+-0: l %r1,BASED(.Ltrace_irq_off) |
97 |
++0: l %r1,BASED(.Ltrace_irq_off_caller) |
98 |
+ basr %r14,%r1 |
99 |
+ 1: |
100 |
+ .endm |
101 |
+@@ -1083,9 +1086,12 @@ cleanup_io_leave_insn: |
102 |
+ .Lschedtail: .long schedule_tail |
103 |
+ .Lsysc_table: .long sys_call_table |
104 |
+ #ifdef CONFIG_TRACE_IRQFLAGS |
105 |
+-.Ltrace_irq_on: .long trace_hardirqs_on |
106 |
+-.Ltrace_irq_off: |
107 |
+- .long trace_hardirqs_off |
108 |
++.Ltrace_irq_on_caller: |
109 |
++ .long trace_hardirqs_on_caller |
110 |
++.Ltrace_irq_off_caller: |
111 |
++ .long trace_hardirqs_off_caller |
112 |
++#endif |
113 |
++#ifdef CONFIG_LOCKDEP |
114 |
+ .Llockdep_sys_exit: |
115 |
+ .long lockdep_sys_exit |
116 |
+ #endif |
117 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/entry64.S |
118 |
+=================================================================== |
119 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/entry64.S |
120 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/entry64.S |
121 |
+@@ -61,19 +61,22 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_ |
122 |
+ |
123 |
+ #ifdef CONFIG_TRACE_IRQFLAGS |
124 |
+ .macro TRACE_IRQS_ON |
125 |
+- brasl %r14,trace_hardirqs_on |
126 |
++ basr %r2,%r0 |
127 |
++ brasl %r14,trace_hardirqs_on_caller |
128 |
+ .endm |
129 |
+ |
130 |
+ .macro TRACE_IRQS_OFF |
131 |
+- brasl %r14,trace_hardirqs_off |
132 |
++ basr %r2,%r0 |
133 |
++ brasl %r14,trace_hardirqs_off_caller |
134 |
+ .endm |
135 |
+ |
136 |
+ .macro TRACE_IRQS_CHECK |
137 |
++ basr %r2,%r0 |
138 |
+ tm SP_PSW(%r15),0x03 # irqs enabled? |
139 |
+ jz 0f |
140 |
+- brasl %r14,trace_hardirqs_on |
141 |
++ brasl %r14,trace_hardirqs_on_caller |
142 |
+ j 1f |
143 |
+-0: brasl %r14,trace_hardirqs_off |
144 |
++0: brasl %r14,trace_hardirqs_off_caller |
145 |
+ 1: |
146 |
+ .endm |
147 |
+ #else |
148 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/process.c |
149 |
+=================================================================== |
150 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/process.c |
151 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/process.c |
152 |
+@@ -136,9 +136,12 @@ static void default_idle(void) |
153 |
+ return; |
154 |
+ } |
155 |
+ trace_hardirqs_on(); |
156 |
++ /* Don't trace preempt off for idle. */ |
157 |
++ stop_critical_timings(); |
158 |
+ /* Wait for external, I/O or machine check interrupt. */ |
159 |
+ __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | |
160 |
+ PSW_MASK_IO | PSW_MASK_EXT); |
161 |
++ start_critical_timings(); |
162 |
+ } |
163 |
+ |
164 |
+ void cpu_idle(void) |
165 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/setup.c |
166 |
+=================================================================== |
167 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/setup.c |
168 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/setup.c |
169 |
+@@ -604,13 +604,13 @@ setup_memory(void) |
170 |
+ if (memory_chunk[i].type != CHUNK_READ_WRITE) |
171 |
+ continue; |
172 |
+ start_chunk = PFN_DOWN(memory_chunk[i].addr); |
173 |
+- end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1; |
174 |
++ end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size); |
175 |
+ end_chunk = min(end_chunk, end_pfn); |
176 |
+ if (start_chunk >= end_chunk) |
177 |
+ continue; |
178 |
+ add_active_range(0, start_chunk, end_chunk); |
179 |
+ pfn = max(start_chunk, start_pfn); |
180 |
+- for (; pfn <= end_chunk; pfn++) |
181 |
++ for (; pfn < end_chunk; pfn++) |
182 |
+ page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY); |
183 |
+ } |
184 |
+ |
185 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/sys_s390.c |
186 |
+=================================================================== |
187 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/sys_s390.c |
188 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/sys_s390.c |
189 |
+@@ -198,7 +198,7 @@ asmlinkage long s390x_newuname(struct ne |
190 |
+ { |
191 |
+ int ret = sys_newuname(name); |
192 |
+ |
193 |
+- if (current->personality == PER_LINUX32 && !ret) { |
194 |
++ if (personality(current->personality) == PER_LINUX32 && !ret) { |
195 |
+ ret = copy_to_user(name->machine, "s390\0\0\0\0", 8); |
196 |
+ if (ret) ret = -EFAULT; |
197 |
+ } |
198 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/time.c |
199 |
+=================================================================== |
200 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/time.c |
201 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/time.c |
202 |
+@@ -1356,7 +1356,7 @@ static void __init stp_reset(void) |
203 |
+ |
204 |
+ stp_page = alloc_bootmem_pages(PAGE_SIZE); |
205 |
+ rc = chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000); |
206 |
+- if (rc == 1) |
207 |
++ if (rc == 0) |
208 |
+ set_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags); |
209 |
+ else if (stp_online) { |
210 |
+ printk(KERN_WARNING "Running on non STP capable machine.\n"); |
211 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/block/dasd.c |
212 |
+=================================================================== |
213 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/block/dasd.c |
214 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/block/dasd.c |
215 |
+@@ -1746,6 +1746,11 @@ restart: |
216 |
+ goto restart; |
217 |
+ } |
218 |
+ |
219 |
++ /* log sense for fatal error */ |
220 |
++ if (cqr->status == DASD_CQR_FAILED) { |
221 |
++ dasd_log_sense(cqr, &cqr->irb); |
222 |
++ } |
223 |
++ |
224 |
+ /* First of all call extended error reporting. */ |
225 |
+ if (dasd_eer_enabled(base) && |
226 |
+ cqr->status == DASD_CQR_FAILED) { |
227 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/block/dasd_eckd.c |
228 |
+=================================================================== |
229 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/block/dasd_eckd.c |
230 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/block/dasd_eckd.c |
231 |
+@@ -1501,12 +1501,27 @@ static void dasd_eckd_handle_unsolicited |
232 |
+ return; |
233 |
+ } |
234 |
+ |
235 |
+- /* just report other unsolicited interrupts */ |
236 |
+- DEV_MESSAGE(KERN_DEBUG, device, "%s", |
237 |
+- "unsolicited interrupt received"); |
238 |
+- device->discipline->dump_sense(device, NULL, irb); |
239 |
+- dasd_schedule_device_bh(device); |
240 |
++ if ((irb->scsw.cmd.cc == 1) && |
241 |
++ (irb->scsw.cmd.fctl & SCSW_FCTL_START_FUNC) && |
242 |
++ (irb->scsw.cmd.actl & SCSW_ACTL_START_PEND) && |
243 |
++ (irb->scsw.cmd.stctl & SCSW_STCTL_STATUS_PEND)) { |
244 |
++ /* fake irb do nothing, they are handled elsewhere */ |
245 |
++ dasd_schedule_device_bh(device); |
246 |
++ return; |
247 |
++ } |
248 |
+ |
249 |
++ if (!(irb->esw.esw0.erw.cons)) { |
250 |
++ /* just report other unsolicited interrupts */ |
251 |
++ DEV_MESSAGE(KERN_ERR, device, "%s", |
252 |
++ "unsolicited interrupt received"); |
253 |
++ } else { |
254 |
++ DEV_MESSAGE(KERN_ERR, device, "%s", |
255 |
++ "unsolicited interrupt received " |
256 |
++ "(sense available)"); |
257 |
++ device->discipline->dump_sense(device, NULL, irb); |
258 |
++ } |
259 |
++ |
260 |
++ dasd_schedule_device_bh(device); |
261 |
+ return; |
262 |
+ }; |
263 |
+ |
264 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/block/xpram.c |
265 |
+=================================================================== |
266 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/block/xpram.c |
267 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/block/xpram.c |
268 |
+@@ -56,6 +56,7 @@ typedef struct { |
269 |
+ static xpram_device_t xpram_devices[XPRAM_MAX_DEVS]; |
270 |
+ static unsigned int xpram_sizes[XPRAM_MAX_DEVS]; |
271 |
+ static struct gendisk *xpram_disks[XPRAM_MAX_DEVS]; |
272 |
++static struct request_queue *xpram_queues[XPRAM_MAX_DEVS]; |
273 |
+ static unsigned int xpram_pages; |
274 |
+ static int xpram_devs; |
275 |
+ |
276 |
+@@ -330,18 +331,22 @@ static int __init xpram_setup_sizes(unsi |
277 |
+ return 0; |
278 |
+ } |
279 |
+ |
280 |
+-static struct request_queue *xpram_queue; |
281 |
+- |
282 |
+ static int __init xpram_setup_blkdev(void) |
283 |
+ { |
284 |
+ unsigned long offset; |
285 |
+ int i, rc = -ENOMEM; |
286 |
+ |
287 |
+ for (i = 0; i < xpram_devs; i++) { |
288 |
+- struct gendisk *disk = alloc_disk(1); |
289 |
+- if (!disk) |
290 |
++ xpram_disks[i] = alloc_disk(1); |
291 |
++ if (!xpram_disks[i]) |
292 |
++ goto out; |
293 |
++ xpram_queues[i] = blk_alloc_queue(GFP_KERNEL); |
294 |
++ if (!xpram_queues[i]) { |
295 |
++ put_disk(xpram_disks[i]); |
296 |
+ goto out; |
297 |
+- xpram_disks[i] = disk; |
298 |
++ } |
299 |
++ blk_queue_make_request(xpram_queues[i], xpram_make_request); |
300 |
++ blk_queue_hardsect_size(xpram_queues[i], 4096); |
301 |
+ } |
302 |
+ |
303 |
+ /* |
304 |
+@@ -352,18 +357,6 @@ static int __init xpram_setup_blkdev(voi |
305 |
+ goto out; |
306 |
+ |
307 |
+ /* |
308 |
+- * Assign the other needed values: make request function, sizes and |
309 |
+- * hardsect size. All the minor devices feature the same value. |
310 |
+- */ |
311 |
+- xpram_queue = blk_alloc_queue(GFP_KERNEL); |
312 |
+- if (!xpram_queue) { |
313 |
+- rc = -ENOMEM; |
314 |
+- goto out_unreg; |
315 |
+- } |
316 |
+- blk_queue_make_request(xpram_queue, xpram_make_request); |
317 |
+- blk_queue_hardsect_size(xpram_queue, 4096); |
318 |
+- |
319 |
+- /* |
320 |
+ * Setup device structures. |
321 |
+ */ |
322 |
+ offset = 0; |
323 |
+@@ -377,18 +370,18 @@ static int __init xpram_setup_blkdev(voi |
324 |
+ disk->first_minor = i; |
325 |
+ disk->fops = &xpram_devops; |
326 |
+ disk->private_data = &xpram_devices[i]; |
327 |
+- disk->queue = xpram_queue; |
328 |
++ disk->queue = xpram_queues[i]; |
329 |
+ sprintf(disk->disk_name, "slram%d", i); |
330 |
+ set_capacity(disk, xpram_sizes[i] << 1); |
331 |
+ add_disk(disk); |
332 |
+ } |
333 |
+ |
334 |
+ return 0; |
335 |
+-out_unreg: |
336 |
+- unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME); |
337 |
+ out: |
338 |
+- while (i--) |
339 |
++ while (i--) { |
340 |
++ blk_cleanup_queue(xpram_queues[i]); |
341 |
+ put_disk(xpram_disks[i]); |
342 |
++ } |
343 |
+ return rc; |
344 |
+ } |
345 |
+ |
346 |
+@@ -400,10 +393,10 @@ static void __exit xpram_exit(void) |
347 |
+ int i; |
348 |
+ for (i = 0; i < xpram_devs; i++) { |
349 |
+ del_gendisk(xpram_disks[i]); |
350 |
++ blk_cleanup_queue(xpram_queues[i]); |
351 |
+ put_disk(xpram_disks[i]); |
352 |
+ } |
353 |
+ unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME); |
354 |
+- blk_cleanup_queue(xpram_queue); |
355 |
+ } |
356 |
+ |
357 |
+ static int __init xpram_init(void) |
358 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/con3215.c |
359 |
+=================================================================== |
360 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/con3215.c |
361 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/con3215.c |
362 |
+@@ -21,6 +21,7 @@ |
363 |
+ #include <linux/console.h> |
364 |
+ #include <linux/interrupt.h> |
365 |
+ #include <linux/err.h> |
366 |
++#include <linux/reboot.h> |
367 |
+ |
368 |
+ #include <linux/slab.h> |
369 |
+ #include <linux/bootmem.h> |
370 |
+@@ -88,7 +89,6 @@ struct raw3215_info { |
371 |
+ int count; /* number of bytes in output buffer */ |
372 |
+ int written; /* number of bytes in write requests */ |
373 |
+ struct tty_struct *tty; /* pointer to tty structure if present */ |
374 |
+- struct tasklet_struct tasklet; |
375 |
+ struct raw3215_req *queued_read; /* pointer to queued read requests */ |
376 |
+ struct raw3215_req *queued_write;/* pointer to queued write requests */ |
377 |
+ wait_queue_head_t empty_wait; /* wait queue for flushing */ |
378 |
+@@ -341,21 +341,14 @@ raw3215_try_io(struct raw3215_info *raw) |
379 |
+ } |
380 |
+ |
381 |
+ /* |
382 |
+- * The bottom half handler routine for 3215 devices. It tries to start |
383 |
+- * the next IO and wakes up processes waiting on the tty. |
384 |
++ * Try to start the next IO and wake up processes waiting on the tty. |
385 |
+ */ |
386 |
+-static void |
387 |
+-raw3215_tasklet(void *data) |
388 |
++static void raw3215_next_io(struct raw3215_info *raw) |
389 |
+ { |
390 |
+- struct raw3215_info *raw; |
391 |
+ struct tty_struct *tty; |
392 |
+- unsigned long flags; |
393 |
+ |
394 |
+- raw = (struct raw3215_info *) data; |
395 |
+- spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); |
396 |
+ raw3215_mk_write_req(raw); |
397 |
+ raw3215_try_io(raw); |
398 |
+- spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); |
399 |
+ tty = raw->tty; |
400 |
+ if (tty != NULL && |
401 |
+ RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) { |
402 |
+@@ -380,7 +373,7 @@ raw3215_irq(struct ccw_device *cdev, uns |
403 |
+ cstat = irb->scsw.cmd.cstat; |
404 |
+ dstat = irb->scsw.cmd.dstat; |
405 |
+ if (cstat != 0) |
406 |
+- tasklet_schedule(&raw->tasklet); |
407 |
++ raw3215_next_io(raw); |
408 |
+ if (dstat & 0x01) { /* we got a unit exception */ |
409 |
+ dstat &= ~0x01; /* we can ignore it */ |
410 |
+ } |
411 |
+@@ -390,7 +383,7 @@ raw3215_irq(struct ccw_device *cdev, uns |
412 |
+ break; |
413 |
+ /* Attention interrupt, someone hit the enter key */ |
414 |
+ raw3215_mk_read_req(raw); |
415 |
+- tasklet_schedule(&raw->tasklet); |
416 |
++ raw3215_next_io(raw); |
417 |
+ break; |
418 |
+ case 0x08: |
419 |
+ case 0x0C: |
420 |
+@@ -448,7 +441,7 @@ raw3215_irq(struct ccw_device *cdev, uns |
421 |
+ raw->queued_read == NULL) { |
422 |
+ wake_up_interruptible(&raw->empty_wait); |
423 |
+ } |
424 |
+- tasklet_schedule(&raw->tasklet); |
425 |
++ raw3215_next_io(raw); |
426 |
+ break; |
427 |
+ default: |
428 |
+ /* Strange interrupt, I'll do my best to clean up */ |
429 |
+@@ -460,7 +453,7 @@ raw3215_irq(struct ccw_device *cdev, uns |
430 |
+ raw->flags &= ~RAW3215_WORKING; |
431 |
+ raw3215_free_req(req); |
432 |
+ } |
433 |
+- tasklet_schedule(&raw->tasklet); |
434 |
++ raw3215_next_io(raw); |
435 |
+ } |
436 |
+ return; |
437 |
+ } |
438 |
+@@ -674,9 +667,6 @@ raw3215_probe (struct ccw_device *cdev) |
439 |
+ kfree(raw); |
440 |
+ return -ENOMEM; |
441 |
+ } |
442 |
+- tasklet_init(&raw->tasklet, |
443 |
+- (void (*)(unsigned long)) raw3215_tasklet, |
444 |
+- (unsigned long) raw); |
445 |
+ init_waitqueue_head(&raw->empty_wait); |
446 |
+ |
447 |
+ cdev->dev.driver_data = raw; |
448 |
+@@ -775,11 +765,11 @@ static struct tty_driver *con3215_device |
449 |
+ } |
450 |
+ |
451 |
+ /* |
452 |
+- * panic() calls console_unblank before the system enters a |
453 |
+- * disabled, endless loop. |
454 |
++ * panic() calls con3215_flush through a panic_notifier |
455 |
++ * before the system enters a disabled, endless loop. |
456 |
+ */ |
457 |
+ static void |
458 |
+-con3215_unblank(void) |
459 |
++con3215_flush(void) |
460 |
+ { |
461 |
+ struct raw3215_info *raw; |
462 |
+ unsigned long flags; |
463 |
+@@ -790,6 +780,23 @@ con3215_unblank(void) |
464 |
+ spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); |
465 |
+ } |
466 |
+ |
467 |
++static int con3215_notify(struct notifier_block *self, |
468 |
++ unsigned long event, void *data) |
469 |
++{ |
470 |
++ con3215_flush(); |
471 |
++ return NOTIFY_OK; |
472 |
++} |
473 |
++ |
474 |
++static struct notifier_block on_panic_nb = { |
475 |
++ .notifier_call = con3215_notify, |
476 |
++ .priority = 0, |
477 |
++}; |
478 |
++ |
479 |
++static struct notifier_block on_reboot_nb = { |
480 |
++ .notifier_call = con3215_notify, |
481 |
++ .priority = 0, |
482 |
++}; |
483 |
++ |
484 |
+ /* |
485 |
+ * The console structure for the 3215 console |
486 |
+ */ |
487 |
+@@ -797,7 +804,6 @@ static struct console con3215 = { |
488 |
+ .name = "ttyS", |
489 |
+ .write = con3215_write, |
490 |
+ .device = con3215_device, |
491 |
+- .unblank = con3215_unblank, |
492 |
+ .flags = CON_PRINTBUFFER, |
493 |
+ }; |
494 |
+ |
495 |
+@@ -846,9 +852,6 @@ con3215_init(void) |
496 |
+ cdev->handler = raw3215_irq; |
497 |
+ |
498 |
+ raw->flags |= RAW3215_FIXED; |
499 |
+- tasklet_init(&raw->tasklet, |
500 |
+- (void (*)(unsigned long)) raw3215_tasklet, |
501 |
+- (unsigned long) raw); |
502 |
+ init_waitqueue_head(&raw->empty_wait); |
503 |
+ |
504 |
+ /* Request the console irq */ |
505 |
+@@ -859,6 +862,8 @@ con3215_init(void) |
506 |
+ raw3215[0] = NULL; |
507 |
+ return -ENODEV; |
508 |
+ } |
509 |
++ atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); |
510 |
++ register_reboot_notifier(&on_reboot_nb); |
511 |
+ register_console(&con3215); |
512 |
+ return 0; |
513 |
+ } |
514 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/con3270.c |
515 |
+=================================================================== |
516 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/con3270.c |
517 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/con3270.c |
518 |
+@@ -15,6 +15,7 @@ |
519 |
+ #include <linux/list.h> |
520 |
+ #include <linux/types.h> |
521 |
+ #include <linux/err.h> |
522 |
++#include <linux/reboot.h> |
523 |
+ |
524 |
+ #include <asm/ccwdev.h> |
525 |
+ #include <asm/cio.h> |
526 |
+@@ -528,11 +529,11 @@ con3270_wait_write(struct con3270 *cp) |
527 |
+ } |
528 |
+ |
529 |
+ /* |
530 |
+- * panic() calls console_unblank before the system enters a |
531 |
+- * disabled, endless loop. |
532 |
++ * panic() calls con3270_flush through a panic_notifier |
533 |
++ * before the system enters a disabled, endless loop. |
534 |
+ */ |
535 |
+ static void |
536 |
+-con3270_unblank(void) |
537 |
++con3270_flush(void) |
538 |
+ { |
539 |
+ struct con3270 *cp; |
540 |
+ unsigned long flags; |
541 |
+@@ -554,6 +555,23 @@ con3270_unblank(void) |
542 |
+ spin_unlock_irqrestore(&cp->view.lock, flags); |
543 |
+ } |
544 |
+ |
545 |
++static int con3270_notify(struct notifier_block *self, |
546 |
++ unsigned long event, void *data) |
547 |
++{ |
548 |
++ con3270_flush(); |
549 |
++ return NOTIFY_OK; |
550 |
++} |
551 |
++ |
552 |
++static struct notifier_block on_panic_nb = { |
553 |
++ .notifier_call = con3270_notify, |
554 |
++ .priority = 0, |
555 |
++}; |
556 |
++ |
557 |
++static struct notifier_block on_reboot_nb = { |
558 |
++ .notifier_call = con3270_notify, |
559 |
++ .priority = 0, |
560 |
++}; |
561 |
++ |
562 |
+ /* |
563 |
+ * The console structure for the 3270 console |
564 |
+ */ |
565 |
+@@ -561,7 +579,6 @@ static struct console con3270 = { |
566 |
+ .name = "tty3270", |
567 |
+ .write = con3270_write, |
568 |
+ .device = con3270_device, |
569 |
+- .unblank = con3270_unblank, |
570 |
+ .flags = CON_PRINTBUFFER, |
571 |
+ }; |
572 |
+ |
573 |
+@@ -623,6 +640,8 @@ con3270_init(void) |
574 |
+ condev->cline->len = 0; |
575 |
+ con3270_create_status(condev); |
576 |
+ condev->input = alloc_string(&condev->freemem, 80); |
577 |
++ atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); |
578 |
++ register_reboot_notifier(&on_reboot_nb); |
579 |
+ register_console(&con3270); |
580 |
+ return 0; |
581 |
+ } |
582 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_cmd.c |
583 |
+=================================================================== |
584 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_cmd.c |
585 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_cmd.c |
586 |
+@@ -324,6 +324,9 @@ static int do_assign_storage(sclp_cmdw_t |
587 |
+ case 0x0120: |
588 |
+ break; |
589 |
+ default: |
590 |
++ pr_warning("assign storage failed (cmd=0x%08x, " |
591 |
++ "response=0x%04x, rn=0x%04x)\n", cmd, |
592 |
++ sccb->header.response_code, rn); |
593 |
+ rc = -EIO; |
594 |
+ break; |
595 |
+ } |
596 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_con.c |
597 |
+=================================================================== |
598 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_con.c |
599 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_con.c |
600 |
+@@ -16,6 +16,7 @@ |
601 |
+ #include <linux/bootmem.h> |
602 |
+ #include <linux/termios.h> |
603 |
+ #include <linux/err.h> |
604 |
++#include <linux/reboot.h> |
605 |
+ |
606 |
+ #include "sclp.h" |
607 |
+ #include "sclp_rw.h" |
608 |
+@@ -172,7 +173,7 @@ sclp_console_device(struct console *c, i |
609 |
+ * will be flushed to the SCLP. |
610 |
+ */ |
611 |
+ static void |
612 |
+-sclp_console_unblank(void) |
613 |
++sclp_console_flush(void) |
614 |
+ { |
615 |
+ unsigned long flags; |
616 |
+ |
617 |
+@@ -188,6 +189,24 @@ sclp_console_unblank(void) |
618 |
+ spin_unlock_irqrestore(&sclp_con_lock, flags); |
619 |
+ } |
620 |
+ |
621 |
++static int |
622 |
++sclp_console_notify(struct notifier_block *self, |
623 |
++ unsigned long event, void *data) |
624 |
++{ |
625 |
++ sclp_console_flush(); |
626 |
++ return NOTIFY_OK; |
627 |
++} |
628 |
++ |
629 |
++static struct notifier_block on_panic_nb = { |
630 |
++ .notifier_call = sclp_console_notify, |
631 |
++ .priority = 1, |
632 |
++}; |
633 |
++ |
634 |
++static struct notifier_block on_reboot_nb = { |
635 |
++ .notifier_call = sclp_console_notify, |
636 |
++ .priority = 1, |
637 |
++}; |
638 |
++ |
639 |
+ /* |
640 |
+ * used to register the SCLP console to the kernel and to |
641 |
+ * give printk necessary information |
642 |
+@@ -197,7 +216,6 @@ static struct console sclp_console = |
643 |
+ .name = sclp_console_name, |
644 |
+ .write = sclp_console_write, |
645 |
+ .device = sclp_console_device, |
646 |
+- .unblank = sclp_console_unblank, |
647 |
+ .flags = CON_PRINTBUFFER, |
648 |
+ .index = 0 /* ttyS0 */ |
649 |
+ }; |
650 |
+@@ -241,6 +259,8 @@ sclp_console_init(void) |
651 |
+ sclp_con_width_htab = 8; |
652 |
+ |
653 |
+ /* enable printk-access to this driver */ |
654 |
++ atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); |
655 |
++ register_reboot_notifier(&on_reboot_nb); |
656 |
+ register_console(&sclp_console); |
657 |
+ return 0; |
658 |
+ } |
659 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_vt220.c |
660 |
+=================================================================== |
661 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_vt220.c |
662 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_vt220.c |
663 |
+@@ -24,6 +24,8 @@ |
664 |
+ #include <linux/bootmem.h> |
665 |
+ #include <linux/interrupt.h> |
666 |
+ #include <linux/init.h> |
667 |
++#include <linux/reboot.h> |
668 |
++ |
669 |
+ #include <asm/uaccess.h> |
670 |
+ #include "sclp.h" |
671 |
+ |
672 |
+@@ -743,24 +745,30 @@ sclp_vt220_con_device(struct console *c, |
673 |
+ return sclp_vt220_driver; |
674 |
+ } |
675 |
+ |
676 |
+-/* |
677 |
+- * This routine is called from panic when the kernel is going to give up. |
678 |
+- * We have to make sure that all buffers will be flushed to the SCLP. |
679 |
+- * Note that this function may be called from within an interrupt context. |
680 |
+- */ |
681 |
+-static void |
682 |
+-sclp_vt220_con_unblank(void) |
683 |
++static int |
684 |
++sclp_vt220_notify(struct notifier_block *self, |
685 |
++ unsigned long event, void *data) |
686 |
+ { |
687 |
+ __sclp_vt220_flush_buffer(); |
688 |
++ return NOTIFY_OK; |
689 |
+ } |
690 |
+ |
691 |
++static struct notifier_block on_panic_nb = { |
692 |
++ .notifier_call = sclp_vt220_notify, |
693 |
++ .priority = 1, |
694 |
++}; |
695 |
++ |
696 |
++static struct notifier_block on_reboot_nb = { |
697 |
++ .notifier_call = sclp_vt220_notify, |
698 |
++ .priority = 1, |
699 |
++}; |
700 |
++ |
701 |
+ /* Structure needed to register with printk */ |
702 |
+ static struct console sclp_vt220_console = |
703 |
+ { |
704 |
+ .name = SCLP_VT220_CONSOLE_NAME, |
705 |
+ .write = sclp_vt220_con_write, |
706 |
+ .device = sclp_vt220_con_device, |
707 |
+- .unblank = sclp_vt220_con_unblank, |
708 |
+ .flags = CON_PRINTBUFFER, |
709 |
+ .index = SCLP_VT220_CONSOLE_INDEX |
710 |
+ }; |
711 |
+@@ -776,6 +784,8 @@ sclp_vt220_con_init(void) |
712 |
+ if (rc) |
713 |
+ return rc; |
714 |
+ /* Attach linux console */ |
715 |
++ atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); |
716 |
++ register_reboot_notifier(&on_reboot_nb); |
717 |
+ register_console(&sclp_vt220_console); |
718 |
+ return 0; |
719 |
+ } |
720 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/tape_block.c |
721 |
+=================================================================== |
722 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/tape_block.c |
723 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/tape_block.c |
724 |
+@@ -76,7 +76,7 @@ tapeblock_trigger_requeue(struct tape_de |
725 |
+ static void |
726 |
+ tapeblock_end_request(struct request *req, int error) |
727 |
+ { |
728 |
+- if (__blk_end_request(req, error, blk_rq_bytes(req))) |
729 |
++ if (blk_end_request(req, error, blk_rq_bytes(req))) |
730 |
+ BUG(); |
731 |
+ } |
732 |
+ |
733 |
+@@ -166,7 +166,7 @@ tapeblock_requeue(struct work_struct *wo |
734 |
+ nr_queued++; |
735 |
+ spin_unlock(get_ccwdev_lock(device->cdev)); |
736 |
+ |
737 |
+- spin_lock(&device->blk_data.request_queue_lock); |
738 |
++ spin_lock_irq(&device->blk_data.request_queue_lock); |
739 |
+ while ( |
740 |
+ !blk_queue_plugged(queue) && |
741 |
+ elv_next_request(queue) && |
742 |
+@@ -176,7 +176,9 @@ tapeblock_requeue(struct work_struct *wo |
743 |
+ if (rq_data_dir(req) == WRITE) { |
744 |
+ DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); |
745 |
+ blkdev_dequeue_request(req); |
746 |
++ spin_unlock_irq(&device->blk_data.request_queue_lock); |
747 |
+ tapeblock_end_request(req, -EIO); |
748 |
++ spin_lock_irq(&device->blk_data.request_queue_lock); |
749 |
+ continue; |
750 |
+ } |
751 |
+ blkdev_dequeue_request(req); |
752 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/tape_core.c |
753 |
+=================================================================== |
754 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/tape_core.c |
755 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/tape_core.c |
756 |
+@@ -1199,7 +1199,7 @@ tape_open(struct tape_device *device) |
757 |
+ { |
758 |
+ int rc; |
759 |
+ |
760 |
+- spin_lock(get_ccwdev_lock(device->cdev)); |
761 |
++ spin_lock_irq(get_ccwdev_lock(device->cdev)); |
762 |
+ if (device->tape_state == TS_NOT_OPER) { |
763 |
+ DBF_EVENT(6, "TAPE:nodev\n"); |
764 |
+ rc = -ENODEV; |
765 |
+@@ -1217,7 +1217,7 @@ tape_open(struct tape_device *device) |
766 |
+ tape_state_set(device, TS_IN_USE); |
767 |
+ rc = 0; |
768 |
+ } |
769 |
+- spin_unlock(get_ccwdev_lock(device->cdev)); |
770 |
++ spin_unlock_irq(get_ccwdev_lock(device->cdev)); |
771 |
+ return rc; |
772 |
+ } |
773 |
+ |
774 |
+@@ -1227,11 +1227,11 @@ tape_open(struct tape_device *device) |
775 |
+ int |
776 |
+ tape_release(struct tape_device *device) |
777 |
+ { |
778 |
+- spin_lock(get_ccwdev_lock(device->cdev)); |
779 |
++ spin_lock_irq(get_ccwdev_lock(device->cdev)); |
780 |
+ if (device->tape_state == TS_IN_USE) |
781 |
+ tape_state_set(device, TS_UNUSED); |
782 |
+ module_put(device->discipline->owner); |
783 |
+- spin_unlock(get_ccwdev_lock(device->cdev)); |
784 |
++ spin_unlock_irq(get_ccwdev_lock(device->cdev)); |
785 |
+ return 0; |
786 |
+ } |
787 |
+ |
788 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/blacklist.c |
789 |
+=================================================================== |
790 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/blacklist.c |
791 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/blacklist.c |
792 |
+@@ -24,6 +24,7 @@ |
793 |
+ #include "cio.h" |
794 |
+ #include "cio_debug.h" |
795 |
+ #include "css.h" |
796 |
++#include "device.h" |
797 |
+ |
798 |
+ /* |
799 |
+ * "Blacklisting" of certain devices: |
800 |
+@@ -191,9 +192,9 @@ static int blacklist_parse_parameters(ch |
801 |
+ rc = blacklist_range(ra, from_ssid, to_ssid, from, to, |
802 |
+ msgtrigger); |
803 |
+ if (rc) |
804 |
+- totalrc = 1; |
805 |
++ totalrc = -EINVAL; |
806 |
+ } else |
807 |
+- totalrc = 1; |
808 |
++ totalrc = -EINVAL; |
809 |
+ } |
810 |
+ |
811 |
+ return totalrc; |
812 |
+@@ -240,8 +241,10 @@ static int blacklist_parse_proc_paramete |
813 |
+ rc = blacklist_parse_parameters(buf, free, 0); |
814 |
+ else if (strcmp("add", parm) == 0) |
815 |
+ rc = blacklist_parse_parameters(buf, add, 0); |
816 |
++ else if (strcmp("purge", parm) == 0) |
817 |
++ return ccw_purge_blacklisted(); |
818 |
+ else |
819 |
+- return 1; |
820 |
++ return -EINVAL; |
821 |
+ |
822 |
+ css_schedule_reprobe(); |
823 |
+ |
824 |
+@@ -353,7 +356,7 @@ cio_ignore_write(struct file *file, cons |
825 |
+ } |
826 |
+ ret = blacklist_parse_proc_parameters(buf); |
827 |
+ if (ret) |
828 |
+- rc = -EINVAL; |
829 |
++ rc = ret; |
830 |
+ else |
831 |
+ rc = user_len; |
832 |
+ |
833 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/cio.c |
834 |
+=================================================================== |
835 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/cio.c |
836 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/cio.c |
837 |
+@@ -114,6 +114,7 @@ cio_tpi(void) |
838 |
+ struct tpi_info *tpi_info; |
839 |
+ struct subchannel *sch; |
840 |
+ struct irb *irb; |
841 |
++ int irq_context; |
842 |
+ |
843 |
+ tpi_info = (struct tpi_info *) __LC_SUBCHANNEL_ID; |
844 |
+ if (tpi (NULL) != 1) |
845 |
+@@ -126,7 +127,9 @@ cio_tpi(void) |
846 |
+ sch = (struct subchannel *)(unsigned long)tpi_info->intparm; |
847 |
+ if (!sch) |
848 |
+ return 1; |
849 |
+- local_bh_disable(); |
850 |
++ irq_context = in_interrupt(); |
851 |
++ if (!irq_context) |
852 |
++ local_bh_disable(); |
853 |
+ irq_enter (); |
854 |
+ spin_lock(sch->lock); |
855 |
+ memcpy(&sch->schib.scsw, &irb->scsw, sizeof(union scsw)); |
856 |
+@@ -134,7 +137,8 @@ cio_tpi(void) |
857 |
+ sch->driver->irq(sch); |
858 |
+ spin_unlock(sch->lock); |
859 |
+ irq_exit (); |
860 |
+- _local_bh_enable(); |
861 |
++ if (!irq_context) |
862 |
++ _local_bh_enable(); |
863 |
+ return 1; |
864 |
+ } |
865 |
+ |
866 |
+@@ -892,7 +896,7 @@ static void cio_reset_pgm_check_handler( |
867 |
+ pgm_check_occured = 1; |
868 |
+ } |
869 |
+ |
870 |
+-static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr) |
871 |
++static int stsch_reset(struct subchannel_id schid, struct schib *addr) |
872 |
+ { |
873 |
+ int rc; |
874 |
+ |
875 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/device.c |
876 |
+=================================================================== |
877 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/device.c |
878 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/device.c |
879 |
+@@ -31,6 +31,7 @@ |
880 |
+ #include "device.h" |
881 |
+ #include "ioasm.h" |
882 |
+ #include "io_sch.h" |
883 |
++#include "blacklist.h" |
884 |
+ |
885 |
+ static struct timer_list recovery_timer; |
886 |
+ static DEFINE_SPINLOCK(recovery_lock); |
887 |
+@@ -296,36 +297,33 @@ static void ccw_device_unregister(struct |
888 |
+ device_del(&cdev->dev); |
889 |
+ } |
890 |
+ |
891 |
+-static void ccw_device_remove_orphan_cb(struct device *dev) |
892 |
++static void ccw_device_remove_orphan_cb(struct work_struct *work) |
893 |
+ { |
894 |
+- struct ccw_device *cdev = to_ccwdev(dev); |
895 |
++ struct ccw_device_private *priv; |
896 |
++ struct ccw_device *cdev; |
897 |
+ |
898 |
++ priv = container_of(work, struct ccw_device_private, kick_work); |
899 |
++ cdev = priv->cdev; |
900 |
+ ccw_device_unregister(cdev); |
901 |
+ put_device(&cdev->dev); |
902 |
++ /* Release cdev reference for workqueue processing. */ |
903 |
++ put_device(&cdev->dev); |
904 |
+ } |
905 |
+ |
906 |
+-static void ccw_device_remove_sch_cb(struct device *dev) |
907 |
+-{ |
908 |
+- struct subchannel *sch; |
909 |
+- |
910 |
+- sch = to_subchannel(dev); |
911 |
+- css_sch_device_unregister(sch); |
912 |
+- /* Reset intparm to zeroes. */ |
913 |
+- sch->schib.pmcw.intparm = 0; |
914 |
+- cio_modify(sch); |
915 |
+- put_device(&sch->dev); |
916 |
+-} |
917 |
++static void ccw_device_call_sch_unregister(struct work_struct *work); |
918 |
+ |
919 |
+ static void |
920 |
+ ccw_device_remove_disconnected(struct ccw_device *cdev) |
921 |
+ { |
922 |
+ unsigned long flags; |
923 |
+- int rc; |
924 |
+ |
925 |
+ /* |
926 |
+ * Forced offline in disconnected state means |
927 |
+ * 'throw away device'. |
928 |
+ */ |
929 |
++ /* Get cdev reference for workqueue processing. */ |
930 |
++ if (!get_device(&cdev->dev)) |
931 |
++ return; |
932 |
+ if (ccw_device_is_orphan(cdev)) { |
933 |
+ /* |
934 |
+ * Deregister ccw device. |
935 |
+@@ -335,23 +333,13 @@ ccw_device_remove_disconnected(struct cc |
936 |
+ spin_lock_irqsave(cdev->ccwlock, flags); |
937 |
+ cdev->private->state = DEV_STATE_NOT_OPER; |
938 |
+ spin_unlock_irqrestore(cdev->ccwlock, flags); |
939 |
+- rc = device_schedule_callback(&cdev->dev, |
940 |
+- ccw_device_remove_orphan_cb); |
941 |
+- if (rc) |
942 |
+- CIO_MSG_EVENT(0, "Couldn't unregister orphan " |
943 |
+- "0.%x.%04x\n", |
944 |
+- cdev->private->dev_id.ssid, |
945 |
+- cdev->private->dev_id.devno); |
946 |
+- return; |
947 |
+- } |
948 |
+- /* Deregister subchannel, which will kill the ccw device. */ |
949 |
+- rc = device_schedule_callback(cdev->dev.parent, |
950 |
+- ccw_device_remove_sch_cb); |
951 |
+- if (rc) |
952 |
+- CIO_MSG_EVENT(0, "Couldn't unregister disconnected device " |
953 |
+- "0.%x.%04x\n", |
954 |
+- cdev->private->dev_id.ssid, |
955 |
+- cdev->private->dev_id.devno); |
956 |
++ PREPARE_WORK(&cdev->private->kick_work, |
957 |
++ ccw_device_remove_orphan_cb); |
958 |
++ } else |
959 |
++ /* Deregister subchannel, which will kill the ccw device. */ |
960 |
++ PREPARE_WORK(&cdev->private->kick_work, |
961 |
++ ccw_device_call_sch_unregister); |
962 |
++ queue_work(slow_path_wq, &cdev->private->kick_work); |
963 |
+ } |
964 |
+ |
965 |
+ /** |
966 |
+@@ -886,11 +874,15 @@ void ccw_device_move_to_orphanage(struct |
967 |
+ replacing_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev); |
968 |
+ if (replacing_cdev) { |
969 |
+ sch_attach_disconnected_device(sch, replacing_cdev); |
970 |
++ /* Release reference from get_disc_ccwdev_by_dev_id() */ |
971 |
++ put_device(&cdev->dev); |
972 |
+ return; |
973 |
+ } |
974 |
+ replacing_cdev = get_orphaned_ccwdev_by_dev_id(css, &dev_id); |
975 |
+ if (replacing_cdev) { |
976 |
+ sch_attach_orphaned_device(sch, replacing_cdev); |
977 |
++ /* Release reference from get_orphaned_ccwdev_by_dev_id() */ |
978 |
++ put_device(&cdev->dev); |
979 |
+ return; |
980 |
+ } |
981 |
+ sch_create_and_recog_new_device(sch); |
982 |
+@@ -970,12 +962,17 @@ static void ccw_device_call_sch_unregist |
983 |
+ |
984 |
+ priv = container_of(work, struct ccw_device_private, kick_work); |
985 |
+ cdev = priv->cdev; |
986 |
++ /* Get subchannel reference for local processing. */ |
987 |
++ if (!get_device(cdev->dev.parent)) |
988 |
++ return; |
989 |
+ sch = to_subchannel(cdev->dev.parent); |
990 |
+ css_sch_device_unregister(sch); |
991 |
+ /* Reset intparm to zeroes. */ |
992 |
+ sch->schib.pmcw.intparm = 0; |
993 |
+ cio_modify(sch); |
994 |
++ /* Release cdev reference for workqueue processing.*/ |
995 |
+ put_device(&cdev->dev); |
996 |
++ /* Release subchannel reference for local processing. */ |
997 |
+ put_device(&sch->dev); |
998 |
+ } |
999 |
+ |
1000 |
+@@ -1001,6 +998,8 @@ io_subchannel_recog_done(struct ccw_devi |
1001 |
+ PREPARE_WORK(&cdev->private->kick_work, |
1002 |
+ ccw_device_call_sch_unregister); |
1003 |
+ queue_work(slow_path_wq, &cdev->private->kick_work); |
1004 |
++ /* Release subchannel reference for asynchronous recognition. */ |
1005 |
++ put_device(&sch->dev); |
1006 |
+ if (atomic_dec_and_test(&ccw_device_init_count)) |
1007 |
+ wake_up(&ccw_device_init_wq); |
1008 |
+ break; |
1009 |
+@@ -1476,6 +1475,45 @@ static void ccw_device_schedule_recovery |
1010 |
+ spin_unlock_irqrestore(&recovery_lock, flags); |
1011 |
+ } |
1012 |
+ |
1013 |
++static int purge_fn(struct device *dev, void *data) |
1014 |
++{ |
1015 |
++ struct ccw_device *cdev = to_ccwdev(dev); |
1016 |
++ struct ccw_device_private *priv = cdev->private; |
1017 |
++ int unreg; |
1018 |
++ |
1019 |
++ spin_lock_irq(cdev->ccwlock); |
1020 |
++ unreg = is_blacklisted(priv->dev_id.ssid, priv->dev_id.devno) && |
1021 |
++ (priv->state == DEV_STATE_OFFLINE); |
1022 |
++ spin_unlock_irq(cdev->ccwlock); |
1023 |
++ if (!unreg) |
1024 |
++ goto out; |
1025 |
++ if (!get_device(&cdev->dev)) |
1026 |
++ goto out; |
1027 |
++ CIO_MSG_EVENT(3, "ccw: purging 0.%x.%04x\n", priv->dev_id.ssid, |
1028 |
++ priv->dev_id.devno); |
1029 |
++ PREPARE_WORK(&cdev->private->kick_work, ccw_device_call_sch_unregister); |
1030 |
++ queue_work(slow_path_wq, &cdev->private->kick_work); |
1031 |
++ |
1032 |
++out: |
1033 |
++ /* Abort loop in case of pending signal. */ |
1034 |
++ if (signal_pending(current)) |
1035 |
++ return -EINTR; |
1036 |
++ |
1037 |
++ return 0; |
1038 |
++} |
1039 |
++ |
1040 |
++/** |
1041 |
++ * ccw_purge_blacklisted - purge unused, blacklisted devices |
1042 |
++ * |
1043 |
++ * Unregister all ccw devices that are offline and on the blacklist. |
1044 |
++ */ |
1045 |
++int ccw_purge_blacklisted(void) |
1046 |
++{ |
1047 |
++ CIO_MSG_EVENT(2, "ccw: purging blacklisted devices\n"); |
1048 |
++ bus_for_each_dev(&ccw_bus_type, NULL, NULL, purge_fn); |
1049 |
++ return 0; |
1050 |
++} |
1051 |
++ |
1052 |
+ static void device_set_disconnected(struct ccw_device *cdev) |
1053 |
+ { |
1054 |
+ if (!cdev) |
1055 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/device.h |
1056 |
+=================================================================== |
1057 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/device.h |
1058 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/device.h |
1059 |
+@@ -86,6 +86,7 @@ int ccw_device_is_orphan(struct ccw_devi |
1060 |
+ int ccw_device_recognition(struct ccw_device *); |
1061 |
+ int ccw_device_online(struct ccw_device *); |
1062 |
+ int ccw_device_offline(struct ccw_device *); |
1063 |
++int ccw_purge_blacklisted(void); |
1064 |
+ |
1065 |
+ /* Function prototypes for device status and basic sense stuff. */ |
1066 |
+ void ccw_device_accumulate_irb(struct ccw_device *, struct irb *); |
1067 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/io_sch.h |
1068 |
+=================================================================== |
1069 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/io_sch.h |
1070 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/io_sch.h |
1071 |
+@@ -123,7 +123,7 @@ struct ccw_device_private { |
1072 |
+ void *cmb_wait; /* deferred cmb enable/disable */ |
1073 |
+ }; |
1074 |
+ |
1075 |
+-static inline int ssch(struct subchannel_id schid, volatile union orb *addr) |
1076 |
++static inline int ssch(struct subchannel_id schid, union orb *addr) |
1077 |
+ { |
1078 |
+ register struct subchannel_id reg1 asm("1") = schid; |
1079 |
+ int ccode = -EIO; |
1080 |
+@@ -134,7 +134,9 @@ static inline int ssch(struct subchannel |
1081 |
+ " srl %0,28\n" |
1082 |
+ "1:\n" |
1083 |
+ EX_TABLE(0b, 1b) |
1084 |
+- : "+d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc"); |
1085 |
++ : "+d" (ccode) |
1086 |
++ : "d" (reg1), "a" (addr), "m" (*addr) |
1087 |
++ : "cc", "memory"); |
1088 |
+ return ccode; |
1089 |
+ } |
1090 |
+ |
1091 |
+@@ -147,7 +149,9 @@ static inline int rsch(struct subchannel |
1092 |
+ " rsch\n" |
1093 |
+ " ipm %0\n" |
1094 |
+ " srl %0,28" |
1095 |
+- : "=d" (ccode) : "d" (reg1) : "cc"); |
1096 |
++ : "=d" (ccode) |
1097 |
++ : "d" (reg1) |
1098 |
++ : "cc", "memory"); |
1099 |
+ return ccode; |
1100 |
+ } |
1101 |
+ |
1102 |
+@@ -160,7 +164,9 @@ static inline int csch(struct subchannel |
1103 |
+ " csch\n" |
1104 |
+ " ipm %0\n" |
1105 |
+ " srl %0,28" |
1106 |
+- : "=d" (ccode) : "d" (reg1) : "cc"); |
1107 |
++ : "=d" (ccode) |
1108 |
++ : "d" (reg1) |
1109 |
++ : "cc"); |
1110 |
+ return ccode; |
1111 |
+ } |
1112 |
+ |
1113 |
+@@ -173,7 +179,9 @@ static inline int hsch(struct subchannel |
1114 |
+ " hsch\n" |
1115 |
+ " ipm %0\n" |
1116 |
+ " srl %0,28" |
1117 |
+- : "=d" (ccode) : "d" (reg1) : "cc"); |
1118 |
++ : "=d" (ccode) |
1119 |
++ : "d" (reg1) |
1120 |
++ : "cc"); |
1121 |
+ return ccode; |
1122 |
+ } |
1123 |
+ |
1124 |
+@@ -186,7 +194,9 @@ static inline int xsch(struct subchannel |
1125 |
+ " .insn rre,0xb2760000,%1,0\n" |
1126 |
+ " ipm %0\n" |
1127 |
+ " srl %0,28" |
1128 |
+- : "=d" (ccode) : "d" (reg1) : "cc"); |
1129 |
++ : "=d" (ccode) |
1130 |
++ : "d" (reg1) |
1131 |
++ : "cc"); |
1132 |
+ return ccode; |
1133 |
+ } |
1134 |
+ |
1135 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/ioasm.h |
1136 |
+=================================================================== |
1137 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/ioasm.h |
1138 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/ioasm.h |
1139 |
+@@ -23,38 +23,39 @@ struct tpi_info { |
1140 |
+ * Some S390 specific IO instructions as inline |
1141 |
+ */ |
1142 |
+ |
1143 |
+-static inline int stsch(struct subchannel_id schid, |
1144 |
+- volatile struct schib *addr) |
1145 |
++static inline int stsch(struct subchannel_id schid, struct schib *addr) |
1146 |
+ { |
1147 |
+ register struct subchannel_id reg1 asm ("1") = schid; |
1148 |
+ int ccode; |
1149 |
+ |
1150 |
+ asm volatile( |
1151 |
+- " stsch 0(%2)\n" |
1152 |
++ " stsch 0(%3)\n" |
1153 |
+ " ipm %0\n" |
1154 |
+ " srl %0,28" |
1155 |
+- : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc"); |
1156 |
++ : "=d" (ccode), "=m" (*addr) |
1157 |
++ : "d" (reg1), "a" (addr) |
1158 |
++ : "cc"); |
1159 |
+ return ccode; |
1160 |
+ } |
1161 |
+ |
1162 |
+-static inline int stsch_err(struct subchannel_id schid, |
1163 |
+- volatile struct schib *addr) |
1164 |
++static inline int stsch_err(struct subchannel_id schid, struct schib *addr) |
1165 |
+ { |
1166 |
+ register struct subchannel_id reg1 asm ("1") = schid; |
1167 |
+ int ccode = -EIO; |
1168 |
+ |
1169 |
+ asm volatile( |
1170 |
+- " stsch 0(%2)\n" |
1171 |
++ " stsch 0(%3)\n" |
1172 |
+ "0: ipm %0\n" |
1173 |
+ " srl %0,28\n" |
1174 |
+ "1:\n" |
1175 |
+ EX_TABLE(0b,1b) |
1176 |
+- : "+d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc"); |
1177 |
++ : "+d" (ccode), "=m" (*addr) |
1178 |
++ : "d" (reg1), "a" (addr) |
1179 |
++ : "cc"); |
1180 |
+ return ccode; |
1181 |
+ } |
1182 |
+ |
1183 |
+-static inline int msch(struct subchannel_id schid, |
1184 |
+- volatile struct schib *addr) |
1185 |
++static inline int msch(struct subchannel_id schid, struct schib *addr) |
1186 |
+ { |
1187 |
+ register struct subchannel_id reg1 asm ("1") = schid; |
1188 |
+ int ccode; |
1189 |
+@@ -63,12 +64,13 @@ static inline int msch(struct subchannel |
1190 |
+ " msch 0(%2)\n" |
1191 |
+ " ipm %0\n" |
1192 |
+ " srl %0,28" |
1193 |
+- : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc"); |
1194 |
++ : "=d" (ccode) |
1195 |
++ : "d" (reg1), "a" (addr), "m" (*addr) |
1196 |
++ : "cc"); |
1197 |
+ return ccode; |
1198 |
+ } |
1199 |
+ |
1200 |
+-static inline int msch_err(struct subchannel_id schid, |
1201 |
+- volatile struct schib *addr) |
1202 |
++static inline int msch_err(struct subchannel_id schid, struct schib *addr) |
1203 |
+ { |
1204 |
+ register struct subchannel_id reg1 asm ("1") = schid; |
1205 |
+ int ccode = -EIO; |
1206 |
+@@ -79,33 +81,38 @@ static inline int msch_err(struct subcha |
1207 |
+ " srl %0,28\n" |
1208 |
+ "1:\n" |
1209 |
+ EX_TABLE(0b,1b) |
1210 |
+- : "+d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc"); |
1211 |
++ : "+d" (ccode) |
1212 |
++ : "d" (reg1), "a" (addr), "m" (*addr) |
1213 |
++ : "cc"); |
1214 |
+ return ccode; |
1215 |
+ } |
1216 |
+ |
1217 |
+-static inline int tsch(struct subchannel_id schid, |
1218 |
+- volatile struct irb *addr) |
1219 |
++static inline int tsch(struct subchannel_id schid, struct irb *addr) |
1220 |
+ { |
1221 |
+ register struct subchannel_id reg1 asm ("1") = schid; |
1222 |
+ int ccode; |
1223 |
+ |
1224 |
+ asm volatile( |
1225 |
+- " tsch 0(%2)\n" |
1226 |
++ " tsch 0(%3)\n" |
1227 |
+ " ipm %0\n" |
1228 |
+ " srl %0,28" |
1229 |
+- : "=d" (ccode) : "d" (reg1), "a" (addr), "m" (*addr) : "cc"); |
1230 |
++ : "=d" (ccode), "=m" (*addr) |
1231 |
++ : "d" (reg1), "a" (addr) |
1232 |
++ : "cc"); |
1233 |
+ return ccode; |
1234 |
+ } |
1235 |
+ |
1236 |
+-static inline int tpi( volatile struct tpi_info *addr) |
1237 |
++static inline int tpi(struct tpi_info *addr) |
1238 |
+ { |
1239 |
+ int ccode; |
1240 |
+ |
1241 |
+ asm volatile( |
1242 |
+- " tpi 0(%1)\n" |
1243 |
++ " tpi 0(%2)\n" |
1244 |
+ " ipm %0\n" |
1245 |
+ " srl %0,28" |
1246 |
+- : "=d" (ccode) : "a" (addr), "m" (*addr) : "cc"); |
1247 |
++ : "=d" (ccode), "=m" (*addr) |
1248 |
++ : "a" (addr) |
1249 |
++ : "cc"); |
1250 |
+ return ccode; |
1251 |
+ } |
1252 |
+ |
1253 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio.h |
1254 |
+=================================================================== |
1255 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/qdio.h |
1256 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio.h |
1257 |
+@@ -16,6 +16,14 @@ |
1258 |
+ #define QDIO_BUSY_BIT_GIVE_UP 2000000 /* 2 seconds = eternity */ |
1259 |
+ #define QDIO_INPUT_THRESHOLD 500 /* 500 microseconds */ |
1260 |
+ |
1261 |
++/* |
1262 |
++ * if an asynchronous HiperSockets queue runs full, the 10 seconds timer wait |
1263 |
++ * till next initiative to give transmitted skbs back to the stack is too long. |
1264 |
++ * Therefore polling is started in case of multicast queue is filled more |
1265 |
++ * than 50 percent. |
1266 |
++ */ |
1267 |
++#define QDIO_IQDIO_POLL_LVL 65 /* HS multicast queue */ |
1268 |
++ |
1269 |
+ enum qdio_irq_states { |
1270 |
+ QDIO_IRQ_STATE_INACTIVE, |
1271 |
+ QDIO_IRQ_STATE_ESTABLISHED, |
1272 |
+@@ -367,6 +375,9 @@ void qdio_int_handler(struct ccw_device |
1273 |
+ int qdio_allocate_qs(struct qdio_irq *irq_ptr, int nr_input_qs, |
1274 |
+ int nr_output_qs); |
1275 |
+ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr); |
1276 |
++int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr, |
1277 |
++ struct subchannel_id *schid, |
1278 |
++ struct qdio_ssqd_desc *data); |
1279 |
+ int qdio_setup_irq(struct qdio_initialize *init_data); |
1280 |
+ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr, |
1281 |
+ struct ccw_device *cdev); |
1282 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_debug.c |
1283 |
+=================================================================== |
1284 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/qdio_debug.c |
1285 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_debug.c |
1286 |
+@@ -20,6 +20,7 @@ static struct dentry *debugfs_root; |
1287 |
+ #define MAX_DEBUGFS_QUEUES 32 |
1288 |
+ static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL }; |
1289 |
+ static DEFINE_MUTEX(debugfs_mutex); |
1290 |
++#define QDIO_DEBUGFS_NAME_LEN 40 |
1291 |
+ |
1292 |
+ void qdio_allocate_do_dbf(struct qdio_initialize *init_data) |
1293 |
+ { |
1294 |
+@@ -152,17 +153,6 @@ static int qstat_seq_open(struct inode * |
1295 |
+ filp->f_path.dentry->d_inode->i_private); |
1296 |
+ } |
1297 |
+ |
1298 |
+-static void get_queue_name(struct qdio_q *q, struct ccw_device *cdev, char *name) |
1299 |
+-{ |
1300 |
+- memset(name, 0, sizeof(name)); |
1301 |
+- sprintf(name, "%s", cdev->dev.bus_id); |
1302 |
+- if (q->is_input_q) |
1303 |
+- sprintf(name + strlen(name), "_input"); |
1304 |
+- else |
1305 |
+- sprintf(name + strlen(name), "_output"); |
1306 |
+- sprintf(name + strlen(name), "_%d", q->nr); |
1307 |
+-} |
1308 |
+- |
1309 |
+ static void remove_debugfs_entry(struct qdio_q *q) |
1310 |
+ { |
1311 |
+ int i; |
1312 |
+@@ -189,14 +179,17 @@ static struct file_operations debugfs_fo |
1313 |
+ static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev) |
1314 |
+ { |
1315 |
+ int i = 0; |
1316 |
+- char name[40]; |
1317 |
++ char name[QDIO_DEBUGFS_NAME_LEN]; |
1318 |
+ |
1319 |
+ while (debugfs_queues[i] != NULL) { |
1320 |
+ i++; |
1321 |
+ if (i >= MAX_DEBUGFS_QUEUES) |
1322 |
+ return; |
1323 |
+ } |
1324 |
+- get_queue_name(q, cdev, name); |
1325 |
++ snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%s_%d", |
1326 |
++ dev_name(&cdev->dev), |
1327 |
++ q->is_input_q ? "input" : "output", |
1328 |
++ q->nr); |
1329 |
+ debugfs_queues[i] = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, |
1330 |
+ debugfs_root, q, &debugfs_fops); |
1331 |
+ } |
1332 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_main.c |
1333 |
+=================================================================== |
1334 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/qdio_main.c |
1335 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_main.c |
1336 |
+@@ -851,6 +851,12 @@ static void __qdio_outbound_processing(s |
1337 |
+ if (queue_type(q) == QDIO_IQDIO_QFMT && !multicast_outbound(q)) |
1338 |
+ return; |
1339 |
+ |
1340 |
++ if ((queue_type(q) == QDIO_IQDIO_QFMT) && |
1341 |
++ (atomic_read(&q->nr_buf_used)) > QDIO_IQDIO_POLL_LVL) { |
1342 |
++ tasklet_schedule(&q->tasklet); |
1343 |
++ return; |
1344 |
++ } |
1345 |
++ |
1346 |
+ if (q->u.out.pci_out_enabled) |
1347 |
+ return; |
1348 |
+ |
1349 |
+@@ -1074,7 +1080,6 @@ void qdio_int_handler(struct ccw_device |
1350 |
+ case -EIO: |
1351 |
+ sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no); |
1352 |
+ QDIO_DBF_TEXT2(1, setup, dbf_text); |
1353 |
+- qdio_int_error(cdev); |
1354 |
+ return; |
1355 |
+ case -ETIMEDOUT: |
1356 |
+ sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no); |
1357 |
+@@ -1121,23 +1126,23 @@ void qdio_int_handler(struct ccw_device |
1358 |
+ /** |
1359 |
+ * qdio_get_ssqd_desc - get qdio subchannel description |
1360 |
+ * @cdev: ccw device to get description for |
1361 |
++ * @data: where to store the ssqd |
1362 |
+ * |
1363 |
+- * Returns a pointer to the saved qdio subchannel description, |
1364 |
+- * or NULL for not setup qdio devices. |
1365 |
++ * Returns 0 or an error code. The results of the chsc are stored in the |
1366 |
++ * specified structure. |
1367 |
+ */ |
1368 |
+-struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev) |
1369 |
++int qdio_get_ssqd_desc(struct ccw_device *cdev, |
1370 |
++ struct qdio_ssqd_desc *data) |
1371 |
+ { |
1372 |
+- struct qdio_irq *irq_ptr; |
1373 |
+ char dbf_text[15]; |
1374 |
+ |
1375 |
++ if (!cdev || !cdev->private) |
1376 |
++ return -EINVAL; |
1377 |
++ |
1378 |
+ sprintf(dbf_text, "qssq%4x", cdev->private->schid.sch_no); |
1379 |
+ QDIO_DBF_TEXT0(0, setup, dbf_text); |
1380 |
+ |
1381 |
+- irq_ptr = cdev->private->qdio_data; |
1382 |
+- if (!irq_ptr) |
1383 |
+- return NULL; |
1384 |
+- |
1385 |
+- return &irq_ptr->ssqd_desc; |
1386 |
++ return qdio_setup_get_ssqd(NULL, &cdev->private->schid, data); |
1387 |
+ } |
1388 |
+ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); |
1389 |
+ |
1390 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_setup.c |
1391 |
+=================================================================== |
1392 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/qdio_setup.c |
1393 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_setup.c |
1394 |
+@@ -243,22 +243,31 @@ no_qebsm: |
1395 |
+ QDIO_DBF_TEXT0(0, setup, "noV=V"); |
1396 |
+ } |
1397 |
+ |
1398 |
+-static int __get_ssqd_info(struct qdio_irq *irq_ptr) |
1399 |
++/* |
1400 |
++ * If there is a qdio_irq we use the chsc_page and store the information |
1401 |
++ * in the qdio_irq, otherwise we copy it to the specified structure. |
1402 |
++ */ |
1403 |
++int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr, |
1404 |
++ struct subchannel_id *schid, |
1405 |
++ struct qdio_ssqd_desc *data) |
1406 |
+ { |
1407 |
+ struct chsc_ssqd_area *ssqd; |
1408 |
+ int rc; |
1409 |
+ |
1410 |
+ QDIO_DBF_TEXT0(0, setup, "getssqd"); |
1411 |
+- ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page; |
1412 |
++ if (irq_ptr != NULL) |
1413 |
++ ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page; |
1414 |
++ else |
1415 |
++ ssqd = (struct chsc_ssqd_area *)__get_free_page(GFP_KERNEL); |
1416 |
+ memset(ssqd, 0, PAGE_SIZE); |
1417 |
+ |
1418 |
+ ssqd->request = (struct chsc_header) { |
1419 |
+ .length = 0x0010, |
1420 |
+ .code = 0x0024, |
1421 |
+ }; |
1422 |
+- ssqd->first_sch = irq_ptr->schid.sch_no; |
1423 |
+- ssqd->last_sch = irq_ptr->schid.sch_no; |
1424 |
+- ssqd->ssid = irq_ptr->schid.ssid; |
1425 |
++ ssqd->first_sch = schid->sch_no; |
1426 |
++ ssqd->last_sch = schid->sch_no; |
1427 |
++ ssqd->ssid = schid->ssid; |
1428 |
+ |
1429 |
+ if (chsc(ssqd)) |
1430 |
+ return -EIO; |
1431 |
+@@ -268,11 +277,17 @@ static int __get_ssqd_info(struct qdio_i |
1432 |
+ |
1433 |
+ if (!(ssqd->qdio_ssqd.flags & CHSC_FLAG_QDIO_CAPABILITY) || |
1434 |
+ !(ssqd->qdio_ssqd.flags & CHSC_FLAG_VALIDITY) || |
1435 |
+- (ssqd->qdio_ssqd.sch != irq_ptr->schid.sch_no)) |
1436 |
++ (ssqd->qdio_ssqd.sch != schid->sch_no)) |
1437 |
+ return -EINVAL; |
1438 |
+ |
1439 |
+- memcpy(&irq_ptr->ssqd_desc, &ssqd->qdio_ssqd, |
1440 |
+- sizeof(struct qdio_ssqd_desc)); |
1441 |
++ if (irq_ptr != NULL) |
1442 |
++ memcpy(&irq_ptr->ssqd_desc, &ssqd->qdio_ssqd, |
1443 |
++ sizeof(struct qdio_ssqd_desc)); |
1444 |
++ else { |
1445 |
++ memcpy(data, &ssqd->qdio_ssqd, |
1446 |
++ sizeof(struct qdio_ssqd_desc)); |
1447 |
++ free_page((unsigned long)ssqd); |
1448 |
++ } |
1449 |
+ return 0; |
1450 |
+ } |
1451 |
+ |
1452 |
+@@ -282,7 +297,7 @@ void qdio_setup_ssqd_info(struct qdio_ir |
1453 |
+ char dbf_text[15]; |
1454 |
+ int rc; |
1455 |
+ |
1456 |
+- rc = __get_ssqd_info(irq_ptr); |
1457 |
++ rc = qdio_setup_get_ssqd(irq_ptr, &irq_ptr->schid, NULL); |
1458 |
+ if (rc) { |
1459 |
+ QDIO_DBF_TEXT2(0, setup, "ssqdasig"); |
1460 |
+ sprintf(dbf_text, "schn%4x", irq_ptr->schid.sch_no); |
1461 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_core_main.c |
1462 |
+=================================================================== |
1463 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_core_main.c |
1464 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_core_main.c |
1465 |
+@@ -760,7 +760,7 @@ static int qeth_get_problem(struct ccw_d |
1466 |
+ if (sense[SENSE_COMMAND_REJECT_BYTE] & |
1467 |
+ SENSE_COMMAND_REJECT_FLAG) { |
1468 |
+ QETH_DBF_TEXT(TRACE, 2, "CMDREJi"); |
1469 |
+- return 0; |
1470 |
++ return 1; |
1471 |
+ } |
1472 |
+ if ((sense[2] == 0xaf) && (sense[3] == 0xfe)) { |
1473 |
+ QETH_DBF_TEXT(TRACE, 2, "AFFE"); |
1474 |
+@@ -884,6 +884,7 @@ static void qeth_irq(struct ccw_device * |
1475 |
+ } |
1476 |
+ rc = qeth_get_problem(cdev, irb); |
1477 |
+ if (rc) { |
1478 |
++ qeth_clear_ipacmd_list(card); |
1479 |
+ qeth_schedule_recovery(card); |
1480 |
+ goto out; |
1481 |
+ } |
1482 |
+@@ -3024,7 +3025,7 @@ static inline void __qeth_fill_buffer(st |
1483 |
+ struct qdio_buffer *buffer, int is_tso, int *next_element_to_fill, |
1484 |
+ int offset) |
1485 |
+ { |
1486 |
+- int length = skb->len - offset; |
1487 |
++ int length = skb->len; |
1488 |
+ int length_here; |
1489 |
+ int element; |
1490 |
+ char *data; |
1491 |
+@@ -3036,6 +3037,7 @@ static inline void __qeth_fill_buffer(st |
1492 |
+ |
1493 |
+ if (offset >= 0) { |
1494 |
+ data = skb->data + offset; |
1495 |
++ length -= offset; |
1496 |
+ first_lap = 0; |
1497 |
+ } |
1498 |
+ |
1499 |
+@@ -3755,7 +3757,7 @@ static int qeth_core_driver_group(const |
1500 |
+ |
1501 |
+ int qeth_core_hardsetup_card(struct qeth_card *card) |
1502 |
+ { |
1503 |
+- struct qdio_ssqd_desc *qdio_ssqd; |
1504 |
++ struct qdio_ssqd_desc *ssqd; |
1505 |
+ int retries = 3; |
1506 |
+ int mpno = 0; |
1507 |
+ int rc; |
1508 |
+@@ -3790,9 +3792,16 @@ retry: |
1509 |
+ return rc; |
1510 |
+ } |
1511 |
+ |
1512 |
+- qdio_ssqd = qdio_get_ssqd_desc(CARD_DDEV(card)); |
1513 |
+- if (qdio_ssqd) |
1514 |
+- mpno = qdio_ssqd->pcnt; |
1515 |
++ ssqd = kmalloc(sizeof(struct qdio_ssqd_desc), GFP_KERNEL); |
1516 |
++ if (!ssqd) { |
1517 |
++ rc = -ENOMEM; |
1518 |
++ goto out; |
1519 |
++ } |
1520 |
++ rc = qdio_get_ssqd_desc(CARD_DDEV(card), ssqd); |
1521 |
++ if (rc == 0) |
1522 |
++ mpno = ssqd->pcnt; |
1523 |
++ kfree(ssqd); |
1524 |
++ |
1525 |
+ if (mpno) |
1526 |
+ mpno = min(mpno - 1, QETH_MAX_PORTNO); |
1527 |
+ if (card->info.portno > mpno) { |
1528 |
+@@ -4147,6 +4156,7 @@ static void qeth_core_remove_device(stru |
1529 |
+ unsigned long flags; |
1530 |
+ struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
1531 |
+ |
1532 |
++ QETH_DBF_TEXT(SETUP, 2, "removedv"); |
1533 |
+ if (card->discipline.ccwgdriver) { |
1534 |
+ card->discipline.ccwgdriver->remove(gdev); |
1535 |
+ qeth_core_free_discipline(card); |
1536 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l2_main.c |
1537 |
+=================================================================== |
1538 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_l2_main.c |
1539 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l2_main.c |
1540 |
+@@ -373,8 +373,6 @@ static int qeth_l2_stop_card(struct qeth |
1541 |
+ QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
1542 |
+ |
1543 |
+ qeth_set_allowed_threads(card, 0, 1); |
1544 |
+- if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) |
1545 |
+- return -ERESTARTSYS; |
1546 |
+ if (card->read.state == CH_STATE_UP && |
1547 |
+ card->write.state == CH_STATE_UP && |
1548 |
+ (card->state == CARD_STATE_UP)) { |
1549 |
+@@ -395,7 +393,8 @@ static int qeth_l2_stop_card(struct qeth |
1550 |
+ } |
1551 |
+ if (card->state == CARD_STATE_SOFTSETUP) { |
1552 |
+ qeth_l2_process_vlans(card, 1); |
1553 |
+- qeth_l2_del_all_mc(card); |
1554 |
++ if (!card->use_hard_stop) |
1555 |
++ qeth_l2_del_all_mc(card); |
1556 |
+ qeth_clear_ipacmd_list(card); |
1557 |
+ card->state = CARD_STATE_HARDSETUP; |
1558 |
+ } |
1559 |
+@@ -450,12 +449,15 @@ static void qeth_l2_process_inbound_buff |
1560 |
+ netif_rx(skb); |
1561 |
+ break; |
1562 |
+ case QETH_HEADER_TYPE_OSN: |
1563 |
+- skb_push(skb, sizeof(struct qeth_hdr)); |
1564 |
+- skb_copy_to_linear_data(skb, hdr, |
1565 |
++ if (card->info.type == QETH_CARD_TYPE_OSN) { |
1566 |
++ skb_push(skb, sizeof(struct qeth_hdr)); |
1567 |
++ skb_copy_to_linear_data(skb, hdr, |
1568 |
+ sizeof(struct qeth_hdr)); |
1569 |
+- len = skb->len; |
1570 |
+- card->osn_info.data_cb(skb); |
1571 |
+- break; |
1572 |
++ len = skb->len; |
1573 |
++ card->osn_info.data_cb(skb); |
1574 |
++ break; |
1575 |
++ } |
1576 |
++ /* else unknown */ |
1577 |
+ default: |
1578 |
+ dev_kfree_skb_any(skb); |
1579 |
+ QETH_DBF_TEXT(TRACE, 3, "inbunkno"); |
1580 |
+@@ -559,7 +561,8 @@ static int qeth_l2_request_initial_mac(s |
1581 |
+ "device %s: x%x\n", CARD_BUS_ID(card), rc); |
1582 |
+ } |
1583 |
+ |
1584 |
+- if (card->info.guestlan) { |
1585 |
++ if ((card->info.type == QETH_CARD_TYPE_IQD) || |
1586 |
++ (card->info.guestlan)) { |
1587 |
+ rc = qeth_setadpparms_change_macaddr(card); |
1588 |
+ if (rc) { |
1589 |
+ QETH_DBF_MESSAGE(2, "couldn't get MAC address on " |
1590 |
+@@ -825,7 +828,6 @@ static int qeth_l2_open(struct net_devic |
1591 |
+ } |
1592 |
+ card->data.state = CH_STATE_UP; |
1593 |
+ card->state = CARD_STATE_UP; |
1594 |
+- card->dev->flags |= IFF_UP; |
1595 |
+ netif_start_queue(dev); |
1596 |
+ |
1597 |
+ if (!card->lan_online && netif_carrier_ok(dev)) |
1598 |
+@@ -840,7 +842,6 @@ static int qeth_l2_stop(struct net_devic |
1599 |
+ |
1600 |
+ QETH_DBF_TEXT(TRACE, 4, "qethstop"); |
1601 |
+ netif_tx_disable(dev); |
1602 |
+- card->dev->flags &= ~IFF_UP; |
1603 |
+ if (card->state == CARD_STATE_UP) |
1604 |
+ card->state = CARD_STATE_SOFTSETUP; |
1605 |
+ return 0; |
1606 |
+@@ -975,12 +976,6 @@ static int __qeth_l2_set_online(struct c |
1607 |
+ QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
1608 |
+ |
1609 |
+ qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1); |
1610 |
+- if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) { |
1611 |
+- PRINT_WARN("set_online of card %s interrupted by user!\n", |
1612 |
+- CARD_BUS_ID(card)); |
1613 |
+- return -ERESTARTSYS; |
1614 |
+- } |
1615 |
+- |
1616 |
+ recover_flag = card->state; |
1617 |
+ rc = ccw_device_set_online(CARD_RDEV(card)); |
1618 |
+ if (rc) { |
1619 |
+@@ -1091,11 +1086,7 @@ static int __qeth_l2_set_offline(struct |
1620 |
+ if (card->dev && netif_carrier_ok(card->dev)) |
1621 |
+ netif_carrier_off(card->dev); |
1622 |
+ recover_flag = card->state; |
1623 |
+- if (qeth_l2_stop_card(card, recovery_mode) == -ERESTARTSYS) { |
1624 |
+- PRINT_WARN("Stopping card %s interrupted by user!\n", |
1625 |
+- CARD_BUS_ID(card)); |
1626 |
+- return -ERESTARTSYS; |
1627 |
+- } |
1628 |
++ qeth_l2_stop_card(card, recovery_mode); |
1629 |
+ rc = ccw_device_set_offline(CARD_DDEV(card)); |
1630 |
+ rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
1631 |
+ rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
1632 |
+@@ -1137,9 +1128,13 @@ static int qeth_l2_recover(void *ptr) |
1633 |
+ if (!rc) |
1634 |
+ PRINT_INFO("Device %s successfully recovered!\n", |
1635 |
+ CARD_BUS_ID(card)); |
1636 |
+- else |
1637 |
++ else { |
1638 |
++ rtnl_lock(); |
1639 |
++ dev_close(card->dev); |
1640 |
++ rtnl_unlock(); |
1641 |
+ PRINT_INFO("Device %s could not be recovered!\n", |
1642 |
+ CARD_BUS_ID(card)); |
1643 |
++ } |
1644 |
+ return 0; |
1645 |
+ } |
1646 |
+ |
1647 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l3_main.c |
1648 |
+=================================================================== |
1649 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_l3_main.c |
1650 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l3_main.c |
1651 |
+@@ -2064,8 +2064,6 @@ static int qeth_l3_stop_card(struct qeth |
1652 |
+ QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
1653 |
+ |
1654 |
+ qeth_set_allowed_threads(card, 0, 1); |
1655 |
+- if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) |
1656 |
+- return -ERESTARTSYS; |
1657 |
+ if (card->read.state == CH_STATE_UP && |
1658 |
+ card->write.state == CH_STATE_UP && |
1659 |
+ (card->state == CARD_STATE_UP)) { |
1660 |
+@@ -2795,7 +2793,6 @@ static int qeth_l3_open(struct net_devic |
1661 |
+ return -ENODEV; |
1662 |
+ card->data.state = CH_STATE_UP; |
1663 |
+ card->state = CARD_STATE_UP; |
1664 |
+- card->dev->flags |= IFF_UP; |
1665 |
+ netif_start_queue(dev); |
1666 |
+ |
1667 |
+ if (!card->lan_online && netif_carrier_ok(dev)) |
1668 |
+@@ -2809,7 +2806,6 @@ static int qeth_l3_stop(struct net_devic |
1669 |
+ |
1670 |
+ QETH_DBF_TEXT(TRACE, 4, "qethstop"); |
1671 |
+ netif_tx_disable(dev); |
1672 |
+- card->dev->flags &= ~IFF_UP; |
1673 |
+ if (card->state == CARD_STATE_UP) |
1674 |
+ card->state = CARD_STATE_SOFTSETUP; |
1675 |
+ return 0; |
1676 |
+@@ -3051,11 +3047,6 @@ static int __qeth_l3_set_online(struct c |
1677 |
+ QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
1678 |
+ |
1679 |
+ qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1); |
1680 |
+- if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) { |
1681 |
+- PRINT_WARN("set_online of card %s interrupted by user!\n", |
1682 |
+- CARD_BUS_ID(card)); |
1683 |
+- return -ERESTARTSYS; |
1684 |
+- } |
1685 |
+ |
1686 |
+ recover_flag = card->state; |
1687 |
+ rc = ccw_device_set_online(CARD_RDEV(card)); |
1688 |
+@@ -3172,11 +3163,7 @@ static int __qeth_l3_set_offline(struct |
1689 |
+ if (card->dev && netif_carrier_ok(card->dev)) |
1690 |
+ netif_carrier_off(card->dev); |
1691 |
+ recover_flag = card->state; |
1692 |
+- if (qeth_l3_stop_card(card, recovery_mode) == -ERESTARTSYS) { |
1693 |
+- PRINT_WARN("Stopping card %s interrupted by user!\n", |
1694 |
+- CARD_BUS_ID(card)); |
1695 |
+- return -ERESTARTSYS; |
1696 |
+- } |
1697 |
++ qeth_l3_stop_card(card, recovery_mode); |
1698 |
+ rc = ccw_device_set_offline(CARD_DDEV(card)); |
1699 |
+ rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
1700 |
+ rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
1701 |
+@@ -3218,9 +3205,13 @@ static int qeth_l3_recover(void *ptr) |
1702 |
+ if (!rc) |
1703 |
+ PRINT_INFO("Device %s successfully recovered!\n", |
1704 |
+ CARD_BUS_ID(card)); |
1705 |
+- else |
1706 |
++ else { |
1707 |
++ rtnl_lock(); |
1708 |
++ dev_close(card->dev); |
1709 |
++ rtnl_unlock(); |
1710 |
+ PRINT_INFO("Device %s could not be recovered!\n", |
1711 |
+ CARD_BUS_ID(card)); |
1712 |
++ } |
1713 |
+ return 0; |
1714 |
+ } |
1715 |
+ |
1716 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l3_sys.c |
1717 |
+=================================================================== |
1718 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_l3_sys.c |
1719 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l3_sys.c |
1720 |
+@@ -121,9 +121,6 @@ static ssize_t qeth_l3_dev_route6_show(s |
1721 |
+ if (!card) |
1722 |
+ return -EINVAL; |
1723 |
+ |
1724 |
+- if (!qeth_is_supported(card, IPA_IPV6)) |
1725 |
+- return sprintf(buf, "%s\n", "n/a"); |
1726 |
+- |
1727 |
+ return qeth_l3_dev_route_show(card, &card->options.route6, buf); |
1728 |
+ } |
1729 |
+ |
1730 |
+@@ -135,10 +132,6 @@ static ssize_t qeth_l3_dev_route6_store( |
1731 |
+ if (!card) |
1732 |
+ return -EINVAL; |
1733 |
+ |
1734 |
+- if (!qeth_is_supported(card, IPA_IPV6)) { |
1735 |
+- return -EOPNOTSUPP; |
1736 |
+- } |
1737 |
+- |
1738 |
+ return qeth_l3_dev_route_store(card, &card->options.route6, |
1739 |
+ QETH_PROT_IPV6, buf, count); |
1740 |
+ } |
1741 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_aux.c |
1742 |
+=================================================================== |
1743 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_aux.c |
1744 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_aux.c |
1745 |
+@@ -100,24 +100,10 @@ static int __init zfcp_device_setup(char |
1746 |
+ |
1747 |
+ err_out: |
1748 |
+ kfree(str); |
1749 |
+- pr_err("zfcp: Parse error for device parameter string %s, " |
1750 |
+- "device not attached.\n", devstr); |
1751 |
++ pr_err("zfcp: %s is not a valid SCSI device\n", devstr); |
1752 |
+ return 0; |
1753 |
+ } |
1754 |
+ |
1755 |
+-static struct zfcp_adapter *zfcp_get_adapter_by_busid(char *bus_id) |
1756 |
+-{ |
1757 |
+- struct zfcp_adapter *adapter; |
1758 |
+- |
1759 |
+- list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list) |
1760 |
+- if ((strncmp(bus_id, adapter->ccw_device->dev.bus_id, |
1761 |
+- BUS_ID_SIZE) == 0) && |
1762 |
+- !(atomic_read(&adapter->status) & |
1763 |
+- ZFCP_STATUS_COMMON_REMOVE)) |
1764 |
+- return adapter; |
1765 |
+- return NULL; |
1766 |
+-} |
1767 |
+- |
1768 |
+ static void __init zfcp_init_device_configure(void) |
1769 |
+ { |
1770 |
+ struct zfcp_adapter *adapter; |
1771 |
+@@ -141,7 +127,12 @@ static void __init zfcp_init_device_conf |
1772 |
+ goto out_unit; |
1773 |
+ up(&zfcp_data.config_sema); |
1774 |
+ ccw_device_set_online(adapter->ccw_device); |
1775 |
++ |
1776 |
+ zfcp_erp_wait(adapter); |
1777 |
++ wait_event(adapter->erp_done_wqh, |
1778 |
++ !(atomic_read(&unit->status) & |
1779 |
++ ZFCP_STATUS_UNIT_SCSI_WORK_PENDING)); |
1780 |
++ |
1781 |
+ down(&zfcp_data.config_sema); |
1782 |
+ zfcp_unit_put(unit); |
1783 |
+ out_unit: |
1784 |
+@@ -180,9 +171,9 @@ static int __init zfcp_module_init(void) |
1785 |
+ if (!zfcp_data.gid_pn_cache) |
1786 |
+ goto out_gid_cache; |
1787 |
+ |
1788 |
+- INIT_LIST_HEAD(&zfcp_data.adapter_list_head); |
1789 |
+- INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh); |
1790 |
++ zfcp_data.work_queue = create_singlethread_workqueue("zfcp_wq"); |
1791 |
+ |
1792 |
++ INIT_LIST_HEAD(&zfcp_data.adapter_list_head); |
1793 |
+ sema_init(&zfcp_data.config_sema, 1); |
1794 |
+ rwlock_init(&zfcp_data.config_lock); |
1795 |
+ |
1796 |
+@@ -193,13 +184,14 @@ static int __init zfcp_module_init(void) |
1797 |
+ |
1798 |
+ retval = misc_register(&zfcp_cfdc_misc); |
1799 |
+ if (retval) { |
1800 |
+- pr_err("zfcp: registration of misc device zfcp_cfdc failed\n"); |
1801 |
++ pr_err("zfcp: Registering the misc device zfcp_cfdc failed\n"); |
1802 |
+ goto out_misc; |
1803 |
+ } |
1804 |
+ |
1805 |
+ retval = zfcp_ccw_register(); |
1806 |
+ if (retval) { |
1807 |
+- pr_err("zfcp: Registration with common I/O layer failed.\n"); |
1808 |
++ pr_err("zfcp: The zfcp device driver could not register with " |
1809 |
++ "the common I/O layer\n"); |
1810 |
+ goto out_ccw_register; |
1811 |
+ } |
1812 |
+ |
1813 |
+@@ -232,7 +224,7 @@ module_init(zfcp_module_init); |
1814 |
+ * Returns: pointer to zfcp_unit or NULL |
1815 |
+ */ |
1816 |
+ struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *port, |
1817 |
+- fcp_lun_t fcp_lun) |
1818 |
++ u64 fcp_lun) |
1819 |
+ { |
1820 |
+ struct zfcp_unit *unit; |
1821 |
+ |
1822 |
+@@ -251,7 +243,7 @@ struct zfcp_unit *zfcp_get_unit_by_lun(s |
1823 |
+ * Returns: pointer to zfcp_port or NULL |
1824 |
+ */ |
1825 |
+ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, |
1826 |
+- wwn_t wwpn) |
1827 |
++ u64 wwpn) |
1828 |
+ { |
1829 |
+ struct zfcp_port *port; |
1830 |
+ |
1831 |
+@@ -276,7 +268,7 @@ static void zfcp_sysfs_unit_release(stru |
1832 |
+ * |
1833 |
+ * Sets up some unit internal structures and creates sysfs entry. |
1834 |
+ */ |
1835 |
+-struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun) |
1836 |
++struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) |
1837 |
+ { |
1838 |
+ struct zfcp_unit *unit; |
1839 |
+ |
1840 |
+@@ -323,7 +315,6 @@ struct zfcp_unit *zfcp_unit_enqueue(stru |
1841 |
+ } |
1842 |
+ |
1843 |
+ zfcp_unit_get(unit); |
1844 |
+- unit->scsi_lun = scsilun_to_int((struct scsi_lun *)&unit->fcp_lun); |
1845 |
+ |
1846 |
+ write_lock_irq(&zfcp_data.config_lock); |
1847 |
+ list_add_tail(&unit->list, &port->unit_list_head); |
1848 |
+@@ -332,7 +323,6 @@ struct zfcp_unit *zfcp_unit_enqueue(stru |
1849 |
+ |
1850 |
+ write_unlock_irq(&zfcp_data.config_lock); |
1851 |
+ |
1852 |
+- port->units++; |
1853 |
+ zfcp_port_get(port); |
1854 |
+ |
1855 |
+ return unit; |
1856 |
+@@ -351,11 +341,10 @@ err_out_free: |
1857 |
+ */ |
1858 |
+ void zfcp_unit_dequeue(struct zfcp_unit *unit) |
1859 |
+ { |
1860 |
+- zfcp_unit_wait(unit); |
1861 |
++ wait_event(unit->remove_wq, atomic_read(&unit->refcount) == 0); |
1862 |
+ write_lock_irq(&zfcp_data.config_lock); |
1863 |
+ list_del(&unit->list); |
1864 |
+ write_unlock_irq(&zfcp_data.config_lock); |
1865 |
+- unit->port->units--; |
1866 |
+ zfcp_port_put(unit->port); |
1867 |
+ sysfs_remove_group(&unit->sysfs_device.kobj, &zfcp_sysfs_unit_attrs); |
1868 |
+ device_unregister(&unit->sysfs_device); |
1869 |
+@@ -416,11 +405,6 @@ static void zfcp_free_low_mem_buffers(st |
1870 |
+ mempool_destroy(adapter->pool.data_gid_pn); |
1871 |
+ } |
1872 |
+ |
1873 |
+-static void zfcp_dummy_release(struct device *dev) |
1874 |
+-{ |
1875 |
+- return; |
1876 |
+-} |
1877 |
+- |
1878 |
+ /** |
1879 |
+ * zfcp_status_read_refill - refill the long running status_read_requests |
1880 |
+ * @adapter: ptr to struct zfcp_adapter for which the buffers should be refilled |
1881 |
+@@ -450,19 +434,6 @@ static void _zfcp_status_read_scheduler( |
1882 |
+ stat_work)); |
1883 |
+ } |
1884 |
+ |
1885 |
+-static int zfcp_nameserver_enqueue(struct zfcp_adapter *adapter) |
1886 |
+-{ |
1887 |
+- struct zfcp_port *port; |
1888 |
+- |
1889 |
+- port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_WKA, |
1890 |
+- ZFCP_DID_DIRECTORY_SERVICE); |
1891 |
+- if (IS_ERR(port)) |
1892 |
+- return PTR_ERR(port); |
1893 |
+- zfcp_port_put(port); |
1894 |
+- |
1895 |
+- return 0; |
1896 |
+-} |
1897 |
+- |
1898 |
+ /** |
1899 |
+ * zfcp_adapter_enqueue - enqueue a new adapter to the list |
1900 |
+ * @ccw_device: pointer to the struct cc_device |
1901 |
+@@ -508,7 +479,6 @@ int zfcp_adapter_enqueue(struct ccw_devi |
1902 |
+ init_waitqueue_head(&adapter->erp_done_wqh); |
1903 |
+ |
1904 |
+ INIT_LIST_HEAD(&adapter->port_list_head); |
1905 |
+- INIT_LIST_HEAD(&adapter->port_remove_lh); |
1906 |
+ INIT_LIST_HEAD(&adapter->erp_ready_head); |
1907 |
+ INIT_LIST_HEAD(&adapter->erp_running_head); |
1908 |
+ |
1909 |
+@@ -518,7 +488,7 @@ int zfcp_adapter_enqueue(struct ccw_devi |
1910 |
+ spin_lock_init(&adapter->san_dbf_lock); |
1911 |
+ spin_lock_init(&adapter->scsi_dbf_lock); |
1912 |
+ spin_lock_init(&adapter->rec_dbf_lock); |
1913 |
+- spin_lock_init(&adapter->req_q.lock); |
1914 |
++ spin_lock_init(&adapter->req_q_lock); |
1915 |
+ |
1916 |
+ rwlock_init(&adapter->erp_lock); |
1917 |
+ rwlock_init(&adapter->abort_lock); |
1918 |
+@@ -537,28 +507,15 @@ int zfcp_adapter_enqueue(struct ccw_devi |
1919 |
+ &zfcp_sysfs_adapter_attrs)) |
1920 |
+ goto sysfs_failed; |
1921 |
+ |
1922 |
+- adapter->generic_services.parent = &adapter->ccw_device->dev; |
1923 |
+- adapter->generic_services.release = zfcp_dummy_release; |
1924 |
+- snprintf(adapter->generic_services.bus_id, BUS_ID_SIZE, |
1925 |
+- "generic_services"); |
1926 |
+- |
1927 |
+- if (device_register(&adapter->generic_services)) |
1928 |
+- goto generic_services_failed; |
1929 |
+- |
1930 |
+ write_lock_irq(&zfcp_data.config_lock); |
1931 |
+ atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); |
1932 |
+ list_add_tail(&adapter->list, &zfcp_data.adapter_list_head); |
1933 |
+ write_unlock_irq(&zfcp_data.config_lock); |
1934 |
+ |
1935 |
+- zfcp_data.adapters++; |
1936 |
+- |
1937 |
+- zfcp_nameserver_enqueue(adapter); |
1938 |
++ zfcp_fc_nameserver_init(adapter); |
1939 |
+ |
1940 |
+ return 0; |
1941 |
+ |
1942 |
+-generic_services_failed: |
1943 |
+- sysfs_remove_group(&ccw_device->dev.kobj, |
1944 |
+- &zfcp_sysfs_adapter_attrs); |
1945 |
+ sysfs_failed: |
1946 |
+ zfcp_adapter_debug_unregister(adapter); |
1947 |
+ debug_register_failed: |
1948 |
+@@ -585,7 +542,6 @@ void zfcp_adapter_dequeue(struct zfcp_ad |
1949 |
+ cancel_work_sync(&adapter->scan_work); |
1950 |
+ cancel_work_sync(&adapter->stat_work); |
1951 |
+ zfcp_adapter_scsi_unregister(adapter); |
1952 |
+- device_unregister(&adapter->generic_services); |
1953 |
+ sysfs_remove_group(&adapter->ccw_device->dev.kobj, |
1954 |
+ &zfcp_sysfs_adapter_attrs); |
1955 |
+ dev_set_drvdata(&adapter->ccw_device->dev, NULL); |
1956 |
+@@ -603,9 +559,6 @@ void zfcp_adapter_dequeue(struct zfcp_ad |
1957 |
+ list_del(&adapter->list); |
1958 |
+ write_unlock_irq(&zfcp_data.config_lock); |
1959 |
+ |
1960 |
+- /* decrease number of adapters in list */ |
1961 |
+- zfcp_data.adapters--; |
1962 |
+- |
1963 |
+ zfcp_qdio_free(adapter); |
1964 |
+ |
1965 |
+ zfcp_free_low_mem_buffers(adapter); |
1966 |
+@@ -633,21 +586,19 @@ static void zfcp_sysfs_port_release(stru |
1967 |
+ * d_id is used to enqueue ports with a well known address like the Directory |
1968 |
+ * Service for nameserver lookup. |
1969 |
+ */ |
1970 |
+-struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, |
1971 |
++struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, |
1972 |
+ u32 status, u32 d_id) |
1973 |
+ { |
1974 |
+ struct zfcp_port *port; |
1975 |
+ int retval; |
1976 |
+- char *bus_id; |
1977 |
+ |
1978 |
+ port = kzalloc(sizeof(struct zfcp_port), GFP_KERNEL); |
1979 |
+ if (!port) |
1980 |
+ return ERR_PTR(-ENOMEM); |
1981 |
+ |
1982 |
+ init_waitqueue_head(&port->remove_wq); |
1983 |
+- |
1984 |
+ INIT_LIST_HEAD(&port->unit_list_head); |
1985 |
+- INIT_LIST_HEAD(&port->unit_remove_lh); |
1986 |
++ INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); |
1987 |
+ |
1988 |
+ port->adapter = adapter; |
1989 |
+ port->d_id = d_id; |
1990 |
+@@ -657,34 +608,8 @@ struct zfcp_port *zfcp_port_enqueue(stru |
1991 |
+ atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status); |
1992 |
+ atomic_set(&port->refcount, 0); |
1993 |
+ |
1994 |
+- if (status & ZFCP_STATUS_PORT_WKA) { |
1995 |
+- switch (d_id) { |
1996 |
+- case ZFCP_DID_DIRECTORY_SERVICE: |
1997 |
+- bus_id = "directory"; |
1998 |
+- break; |
1999 |
+- case ZFCP_DID_MANAGEMENT_SERVICE: |
2000 |
+- bus_id = "management"; |
2001 |
+- break; |
2002 |
+- case ZFCP_DID_KEY_DISTRIBUTION_SERVICE: |
2003 |
+- bus_id = "key_distribution"; |
2004 |
+- break; |
2005 |
+- case ZFCP_DID_ALIAS_SERVICE: |
2006 |
+- bus_id = "alias"; |
2007 |
+- break; |
2008 |
+- case ZFCP_DID_TIME_SERVICE: |
2009 |
+- bus_id = "time"; |
2010 |
+- break; |
2011 |
+- default: |
2012 |
+- kfree(port); |
2013 |
+- return ERR_PTR(-EINVAL); |
2014 |
+- } |
2015 |
+- snprintf(port->sysfs_device.bus_id, BUS_ID_SIZE, "%s", bus_id); |
2016 |
+- port->sysfs_device.parent = &adapter->generic_services; |
2017 |
+- } else { |
2018 |
+- snprintf(port->sysfs_device.bus_id, |
2019 |
+- BUS_ID_SIZE, "0x%016llx", wwpn); |
2020 |
+- port->sysfs_device.parent = &adapter->ccw_device->dev; |
2021 |
+- } |
2022 |
++ snprintf(port->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx", wwpn); |
2023 |
++ port->sysfs_device.parent = &adapter->ccw_device->dev; |
2024 |
+ |
2025 |
+ port->sysfs_device.release = zfcp_sysfs_port_release; |
2026 |
+ dev_set_drvdata(&port->sysfs_device, port); |
2027 |
+@@ -700,12 +625,8 @@ struct zfcp_port *zfcp_port_enqueue(stru |
2028 |
+ if (device_register(&port->sysfs_device)) |
2029 |
+ goto err_out_free; |
2030 |
+ |
2031 |
+- if (status & ZFCP_STATUS_PORT_WKA) |
2032 |
+- retval = sysfs_create_group(&port->sysfs_device.kobj, |
2033 |
+- &zfcp_sysfs_ns_port_attrs); |
2034 |
+- else |
2035 |
+- retval = sysfs_create_group(&port->sysfs_device.kobj, |
2036 |
+- &zfcp_sysfs_port_attrs); |
2037 |
++ retval = sysfs_create_group(&port->sysfs_device.kobj, |
2038 |
++ &zfcp_sysfs_port_attrs); |
2039 |
+ |
2040 |
+ if (retval) { |
2041 |
+ device_unregister(&port->sysfs_device); |
2042 |
+@@ -718,10 +639,6 @@ struct zfcp_port *zfcp_port_enqueue(stru |
2043 |
+ list_add_tail(&port->list, &adapter->port_list_head); |
2044 |
+ atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); |
2045 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &port->status); |
2046 |
+- if (d_id == ZFCP_DID_DIRECTORY_SERVICE) |
2047 |
+- if (!adapter->nameserver_port) |
2048 |
+- adapter->nameserver_port = port; |
2049 |
+- adapter->ports++; |
2050 |
+ |
2051 |
+ write_unlock_irq(&zfcp_data.config_lock); |
2052 |
+ |
2053 |
+@@ -740,21 +657,15 @@ err_out: |
2054 |
+ */ |
2055 |
+ void zfcp_port_dequeue(struct zfcp_port *port) |
2056 |
+ { |
2057 |
+- zfcp_port_wait(port); |
2058 |
++ wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); |
2059 |
+ write_lock_irq(&zfcp_data.config_lock); |
2060 |
+ list_del(&port->list); |
2061 |
+- port->adapter->ports--; |
2062 |
+ write_unlock_irq(&zfcp_data.config_lock); |
2063 |
+ if (port->rport) |
2064 |
+ fc_remote_port_delete(port->rport); |
2065 |
+ port->rport = NULL; |
2066 |
+ zfcp_adapter_put(port->adapter); |
2067 |
+- if (atomic_read(&port->status) & ZFCP_STATUS_PORT_WKA) |
2068 |
+- sysfs_remove_group(&port->sysfs_device.kobj, |
2069 |
+- &zfcp_sysfs_ns_port_attrs); |
2070 |
+- else |
2071 |
+- sysfs_remove_group(&port->sysfs_device.kobj, |
2072 |
+- &zfcp_sysfs_port_attrs); |
2073 |
++ sysfs_remove_group(&port->sysfs_device.kobj, &zfcp_sysfs_port_attrs); |
2074 |
+ device_unregister(&port->sysfs_device); |
2075 |
+ } |
2076 |
+ |
2077 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_ccw.c |
2078 |
+=================================================================== |
2079 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_ccw.c |
2080 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_ccw.c |
2081 |
+@@ -25,7 +25,8 @@ static int zfcp_ccw_probe(struct ccw_dev |
2082 |
+ down(&zfcp_data.config_sema); |
2083 |
+ if (zfcp_adapter_enqueue(ccw_device)) { |
2084 |
+ dev_err(&ccw_device->dev, |
2085 |
+- "Setup of data structures failed.\n"); |
2086 |
++ "Setting up data structures for the " |
2087 |
++ "FCP adapter failed\n"); |
2088 |
+ retval = -EINVAL; |
2089 |
+ } |
2090 |
+ up(&zfcp_data.config_sema); |
2091 |
+@@ -46,6 +47,8 @@ static void zfcp_ccw_remove(struct ccw_d |
2092 |
+ struct zfcp_adapter *adapter; |
2093 |
+ struct zfcp_port *port, *p; |
2094 |
+ struct zfcp_unit *unit, *u; |
2095 |
++ LIST_HEAD(unit_remove_lh); |
2096 |
++ LIST_HEAD(port_remove_lh); |
2097 |
+ |
2098 |
+ ccw_device_set_offline(ccw_device); |
2099 |
+ down(&zfcp_data.config_sema); |
2100 |
+@@ -54,26 +57,26 @@ static void zfcp_ccw_remove(struct ccw_d |
2101 |
+ write_lock_irq(&zfcp_data.config_lock); |
2102 |
+ list_for_each_entry_safe(port, p, &adapter->port_list_head, list) { |
2103 |
+ list_for_each_entry_safe(unit, u, &port->unit_list_head, list) { |
2104 |
+- list_move(&unit->list, &port->unit_remove_lh); |
2105 |
++ list_move(&unit->list, &unit_remove_lh); |
2106 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, |
2107 |
+ &unit->status); |
2108 |
+ } |
2109 |
+- list_move(&port->list, &adapter->port_remove_lh); |
2110 |
++ list_move(&port->list, &port_remove_lh); |
2111 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); |
2112 |
+ } |
2113 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); |
2114 |
+ write_unlock_irq(&zfcp_data.config_lock); |
2115 |
+ |
2116 |
+- list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) { |
2117 |
+- list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) { |
2118 |
+- if (atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED, |
2119 |
+- &unit->status)) |
2120 |
++ list_for_each_entry_safe(port, p, &port_remove_lh, list) { |
2121 |
++ list_for_each_entry_safe(unit, u, &unit_remove_lh, list) { |
2122 |
++ if (atomic_read(&unit->status) & |
2123 |
++ ZFCP_STATUS_UNIT_REGISTERED) |
2124 |
+ scsi_remove_device(unit->device); |
2125 |
+ zfcp_unit_dequeue(unit); |
2126 |
+ } |
2127 |
+ zfcp_port_dequeue(port); |
2128 |
+ } |
2129 |
+- zfcp_adapter_wait(adapter); |
2130 |
++ wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0); |
2131 |
+ zfcp_adapter_dequeue(adapter); |
2132 |
+ |
2133 |
+ up(&zfcp_data.config_sema); |
2134 |
+@@ -113,7 +116,9 @@ static int zfcp_ccw_set_online(struct cc |
2135 |
+ zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85, |
2136 |
+ NULL); |
2137 |
+ zfcp_erp_wait(adapter); |
2138 |
+- goto out; |
2139 |
++ up(&zfcp_data.config_sema); |
2140 |
++ flush_work(&adapter->scan_work); |
2141 |
++ return 0; |
2142 |
+ |
2143 |
+ out_scsi_register: |
2144 |
+ zfcp_erp_thread_kill(adapter); |
2145 |
+@@ -156,15 +161,18 @@ static int zfcp_ccw_notify(struct ccw_de |
2146 |
+ |
2147 |
+ switch (event) { |
2148 |
+ case CIO_GONE: |
2149 |
+- dev_warn(&adapter->ccw_device->dev, "device gone\n"); |
2150 |
++ dev_warn(&adapter->ccw_device->dev, |
2151 |
++ "The FCP device has been detached\n"); |
2152 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 87, NULL); |
2153 |
+ break; |
2154 |
+ case CIO_NO_PATH: |
2155 |
+- dev_warn(&adapter->ccw_device->dev, "no path\n"); |
2156 |
++ dev_warn(&adapter->ccw_device->dev, |
2157 |
++ "The CHPID for the FCP device is offline\n"); |
2158 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 88, NULL); |
2159 |
+ break; |
2160 |
+ case CIO_OPER: |
2161 |
+- dev_info(&adapter->ccw_device->dev, "operational again\n"); |
2162 |
++ dev_info(&adapter->ccw_device->dev, |
2163 |
++ "The FCP device is operational again\n"); |
2164 |
+ zfcp_erp_modify_adapter_status(adapter, 11, NULL, |
2165 |
+ ZFCP_STATUS_COMMON_RUNNING, |
2166 |
+ ZFCP_SET); |
2167 |
+@@ -220,3 +228,20 @@ int __init zfcp_ccw_register(void) |
2168 |
+ { |
2169 |
+ return ccw_driver_register(&zfcp_ccw_driver); |
2170 |
+ } |
2171 |
++ |
2172 |
++/** |
2173 |
++ * zfcp_get_adapter_by_busid - find zfcp_adapter struct |
2174 |
++ * @busid: bus id string of zfcp adapter to find |
2175 |
++ */ |
2176 |
++struct zfcp_adapter *zfcp_get_adapter_by_busid(char *busid) |
2177 |
++{ |
2178 |
++ struct ccw_device *ccw_device; |
2179 |
++ struct zfcp_adapter *adapter = NULL; |
2180 |
++ |
2181 |
++ ccw_device = get_ccwdev_by_busid(&zfcp_ccw_driver, busid); |
2182 |
++ if (ccw_device) { |
2183 |
++ adapter = dev_get_drvdata(&ccw_device->dev); |
2184 |
++ put_device(&ccw_device->dev); |
2185 |
++ } |
2186 |
++ return adapter; |
2187 |
++} |
2188 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_dbf.c |
2189 |
+=================================================================== |
2190 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_dbf.c |
2191 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_dbf.c |
2192 |
+@@ -30,7 +30,7 @@ static void zfcp_dbf_hexdump(debug_info_ |
2193 |
+ dump->offset = offset; |
2194 |
+ dump->size = min(from_len - offset, room); |
2195 |
+ memcpy(dump->data, from + offset, dump->size); |
2196 |
+- debug_event(dbf, level, dump, dump->size); |
2197 |
++ debug_event(dbf, level, dump, dump->size + sizeof(*dump)); |
2198 |
+ } |
2199 |
+ } |
2200 |
+ |
2201 |
+@@ -108,7 +108,7 @@ static int zfcp_dbf_view_header(debug_in |
2202 |
+ t.tv_sec, t.tv_nsec); |
2203 |
+ zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid); |
2204 |
+ } else { |
2205 |
+- zfcp_dbf_outd(&p, NULL, dump->data, dump->size, dump->offset, |
2206 |
++ zfcp_dbf_outd(&p, "", dump->data, dump->size, dump->offset, |
2207 |
+ dump->total_size); |
2208 |
+ if ((dump->offset + dump->size) == dump->total_size) |
2209 |
+ p += sprintf(p, "\n"); |
2210 |
+@@ -318,6 +318,26 @@ void zfcp_hba_dbf_event_qdio(struct zfcp |
2211 |
+ spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); |
2212 |
+ } |
2213 |
+ |
2214 |
++/** |
2215 |
++ * zfcp_hba_dbf_event_berr - trace event for bit error threshold |
2216 |
++ * @adapter: adapter affected by this QDIO related event |
2217 |
++ * @req: fsf request |
2218 |
++ */ |
2219 |
++void zfcp_hba_dbf_event_berr(struct zfcp_adapter *adapter, |
2220 |
++ struct zfcp_fsf_req *req) |
2221 |
++{ |
2222 |
++ struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf; |
2223 |
++ struct fsf_status_read_buffer *sr_buf = req->data; |
2224 |
++ struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error; |
2225 |
++ unsigned long flags; |
2226 |
++ |
2227 |
++ spin_lock_irqsave(&adapter->hba_dbf_lock, flags); |
2228 |
++ memset(r, 0, sizeof(*r)); |
2229 |
++ strncpy(r->tag, "berr", ZFCP_DBF_TAG_SIZE); |
2230 |
++ memcpy(&r->u.berr, err, sizeof(struct fsf_bit_error_payload)); |
2231 |
++ debug_event(adapter->hba_dbf, 0, r, sizeof(*r)); |
2232 |
++ spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); |
2233 |
++} |
2234 |
+ static void zfcp_hba_dbf_view_response(char **p, |
2235 |
+ struct zfcp_hba_dbf_record_response *r) |
2236 |
+ { |
2237 |
+@@ -346,6 +366,7 @@ static void zfcp_hba_dbf_view_response(c |
2238 |
+ break; |
2239 |
+ zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd); |
2240 |
+ zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial); |
2241 |
++ p += sprintf(*p, "\n"); |
2242 |
+ break; |
2243 |
+ |
2244 |
+ case FSF_QTCB_OPEN_PORT_WITH_DID: |
2245 |
+@@ -399,6 +420,30 @@ static void zfcp_hba_dbf_view_qdio(char |
2246 |
+ zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); |
2247 |
+ } |
2248 |
+ |
2249 |
++static void zfcp_hba_dbf_view_berr(char **p, struct fsf_bit_error_payload *r) |
2250 |
++{ |
2251 |
++ zfcp_dbf_out(p, "link_failures", "%d", r->link_failure_error_count); |
2252 |
++ zfcp_dbf_out(p, "loss_of_sync_err", "%d", r->loss_of_sync_error_count); |
2253 |
++ zfcp_dbf_out(p, "loss_of_sig_err", "%d", r->loss_of_signal_error_count); |
2254 |
++ zfcp_dbf_out(p, "prim_seq_err", "%d", |
2255 |
++ r->primitive_sequence_error_count); |
2256 |
++ zfcp_dbf_out(p, "inval_trans_word_err", "%d", |
2257 |
++ r->invalid_transmission_word_error_count); |
2258 |
++ zfcp_dbf_out(p, "CRC_errors", "%d", r->crc_error_count); |
2259 |
++ zfcp_dbf_out(p, "prim_seq_event_to", "%d", |
2260 |
++ r->primitive_sequence_event_timeout_count); |
2261 |
++ zfcp_dbf_out(p, "elast_buf_overrun_err", "%d", |
2262 |
++ r->elastic_buffer_overrun_error_count); |
2263 |
++ zfcp_dbf_out(p, "adv_rec_buf2buf_cred", "%d", |
2264 |
++ r->advertised_receive_b2b_credit); |
2265 |
++ zfcp_dbf_out(p, "curr_rec_buf2buf_cred", "%d", |
2266 |
++ r->current_receive_b2b_credit); |
2267 |
++ zfcp_dbf_out(p, "adv_trans_buf2buf_cred", "%d", |
2268 |
++ r->advertised_transmit_b2b_credit); |
2269 |
++ zfcp_dbf_out(p, "curr_trans_buf2buf_cred", "%d", |
2270 |
++ r->current_transmit_b2b_credit); |
2271 |
++} |
2272 |
++ |
2273 |
+ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, |
2274 |
+ char *out_buf, const char *in_buf) |
2275 |
+ { |
2276 |
+@@ -418,8 +463,11 @@ static int zfcp_hba_dbf_view_format(debu |
2277 |
+ zfcp_hba_dbf_view_status(&p, &r->u.status); |
2278 |
+ else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) |
2279 |
+ zfcp_hba_dbf_view_qdio(&p, &r->u.qdio); |
2280 |
++ else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0) |
2281 |
++ zfcp_hba_dbf_view_berr(&p, &r->u.berr); |
2282 |
+ |
2283 |
+- p += sprintf(p, "\n"); |
2284 |
++ if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) != 0) |
2285 |
++ p += sprintf(p, "\n"); |
2286 |
+ return p - out_buf; |
2287 |
+ } |
2288 |
+ |
2289 |
+@@ -519,14 +567,14 @@ static const char *zfcp_rec_dbf_ids[] = |
2290 |
+ [75] = "physical port recovery escalation after failed port " |
2291 |
+ "recovery", |
2292 |
+ [76] = "port recovery escalation after failed unit recovery", |
2293 |
+- [77] = "recovery opening nameserver port", |
2294 |
++ [77] = "", |
2295 |
+ [78] = "duplicate request id", |
2296 |
+ [79] = "link down", |
2297 |
+ [80] = "exclusive read-only unit access unsupported", |
2298 |
+ [81] = "shared read-write unit access unsupported", |
2299 |
+ [82] = "incoming rscn", |
2300 |
+ [83] = "incoming wwpn", |
2301 |
+- [84] = "", |
2302 |
++ [84] = "wka port handle not valid close port", |
2303 |
+ [85] = "online", |
2304 |
+ [86] = "offline", |
2305 |
+ [87] = "ccw device gone", |
2306 |
+@@ -570,7 +618,7 @@ static const char *zfcp_rec_dbf_ids[] = |
2307 |
+ [125] = "need newer zfcp", |
2308 |
+ [126] = "need newer microcode", |
2309 |
+ [127] = "arbitrated loop not supported", |
2310 |
+- [128] = "unknown topology", |
2311 |
++ [128] = "", |
2312 |
+ [129] = "qtcb size mismatch", |
2313 |
+ [130] = "unknown fsf status ecd", |
2314 |
+ [131] = "fcp request too big", |
2315 |
+@@ -829,11 +877,12 @@ void zfcp_rec_dbf_event_action(u8 id2, s |
2316 |
+ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) |
2317 |
+ { |
2318 |
+ struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; |
2319 |
+- struct zfcp_port *port = ct->port; |
2320 |
+- struct zfcp_adapter *adapter = port->adapter; |
2321 |
+- struct ct_hdr *hdr = zfcp_sg_to_address(ct->req); |
2322 |
++ struct zfcp_wka_port *wka_port = ct->wka_port; |
2323 |
++ struct zfcp_adapter *adapter = wka_port->adapter; |
2324 |
++ struct ct_hdr *hdr = sg_virt(ct->req); |
2325 |
+ struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; |
2326 |
+ struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; |
2327 |
++ int level = 3; |
2328 |
+ unsigned long flags; |
2329 |
+ |
2330 |
+ spin_lock_irqsave(&adapter->san_dbf_lock, flags); |
2331 |
+@@ -842,7 +891,7 @@ void zfcp_san_dbf_event_ct_request(struc |
2332 |
+ r->fsf_reqid = (unsigned long)fsf_req; |
2333 |
+ r->fsf_seqno = fsf_req->seq_no; |
2334 |
+ r->s_id = fc_host_port_id(adapter->scsi_host); |
2335 |
+- r->d_id = port->d_id; |
2336 |
++ r->d_id = wka_port->d_id; |
2337 |
+ oct->cmd_req_code = hdr->cmd_rsp_code; |
2338 |
+ oct->revision = hdr->revision; |
2339 |
+ oct->gs_type = hdr->gs_type; |
2340 |
+@@ -850,9 +899,10 @@ void zfcp_san_dbf_event_ct_request(struc |
2341 |
+ oct->options = hdr->options; |
2342 |
+ oct->max_res_size = hdr->max_res_size; |
2343 |
+ oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr), |
2344 |
+- ZFCP_DBF_CT_PAYLOAD); |
2345 |
+- memcpy(oct->payload, (void *)hdr + sizeof(struct ct_hdr), oct->len); |
2346 |
+- debug_event(adapter->san_dbf, 3, r, sizeof(*r)); |
2347 |
++ ZFCP_DBF_SAN_MAX_PAYLOAD); |
2348 |
++ debug_event(adapter->san_dbf, level, r, sizeof(*r)); |
2349 |
++ zfcp_dbf_hexdump(adapter->san_dbf, r, sizeof(*r), level, |
2350 |
++ (void *)hdr + sizeof(struct ct_hdr), oct->len); |
2351 |
+ spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); |
2352 |
+ } |
2353 |
+ |
2354 |
+@@ -863,11 +913,12 @@ void zfcp_san_dbf_event_ct_request(struc |
2355 |
+ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) |
2356 |
+ { |
2357 |
+ struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; |
2358 |
+- struct zfcp_port *port = ct->port; |
2359 |
+- struct zfcp_adapter *adapter = port->adapter; |
2360 |
+- struct ct_hdr *hdr = zfcp_sg_to_address(ct->resp); |
2361 |
++ struct zfcp_wka_port *wka_port = ct->wka_port; |
2362 |
++ struct zfcp_adapter *adapter = wka_port->adapter; |
2363 |
++ struct ct_hdr *hdr = sg_virt(ct->resp); |
2364 |
+ struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; |
2365 |
+ struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; |
2366 |
++ int level = 3; |
2367 |
+ unsigned long flags; |
2368 |
+ |
2369 |
+ spin_lock_irqsave(&adapter->san_dbf_lock, flags); |
2370 |
+@@ -875,7 +926,7 @@ void zfcp_san_dbf_event_ct_response(stru |
2371 |
+ strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); |
2372 |
+ r->fsf_reqid = (unsigned long)fsf_req; |
2373 |
+ r->fsf_seqno = fsf_req->seq_no; |
2374 |
+- r->s_id = port->d_id; |
2375 |
++ r->s_id = wka_port->d_id; |
2376 |
+ r->d_id = fc_host_port_id(adapter->scsi_host); |
2377 |
+ rct->cmd_rsp_code = hdr->cmd_rsp_code; |
2378 |
+ rct->revision = hdr->revision; |
2379 |
+@@ -883,9 +934,10 @@ void zfcp_san_dbf_event_ct_response(stru |
2380 |
+ rct->expl = hdr->reason_code_expl; |
2381 |
+ rct->vendor_unique = hdr->vendor_unique; |
2382 |
+ rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr), |
2383 |
+- ZFCP_DBF_CT_PAYLOAD); |
2384 |
+- memcpy(rct->payload, (void *)hdr + sizeof(struct ct_hdr), rct->len); |
2385 |
+- debug_event(adapter->san_dbf, 3, r, sizeof(*r)); |
2386 |
++ ZFCP_DBF_SAN_MAX_PAYLOAD); |
2387 |
++ debug_event(adapter->san_dbf, level, r, sizeof(*r)); |
2388 |
++ zfcp_dbf_hexdump(adapter->san_dbf, r, sizeof(*r), level, |
2389 |
++ (void *)hdr + sizeof(struct ct_hdr), rct->len); |
2390 |
+ spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); |
2391 |
+ } |
2392 |
+ |
2393 |
+@@ -908,7 +960,7 @@ static void zfcp_san_dbf_event_els(const |
2394 |
+ rec->u.els.ls_code = ls_code; |
2395 |
+ debug_event(adapter->san_dbf, level, rec, sizeof(*rec)); |
2396 |
+ zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level, |
2397 |
+- buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD)); |
2398 |
++ buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD)); |
2399 |
+ spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); |
2400 |
+ } |
2401 |
+ |
2402 |
+@@ -922,8 +974,8 @@ void zfcp_san_dbf_event_els_request(stru |
2403 |
+ |
2404 |
+ zfcp_san_dbf_event_els("oels", 2, fsf_req, |
2405 |
+ fc_host_port_id(els->adapter->scsi_host), |
2406 |
+- els->d_id, *(u8 *) zfcp_sg_to_address(els->req), |
2407 |
+- zfcp_sg_to_address(els->req), els->req->length); |
2408 |
++ els->d_id, *(u8 *) sg_virt(els->req), |
2409 |
++ sg_virt(els->req), els->req->length); |
2410 |
+ } |
2411 |
+ |
2412 |
+ /** |
2413 |
+@@ -936,8 +988,7 @@ void zfcp_san_dbf_event_els_response(str |
2414 |
+ |
2415 |
+ zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id, |
2416 |
+ fc_host_port_id(els->adapter->scsi_host), |
2417 |
+- *(u8 *)zfcp_sg_to_address(els->req), |
2418 |
+- zfcp_sg_to_address(els->resp), |
2419 |
++ *(u8 *)sg_virt(els->req), sg_virt(els->resp), |
2420 |
+ els->resp->length); |
2421 |
+ } |
2422 |
+ |
2423 |
+@@ -963,8 +1014,6 @@ static int zfcp_san_dbf_view_format(debu |
2424 |
+ char *out_buf, const char *in_buf) |
2425 |
+ { |
2426 |
+ struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf; |
2427 |
+- char *buffer = NULL; |
2428 |
+- int buflen = 0, total = 0; |
2429 |
+ char *p = out_buf; |
2430 |
+ |
2431 |
+ if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) |
2432 |
+@@ -984,9 +1033,6 @@ static int zfcp_san_dbf_view_format(debu |
2433 |
+ zfcp_dbf_out(&p, "gs_subtype", "0x%02x", ct->gs_subtype); |
2434 |
+ zfcp_dbf_out(&p, "options", "0x%02x", ct->options); |
2435 |
+ zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size); |
2436 |
+- total = ct->len; |
2437 |
+- buffer = ct->payload; |
2438 |
+- buflen = min(total, ZFCP_DBF_CT_PAYLOAD); |
2439 |
+ } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { |
2440 |
+ struct zfcp_san_dbf_record_ct_response *ct = &r->u.ct_resp; |
2441 |
+ zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code); |
2442 |
+@@ -994,23 +1040,12 @@ static int zfcp_san_dbf_view_format(debu |
2443 |
+ zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code); |
2444 |
+ zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", ct->expl); |
2445 |
+ zfcp_dbf_out(&p, "vendor_unique", "0x%02x", ct->vendor_unique); |
2446 |
+- total = ct->len; |
2447 |
+- buffer = ct->payload; |
2448 |
+- buflen = min(total, ZFCP_DBF_CT_PAYLOAD); |
2449 |
+ } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || |
2450 |
+ strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || |
2451 |
+ strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { |
2452 |
+ struct zfcp_san_dbf_record_els *els = &r->u.els; |
2453 |
+ zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code); |
2454 |
+- total = els->len; |
2455 |
+- buffer = els->payload; |
2456 |
+- buflen = min(total, ZFCP_DBF_ELS_PAYLOAD); |
2457 |
+ } |
2458 |
+- |
2459 |
+- zfcp_dbf_outd(&p, "payload", buffer, buflen, 0, total); |
2460 |
+- if (buflen == total) |
2461 |
+- p += sprintf(p, "\n"); |
2462 |
+- |
2463 |
+ return p - out_buf; |
2464 |
+ } |
2465 |
+ |
2466 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_dbf.h |
2467 |
+=================================================================== |
2468 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_dbf.h |
2469 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_dbf.h |
2470 |
+@@ -151,6 +151,7 @@ struct zfcp_hba_dbf_record { |
2471 |
+ struct zfcp_hba_dbf_record_response response; |
2472 |
+ struct zfcp_hba_dbf_record_status status; |
2473 |
+ struct zfcp_hba_dbf_record_qdio qdio; |
2474 |
++ struct fsf_bit_error_payload berr; |
2475 |
+ } u; |
2476 |
+ } __attribute__ ((packed)); |
2477 |
+ |
2478 |
+@@ -162,8 +163,6 @@ struct zfcp_san_dbf_record_ct_request { |
2479 |
+ u8 options; |
2480 |
+ u16 max_res_size; |
2481 |
+ u32 len; |
2482 |
+-#define ZFCP_DBF_CT_PAYLOAD 24 |
2483 |
+- u8 payload[ZFCP_DBF_CT_PAYLOAD]; |
2484 |
+ } __attribute__ ((packed)); |
2485 |
+ |
2486 |
+ struct zfcp_san_dbf_record_ct_response { |
2487 |
+@@ -173,15 +172,11 @@ struct zfcp_san_dbf_record_ct_response { |
2488 |
+ u8 expl; |
2489 |
+ u8 vendor_unique; |
2490 |
+ u32 len; |
2491 |
+- u8 payload[ZFCP_DBF_CT_PAYLOAD]; |
2492 |
+ } __attribute__ ((packed)); |
2493 |
+ |
2494 |
+ struct zfcp_san_dbf_record_els { |
2495 |
+ u8 ls_code; |
2496 |
+ u32 len; |
2497 |
+-#define ZFCP_DBF_ELS_PAYLOAD 32 |
2498 |
+-#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024 |
2499 |
+- u8 payload[ZFCP_DBF_ELS_PAYLOAD]; |
2500 |
+ } __attribute__ ((packed)); |
2501 |
+ |
2502 |
+ struct zfcp_san_dbf_record { |
2503 |
+@@ -195,6 +190,8 @@ struct zfcp_san_dbf_record { |
2504 |
+ struct zfcp_san_dbf_record_ct_response ct_resp; |
2505 |
+ struct zfcp_san_dbf_record_els els; |
2506 |
+ } u; |
2507 |
++#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024 |
2508 |
++ u8 payload[32]; |
2509 |
+ } __attribute__ ((packed)); |
2510 |
+ |
2511 |
+ struct zfcp_scsi_dbf_record { |
2512 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_def.h |
2513 |
+=================================================================== |
2514 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_def.h |
2515 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_def.h |
2516 |
+@@ -39,29 +39,6 @@ |
2517 |
+ |
2518 |
+ /********************* GENERAL DEFINES *********************************/ |
2519 |
+ |
2520 |
+-/** |
2521 |
+- * zfcp_sg_to_address - determine kernel address from struct scatterlist |
2522 |
+- * @list: struct scatterlist |
2523 |
+- * Return: kernel address |
2524 |
+- */ |
2525 |
+-static inline void * |
2526 |
+-zfcp_sg_to_address(struct scatterlist *list) |
2527 |
+-{ |
2528 |
+- return sg_virt(list); |
2529 |
+-} |
2530 |
+- |
2531 |
+-/** |
2532 |
+- * zfcp_address_to_sg - set up struct scatterlist from kernel address |
2533 |
+- * @address: kernel address |
2534 |
+- * @list: struct scatterlist |
2535 |
+- * @size: buffer size |
2536 |
+- */ |
2537 |
+-static inline void |
2538 |
+-zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size) |
2539 |
+-{ |
2540 |
+- sg_set_buf(list, address, size); |
2541 |
+-} |
2542 |
+- |
2543 |
+ #define REQUEST_LIST_SIZE 128 |
2544 |
+ |
2545 |
+ /********************* SCSI SPECIFIC DEFINES *********************************/ |
2546 |
+@@ -101,11 +78,6 @@ zfcp_address_to_sg(void *address, struct |
2547 |
+ |
2548 |
+ /*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/ |
2549 |
+ |
2550 |
+-typedef unsigned long long wwn_t; |
2551 |
+-typedef unsigned long long fcp_lun_t; |
2552 |
+-/* data length field may be at variable position in FCP-2 FCP_CMND IU */ |
2553 |
+-typedef unsigned int fcp_dl_t; |
2554 |
+- |
2555 |
+ /* timeout for name-server lookup (in seconds) */ |
2556 |
+ #define ZFCP_NS_GID_PN_TIMEOUT 10 |
2557 |
+ |
2558 |
+@@ -129,7 +101,7 @@ typedef unsigned int fcp_dl_t; |
2559 |
+ |
2560 |
+ /* FCP(-2) FCP_CMND IU */ |
2561 |
+ struct fcp_cmnd_iu { |
2562 |
+- fcp_lun_t fcp_lun; /* FCP logical unit number */ |
2563 |
++ u64 fcp_lun; /* FCP logical unit number */ |
2564 |
+ u8 crn; /* command reference number */ |
2565 |
+ u8 reserved0:5; /* reserved */ |
2566 |
+ u8 task_attribute:3; /* task attribute */ |
2567 |
+@@ -204,7 +176,7 @@ struct fcp_rscn_element { |
2568 |
+ struct fcp_logo { |
2569 |
+ u32 command; |
2570 |
+ u32 nport_did; |
2571 |
+- wwn_t nport_wwpn; |
2572 |
++ u64 nport_wwpn; |
2573 |
+ } __attribute__((packed)); |
2574 |
+ |
2575 |
+ /* |
2576 |
+@@ -218,13 +190,6 @@ struct fcp_logo { |
2577 |
+ #define ZFCP_LS_RSCN 0x61 |
2578 |
+ #define ZFCP_LS_RNID 0x78 |
2579 |
+ |
2580 |
+-struct zfcp_ls_rjt_par { |
2581 |
+- u8 action; |
2582 |
+- u8 reason_code; |
2583 |
+- u8 reason_expl; |
2584 |
+- u8 vendor_unique; |
2585 |
+-} __attribute__ ((packed)); |
2586 |
+- |
2587 |
+ struct zfcp_ls_adisc { |
2588 |
+ u8 code; |
2589 |
+ u8 field[3]; |
2590 |
+@@ -234,20 +199,6 @@ struct zfcp_ls_adisc { |
2591 |
+ u32 nport_id; |
2592 |
+ } __attribute__ ((packed)); |
2593 |
+ |
2594 |
+-struct zfcp_ls_adisc_acc { |
2595 |
+- u8 code; |
2596 |
+- u8 field[3]; |
2597 |
+- u32 hard_nport_id; |
2598 |
+- u64 wwpn; |
2599 |
+- u64 wwnn; |
2600 |
+- u32 nport_id; |
2601 |
+-} __attribute__ ((packed)); |
2602 |
+- |
2603 |
+-struct zfcp_rc_entry { |
2604 |
+- u8 code; |
2605 |
+- const char *description; |
2606 |
+-}; |
2607 |
+- |
2608 |
+ /* |
2609 |
+ * FC-GS-2 stuff |
2610 |
+ */ |
2611 |
+@@ -281,9 +232,7 @@ struct zfcp_rc_entry { |
2612 |
+ #define ZFCP_STATUS_COMMON_RUNNING 0x40000000 |
2613 |
+ #define ZFCP_STATUS_COMMON_ERP_FAILED 0x20000000 |
2614 |
+ #define ZFCP_STATUS_COMMON_UNBLOCKED 0x10000000 |
2615 |
+-#define ZFCP_STATUS_COMMON_OPENING 0x08000000 |
2616 |
+ #define ZFCP_STATUS_COMMON_OPEN 0x04000000 |
2617 |
+-#define ZFCP_STATUS_COMMON_CLOSING 0x02000000 |
2618 |
+ #define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 |
2619 |
+ #define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 |
2620 |
+ #define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000 |
2621 |
+@@ -291,16 +240,15 @@ struct zfcp_rc_entry { |
2622 |
+ |
2623 |
+ /* adapter status */ |
2624 |
+ #define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 |
2625 |
+-#define ZFCP_STATUS_ADAPTER_REGISTERED 0x00000004 |
2626 |
+ #define ZFCP_STATUS_ADAPTER_XCONFIG_OK 0x00000008 |
2627 |
+ #define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010 |
2628 |
+ #define ZFCP_STATUS_ADAPTER_ERP_THREAD_UP 0x00000020 |
2629 |
+ #define ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL 0x00000080 |
2630 |
+ #define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100 |
2631 |
+ #define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 |
2632 |
+-#define ZFCP_STATUS_ADAPTER_XPORT_OK 0x00000800 |
2633 |
+ |
2634 |
+ /* FC-PH/FC-GS well-known address identifiers for generic services */ |
2635 |
++#define ZFCP_DID_WKA 0xFFFFF0 |
2636 |
+ #define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA |
2637 |
+ #define ZFCP_DID_TIME_SERVICE 0xFFFFFB |
2638 |
+ #define ZFCP_DID_DIRECTORY_SERVICE 0xFFFFFC |
2639 |
+@@ -312,29 +260,27 @@ struct zfcp_rc_entry { |
2640 |
+ #define ZFCP_STATUS_PORT_DID_DID 0x00000002 |
2641 |
+ #define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 |
2642 |
+ #define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 |
2643 |
+-#define ZFCP_STATUS_PORT_NO_SCSI_ID 0x00000010 |
2644 |
+ #define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 |
2645 |
+ |
2646 |
+-/* for ports with well known addresses */ |
2647 |
+-#define ZFCP_STATUS_PORT_WKA \ |
2648 |
+- (ZFCP_STATUS_PORT_NO_WWPN | \ |
2649 |
+- ZFCP_STATUS_PORT_NO_SCSI_ID) |
2650 |
++/* well known address (WKA) port status*/ |
2651 |
++enum zfcp_wka_status { |
2652 |
++ ZFCP_WKA_PORT_OFFLINE, |
2653 |
++ ZFCP_WKA_PORT_CLOSING, |
2654 |
++ ZFCP_WKA_PORT_OPENING, |
2655 |
++ ZFCP_WKA_PORT_ONLINE, |
2656 |
++}; |
2657 |
+ |
2658 |
+ /* logical unit status */ |
2659 |
+-#define ZFCP_STATUS_UNIT_TEMPORARY 0x00000002 |
2660 |
+ #define ZFCP_STATUS_UNIT_SHARED 0x00000004 |
2661 |
+ #define ZFCP_STATUS_UNIT_READONLY 0x00000008 |
2662 |
+ #define ZFCP_STATUS_UNIT_REGISTERED 0x00000010 |
2663 |
+ #define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020 |
2664 |
+ |
2665 |
+ /* FSF request status (this does not have a common part) */ |
2666 |
+-#define ZFCP_STATUS_FSFREQ_NOT_INIT 0x00000000 |
2667 |
+-#define ZFCP_STATUS_FSFREQ_POOL 0x00000001 |
2668 |
+ #define ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT 0x00000002 |
2669 |
+ #define ZFCP_STATUS_FSFREQ_COMPLETED 0x00000004 |
2670 |
+ #define ZFCP_STATUS_FSFREQ_ERROR 0x00000008 |
2671 |
+ #define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 |
2672 |
+-#define ZFCP_STATUS_FSFREQ_ABORTING 0x00000020 |
2673 |
+ #define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040 |
2674 |
+ #define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080 |
2675 |
+ #define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100 |
2676 |
+@@ -379,7 +325,7 @@ struct ct_hdr { |
2677 |
+ * a port name is required */ |
2678 |
+ struct ct_iu_gid_pn_req { |
2679 |
+ struct ct_hdr header; |
2680 |
+- wwn_t wwpn; |
2681 |
++ u64 wwpn; |
2682 |
+ } __attribute__ ((packed)); |
2683 |
+ |
2684 |
+ /* FS_ACC IU and data unit for GID_PN nameserver request */ |
2685 |
+@@ -388,11 +334,9 @@ struct ct_iu_gid_pn_resp { |
2686 |
+ u32 d_id; |
2687 |
+ } __attribute__ ((packed)); |
2688 |
+ |
2689 |
+-typedef void (*zfcp_send_ct_handler_t)(unsigned long); |
2690 |
+- |
2691 |
+ /** |
2692 |
+ * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct |
2693 |
+- * @port: port where the request is sent to |
2694 |
++ * @wka_port: port where the request is sent to |
2695 |
+ * @req: scatter-gather list for request |
2696 |
+ * @resp: scatter-gather list for response |
2697 |
+ * @req_count: number of elements in request scatter-gather list |
2698 |
+@@ -404,12 +348,12 @@ typedef void (*zfcp_send_ct_handler_t)(u |
2699 |
+ * @status: used to pass error status to calling function |
2700 |
+ */ |
2701 |
+ struct zfcp_send_ct { |
2702 |
+- struct zfcp_port *port; |
2703 |
++ struct zfcp_wka_port *wka_port; |
2704 |
+ struct scatterlist *req; |
2705 |
+ struct scatterlist *resp; |
2706 |
+ unsigned int req_count; |
2707 |
+ unsigned int resp_count; |
2708 |
+- zfcp_send_ct_handler_t handler; |
2709 |
++ void (*handler)(unsigned long); |
2710 |
+ unsigned long handler_data; |
2711 |
+ int timeout; |
2712 |
+ struct completion *completion; |
2713 |
+@@ -426,8 +370,6 @@ struct zfcp_gid_pn_data { |
2714 |
+ struct zfcp_port *port; |
2715 |
+ }; |
2716 |
+ |
2717 |
+-typedef void (*zfcp_send_els_handler_t)(unsigned long); |
2718 |
+- |
2719 |
+ /** |
2720 |
+ * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els |
2721 |
+ * @adapter: adapter where request is sent from |
2722 |
+@@ -451,22 +393,28 @@ struct zfcp_send_els { |
2723 |
+ struct scatterlist *resp; |
2724 |
+ unsigned int req_count; |
2725 |
+ unsigned int resp_count; |
2726 |
+- zfcp_send_els_handler_t handler; |
2727 |
++ void (*handler)(unsigned long); |
2728 |
+ unsigned long handler_data; |
2729 |
+ struct completion *completion; |
2730 |
+ int ls_code; |
2731 |
+ int status; |
2732 |
+ }; |
2733 |
+ |
2734 |
++struct zfcp_wka_port { |
2735 |
++ struct zfcp_adapter *adapter; |
2736 |
++ wait_queue_head_t completion_wq; |
2737 |
++ enum zfcp_wka_status status; |
2738 |
++ atomic_t refcount; |
2739 |
++ u32 d_id; |
2740 |
++ u32 handle; |
2741 |
++ struct mutex mutex; |
2742 |
++ struct delayed_work work; |
2743 |
++}; |
2744 |
++ |
2745 |
+ struct zfcp_qdio_queue { |
2746 |
+- struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q]; /* SBALs */ |
2747 |
+- u8 first; /* index of next free bfr |
2748 |
+- in queue (free_count>0) */ |
2749 |
+- atomic_t count; /* number of free buffers |
2750 |
+- in queue */ |
2751 |
+- spinlock_t lock; /* lock for operations on queue */ |
2752 |
+- int pci_batch; /* SBALs since PCI indication |
2753 |
+- was last set */ |
2754 |
++ struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q]; |
2755 |
++ u8 first; /* index of next free bfr in queue */ |
2756 |
++ atomic_t count; /* number of free buffers in queue */ |
2757 |
+ }; |
2758 |
+ |
2759 |
+ struct zfcp_erp_action { |
2760 |
+@@ -475,7 +423,7 @@ struct zfcp_erp_action { |
2761 |
+ struct zfcp_adapter *adapter; /* device which should be recovered */ |
2762 |
+ struct zfcp_port *port; |
2763 |
+ struct zfcp_unit *unit; |
2764 |
+- volatile u32 status; /* recovery status */ |
2765 |
++ u32 status; /* recovery status */ |
2766 |
+ u32 step; /* active step of this erp action */ |
2767 |
+ struct zfcp_fsf_req *fsf_req; /* fsf request currently pending |
2768 |
+ for this action */ |
2769 |
+@@ -506,8 +454,8 @@ struct zfcp_adapter { |
2770 |
+ atomic_t refcount; /* reference count */ |
2771 |
+ wait_queue_head_t remove_wq; /* can be used to wait for |
2772 |
+ refcount drop to zero */ |
2773 |
+- wwn_t peer_wwnn; /* P2P peer WWNN */ |
2774 |
+- wwn_t peer_wwpn; /* P2P peer WWPN */ |
2775 |
++ u64 peer_wwnn; /* P2P peer WWNN */ |
2776 |
++ u64 peer_wwpn; /* P2P peer WWPN */ |
2777 |
+ u32 peer_d_id; /* P2P peer D_ID */ |
2778 |
+ struct ccw_device *ccw_device; /* S/390 ccw device */ |
2779 |
+ u32 hydra_version; /* Hydra version */ |
2780 |
+@@ -518,13 +466,13 @@ struct zfcp_adapter { |
2781 |
+ u16 timer_ticks; /* time int for a tick */ |
2782 |
+ struct Scsi_Host *scsi_host; /* Pointer to mid-layer */ |
2783 |
+ struct list_head port_list_head; /* remote port list */ |
2784 |
+- struct list_head port_remove_lh; /* head of ports to be |
2785 |
+- removed */ |
2786 |
+- u32 ports; /* number of remote ports */ |
2787 |
+ unsigned long req_no; /* unique FSF req number */ |
2788 |
+ struct list_head *req_list; /* list of pending reqs */ |
2789 |
+ spinlock_t req_list_lock; /* request list lock */ |
2790 |
+ struct zfcp_qdio_queue req_q; /* request queue */ |
2791 |
++ spinlock_t req_q_lock; /* for operations on queue */ |
2792 |
++ int req_q_pci_batch; /* SBALs since PCI indication |
2793 |
++ was last set */ |
2794 |
+ u32 fsf_req_seq_no; /* FSF cmnd seq number */ |
2795 |
+ wait_queue_head_t request_wq; /* can be used to wait for |
2796 |
+ more avaliable SBALs */ |
2797 |
+@@ -548,7 +496,7 @@ struct zfcp_adapter { |
2798 |
+ actions */ |
2799 |
+ u32 erp_low_mem_count; /* nr of erp actions waiting |
2800 |
+ for memory */ |
2801 |
+- struct zfcp_port *nameserver_port; /* adapter's nameserver */ |
2802 |
++ struct zfcp_wka_port nsp; /* adapter's nameserver */ |
2803 |
+ debug_info_t *rec_dbf; |
2804 |
+ debug_info_t *hba_dbf; |
2805 |
+ debug_info_t *san_dbf; /* debug feature areas */ |
2806 |
+@@ -563,11 +511,11 @@ struct zfcp_adapter { |
2807 |
+ struct zfcp_scsi_dbf_record scsi_dbf_buf; |
2808 |
+ struct zfcp_adapter_mempool pool; /* Adapter memory pools */ |
2809 |
+ struct qdio_initialize qdio_init_data; /* for qdio_establish */ |
2810 |
+- struct device generic_services; /* directory for WKA ports */ |
2811 |
+ struct fc_host_statistics *fc_stats; |
2812 |
+ struct fsf_qtcb_bottom_port *stats_reset_data; |
2813 |
+ unsigned long stats_reset; |
2814 |
+ struct work_struct scan_work; |
2815 |
++ atomic_t qdio_outb_full; /* queue full incidents */ |
2816 |
+ }; |
2817 |
+ |
2818 |
+ struct zfcp_port { |
2819 |
+@@ -579,18 +527,16 @@ struct zfcp_port { |
2820 |
+ refcount drop to zero */ |
2821 |
+ struct zfcp_adapter *adapter; /* adapter used to access port */ |
2822 |
+ struct list_head unit_list_head; /* head of logical unit list */ |
2823 |
+- struct list_head unit_remove_lh; /* head of luns to be removed |
2824 |
+- list */ |
2825 |
+- u32 units; /* # of logical units in list */ |
2826 |
+ atomic_t status; /* status of this remote port */ |
2827 |
+- wwn_t wwnn; /* WWNN if known */ |
2828 |
+- wwn_t wwpn; /* WWPN */ |
2829 |
++ u64 wwnn; /* WWNN if known */ |
2830 |
++ u64 wwpn; /* WWPN */ |
2831 |
+ u32 d_id; /* D_ID */ |
2832 |
+ u32 handle; /* handle assigned by FSF */ |
2833 |
+ struct zfcp_erp_action erp_action; /* pending error recovery */ |
2834 |
+ atomic_t erp_counter; |
2835 |
+ u32 maxframe_size; |
2836 |
+ u32 supported_classes; |
2837 |
++ struct work_struct gid_pn_work; |
2838 |
+ }; |
2839 |
+ |
2840 |
+ struct zfcp_unit { |
2841 |
+@@ -601,8 +547,7 @@ struct zfcp_unit { |
2842 |
+ refcount drop to zero */ |
2843 |
+ struct zfcp_port *port; /* remote port of unit */ |
2844 |
+ atomic_t status; /* status of this logical unit */ |
2845 |
+- unsigned int scsi_lun; /* own SCSI LUN */ |
2846 |
+- fcp_lun_t fcp_lun; /* own FCP_LUN */ |
2847 |
++ u64 fcp_lun; /* own FCP_LUN */ |
2848 |
+ u32 handle; /* handle assigned by FSF */ |
2849 |
+ struct scsi_device *device; /* scsi device struct pointer */ |
2850 |
+ struct zfcp_erp_action erp_action; /* pending error recovery */ |
2851 |
+@@ -625,7 +570,7 @@ struct zfcp_fsf_req { |
2852 |
+ u8 sbal_response; /* SBAL used in interrupt */ |
2853 |
+ wait_queue_head_t completion_wq; /* can be used by a routine |
2854 |
+ to wait for completion */ |
2855 |
+- volatile u32 status; /* status of this request */ |
2856 |
++ u32 status; /* status of this request */ |
2857 |
+ u32 fsf_command; /* FSF Command copy */ |
2858 |
+ struct fsf_qtcb *qtcb; /* address of associated QTCB */ |
2859 |
+ u32 seq_no; /* Sequence number of request */ |
2860 |
+@@ -644,11 +589,7 @@ struct zfcp_fsf_req { |
2861 |
+ struct zfcp_data { |
2862 |
+ struct scsi_host_template scsi_host_template; |
2863 |
+ struct scsi_transport_template *scsi_transport_template; |
2864 |
+- atomic_t status; /* Module status flags */ |
2865 |
+ struct list_head adapter_list_head; /* head of adapter list */ |
2866 |
+- struct list_head adapter_remove_lh; /* head of adapters to be |
2867 |
+- removed */ |
2868 |
+- u32 adapters; /* # of adapters in list */ |
2869 |
+ rwlock_t config_lock; /* serialises changes |
2870 |
+ to adapter/port/unit |
2871 |
+ lists */ |
2872 |
+@@ -656,11 +597,12 @@ struct zfcp_data { |
2873 |
+ changes */ |
2874 |
+ atomic_t loglevel; /* current loglevel */ |
2875 |
+ char init_busid[BUS_ID_SIZE]; |
2876 |
+- wwn_t init_wwpn; |
2877 |
+- fcp_lun_t init_fcp_lun; |
2878 |
+- struct kmem_cache *fsf_req_qtcb_cache; |
2879 |
+- struct kmem_cache *sr_buffer_cache; |
2880 |
+- struct kmem_cache *gid_pn_cache; |
2881 |
++ u64 init_wwpn; |
2882 |
++ u64 init_fcp_lun; |
2883 |
++ struct kmem_cache *fsf_req_qtcb_cache; |
2884 |
++ struct kmem_cache *sr_buffer_cache; |
2885 |
++ struct kmem_cache *gid_pn_cache; |
2886 |
++ struct workqueue_struct *work_queue; |
2887 |
+ }; |
2888 |
+ |
2889 |
+ /* struct used by memory pools for fsf_requests */ |
2890 |
+@@ -677,14 +619,7 @@ struct zfcp_fsf_req_qtcb { |
2891 |
+ #define ZFCP_SET 0x00000100 |
2892 |
+ #define ZFCP_CLEAR 0x00000200 |
2893 |
+ |
2894 |
+-#ifndef atomic_test_mask |
2895 |
+-#define atomic_test_mask(mask, target) \ |
2896 |
+- ((atomic_read(target) & mask) == mask) |
2897 |
+-#endif |
2898 |
+- |
2899 |
+ #define zfcp_get_busid_by_adapter(adapter) (adapter->ccw_device->dev.bus_id) |
2900 |
+-#define zfcp_get_busid_by_port(port) (zfcp_get_busid_by_adapter(port->adapter)) |
2901 |
+-#define zfcp_get_busid_by_unit(unit) (zfcp_get_busid_by_port(unit->port)) |
2902 |
+ |
2903 |
+ /* |
2904 |
+ * Helper functions for request ID management. |
2905 |
+@@ -745,12 +680,6 @@ zfcp_unit_put(struct zfcp_unit *unit) |
2906 |
+ } |
2907 |
+ |
2908 |
+ static inline void |
2909 |
+-zfcp_unit_wait(struct zfcp_unit *unit) |
2910 |
+-{ |
2911 |
+- wait_event(unit->remove_wq, atomic_read(&unit->refcount) == 0); |
2912 |
+-} |
2913 |
+- |
2914 |
+-static inline void |
2915 |
+ zfcp_port_get(struct zfcp_port *port) |
2916 |
+ { |
2917 |
+ atomic_inc(&port->refcount); |
2918 |
+@@ -764,12 +693,6 @@ zfcp_port_put(struct zfcp_port *port) |
2919 |
+ } |
2920 |
+ |
2921 |
+ static inline void |
2922 |
+-zfcp_port_wait(struct zfcp_port *port) |
2923 |
+-{ |
2924 |
+- wait_event(port->remove_wq, atomic_read(&port->refcount) == 0); |
2925 |
+-} |
2926 |
+- |
2927 |
+-static inline void |
2928 |
+ zfcp_adapter_get(struct zfcp_adapter *adapter) |
2929 |
+ { |
2930 |
+ atomic_inc(&adapter->refcount); |
2931 |
+@@ -782,10 +705,4 @@ zfcp_adapter_put(struct zfcp_adapter *ad |
2932 |
+ wake_up(&adapter->remove_wq); |
2933 |
+ } |
2934 |
+ |
2935 |
+-static inline void |
2936 |
+-zfcp_adapter_wait(struct zfcp_adapter *adapter) |
2937 |
+-{ |
2938 |
+- wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0); |
2939 |
+-} |
2940 |
+- |
2941 |
+ #endif /* ZFCP_DEF_H */ |
2942 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_erp.c |
2943 |
+=================================================================== |
2944 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_erp.c |
2945 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_erp.c |
2946 |
+@@ -23,7 +23,6 @@ enum zfcp_erp_steps { |
2947 |
+ ZFCP_ERP_STEP_FSF_XCONFIG = 0x0001, |
2948 |
+ ZFCP_ERP_STEP_PHYS_PORT_CLOSING = 0x0010, |
2949 |
+ ZFCP_ERP_STEP_PORT_CLOSING = 0x0100, |
2950 |
+- ZFCP_ERP_STEP_NAMESERVER_OPEN = 0x0200, |
2951 |
+ ZFCP_ERP_STEP_NAMESERVER_LOOKUP = 0x0400, |
2952 |
+ ZFCP_ERP_STEP_PORT_OPENING = 0x0800, |
2953 |
+ ZFCP_ERP_STEP_UNIT_CLOSING = 0x1000, |
2954 |
+@@ -473,6 +472,7 @@ static void zfcp_erp_strategy_check_fsfr |
2955 |
+ ZFCP_STATUS_ERP_TIMEDOUT)) { |
2956 |
+ act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; |
2957 |
+ zfcp_rec_dbf_event_action(142, act); |
2958 |
++ act->fsf_req->erp_action = NULL; |
2959 |
+ } |
2960 |
+ if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) |
2961 |
+ zfcp_rec_dbf_event_action(143, act); |
2962 |
+@@ -532,8 +532,7 @@ static void _zfcp_erp_port_reopen_all(st |
2963 |
+ struct zfcp_port *port; |
2964 |
+ |
2965 |
+ list_for_each_entry(port, &adapter->port_list_head, list) |
2966 |
+- if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_WKA)) |
2967 |
+- _zfcp_erp_port_reopen(port, clear, id, ref); |
2968 |
++ _zfcp_erp_port_reopen(port, clear, id, ref); |
2969 |
+ } |
2970 |
+ |
2971 |
+ static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear, u8 id, |
2972 |
+@@ -669,8 +668,6 @@ static int zfcp_erp_adapter_strategy_ope |
2973 |
+ int ret; |
2974 |
+ struct zfcp_adapter *adapter = act->adapter; |
2975 |
+ |
2976 |
+- atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
2977 |
+- |
2978 |
+ write_lock_irq(&adapter->erp_lock); |
2979 |
+ zfcp_erp_action_to_running(act); |
2980 |
+ write_unlock_irq(&adapter->erp_lock); |
2981 |
+@@ -741,8 +738,7 @@ static int zfcp_erp_adapter_strategy_gen |
2982 |
+ ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); |
2983 |
+ failed_qdio: |
2984 |
+ atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | |
2985 |
+- ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | |
2986 |
+- ZFCP_STATUS_ADAPTER_XPORT_OK, |
2987 |
++ ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, |
2988 |
+ &act->adapter->status); |
2989 |
+ return retval; |
2990 |
+ } |
2991 |
+@@ -751,15 +747,11 @@ static int zfcp_erp_adapter_strategy(str |
2992 |
+ { |
2993 |
+ int retval; |
2994 |
+ |
2995 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &act->adapter->status); |
2996 |
+ zfcp_erp_adapter_strategy_generic(act, 1); /* close */ |
2997 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_CLOSING, &act->adapter->status); |
2998 |
+ if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) |
2999 |
+ return ZFCP_ERP_EXIT; |
3000 |
+ |
3001 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &act->adapter->status); |
3002 |
+ retval = zfcp_erp_adapter_strategy_generic(act, 0); /* open */ |
3003 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING, &act->adapter->status); |
3004 |
+ |
3005 |
+ if (retval == ZFCP_ERP_FAILED) |
3006 |
+ ssleep(8); |
3007 |
+@@ -783,10 +775,7 @@ static int zfcp_erp_port_forced_strategy |
3008 |
+ |
3009 |
+ static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) |
3010 |
+ { |
3011 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING | |
3012 |
+- ZFCP_STATUS_COMMON_CLOSING | |
3013 |
+- ZFCP_STATUS_COMMON_ACCESS_DENIED | |
3014 |
+- ZFCP_STATUS_PORT_DID_DID | |
3015 |
++ atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | |
3016 |
+ ZFCP_STATUS_PORT_PHYS_CLOSING | |
3017 |
+ ZFCP_STATUS_PORT_INVALID_WWPN, |
3018 |
+ &port->status); |
3019 |
+@@ -839,73 +828,12 @@ static int zfcp_erp_port_strategy_open_p |
3020 |
+ return ZFCP_ERP_CONTINUES; |
3021 |
+ } |
3022 |
+ |
3023 |
+-static void zfcp_erp_port_strategy_open_ns_wake(struct zfcp_erp_action *ns_act) |
3024 |
+-{ |
3025 |
+- unsigned long flags; |
3026 |
+- struct zfcp_adapter *adapter = ns_act->adapter; |
3027 |
+- struct zfcp_erp_action *act, *tmp; |
3028 |
+- int status; |
3029 |
+- |
3030 |
+- read_lock_irqsave(&adapter->erp_lock, flags); |
3031 |
+- list_for_each_entry_safe(act, tmp, &adapter->erp_running_head, list) { |
3032 |
+- if (act->step == ZFCP_ERP_STEP_NAMESERVER_OPEN) { |
3033 |
+- status = atomic_read(&adapter->nameserver_port->status); |
3034 |
+- if (status & ZFCP_STATUS_COMMON_ERP_FAILED) |
3035 |
+- zfcp_erp_port_failed(act->port, 27, NULL); |
3036 |
+- zfcp_erp_action_ready(act); |
3037 |
+- } |
3038 |
+- } |
3039 |
+- read_unlock_irqrestore(&adapter->erp_lock, flags); |
3040 |
+-} |
3041 |
+- |
3042 |
+-static int zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *act) |
3043 |
+-{ |
3044 |
+- int retval; |
3045 |
+- |
3046 |
+- switch (act->step) { |
3047 |
+- case ZFCP_ERP_STEP_UNINITIALIZED: |
3048 |
+- case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: |
3049 |
+- case ZFCP_ERP_STEP_PORT_CLOSING: |
3050 |
+- return zfcp_erp_port_strategy_open_port(act); |
3051 |
+- |
3052 |
+- case ZFCP_ERP_STEP_PORT_OPENING: |
3053 |
+- if (atomic_read(&act->port->status) & ZFCP_STATUS_COMMON_OPEN) |
3054 |
+- retval = ZFCP_ERP_SUCCEEDED; |
3055 |
+- else |
3056 |
+- retval = ZFCP_ERP_FAILED; |
3057 |
+- /* this is needed anyway */ |
3058 |
+- zfcp_erp_port_strategy_open_ns_wake(act); |
3059 |
+- return retval; |
3060 |
+- |
3061 |
+- default: |
3062 |
+- return ZFCP_ERP_FAILED; |
3063 |
+- } |
3064 |
+-} |
3065 |
+- |
3066 |
+-static int zfcp_erp_port_strategy_open_lookup(struct zfcp_erp_action *act) |
3067 |
+-{ |
3068 |
+- int retval; |
3069 |
+- |
3070 |
+- retval = zfcp_fc_ns_gid_pn_request(act); |
3071 |
+- if (retval == -ENOMEM) |
3072 |
+- return ZFCP_ERP_NOMEM; |
3073 |
+- act->step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; |
3074 |
+- if (retval) |
3075 |
+- return ZFCP_ERP_FAILED; |
3076 |
+- return ZFCP_ERP_CONTINUES; |
3077 |
+-} |
3078 |
+- |
3079 |
+ static int zfcp_erp_open_ptp_port(struct zfcp_erp_action *act) |
3080 |
+ { |
3081 |
+ struct zfcp_adapter *adapter = act->adapter; |
3082 |
+ struct zfcp_port *port = act->port; |
3083 |
+ |
3084 |
+ if (port->wwpn != adapter->peer_wwpn) { |
3085 |
+- dev_err(&adapter->ccw_device->dev, |
3086 |
+- "Failed to open port 0x%016Lx, " |
3087 |
+- "Peer WWPN 0x%016Lx does not " |
3088 |
+- "match.\n", port->wwpn, |
3089 |
+- adapter->peer_wwpn); |
3090 |
+ zfcp_erp_port_failed(port, 25, NULL); |
3091 |
+ return ZFCP_ERP_FAILED; |
3092 |
+ } |
3093 |
+@@ -914,11 +842,25 @@ static int zfcp_erp_open_ptp_port(struct |
3094 |
+ return zfcp_erp_port_strategy_open_port(act); |
3095 |
+ } |
3096 |
+ |
3097 |
++void zfcp_erp_port_strategy_open_lookup(struct work_struct *work) |
3098 |
++{ |
3099 |
++ int retval; |
3100 |
++ struct zfcp_port *port = container_of(work, struct zfcp_port, |
3101 |
++ gid_pn_work); |
3102 |
++ |
3103 |
++ retval = zfcp_fc_ns_gid_pn(&port->erp_action); |
3104 |
++ if (retval == -ENOMEM) |
3105 |
++ zfcp_erp_notify(&port->erp_action, ZFCP_ERP_NOMEM); |
3106 |
++ port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; |
3107 |
++ if (retval) |
3108 |
++ zfcp_erp_notify(&port->erp_action, ZFCP_ERP_FAILED); |
3109 |
++ |
3110 |
++} |
3111 |
++ |
3112 |
+ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) |
3113 |
+ { |
3114 |
+ struct zfcp_adapter *adapter = act->adapter; |
3115 |
+ struct zfcp_port *port = act->port; |
3116 |
+- struct zfcp_port *ns_port = adapter->nameserver_port; |
3117 |
+ int p_status = atomic_read(&port->status); |
3118 |
+ |
3119 |
+ switch (act->step) { |
3120 |
+@@ -927,28 +869,10 @@ static int zfcp_erp_port_strategy_open_c |
3121 |
+ case ZFCP_ERP_STEP_PORT_CLOSING: |
3122 |
+ if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) |
3123 |
+ return zfcp_erp_open_ptp_port(act); |
3124 |
+- if (!ns_port) { |
3125 |
+- dev_err(&adapter->ccw_device->dev, |
3126 |
+- "Nameserver port unavailable.\n"); |
3127 |
+- return ZFCP_ERP_FAILED; |
3128 |
+- } |
3129 |
+- if (!(atomic_read(&ns_port->status) & |
3130 |
+- ZFCP_STATUS_COMMON_UNBLOCKED)) { |
3131 |
+- /* nameserver port may live again */ |
3132 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, |
3133 |
+- &ns_port->status); |
3134 |
+- if (zfcp_erp_port_reopen(ns_port, 0, 77, act) >= 0) { |
3135 |
+- act->step = ZFCP_ERP_STEP_NAMESERVER_OPEN; |
3136 |
+- return ZFCP_ERP_CONTINUES; |
3137 |
+- } |
3138 |
+- return ZFCP_ERP_FAILED; |
3139 |
++ if (!(p_status & ZFCP_STATUS_PORT_DID_DID)) { |
3140 |
++ queue_work(zfcp_data.work_queue, &port->gid_pn_work); |
3141 |
++ return ZFCP_ERP_CONTINUES; |
3142 |
+ } |
3143 |
+- /* else nameserver port is already open, fall through */ |
3144 |
+- case ZFCP_ERP_STEP_NAMESERVER_OPEN: |
3145 |
+- if (!(atomic_read(&ns_port->status) & ZFCP_STATUS_COMMON_OPEN)) |
3146 |
+- return ZFCP_ERP_FAILED; |
3147 |
+- return zfcp_erp_port_strategy_open_lookup(act); |
3148 |
+- |
3149 |
+ case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: |
3150 |
+ if (!(p_status & ZFCP_STATUS_PORT_DID_DID)) { |
3151 |
+ if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) { |
3152 |
+@@ -961,25 +885,26 @@ static int zfcp_erp_port_strategy_open_c |
3153 |
+ |
3154 |
+ case ZFCP_ERP_STEP_PORT_OPENING: |
3155 |
+ /* D_ID might have changed during open */ |
3156 |
+- if ((p_status & ZFCP_STATUS_COMMON_OPEN) && |
3157 |
+- (p_status & ZFCP_STATUS_PORT_DID_DID)) |
3158 |
+- return ZFCP_ERP_SUCCEEDED; |
3159 |
++ if (p_status & ZFCP_STATUS_COMMON_OPEN) { |
3160 |
++ if (p_status & ZFCP_STATUS_PORT_DID_DID) |
3161 |
++ return ZFCP_ERP_SUCCEEDED; |
3162 |
++ else { |
3163 |
++ act->step = ZFCP_ERP_STEP_PORT_CLOSING; |
3164 |
++ return ZFCP_ERP_CONTINUES; |
3165 |
++ } |
3166 |
+ /* fall through otherwise */ |
3167 |
++ } |
3168 |
+ } |
3169 |
+ return ZFCP_ERP_FAILED; |
3170 |
+ } |
3171 |
+ |
3172 |
+-static int zfcp_erp_port_strategy_open(struct zfcp_erp_action *act) |
3173 |
+-{ |
3174 |
+- if (atomic_read(&act->port->status) & (ZFCP_STATUS_PORT_WKA)) |
3175 |
+- return zfcp_erp_port_strategy_open_nameserver(act); |
3176 |
+- return zfcp_erp_port_strategy_open_common(act); |
3177 |
+-} |
3178 |
+- |
3179 |
+ static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) |
3180 |
+ { |
3181 |
+ struct zfcp_port *port = erp_action->port; |
3182 |
+ |
3183 |
++ if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_NOESC) |
3184 |
++ goto close_init_done; |
3185 |
++ |
3186 |
+ switch (erp_action->step) { |
3187 |
+ case ZFCP_ERP_STEP_UNINITIALIZED: |
3188 |
+ zfcp_erp_port_strategy_clearstati(port); |
3189 |
+@@ -992,19 +917,17 @@ static int zfcp_erp_port_strategy(struct |
3190 |
+ return ZFCP_ERP_FAILED; |
3191 |
+ break; |
3192 |
+ } |
3193 |
++ |
3194 |
++close_init_done: |
3195 |
+ if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) |
3196 |
+ return ZFCP_ERP_EXIT; |
3197 |
+- else |
3198 |
+- return zfcp_erp_port_strategy_open(erp_action); |
3199 |
+ |
3200 |
+- return ZFCP_ERP_FAILED; |
3201 |
++ return zfcp_erp_port_strategy_open_common(erp_action); |
3202 |
+ } |
3203 |
+ |
3204 |
+ static void zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *unit) |
3205 |
+ { |
3206 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING | |
3207 |
+- ZFCP_STATUS_COMMON_CLOSING | |
3208 |
+- ZFCP_STATUS_COMMON_ACCESS_DENIED | |
3209 |
++ atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | |
3210 |
+ ZFCP_STATUS_UNIT_SHARED | |
3211 |
+ ZFCP_STATUS_UNIT_READONLY, |
3212 |
+ &unit->status); |
3213 |
+@@ -1065,8 +988,14 @@ static int zfcp_erp_strategy_check_unit( |
3214 |
+ break; |
3215 |
+ case ZFCP_ERP_FAILED : |
3216 |
+ atomic_inc(&unit->erp_counter); |
3217 |
+- if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) |
3218 |
++ if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) { |
3219 |
++ dev_err(&unit->port->adapter->ccw_device->dev, |
3220 |
++ "ERP failed for unit 0x%016Lx on " |
3221 |
++ "port 0x%016Lx\n", |
3222 |
++ (unsigned long long)unit->fcp_lun, |
3223 |
++ (unsigned long long)unit->port->wwpn); |
3224 |
+ zfcp_erp_unit_failed(unit, 21, NULL); |
3225 |
++ } |
3226 |
+ break; |
3227 |
+ } |
3228 |
+ |
3229 |
+@@ -1091,8 +1020,12 @@ static int zfcp_erp_strategy_check_port( |
3230 |
+ result = ZFCP_ERP_EXIT; |
3231 |
+ } |
3232 |
+ atomic_inc(&port->erp_counter); |
3233 |
+- if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) |
3234 |
++ if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) { |
3235 |
++ dev_err(&port->adapter->ccw_device->dev, |
3236 |
++ "ERP failed for remote port 0x%016Lx\n", |
3237 |
++ (unsigned long long)port->wwpn); |
3238 |
+ zfcp_erp_port_failed(port, 22, NULL); |
3239 |
++ } |
3240 |
+ break; |
3241 |
+ } |
3242 |
+ |
3243 |
+@@ -1114,8 +1047,12 @@ static int zfcp_erp_strategy_check_adapt |
3244 |
+ |
3245 |
+ case ZFCP_ERP_FAILED : |
3246 |
+ atomic_inc(&adapter->erp_counter); |
3247 |
+- if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) |
3248 |
++ if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) { |
3249 |
++ dev_err(&adapter->ccw_device->dev, |
3250 |
++ "ERP cannot recover an error " |
3251 |
++ "on the FCP device\n"); |
3252 |
+ zfcp_erp_adapter_failed(adapter, 23, NULL); |
3253 |
++ } |
3254 |
+ break; |
3255 |
+ } |
3256 |
+ |
3257 |
+@@ -1249,10 +1186,13 @@ static void zfcp_erp_scsi_scan(struct wo |
3258 |
+ container_of(work, struct zfcp_erp_add_work, work); |
3259 |
+ struct zfcp_unit *unit = p->unit; |
3260 |
+ struct fc_rport *rport = unit->port->rport; |
3261 |
+- scsi_scan_target(&rport->dev, 0, rport->scsi_target_id, |
3262 |
+- unit->scsi_lun, 0); |
3263 |
++ |
3264 |
++ if (rport && rport->port_state == FC_PORTSTATE_ONLINE) |
3265 |
++ scsi_scan_target(&rport->dev, 0, rport->scsi_target_id, |
3266 |
++ scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0); |
3267 |
+ atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); |
3268 |
+ zfcp_unit_put(unit); |
3269 |
++ wake_up(&unit->port->adapter->erp_done_wqh); |
3270 |
+ kfree(p); |
3271 |
+ } |
3272 |
+ |
3273 |
+@@ -1263,9 +1203,9 @@ static void zfcp_erp_schedule_work(struc |
3274 |
+ p = kzalloc(sizeof(*p), GFP_KERNEL); |
3275 |
+ if (!p) { |
3276 |
+ dev_err(&unit->port->adapter->ccw_device->dev, |
3277 |
+- "Out of resources. Could not register unit " |
3278 |
+- "0x%016Lx on port 0x%016Lx with SCSI stack.\n", |
3279 |
+- unit->fcp_lun, unit->port->wwpn); |
3280 |
++ "Registering unit 0x%016Lx on port 0x%016Lx failed\n", |
3281 |
++ (unsigned long long)unit->fcp_lun, |
3282 |
++ (unsigned long long)unit->port->wwpn); |
3283 |
+ return; |
3284 |
+ } |
3285 |
+ |
3286 |
+@@ -1273,7 +1213,7 @@ static void zfcp_erp_schedule_work(struc |
3287 |
+ atomic_set_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); |
3288 |
+ INIT_WORK(&p->work, zfcp_erp_scsi_scan); |
3289 |
+ p->unit = unit; |
3290 |
+- schedule_work(&p->work); |
3291 |
++ queue_work(zfcp_data.work_queue, &p->work); |
3292 |
+ } |
3293 |
+ |
3294 |
+ static void zfcp_erp_rport_register(struct zfcp_port *port) |
3295 |
+@@ -1286,8 +1226,8 @@ static void zfcp_erp_rport_register(stru |
3296 |
+ port->rport = fc_remote_port_add(port->adapter->scsi_host, 0, &ids); |
3297 |
+ if (!port->rport) { |
3298 |
+ dev_err(&port->adapter->ccw_device->dev, |
3299 |
+- "Failed registration of rport " |
3300 |
+- "0x%016Lx.\n", port->wwpn); |
3301 |
++ "Registering port 0x%016Lx failed\n", |
3302 |
++ (unsigned long long)port->wwpn); |
3303 |
+ return; |
3304 |
+ } |
3305 |
+ |
3306 |
+@@ -1299,12 +1239,12 @@ static void zfcp_erp_rport_register(stru |
3307 |
+ static void zfcp_erp_rports_del(struct zfcp_adapter *adapter) |
3308 |
+ { |
3309 |
+ struct zfcp_port *port; |
3310 |
+- list_for_each_entry(port, &adapter->port_list_head, list) |
3311 |
+- if (port->rport && !(atomic_read(&port->status) & |
3312 |
+- ZFCP_STATUS_PORT_WKA)) { |
3313 |
+- fc_remote_port_delete(port->rport); |
3314 |
+- port->rport = NULL; |
3315 |
+- } |
3316 |
++ list_for_each_entry(port, &adapter->port_list_head, list) { |
3317 |
++ if (!port->rport) |
3318 |
++ continue; |
3319 |
++ fc_remote_port_delete(port->rport); |
3320 |
++ port->rport = NULL; |
3321 |
++ } |
3322 |
+ } |
3323 |
+ |
3324 |
+ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) |
3325 |
+@@ -1459,9 +1399,9 @@ static int zfcp_erp_thread(void *data) |
3326 |
+ zfcp_erp_wakeup(adapter); |
3327 |
+ } |
3328 |
+ |
3329 |
+- zfcp_rec_dbf_event_thread(4, adapter); |
3330 |
++ zfcp_rec_dbf_event_thread_lock(4, adapter); |
3331 |
+ down_interruptible(&adapter->erp_ready_sem); |
3332 |
+- zfcp_rec_dbf_event_thread(5, adapter); |
3333 |
++ zfcp_rec_dbf_event_thread_lock(5, adapter); |
3334 |
+ } |
3335 |
+ |
3336 |
+ atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); |
3337 |
+@@ -1484,7 +1424,7 @@ int zfcp_erp_thread_setup(struct zfcp_ad |
3338 |
+ retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD); |
3339 |
+ if (retval < 0) { |
3340 |
+ dev_err(&adapter->ccw_device->dev, |
3341 |
+- "Creation of ERP thread failed.\n"); |
3342 |
++ "Creating an ERP thread for the FCP device failed.\n"); |
3343 |
+ return retval; |
3344 |
+ } |
3345 |
+ wait_event(adapter->erp_thread_wqh, |
3346 |
+@@ -1506,7 +1446,7 @@ void zfcp_erp_thread_kill(struct zfcp_ad |
3347 |
+ { |
3348 |
+ atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); |
3349 |
+ up(&adapter->erp_ready_sem); |
3350 |
+- zfcp_rec_dbf_event_thread_lock(2, adapter); |
3351 |
++ zfcp_rec_dbf_event_thread_lock(3, adapter); |
3352 |
+ |
3353 |
+ wait_event(adapter->erp_thread_wqh, |
3354 |
+ !(atomic_read(&adapter->status) & |
3355 |
+@@ -1526,7 +1466,6 @@ void zfcp_erp_adapter_failed(struct zfcp |
3356 |
+ { |
3357 |
+ zfcp_erp_modify_adapter_status(adapter, id, ref, |
3358 |
+ ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
3359 |
+- dev_err(&adapter->ccw_device->dev, "Adapter ERP failed.\n"); |
3360 |
+ } |
3361 |
+ |
3362 |
+ /** |
3363 |
+@@ -1539,15 +1478,6 @@ void zfcp_erp_port_failed(struct zfcp_po |
3364 |
+ { |
3365 |
+ zfcp_erp_modify_port_status(port, id, ref, |
3366 |
+ ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
3367 |
+- |
3368 |
+- if (atomic_read(&port->status) & ZFCP_STATUS_PORT_WKA) |
3369 |
+- dev_err(&port->adapter->ccw_device->dev, |
3370 |
+- "Port ERP failed for WKA port d_id=0x%06x.\n", |
3371 |
+- port->d_id); |
3372 |
+- else |
3373 |
+- dev_err(&port->adapter->ccw_device->dev, |
3374 |
+- "Port ERP failed for port wwpn=0x%016Lx.\n", |
3375 |
+- port->wwpn); |
3376 |
+ } |
3377 |
+ |
3378 |
+ /** |
3379 |
+@@ -1560,10 +1490,6 @@ void zfcp_erp_unit_failed(struct zfcp_un |
3380 |
+ { |
3381 |
+ zfcp_erp_modify_unit_status(unit, id, ref, |
3382 |
+ ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
3383 |
+- |
3384 |
+- dev_err(&unit->port->adapter->ccw_device->dev, |
3385 |
+- "Unit ERP failed for unit 0x%016Lx on port 0x%016Lx.\n", |
3386 |
+- unit->fcp_lun, unit->port->wwpn); |
3387 |
+ } |
3388 |
+ |
3389 |
+ /** |
3390 |
+@@ -1754,9 +1680,8 @@ static void zfcp_erp_port_access_changed |
3391 |
+ |
3392 |
+ if (!(status & (ZFCP_STATUS_COMMON_ACCESS_DENIED | |
3393 |
+ ZFCP_STATUS_COMMON_ACCESS_BOXED))) { |
3394 |
+- if (!(status & ZFCP_STATUS_PORT_WKA)) |
3395 |
+- list_for_each_entry(unit, &port->unit_list_head, list) |
3396 |
+- zfcp_erp_unit_access_changed(unit, id, ref); |
3397 |
++ list_for_each_entry(unit, &port->unit_list_head, list) |
3398 |
++ zfcp_erp_unit_access_changed(unit, id, ref); |
3399 |
+ return; |
3400 |
+ } |
3401 |
+ |
3402 |
+@@ -1779,10 +1704,7 @@ void zfcp_erp_adapter_access_changed(str |
3403 |
+ return; |
3404 |
+ |
3405 |
+ read_lock_irqsave(&zfcp_data.config_lock, flags); |
3406 |
+- if (adapter->nameserver_port) |
3407 |
+- zfcp_erp_port_access_changed(adapter->nameserver_port, id, ref); |
3408 |
+ list_for_each_entry(port, &adapter->port_list_head, list) |
3409 |
+- if (port != adapter->nameserver_port) |
3410 |
+- zfcp_erp_port_access_changed(port, id, ref); |
3411 |
++ zfcp_erp_port_access_changed(port, id, ref); |
3412 |
+ read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
3413 |
+ } |
3414 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_ext.h |
3415 |
+=================================================================== |
3416 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_ext.h |
3417 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_ext.h |
3418 |
+@@ -12,16 +12,14 @@ |
3419 |
+ #include "zfcp_def.h" |
3420 |
+ |
3421 |
+ /* zfcp_aux.c */ |
3422 |
+-extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *, |
3423 |
+- fcp_lun_t); |
3424 |
+-extern struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *, |
3425 |
+- wwn_t); |
3426 |
++extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *, u64); |
3427 |
++extern struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *, u64); |
3428 |
+ extern int zfcp_adapter_enqueue(struct ccw_device *); |
3429 |
+ extern void zfcp_adapter_dequeue(struct zfcp_adapter *); |
3430 |
+-extern struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *, wwn_t, u32, |
3431 |
++extern struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *, u64, u32, |
3432 |
+ u32); |
3433 |
+ extern void zfcp_port_dequeue(struct zfcp_port *); |
3434 |
+-extern struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *, fcp_lun_t); |
3435 |
++extern struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *, u64); |
3436 |
+ extern void zfcp_unit_dequeue(struct zfcp_unit *); |
3437 |
+ extern int zfcp_reqlist_isempty(struct zfcp_adapter *); |
3438 |
+ extern void zfcp_sg_free_table(struct scatterlist *, int); |
3439 |
+@@ -29,6 +27,7 @@ extern int zfcp_sg_setup_table(struct sc |
3440 |
+ |
3441 |
+ /* zfcp_ccw.c */ |
3442 |
+ extern int zfcp_ccw_register(void); |
3443 |
++extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); |
3444 |
+ |
3445 |
+ /* zfcp_cfdc.c */ |
3446 |
+ extern struct miscdevice zfcp_cfdc_misc; |
3447 |
+@@ -50,6 +49,8 @@ extern void zfcp_hba_dbf_event_fsf_unsol |
3448 |
+ struct fsf_status_read_buffer *); |
3449 |
+ extern void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *, unsigned int, int, |
3450 |
+ int); |
3451 |
++extern void zfcp_hba_dbf_event_berr(struct zfcp_adapter *, |
3452 |
++ struct zfcp_fsf_req *); |
3453 |
+ extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *); |
3454 |
+ extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *); |
3455 |
+ extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *); |
3456 |
+@@ -91,17 +92,21 @@ extern void zfcp_erp_port_access_denied( |
3457 |
+ extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8, void *); |
3458 |
+ extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, u8, void *); |
3459 |
+ extern void zfcp_erp_timeout_handler(unsigned long); |
3460 |
++extern void zfcp_erp_port_strategy_open_lookup(struct work_struct *); |
3461 |
+ |
3462 |
+ /* zfcp_fc.c */ |
3463 |
+ extern int zfcp_scan_ports(struct zfcp_adapter *); |
3464 |
+ extern void _zfcp_scan_ports_later(struct work_struct *); |
3465 |
+ extern void zfcp_fc_incoming_els(struct zfcp_fsf_req *); |
3466 |
+-extern int zfcp_fc_ns_gid_pn_request(struct zfcp_erp_action *); |
3467 |
++extern int zfcp_fc_ns_gid_pn(struct zfcp_erp_action *); |
3468 |
+ extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *); |
3469 |
+ extern void zfcp_test_link(struct zfcp_port *); |
3470 |
++extern void zfcp_fc_nameserver_init(struct zfcp_adapter *); |
3471 |
+ |
3472 |
+ /* zfcp_fsf.c */ |
3473 |
+ extern int zfcp_fsf_open_port(struct zfcp_erp_action *); |
3474 |
++extern int zfcp_fsf_open_wka_port(struct zfcp_wka_port *); |
3475 |
++extern int zfcp_fsf_close_wka_port(struct zfcp_wka_port *); |
3476 |
+ extern int zfcp_fsf_close_port(struct zfcp_erp_action *); |
3477 |
+ extern int zfcp_fsf_close_physical_port(struct zfcp_erp_action *); |
3478 |
+ extern int zfcp_fsf_open_unit(struct zfcp_erp_action *); |
3479 |
+@@ -135,10 +140,8 @@ extern struct zfcp_fsf_req *zfcp_fsf_abo |
3480 |
+ extern int zfcp_qdio_allocate(struct zfcp_adapter *); |
3481 |
+ extern void zfcp_qdio_free(struct zfcp_adapter *); |
3482 |
+ extern int zfcp_qdio_send(struct zfcp_fsf_req *); |
3483 |
+-extern volatile struct qdio_buffer_element *zfcp_qdio_sbale_req( |
3484 |
+- struct zfcp_fsf_req *); |
3485 |
+-extern volatile struct qdio_buffer_element *zfcp_qdio_sbale_curr( |
3486 |
+- struct zfcp_fsf_req *); |
3487 |
++extern struct qdio_buffer_element *zfcp_qdio_sbale_req(struct zfcp_fsf_req *); |
3488 |
++extern struct qdio_buffer_element *zfcp_qdio_sbale_curr(struct zfcp_fsf_req *); |
3489 |
+ extern int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *, unsigned long, |
3490 |
+ struct scatterlist *, int); |
3491 |
+ extern int zfcp_qdio_open(struct zfcp_adapter *); |
3492 |
+@@ -148,14 +151,12 @@ extern void zfcp_qdio_close(struct zfcp_ |
3493 |
+ extern struct zfcp_data zfcp_data; |
3494 |
+ extern int zfcp_adapter_scsi_register(struct zfcp_adapter *); |
3495 |
+ extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *); |
3496 |
+-extern void zfcp_set_fcp_dl(struct fcp_cmnd_iu *, fcp_dl_t); |
3497 |
+ extern char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *); |
3498 |
+ extern struct fc_function_template zfcp_transport_functions; |
3499 |
+ |
3500 |
+ /* zfcp_sysfs.c */ |
3501 |
+ extern struct attribute_group zfcp_sysfs_unit_attrs; |
3502 |
+ extern struct attribute_group zfcp_sysfs_adapter_attrs; |
3503 |
+-extern struct attribute_group zfcp_sysfs_ns_port_attrs; |
3504 |
+ extern struct attribute_group zfcp_sysfs_port_attrs; |
3505 |
+ extern struct device_attribute *zfcp_sysfs_sdev_attrs[]; |
3506 |
+ extern struct device_attribute *zfcp_sysfs_shost_attrs[]; |
3507 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fc.c |
3508 |
+=================================================================== |
3509 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_fc.c |
3510 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fc.c |
3511 |
+@@ -39,6 +39,84 @@ struct zfcp_gpn_ft { |
3512 |
+ struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS]; |
3513 |
+ }; |
3514 |
+ |
3515 |
++struct zfcp_fc_ns_handler_data { |
3516 |
++ struct completion done; |
3517 |
++ void (*handler)(unsigned long); |
3518 |
++ unsigned long handler_data; |
3519 |
++}; |
3520 |
++ |
3521 |
++static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port) |
3522 |
++{ |
3523 |
++ if (mutex_lock_interruptible(&wka_port->mutex)) |
3524 |
++ return -ERESTARTSYS; |
3525 |
++ |
3526 |
++ if (wka_port->status != ZFCP_WKA_PORT_ONLINE) { |
3527 |
++ wka_port->status = ZFCP_WKA_PORT_OPENING; |
3528 |
++ if (zfcp_fsf_open_wka_port(wka_port)) |
3529 |
++ wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
3530 |
++ } |
3531 |
++ |
3532 |
++ mutex_unlock(&wka_port->mutex); |
3533 |
++ |
3534 |
++ wait_event_timeout( |
3535 |
++ wka_port->completion_wq, |
3536 |
++ wka_port->status == ZFCP_WKA_PORT_ONLINE || |
3537 |
++ wka_port->status == ZFCP_WKA_PORT_OFFLINE, |
3538 |
++ HZ >> 1); |
3539 |
++ |
3540 |
++ if (wka_port->status == ZFCP_WKA_PORT_ONLINE) { |
3541 |
++ atomic_inc(&wka_port->refcount); |
3542 |
++ return 0; |
3543 |
++ } |
3544 |
++ return -EIO; |
3545 |
++} |
3546 |
++ |
3547 |
++static void zfcp_wka_port_offline(struct work_struct *work) |
3548 |
++{ |
3549 |
++ struct delayed_work *dw = container_of(work, struct delayed_work, work); |
3550 |
++ struct zfcp_wka_port *wka_port = |
3551 |
++ container_of(dw, struct zfcp_wka_port, work); |
3552 |
++ |
3553 |
++ wait_event(wka_port->completion_wq, |
3554 |
++ atomic_read(&wka_port->refcount) == 0); |
3555 |
++ |
3556 |
++ mutex_lock(&wka_port->mutex); |
3557 |
++ if ((atomic_read(&wka_port->refcount) != 0) || |
3558 |
++ (wka_port->status != ZFCP_WKA_PORT_ONLINE)) |
3559 |
++ goto out; |
3560 |
++ |
3561 |
++ wka_port->status = ZFCP_WKA_PORT_CLOSING; |
3562 |
++ if (zfcp_fsf_close_wka_port(wka_port)) { |
3563 |
++ wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
3564 |
++ wake_up(&wka_port->completion_wq); |
3565 |
++ } |
3566 |
++out: |
3567 |
++ mutex_unlock(&wka_port->mutex); |
3568 |
++} |
3569 |
++ |
3570 |
++static void zfcp_wka_port_put(struct zfcp_wka_port *wka_port) |
3571 |
++{ |
3572 |
++ if (atomic_dec_return(&wka_port->refcount) != 0) |
3573 |
++ return; |
3574 |
++ /* wait 10 miliseconds, other reqs might pop in */ |
3575 |
++ schedule_delayed_work(&wka_port->work, HZ / 100); |
3576 |
++} |
3577 |
++ |
3578 |
++void zfcp_fc_nameserver_init(struct zfcp_adapter *adapter) |
3579 |
++{ |
3580 |
++ struct zfcp_wka_port *wka_port = &adapter->nsp; |
3581 |
++ |
3582 |
++ init_waitqueue_head(&wka_port->completion_wq); |
3583 |
++ |
3584 |
++ wka_port->adapter = adapter; |
3585 |
++ wka_port->d_id = ZFCP_DID_DIRECTORY_SERVICE; |
3586 |
++ |
3587 |
++ wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
3588 |
++ atomic_set(&wka_port->refcount, 0); |
3589 |
++ mutex_init(&wka_port->mutex); |
3590 |
++ INIT_DELAYED_WORK(&wka_port->work, zfcp_wka_port_offline); |
3591 |
++} |
3592 |
++ |
3593 |
+ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, |
3594 |
+ struct fcp_rscn_element *elem) |
3595 |
+ { |
3596 |
+@@ -47,10 +125,7 @@ static void _zfcp_fc_incoming_rscn(struc |
3597 |
+ |
3598 |
+ read_lock_irqsave(&zfcp_data.config_lock, flags); |
3599 |
+ list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { |
3600 |
+- if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) |
3601 |
+- continue; |
3602 |
+- /* FIXME: ZFCP_STATUS_PORT_DID_DID check is racy */ |
3603 |
+- if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) |
3604 |
++ if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_PHYS_OPEN)) |
3605 |
+ /* Try to connect to unused ports anyway. */ |
3606 |
+ zfcp_erp_port_reopen(port, |
3607 |
+ ZFCP_STATUS_COMMON_ERP_FAILED, |
3608 |
+@@ -102,7 +177,7 @@ static void zfcp_fc_incoming_rscn(struct |
3609 |
+ schedule_work(&fsf_req->adapter->scan_work); |
3610 |
+ } |
3611 |
+ |
3612 |
+-static void zfcp_fc_incoming_wwpn(struct zfcp_fsf_req *req, wwn_t wwpn) |
3613 |
++static void zfcp_fc_incoming_wwpn(struct zfcp_fsf_req *req, u64 wwpn) |
3614 |
+ { |
3615 |
+ struct zfcp_adapter *adapter = req->adapter; |
3616 |
+ struct zfcp_port *port; |
3617 |
+@@ -157,7 +232,18 @@ void zfcp_fc_incoming_els(struct zfcp_fs |
3618 |
+ zfcp_fc_incoming_rscn(fsf_req); |
3619 |
+ } |
3620 |
+ |
3621 |
+-static void zfcp_ns_gid_pn_handler(unsigned long data) |
3622 |
++static void zfcp_fc_ns_handler(unsigned long data) |
3623 |
++{ |
3624 |
++ struct zfcp_fc_ns_handler_data *compl_rec = |
3625 |
++ (struct zfcp_fc_ns_handler_data *) data; |
3626 |
++ |
3627 |
++ if (compl_rec->handler) |
3628 |
++ compl_rec->handler(compl_rec->handler_data); |
3629 |
++ |
3630 |
++ complete(&compl_rec->done); |
3631 |
++} |
3632 |
++ |
3633 |
++static void zfcp_fc_ns_gid_pn_eval(unsigned long data) |
3634 |
+ { |
3635 |
+ struct zfcp_gid_pn_data *gid_pn = (struct zfcp_gid_pn_data *) data; |
3636 |
+ struct zfcp_send_ct *ct = &gid_pn->ct; |
3637 |
+@@ -166,43 +252,31 @@ static void zfcp_ns_gid_pn_handler(unsig |
3638 |
+ struct zfcp_port *port = gid_pn->port; |
3639 |
+ |
3640 |
+ if (ct->status) |
3641 |
+- goto out; |
3642 |
++ return; |
3643 |
+ if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) { |
3644 |
+ atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); |
3645 |
+- goto out; |
3646 |
++ return; |
3647 |
+ } |
3648 |
+ /* paranoia */ |
3649 |
+ if (ct_iu_req->wwpn != port->wwpn) |
3650 |
+- goto out; |
3651 |
++ return; |
3652 |
+ /* looks like a valid d_id */ |
3653 |
+ port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK; |
3654 |
+ atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status); |
3655 |
+-out: |
3656 |
+- mempool_free(gid_pn, port->adapter->pool.data_gid_pn); |
3657 |
+ } |
3658 |
+ |
3659 |
+-/** |
3660 |
+- * zfcp_fc_ns_gid_pn_request - initiate GID_PN nameserver request |
3661 |
+- * @erp_action: pointer to zfcp_erp_action where GID_PN request is needed |
3662 |
+- * return: -ENOMEM on error, 0 otherwise |
3663 |
+- */ |
3664 |
+-int zfcp_fc_ns_gid_pn_request(struct zfcp_erp_action *erp_action) |
3665 |
++int static zfcp_fc_ns_gid_pn_request(struct zfcp_erp_action *erp_action, |
3666 |
++ struct zfcp_gid_pn_data *gid_pn) |
3667 |
+ { |
3668 |
+- int ret; |
3669 |
+- struct zfcp_gid_pn_data *gid_pn; |
3670 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
3671 |
+- |
3672 |
+- gid_pn = mempool_alloc(adapter->pool.data_gid_pn, GFP_ATOMIC); |
3673 |
+- if (!gid_pn) |
3674 |
+- return -ENOMEM; |
3675 |
+- |
3676 |
+- memset(gid_pn, 0, sizeof(*gid_pn)); |
3677 |
++ struct zfcp_fc_ns_handler_data compl_rec; |
3678 |
++ int ret; |
3679 |
+ |
3680 |
+ /* setup parameters for send generic command */ |
3681 |
+ gid_pn->port = erp_action->port; |
3682 |
+- gid_pn->ct.port = adapter->nameserver_port; |
3683 |
+- gid_pn->ct.handler = zfcp_ns_gid_pn_handler; |
3684 |
+- gid_pn->ct.handler_data = (unsigned long) gid_pn; |
3685 |
++ gid_pn->ct.wka_port = &adapter->nsp; |
3686 |
++ gid_pn->ct.handler = zfcp_fc_ns_handler; |
3687 |
++ gid_pn->ct.handler_data = (unsigned long) &compl_rec; |
3688 |
+ gid_pn->ct.timeout = ZFCP_NS_GID_PN_TIMEOUT; |
3689 |
+ gid_pn->ct.req = &gid_pn->req; |
3690 |
+ gid_pn->ct.resp = &gid_pn->resp; |
3691 |
+@@ -222,10 +296,42 @@ int zfcp_fc_ns_gid_pn_request(struct zfc |
3692 |
+ gid_pn->ct_iu_req.header.max_res_size = ZFCP_CT_MAX_SIZE; |
3693 |
+ gid_pn->ct_iu_req.wwpn = erp_action->port->wwpn; |
3694 |
+ |
3695 |
++ init_completion(&compl_rec.done); |
3696 |
++ compl_rec.handler = zfcp_fc_ns_gid_pn_eval; |
3697 |
++ compl_rec.handler_data = (unsigned long) gid_pn; |
3698 |
+ ret = zfcp_fsf_send_ct(&gid_pn->ct, adapter->pool.fsf_req_erp, |
3699 |
+ erp_action); |
3700 |
++ if (!ret) |
3701 |
++ wait_for_completion(&compl_rec.done); |
3702 |
++ return ret; |
3703 |
++} |
3704 |
++ |
3705 |
++/** |
3706 |
++ * zfcp_fc_ns_gid_pn_request - initiate GID_PN nameserver request |
3707 |
++ * @erp_action: pointer to zfcp_erp_action where GID_PN request is needed |
3708 |
++ * return: -ENOMEM on error, 0 otherwise |
3709 |
++ */ |
3710 |
++int zfcp_fc_ns_gid_pn(struct zfcp_erp_action *erp_action) |
3711 |
++{ |
3712 |
++ int ret; |
3713 |
++ struct zfcp_gid_pn_data *gid_pn; |
3714 |
++ struct zfcp_adapter *adapter = erp_action->adapter; |
3715 |
++ |
3716 |
++ gid_pn = mempool_alloc(adapter->pool.data_gid_pn, GFP_ATOMIC); |
3717 |
++ if (!gid_pn) |
3718 |
++ return -ENOMEM; |
3719 |
++ |
3720 |
++ memset(gid_pn, 0, sizeof(*gid_pn)); |
3721 |
++ |
3722 |
++ ret = zfcp_wka_port_get(&adapter->nsp); |
3723 |
+ if (ret) |
3724 |
+- mempool_free(gid_pn, adapter->pool.data_gid_pn); |
3725 |
++ goto out; |
3726 |
++ |
3727 |
++ ret = zfcp_fc_ns_gid_pn_request(erp_action, gid_pn); |
3728 |
++ |
3729 |
++ zfcp_wka_port_put(&adapter->nsp); |
3730 |
++out: |
3731 |
++ mempool_free(gid_pn, adapter->pool.data_gid_pn); |
3732 |
+ return ret; |
3733 |
+ } |
3734 |
+ |
3735 |
+@@ -255,14 +361,14 @@ struct zfcp_els_adisc { |
3736 |
+ struct scatterlist req; |
3737 |
+ struct scatterlist resp; |
3738 |
+ struct zfcp_ls_adisc ls_adisc; |
3739 |
+- struct zfcp_ls_adisc_acc ls_adisc_acc; |
3740 |
++ struct zfcp_ls_adisc ls_adisc_acc; |
3741 |
+ }; |
3742 |
+ |
3743 |
+ static void zfcp_fc_adisc_handler(unsigned long data) |
3744 |
+ { |
3745 |
+ struct zfcp_els_adisc *adisc = (struct zfcp_els_adisc *) data; |
3746 |
+ struct zfcp_port *port = adisc->els.port; |
3747 |
+- struct zfcp_ls_adisc_acc *ls_adisc = &adisc->ls_adisc_acc; |
3748 |
++ struct zfcp_ls_adisc *ls_adisc = &adisc->ls_adisc_acc; |
3749 |
+ |
3750 |
+ if (adisc->els.status) { |
3751 |
+ /* request rejected or timed out */ |
3752 |
+@@ -295,7 +401,7 @@ static int zfcp_fc_adisc(struct zfcp_por |
3753 |
+ sg_init_one(adisc->els.req, &adisc->ls_adisc, |
3754 |
+ sizeof(struct zfcp_ls_adisc)); |
3755 |
+ sg_init_one(adisc->els.resp, &adisc->ls_adisc_acc, |
3756 |
+- sizeof(struct zfcp_ls_adisc_acc)); |
3757 |
++ sizeof(struct zfcp_ls_adisc)); |
3758 |
+ |
3759 |
+ adisc->els.req_count = 1; |
3760 |
+ adisc->els.resp_count = 1; |
3761 |
+@@ -338,30 +444,6 @@ void zfcp_test_link(struct zfcp_port *po |
3762 |
+ zfcp_erp_port_forced_reopen(port, 0, 65, NULL); |
3763 |
+ } |
3764 |
+ |
3765 |
+-static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter) |
3766 |
+-{ |
3767 |
+- int ret; |
3768 |
+- |
3769 |
+- if (!adapter->nameserver_port) |
3770 |
+- return -EINTR; |
3771 |
+- |
3772 |
+- if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, |
3773 |
+- &adapter->nameserver_port->status)) { |
3774 |
+- ret = zfcp_erp_port_reopen(adapter->nameserver_port, 0, 148, |
3775 |
+- NULL); |
3776 |
+- if (ret) |
3777 |
+- return ret; |
3778 |
+- zfcp_erp_wait(adapter); |
3779 |
+- } |
3780 |
+- return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, |
3781 |
+- &adapter->nameserver_port->status); |
3782 |
+-} |
3783 |
+- |
3784 |
+-static void zfcp_gpn_ft_handler(unsigned long _done) |
3785 |
+-{ |
3786 |
+- complete((struct completion *)_done); |
3787 |
+-} |
3788 |
+- |
3789 |
+ static void zfcp_free_sg_env(struct zfcp_gpn_ft *gpn_ft) |
3790 |
+ { |
3791 |
+ struct scatterlist *sg = &gpn_ft->sg_req; |
3792 |
+@@ -403,7 +485,7 @@ static int zfcp_scan_issue_gpn_ft(struct |
3793 |
+ { |
3794 |
+ struct zfcp_send_ct *ct = &gpn_ft->ct; |
3795 |
+ struct ct_iu_gpn_ft_req *req = sg_virt(&gpn_ft->sg_req); |
3796 |
+- struct completion done; |
3797 |
++ struct zfcp_fc_ns_handler_data compl_rec; |
3798 |
+ int ret; |
3799 |
+ |
3800 |
+ /* prepare CT IU for GPN_FT */ |
3801 |
+@@ -420,19 +502,20 @@ static int zfcp_scan_issue_gpn_ft(struct |
3802 |
+ req->fc4_type = ZFCP_CT_SCSI_FCP; |
3803 |
+ |
3804 |
+ /* prepare zfcp_send_ct */ |
3805 |
+- ct->port = adapter->nameserver_port; |
3806 |
+- ct->handler = zfcp_gpn_ft_handler; |
3807 |
+- ct->handler_data = (unsigned long)&done; |
3808 |
++ ct->wka_port = &adapter->nsp; |
3809 |
++ ct->handler = zfcp_fc_ns_handler; |
3810 |
++ ct->handler_data = (unsigned long)&compl_rec; |
3811 |
+ ct->timeout = 10; |
3812 |
+ ct->req = &gpn_ft->sg_req; |
3813 |
+ ct->resp = gpn_ft->sg_resp; |
3814 |
+ ct->req_count = 1; |
3815 |
+ ct->resp_count = ZFCP_GPN_FT_BUFFERS; |
3816 |
+ |
3817 |
+- init_completion(&done); |
3818 |
++ init_completion(&compl_rec.done); |
3819 |
++ compl_rec.handler = NULL; |
3820 |
+ ret = zfcp_fsf_send_ct(ct, NULL, NULL); |
3821 |
+ if (!ret) |
3822 |
+- wait_for_completion(&done); |
3823 |
++ wait_for_completion(&compl_rec.done); |
3824 |
+ return ret; |
3825 |
+ } |
3826 |
+ |
3827 |
+@@ -442,9 +525,8 @@ static void zfcp_validate_port(struct zf |
3828 |
+ |
3829 |
+ atomic_clear_mask(ZFCP_STATUS_COMMON_NOESC, &port->status); |
3830 |
+ |
3831 |
+- if (port == adapter->nameserver_port) |
3832 |
+- return; |
3833 |
+- if ((port->supported_classes != 0) || (port->units != 0)) { |
3834 |
++ if ((port->supported_classes != 0) || |
3835 |
++ !list_empty(&port->unit_list_head)) { |
3836 |
+ zfcp_port_put(port); |
3837 |
+ return; |
3838 |
+ } |
3839 |
+@@ -460,7 +542,7 @@ static int zfcp_scan_eval_gpn_ft(struct |
3840 |
+ struct scatterlist *sg = gpn_ft->sg_resp; |
3841 |
+ struct ct_hdr *hdr = sg_virt(sg); |
3842 |
+ struct gpn_ft_resp_acc *acc = sg_virt(sg); |
3843 |
+- struct zfcp_adapter *adapter = ct->port->adapter; |
3844 |
++ struct zfcp_adapter *adapter = ct->wka_port->adapter; |
3845 |
+ struct zfcp_port *port, *tmp; |
3846 |
+ u32 d_id; |
3847 |
+ int ret = 0, x, last = 0; |
3848 |
+@@ -490,6 +572,9 @@ static int zfcp_scan_eval_gpn_ft(struct |
3849 |
+ d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 | |
3850 |
+ acc->port_id[2]; |
3851 |
+ |
3852 |
++ /* don't attach ports with a well known address */ |
3853 |
++ if ((d_id & ZFCP_DID_WKA) == ZFCP_DID_WKA) |
3854 |
++ continue; |
3855 |
+ /* skip the adapter's port and known remote ports */ |
3856 |
+ if (acc->wwpn == fc_host_port_name(adapter->scsi_host)) |
3857 |
+ continue; |
3858 |
+@@ -528,13 +613,15 @@ int zfcp_scan_ports(struct zfcp_adapter |
3859 |
+ if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT) |
3860 |
+ return 0; |
3861 |
+ |
3862 |
+- ret = zfcp_scan_get_nameserver(adapter); |
3863 |
++ ret = zfcp_wka_port_get(&adapter->nsp); |
3864 |
+ if (ret) |
3865 |
+ return ret; |
3866 |
+ |
3867 |
+ gpn_ft = zfcp_alloc_sg_env(); |
3868 |
+- if (!gpn_ft) |
3869 |
+- return -ENOMEM; |
3870 |
++ if (!gpn_ft) { |
3871 |
++ ret = -ENOMEM; |
3872 |
++ goto out; |
3873 |
++ } |
3874 |
+ |
3875 |
+ for (i = 0; i < 3; i++) { |
3876 |
+ ret = zfcp_scan_issue_gpn_ft(gpn_ft, adapter); |
3877 |
+@@ -547,7 +634,8 @@ int zfcp_scan_ports(struct zfcp_adapter |
3878 |
+ } |
3879 |
+ } |
3880 |
+ zfcp_free_sg_env(gpn_ft); |
3881 |
+- |
3882 |
++out: |
3883 |
++ zfcp_wka_port_put(&adapter->nsp); |
3884 |
+ return ret; |
3885 |
+ } |
3886 |
+ |
3887 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.c |
3888 |
+=================================================================== |
3889 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_fsf.c |
3890 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.c |
3891 |
+@@ -50,19 +50,16 @@ static u32 fsf_qtcb_type[] = { |
3892 |
+ [FSF_QTCB_UPLOAD_CONTROL_FILE] = FSF_SUPPORT_COMMAND |
3893 |
+ }; |
3894 |
+ |
3895 |
+-static const char *zfcp_act_subtable_type[] = { |
3896 |
+- "unknown", "OS", "WWPN", "DID", "LUN" |
3897 |
+-}; |
3898 |
+- |
3899 |
+ static void zfcp_act_eval_err(struct zfcp_adapter *adapter, u32 table) |
3900 |
+ { |
3901 |
+ u16 subtable = table >> 16; |
3902 |
+ u16 rule = table & 0xffff; |
3903 |
++ const char *act_type[] = { "unknown", "OS", "WWPN", "DID", "LUN" }; |
3904 |
+ |
3905 |
+- if (subtable && subtable < ARRAY_SIZE(zfcp_act_subtable_type)) |
3906 |
++ if (subtable && subtable < ARRAY_SIZE(act_type)) |
3907 |
+ dev_warn(&adapter->ccw_device->dev, |
3908 |
+- "Access denied in subtable %s, rule %d.\n", |
3909 |
+- zfcp_act_subtable_type[subtable], rule); |
3910 |
++ "Access denied according to ACT rule type %s, " |
3911 |
++ "rule %d\n", act_type[subtable], rule); |
3912 |
+ } |
3913 |
+ |
3914 |
+ static void zfcp_fsf_access_denied_port(struct zfcp_fsf_req *req, |
3915 |
+@@ -70,8 +67,8 @@ static void zfcp_fsf_access_denied_port( |
3916 |
+ { |
3917 |
+ struct fsf_qtcb_header *header = &req->qtcb->header; |
3918 |
+ dev_warn(&req->adapter->ccw_device->dev, |
3919 |
+- "Access denied, cannot send command to port 0x%016Lx.\n", |
3920 |
+- port->wwpn); |
3921 |
++ "Access denied to port 0x%016Lx\n", |
3922 |
++ (unsigned long long)port->wwpn); |
3923 |
+ zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); |
3924 |
+ zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); |
3925 |
+ zfcp_erp_port_access_denied(port, 55, req); |
3926 |
+@@ -83,8 +80,9 @@ static void zfcp_fsf_access_denied_unit( |
3927 |
+ { |
3928 |
+ struct fsf_qtcb_header *header = &req->qtcb->header; |
3929 |
+ dev_warn(&req->adapter->ccw_device->dev, |
3930 |
+- "Access denied for unit 0x%016Lx on port 0x%016Lx.\n", |
3931 |
+- unit->fcp_lun, unit->port->wwpn); |
3932 |
++ "Access denied to unit 0x%016Lx on port 0x%016Lx\n", |
3933 |
++ (unsigned long long)unit->fcp_lun, |
3934 |
++ (unsigned long long)unit->port->wwpn); |
3935 |
+ zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); |
3936 |
+ zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); |
3937 |
+ zfcp_erp_unit_access_denied(unit, 59, req); |
3938 |
+@@ -93,9 +91,8 @@ static void zfcp_fsf_access_denied_unit( |
3939 |
+ |
3940 |
+ static void zfcp_fsf_class_not_supp(struct zfcp_fsf_req *req) |
3941 |
+ { |
3942 |
+- dev_err(&req->adapter->ccw_device->dev, |
3943 |
+- "Required FC class not supported by adapter, " |
3944 |
+- "shutting down adapter.\n"); |
3945 |
++ dev_err(&req->adapter->ccw_device->dev, "FCP device not " |
3946 |
++ "operational because of an unsupported FC class\n"); |
3947 |
+ zfcp_erp_adapter_shutdown(req->adapter, 0, 123, req); |
3948 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
3949 |
+ } |
3950 |
+@@ -171,42 +168,6 @@ static void zfcp_fsf_status_read_port_cl |
3951 |
+ read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
3952 |
+ } |
3953 |
+ |
3954 |
+-static void zfcp_fsf_bit_error_threshold(struct zfcp_fsf_req *req) |
3955 |
+-{ |
3956 |
+- struct zfcp_adapter *adapter = req->adapter; |
3957 |
+- struct fsf_status_read_buffer *sr_buf = req->data; |
3958 |
+- struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error; |
3959 |
+- |
3960 |
+- dev_warn(&adapter->ccw_device->dev, |
3961 |
+- "Warning: bit error threshold data " |
3962 |
+- "received for the adapter: " |
3963 |
+- "link failures = %i, loss of sync errors = %i, " |
3964 |
+- "loss of signal errors = %i, " |
3965 |
+- "primitive sequence errors = %i, " |
3966 |
+- "invalid transmission word errors = %i, " |
3967 |
+- "CRC errors = %i).\n", |
3968 |
+- err->link_failure_error_count, |
3969 |
+- err->loss_of_sync_error_count, |
3970 |
+- err->loss_of_signal_error_count, |
3971 |
+- err->primitive_sequence_error_count, |
3972 |
+- err->invalid_transmission_word_error_count, |
3973 |
+- err->crc_error_count); |
3974 |
+- dev_warn(&adapter->ccw_device->dev, |
3975 |
+- "Additional bit error threshold data of the adapter: " |
3976 |
+- "primitive sequence event time-outs = %i, " |
3977 |
+- "elastic buffer overrun errors = %i, " |
3978 |
+- "advertised receive buffer-to-buffer credit = %i, " |
3979 |
+- "current receice buffer-to-buffer credit = %i, " |
3980 |
+- "advertised transmit buffer-to-buffer credit = %i, " |
3981 |
+- "current transmit buffer-to-buffer credit = %i).\n", |
3982 |
+- err->primitive_sequence_event_timeout_count, |
3983 |
+- err->elastic_buffer_overrun_error_count, |
3984 |
+- err->advertised_receive_b2b_credit, |
3985 |
+- err->current_receive_b2b_credit, |
3986 |
+- err->advertised_transmit_b2b_credit, |
3987 |
+- err->current_transmit_b2b_credit); |
3988 |
+-} |
3989 |
+- |
3990 |
+ static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, u8 id, |
3991 |
+ struct fsf_link_down_info *link_down) |
3992 |
+ { |
3993 |
+@@ -223,62 +184,66 @@ static void zfcp_fsf_link_down_info_eval |
3994 |
+ switch (link_down->error_code) { |
3995 |
+ case FSF_PSQ_LINK_NO_LIGHT: |
3996 |
+ dev_warn(&req->adapter->ccw_device->dev, |
3997 |
+- "The local link is down: no light detected.\n"); |
3998 |
++ "There is no light signal from the local " |
3999 |
++ "fibre channel cable\n"); |
4000 |
+ break; |
4001 |
+ case FSF_PSQ_LINK_WRAP_PLUG: |
4002 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4003 |
+- "The local link is down: wrap plug detected.\n"); |
4004 |
++ "There is a wrap plug instead of a fibre " |
4005 |
++ "channel cable\n"); |
4006 |
+ break; |
4007 |
+ case FSF_PSQ_LINK_NO_FCP: |
4008 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4009 |
+- "The local link is down: " |
4010 |
+- "adjacent node on link does not support FCP.\n"); |
4011 |
++ "The adjacent fibre channel node does not " |
4012 |
++ "support FCP\n"); |
4013 |
+ break; |
4014 |
+ case FSF_PSQ_LINK_FIRMWARE_UPDATE: |
4015 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4016 |
+- "The local link is down: " |
4017 |
+- "firmware update in progress.\n"); |
4018 |
++ "The FCP device is suspended because of a " |
4019 |
++ "firmware update\n"); |
4020 |
+ break; |
4021 |
+ case FSF_PSQ_LINK_INVALID_WWPN: |
4022 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4023 |
+- "The local link is down: " |
4024 |
+- "duplicate or invalid WWPN detected.\n"); |
4025 |
++ "The FCP device detected a WWPN that is " |
4026 |
++ "duplicate or not valid\n"); |
4027 |
+ break; |
4028 |
+ case FSF_PSQ_LINK_NO_NPIV_SUPPORT: |
4029 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4030 |
+- "The local link is down: " |
4031 |
+- "no support for NPIV by Fabric.\n"); |
4032 |
++ "The fibre channel fabric does not support NPIV\n"); |
4033 |
+ break; |
4034 |
+ case FSF_PSQ_LINK_NO_FCP_RESOURCES: |
4035 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4036 |
+- "The local link is down: " |
4037 |
+- "out of resource in FCP daughtercard.\n"); |
4038 |
++ "The FCP adapter cannot support more NPIV ports\n"); |
4039 |
+ break; |
4040 |
+ case FSF_PSQ_LINK_NO_FABRIC_RESOURCES: |
4041 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4042 |
+- "The local link is down: " |
4043 |
+- "out of resource in Fabric.\n"); |
4044 |
++ "The adjacent switch cannot support " |
4045 |
++ "more NPIV ports\n"); |
4046 |
+ break; |
4047 |
+ case FSF_PSQ_LINK_FABRIC_LOGIN_UNABLE: |
4048 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4049 |
+- "The local link is down: " |
4050 |
+- "unable to login to Fabric.\n"); |
4051 |
++ "The FCP adapter could not log in to the " |
4052 |
++ "fibre channel fabric\n"); |
4053 |
+ break; |
4054 |
+ case FSF_PSQ_LINK_WWPN_ASSIGNMENT_CORRUPTED: |
4055 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4056 |
+- "WWPN assignment file corrupted on adapter.\n"); |
4057 |
++ "The WWPN assignment file on the FCP adapter " |
4058 |
++ "has been damaged\n"); |
4059 |
+ break; |
4060 |
+ case FSF_PSQ_LINK_MODE_TABLE_CURRUPTED: |
4061 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4062 |
+- "Mode table corrupted on adapter.\n"); |
4063 |
++ "The mode table on the FCP adapter " |
4064 |
++ "has been damaged\n"); |
4065 |
+ break; |
4066 |
+ case FSF_PSQ_LINK_NO_WWPN_ASSIGNMENT: |
4067 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4068 |
+- "No WWPN for assignment table on adapter.\n"); |
4069 |
++ "All NPIV ports on the FCP adapter have " |
4070 |
++ "been assigned\n"); |
4071 |
+ break; |
4072 |
+ default: |
4073 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4074 |
+- "The local link to adapter is down.\n"); |
4075 |
++ "The link between the FCP adapter and " |
4076 |
++ "the FC fabric is down\n"); |
4077 |
+ } |
4078 |
+ out: |
4079 |
+ zfcp_erp_adapter_failed(adapter, id, req); |
4080 |
+@@ -286,27 +251,18 @@ out: |
4081 |
+ |
4082 |
+ static void zfcp_fsf_status_read_link_down(struct zfcp_fsf_req *req) |
4083 |
+ { |
4084 |
+- struct zfcp_adapter *adapter = req->adapter; |
4085 |
+ struct fsf_status_read_buffer *sr_buf = req->data; |
4086 |
+ struct fsf_link_down_info *ldi = |
4087 |
+ (struct fsf_link_down_info *) &sr_buf->payload; |
4088 |
+ |
4089 |
+ switch (sr_buf->status_subtype) { |
4090 |
+ case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: |
4091 |
+- dev_warn(&adapter->ccw_device->dev, |
4092 |
+- "Physical link is down.\n"); |
4093 |
+ zfcp_fsf_link_down_info_eval(req, 38, ldi); |
4094 |
+ break; |
4095 |
+ case FSF_STATUS_READ_SUB_FDISC_FAILED: |
4096 |
+- dev_warn(&adapter->ccw_device->dev, |
4097 |
+- "Local link is down " |
4098 |
+- "due to failed FDISC login.\n"); |
4099 |
+ zfcp_fsf_link_down_info_eval(req, 39, ldi); |
4100 |
+ break; |
4101 |
+ case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE: |
4102 |
+- dev_warn(&adapter->ccw_device->dev, |
4103 |
+- "Local link is down " |
4104 |
+- "due to firmware update on adapter.\n"); |
4105 |
+ zfcp_fsf_link_down_info_eval(req, 40, NULL); |
4106 |
+ }; |
4107 |
+ } |
4108 |
+@@ -335,14 +291,17 @@ static void zfcp_fsf_status_read_handler |
4109 |
+ case FSF_STATUS_READ_SENSE_DATA_AVAIL: |
4110 |
+ break; |
4111 |
+ case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: |
4112 |
+- zfcp_fsf_bit_error_threshold(req); |
4113 |
++ dev_warn(&adapter->ccw_device->dev, |
4114 |
++ "The error threshold for checksum statistics " |
4115 |
++ "has been exceeded\n"); |
4116 |
++ zfcp_hba_dbf_event_berr(adapter, req); |
4117 |
+ break; |
4118 |
+ case FSF_STATUS_READ_LINK_DOWN: |
4119 |
+ zfcp_fsf_status_read_link_down(req); |
4120 |
+ break; |
4121 |
+ case FSF_STATUS_READ_LINK_UP: |
4122 |
+ dev_info(&adapter->ccw_device->dev, |
4123 |
+- "Local link was replugged.\n"); |
4124 |
++ "The local link has been restored\n"); |
4125 |
+ /* All ports should be marked as ready to run again */ |
4126 |
+ zfcp_erp_modify_adapter_status(adapter, 30, NULL, |
4127 |
+ ZFCP_STATUS_COMMON_RUNNING, |
4128 |
+@@ -370,7 +329,7 @@ static void zfcp_fsf_status_read_handler |
4129 |
+ zfcp_fsf_req_free(req); |
4130 |
+ |
4131 |
+ atomic_inc(&adapter->stat_miss); |
4132 |
+- schedule_work(&adapter->stat_work); |
4133 |
++ queue_work(zfcp_data.work_queue, &adapter->stat_work); |
4134 |
+ } |
4135 |
+ |
4136 |
+ static void zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *req) |
4137 |
+@@ -386,8 +345,8 @@ static void zfcp_fsf_fsfstatus_qual_eval |
4138 |
+ break; |
4139 |
+ case FSF_SQ_NO_RECOM: |
4140 |
+ dev_err(&req->adapter->ccw_device->dev, |
4141 |
+- "No recommendation could be given for a " |
4142 |
+- "problem on the adapter.\n"); |
4143 |
++ "The FCP adapter reported a problem " |
4144 |
++ "that cannot be recovered\n"); |
4145 |
+ zfcp_erp_adapter_shutdown(req->adapter, 0, 121, req); |
4146 |
+ break; |
4147 |
+ } |
4148 |
+@@ -403,8 +362,7 @@ static void zfcp_fsf_fsfstatus_eval(stru |
4149 |
+ switch (req->qtcb->header.fsf_status) { |
4150 |
+ case FSF_UNKNOWN_COMMAND: |
4151 |
+ dev_err(&req->adapter->ccw_device->dev, |
4152 |
+- "Command issued by the device driver (0x%x) is " |
4153 |
+- "not known by the adapter.\n", |
4154 |
++ "The FCP adapter does not recognize the command 0x%x\n", |
4155 |
+ req->qtcb->header.fsf_command); |
4156 |
+ zfcp_erp_adapter_shutdown(req->adapter, 0, 120, req); |
4157 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4158 |
+@@ -435,11 +393,9 @@ static void zfcp_fsf_protstatus_eval(str |
4159 |
+ return; |
4160 |
+ case FSF_PROT_QTCB_VERSION_ERROR: |
4161 |
+ dev_err(&adapter->ccw_device->dev, |
4162 |
+- "The QTCB version requested by zfcp (0x%x) is not " |
4163 |
+- "supported by the FCP adapter (lowest supported " |
4164 |
+- "0x%x, highest supported 0x%x).\n", |
4165 |
+- FSF_QTCB_CURRENT_VERSION, psq->word[0], |
4166 |
+- psq->word[1]); |
4167 |
++ "QTCB version 0x%x not supported by FCP adapter " |
4168 |
++ "(0x%x to 0x%x)\n", FSF_QTCB_CURRENT_VERSION, |
4169 |
++ psq->word[0], psq->word[1]); |
4170 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 117, req); |
4171 |
+ break; |
4172 |
+ case FSF_PROT_ERROR_STATE: |
4173 |
+@@ -449,8 +405,7 @@ static void zfcp_fsf_protstatus_eval(str |
4174 |
+ break; |
4175 |
+ case FSF_PROT_UNSUPP_QTCB_TYPE: |
4176 |
+ dev_err(&adapter->ccw_device->dev, |
4177 |
+- "Packet header type used by the device driver is " |
4178 |
+- "incompatible with that used on the adapter.\n"); |
4179 |
++ "The QTCB type is not supported by the FCP adapter\n"); |
4180 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 118, req); |
4181 |
+ break; |
4182 |
+ case FSF_PROT_HOST_CONNECTION_INITIALIZING: |
4183 |
+@@ -459,7 +414,7 @@ static void zfcp_fsf_protstatus_eval(str |
4184 |
+ break; |
4185 |
+ case FSF_PROT_DUPLICATE_REQUEST_ID: |
4186 |
+ dev_err(&adapter->ccw_device->dev, |
4187 |
+- "The request identifier 0x%Lx is ambiguous.\n", |
4188 |
++ "0x%Lx is an ambiguous request identifier\n", |
4189 |
+ (unsigned long long)qtcb->bottom.support.req_handle); |
4190 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 78, req); |
4191 |
+ break; |
4192 |
+@@ -479,9 +434,7 @@ static void zfcp_fsf_protstatus_eval(str |
4193 |
+ break; |
4194 |
+ default: |
4195 |
+ dev_err(&adapter->ccw_device->dev, |
4196 |
+- "Transfer protocol status information" |
4197 |
+- "provided by the adapter (0x%x) " |
4198 |
+- "is not compatible with the device driver.\n", |
4199 |
++ "0x%x is not a valid transfer protocol status\n", |
4200 |
+ qtcb->prefix.prot_status); |
4201 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 119, req); |
4202 |
+ } |
4203 |
+@@ -559,33 +512,17 @@ static int zfcp_fsf_exchange_config_eval |
4204 |
+ adapter->peer_wwpn = bottom->plogi_payload.wwpn; |
4205 |
+ adapter->peer_wwnn = bottom->plogi_payload.wwnn; |
4206 |
+ fc_host_port_type(shost) = FC_PORTTYPE_PTP; |
4207 |
+- if (req->erp_action) |
4208 |
+- dev_info(&adapter->ccw_device->dev, |
4209 |
+- "Point-to-Point fibrechannel " |
4210 |
+- "configuration detected.\n"); |
4211 |
+ break; |
4212 |
+ case FSF_TOPO_FABRIC: |
4213 |
+ fc_host_port_type(shost) = FC_PORTTYPE_NPORT; |
4214 |
+- if (req->erp_action) |
4215 |
+- dev_info(&adapter->ccw_device->dev, |
4216 |
+- "Switched fabric fibrechannel " |
4217 |
+- "network detected.\n"); |
4218 |
+ break; |
4219 |
+ case FSF_TOPO_AL: |
4220 |
+ fc_host_port_type(shost) = FC_PORTTYPE_NLPORT; |
4221 |
+- dev_err(&adapter->ccw_device->dev, |
4222 |
+- "Unsupported arbitrated loop fibrechannel " |
4223 |
+- "topology detected, shutting down " |
4224 |
+- "adapter.\n"); |
4225 |
+- zfcp_erp_adapter_shutdown(adapter, 0, 127, req); |
4226 |
+- return -EIO; |
4227 |
+ default: |
4228 |
+- fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; |
4229 |
+ dev_err(&adapter->ccw_device->dev, |
4230 |
+- "The fibrechannel topology reported by the" |
4231 |
+- " adapter is not known by the zfcp driver," |
4232 |
+- " shutting down adapter.\n"); |
4233 |
+- zfcp_erp_adapter_shutdown(adapter, 0, 128, req); |
4234 |
++ "Unknown or unsupported arbitrated loop " |
4235 |
++ "fibre channel topology detected\n"); |
4236 |
++ zfcp_erp_adapter_shutdown(adapter, 0, 127, req); |
4237 |
+ return -EIO; |
4238 |
+ } |
4239 |
+ |
4240 |
+@@ -616,11 +553,9 @@ static void zfcp_fsf_exchange_config_dat |
4241 |
+ |
4242 |
+ if (bottom->max_qtcb_size < sizeof(struct fsf_qtcb)) { |
4243 |
+ dev_err(&adapter->ccw_device->dev, |
4244 |
+- "Maximum QTCB size (%d bytes) allowed by " |
4245 |
+- "the adapter is lower than the minimum " |
4246 |
+- "required by the driver (%ld bytes).\n", |
4247 |
+- bottom->max_qtcb_size, |
4248 |
+- sizeof(struct fsf_qtcb)); |
4249 |
++ "FCP adapter maximum QTCB size (%d bytes) " |
4250 |
++ "is too small\n", |
4251 |
++ bottom->max_qtcb_size); |
4252 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 129, req); |
4253 |
+ return; |
4254 |
+ } |
4255 |
+@@ -656,15 +591,15 @@ static void zfcp_fsf_exchange_config_dat |
4256 |
+ |
4257 |
+ if (FSF_QTCB_CURRENT_VERSION < bottom->low_qtcb_version) { |
4258 |
+ dev_err(&adapter->ccw_device->dev, |
4259 |
+- "The adapter only supports newer control block " |
4260 |
+- "versions, try updated device driver.\n"); |
4261 |
++ "The FCP adapter only supports newer " |
4262 |
++ "control block versions\n"); |
4263 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 125, req); |
4264 |
+ return; |
4265 |
+ } |
4266 |
+ if (FSF_QTCB_CURRENT_VERSION > bottom->high_qtcb_version) { |
4267 |
+ dev_err(&adapter->ccw_device->dev, |
4268 |
+- "The adapter only supports older control block " |
4269 |
+- "versions, consider a microcode upgrade.\n"); |
4270 |
++ "The FCP adapter only supports older " |
4271 |
++ "control block versions\n"); |
4272 |
+ zfcp_erp_adapter_shutdown(adapter, 0, 126, req); |
4273 |
+ } |
4274 |
+ } |
4275 |
+@@ -688,7 +623,6 @@ static void zfcp_fsf_exchange_port_evalu |
4276 |
+ |
4277 |
+ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) |
4278 |
+ { |
4279 |
+- struct zfcp_adapter *adapter = req->adapter; |
4280 |
+ struct fsf_qtcb *qtcb = req->qtcb; |
4281 |
+ |
4282 |
+ if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
4283 |
+@@ -697,38 +631,47 @@ static void zfcp_fsf_exchange_port_data_ |
4284 |
+ switch (qtcb->header.fsf_status) { |
4285 |
+ case FSF_GOOD: |
4286 |
+ zfcp_fsf_exchange_port_evaluate(req); |
4287 |
+- atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
4288 |
+ break; |
4289 |
+ case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: |
4290 |
+ zfcp_fsf_exchange_port_evaluate(req); |
4291 |
+- atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
4292 |
+ zfcp_fsf_link_down_info_eval(req, 43, |
4293 |
+ &qtcb->header.fsf_status_qual.link_down_info); |
4294 |
+ break; |
4295 |
+ } |
4296 |
+ } |
4297 |
+ |
4298 |
+-static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue) |
4299 |
++static int zfcp_fsf_sbal_check(struct zfcp_adapter *adapter) |
4300 |
+ { |
4301 |
+- spin_lock_bh(&queue->lock); |
4302 |
+- if (atomic_read(&queue->count)) |
4303 |
++ struct zfcp_qdio_queue *req_q = &adapter->req_q; |
4304 |
++ |
4305 |
++ spin_lock_bh(&adapter->req_q_lock); |
4306 |
++ if (atomic_read(&req_q->count)) |
4307 |
+ return 1; |
4308 |
+- spin_unlock_bh(&queue->lock); |
4309 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4310 |
+ return 0; |
4311 |
+ } |
4312 |
+ |
4313 |
++static int zfcp_fsf_sbal_available(struct zfcp_adapter *adapter) |
4314 |
++{ |
4315 |
++ unsigned int count = atomic_read(&adapter->req_q.count); |
4316 |
++ if (!count) |
4317 |
++ atomic_inc(&adapter->qdio_outb_full); |
4318 |
++ return count > 0; |
4319 |
++} |
4320 |
++ |
4321 |
+ static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) |
4322 |
+ { |
4323 |
+ long ret; |
4324 |
+- struct zfcp_qdio_queue *req_q = &adapter->req_q; |
4325 |
+ |
4326 |
+- spin_unlock_bh(&req_q->lock); |
4327 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4328 |
+ ret = wait_event_interruptible_timeout(adapter->request_wq, |
4329 |
+- zfcp_fsf_sbal_check(req_q), 5 * HZ); |
4330 |
++ zfcp_fsf_sbal_check(adapter), 5 * HZ); |
4331 |
+ if (ret > 0) |
4332 |
+ return 0; |
4333 |
++ if (!ret) |
4334 |
++ atomic_inc(&adapter->qdio_outb_full); |
4335 |
+ |
4336 |
+- spin_lock_bh(&req_q->lock); |
4337 |
++ spin_lock_bh(&adapter->req_q_lock); |
4338 |
+ return -EIO; |
4339 |
+ } |
4340 |
+ |
4341 |
+@@ -739,6 +682,7 @@ static struct zfcp_fsf_req *zfcp_fsf_all |
4342 |
+ if (!req) |
4343 |
+ return NULL; |
4344 |
+ memset(req, 0, sizeof(*req)); |
4345 |
++ req->pool = pool; |
4346 |
+ return req; |
4347 |
+ } |
4348 |
+ |
4349 |
+@@ -765,7 +709,7 @@ static struct zfcp_fsf_req *zfcp_fsf_req |
4350 |
+ u32 fsf_cmd, int req_flags, |
4351 |
+ mempool_t *pool) |
4352 |
+ { |
4353 |
+- volatile struct qdio_buffer_element *sbale; |
4354 |
++ struct qdio_buffer_element *sbale; |
4355 |
+ |
4356 |
+ struct zfcp_fsf_req *req; |
4357 |
+ struct zfcp_qdio_queue *req_q = &adapter->req_q; |
4358 |
+@@ -825,27 +769,23 @@ static struct zfcp_fsf_req *zfcp_fsf_req |
4359 |
+ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) |
4360 |
+ { |
4361 |
+ struct zfcp_adapter *adapter = req->adapter; |
4362 |
+- struct zfcp_qdio_queue *req_q = &adapter->req_q; |
4363 |
++ unsigned long flags; |
4364 |
+ int idx; |
4365 |
+ |
4366 |
+ /* put allocated FSF request into hash table */ |
4367 |
+- spin_lock(&adapter->req_list_lock); |
4368 |
++ spin_lock_irqsave(&adapter->req_list_lock, flags); |
4369 |
+ idx = zfcp_reqlist_hash(req->req_id); |
4370 |
+ list_add_tail(&req->list, &adapter->req_list[idx]); |
4371 |
+- spin_unlock(&adapter->req_list_lock); |
4372 |
++ spin_unlock_irqrestore(&adapter->req_list_lock, flags); |
4373 |
+ |
4374 |
+ req->issued = get_clock(); |
4375 |
+ if (zfcp_qdio_send(req)) { |
4376 |
+- /* Queues are down..... */ |
4377 |
+ del_timer(&req->timer); |
4378 |
+- spin_lock(&adapter->req_list_lock); |
4379 |
+- zfcp_reqlist_remove(adapter, req); |
4380 |
+- spin_unlock(&adapter->req_list_lock); |
4381 |
+- /* undo changes in request queue made for this request */ |
4382 |
+- atomic_add(req->sbal_number, &req_q->count); |
4383 |
+- req_q->first -= req->sbal_number; |
4384 |
+- req_q->first += QDIO_MAX_BUFFERS_PER_Q; |
4385 |
+- req_q->first %= QDIO_MAX_BUFFERS_PER_Q; /* wrap */ |
4386 |
++ spin_lock_irqsave(&adapter->req_list_lock, flags); |
4387 |
++ /* lookup request again, list might have changed */ |
4388 |
++ if (zfcp_reqlist_find_safe(adapter, req)) |
4389 |
++ zfcp_reqlist_remove(adapter, req); |
4390 |
++ spin_unlock_irqrestore(&adapter->req_list_lock, flags); |
4391 |
+ zfcp_erp_adapter_reopen(adapter, 0, 116, req); |
4392 |
+ return -EIO; |
4393 |
+ } |
4394 |
+@@ -867,10 +807,10 @@ int zfcp_fsf_status_read(struct zfcp_ada |
4395 |
+ { |
4396 |
+ struct zfcp_fsf_req *req; |
4397 |
+ struct fsf_status_read_buffer *sr_buf; |
4398 |
+- volatile struct qdio_buffer_element *sbale; |
4399 |
++ struct qdio_buffer_element *sbale; |
4400 |
+ int retval = -EIO; |
4401 |
+ |
4402 |
+- spin_lock_bh(&adapter->req_q.lock); |
4403 |
++ spin_lock_bh(&adapter->req_q_lock); |
4404 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
4405 |
+ goto out; |
4406 |
+ |
4407 |
+@@ -910,7 +850,7 @@ failed_buf: |
4408 |
+ zfcp_fsf_req_free(req); |
4409 |
+ zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); |
4410 |
+ out: |
4411 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4412 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4413 |
+ return retval; |
4414 |
+ } |
4415 |
+ |
4416 |
+@@ -980,11 +920,11 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_ |
4417 |
+ struct zfcp_unit *unit, |
4418 |
+ int req_flags) |
4419 |
+ { |
4420 |
+- volatile struct qdio_buffer_element *sbale; |
4421 |
++ struct qdio_buffer_element *sbale; |
4422 |
+ struct zfcp_fsf_req *req = NULL; |
4423 |
+ |
4424 |
+- spin_lock(&adapter->req_q.lock); |
4425 |
+- if (!atomic_read(&adapter->req_q.count)) |
4426 |
++ spin_lock(&adapter->req_q_lock); |
4427 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
4428 |
+ goto out; |
4429 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, |
4430 |
+ req_flags, adapter->pool.fsf_req_abort); |
4431 |
+@@ -1013,7 +953,7 @@ out_error_free: |
4432 |
+ zfcp_fsf_req_free(req); |
4433 |
+ req = NULL; |
4434 |
+ out: |
4435 |
+- spin_unlock(&adapter->req_q.lock); |
4436 |
++ spin_unlock(&adapter->req_q_lock); |
4437 |
+ return req; |
4438 |
+ } |
4439 |
+ |
4440 |
+@@ -1021,7 +961,6 @@ static void zfcp_fsf_send_ct_handler(str |
4441 |
+ { |
4442 |
+ struct zfcp_adapter *adapter = req->adapter; |
4443 |
+ struct zfcp_send_ct *send_ct = req->data; |
4444 |
+- struct zfcp_port *port = send_ct->port; |
4445 |
+ struct fsf_qtcb_header *header = &req->qtcb->header; |
4446 |
+ |
4447 |
+ send_ct->status = -EINVAL; |
4448 |
+@@ -1040,17 +979,14 @@ static void zfcp_fsf_send_ct_handler(str |
4449 |
+ case FSF_ADAPTER_STATUS_AVAILABLE: |
4450 |
+ switch (header->fsf_status_qual.word[0]){ |
4451 |
+ case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: |
4452 |
+- zfcp_test_link(port); |
4453 |
+ case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: |
4454 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4455 |
+ break; |
4456 |
+ } |
4457 |
+ break; |
4458 |
+ case FSF_ACCESS_DENIED: |
4459 |
+- zfcp_fsf_access_denied_port(req, port); |
4460 |
+ break; |
4461 |
+ case FSF_PORT_BOXED: |
4462 |
+- zfcp_erp_port_boxed(port, 49, req); |
4463 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
4464 |
+ ZFCP_STATUS_FSFREQ_RETRY; |
4465 |
+ break; |
4466 |
+@@ -1101,12 +1037,12 @@ static int zfcp_fsf_setup_sbals(struct z |
4467 |
+ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, |
4468 |
+ struct zfcp_erp_action *erp_action) |
4469 |
+ { |
4470 |
+- struct zfcp_port *port = ct->port; |
4471 |
+- struct zfcp_adapter *adapter = port->adapter; |
4472 |
++ struct zfcp_wka_port *wka_port = ct->wka_port; |
4473 |
++ struct zfcp_adapter *adapter = wka_port->adapter; |
4474 |
+ struct zfcp_fsf_req *req; |
4475 |
+ int ret = -EIO; |
4476 |
+ |
4477 |
+- spin_lock_bh(&adapter->req_q.lock); |
4478 |
++ spin_lock_bh(&adapter->req_q_lock); |
4479 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
4480 |
+ goto out; |
4481 |
+ |
4482 |
+@@ -1123,7 +1059,7 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct |
4483 |
+ goto failed_send; |
4484 |
+ |
4485 |
+ req->handler = zfcp_fsf_send_ct_handler; |
4486 |
+- req->qtcb->header.port_handle = port->handle; |
4487 |
++ req->qtcb->header.port_handle = wka_port->handle; |
4488 |
+ req->qtcb->bottom.support.service_class = FSF_CLASS_3; |
4489 |
+ req->qtcb->bottom.support.timeout = ct->timeout; |
4490 |
+ req->data = ct; |
4491 |
+@@ -1148,7 +1084,7 @@ failed_send: |
4492 |
+ if (erp_action) |
4493 |
+ erp_action->fsf_req = NULL; |
4494 |
+ out: |
4495 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4496 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4497 |
+ return ret; |
4498 |
+ } |
4499 |
+ |
4500 |
+@@ -1218,8 +1154,8 @@ int zfcp_fsf_send_els(struct zfcp_send_e |
4501 |
+ ZFCP_STATUS_COMMON_UNBLOCKED))) |
4502 |
+ return -EBUSY; |
4503 |
+ |
4504 |
+- spin_lock(&adapter->req_q.lock); |
4505 |
+- if (!atomic_read(&adapter->req_q.count)) |
4506 |
++ spin_lock(&adapter->req_q_lock); |
4507 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
4508 |
+ goto out; |
4509 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, |
4510 |
+ ZFCP_REQ_AUTO_CLEANUP, NULL); |
4511 |
+@@ -1228,8 +1164,8 @@ int zfcp_fsf_send_els(struct zfcp_send_e |
4512 |
+ goto out; |
4513 |
+ } |
4514 |
+ |
4515 |
+- ret = zfcp_fsf_setup_sbals(req, els->req, els->resp, |
4516 |
+- FSF_MAX_SBALS_PER_ELS_REQ); |
4517 |
++ ret = zfcp_fsf_setup_sbals(req, els->req, els->resp, 2); |
4518 |
++ |
4519 |
+ if (ret) |
4520 |
+ goto failed_send; |
4521 |
+ |
4522 |
+@@ -1252,19 +1188,19 @@ int zfcp_fsf_send_els(struct zfcp_send_e |
4523 |
+ failed_send: |
4524 |
+ zfcp_fsf_req_free(req); |
4525 |
+ out: |
4526 |
+- spin_unlock(&adapter->req_q.lock); |
4527 |
++ spin_unlock(&adapter->req_q_lock); |
4528 |
+ return ret; |
4529 |
+ } |
4530 |
+ |
4531 |
+ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) |
4532 |
+ { |
4533 |
+- volatile struct qdio_buffer_element *sbale; |
4534 |
++ struct qdio_buffer_element *sbale; |
4535 |
+ struct zfcp_fsf_req *req; |
4536 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
4537 |
+ int retval = -EIO; |
4538 |
+ |
4539 |
+- spin_lock_bh(&adapter->req_q.lock); |
4540 |
+- if (!atomic_read(&adapter->req_q.count)) |
4541 |
++ spin_lock_bh(&adapter->req_q_lock); |
4542 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
4543 |
+ goto out; |
4544 |
+ req = zfcp_fsf_req_create(adapter, |
4545 |
+ FSF_QTCB_EXCHANGE_CONFIG_DATA, |
4546 |
+@@ -1295,18 +1231,18 @@ int zfcp_fsf_exchange_config_data(struct |
4547 |
+ erp_action->fsf_req = NULL; |
4548 |
+ } |
4549 |
+ out: |
4550 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4551 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4552 |
+ return retval; |
4553 |
+ } |
4554 |
+ |
4555 |
+ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, |
4556 |
+ struct fsf_qtcb_bottom_config *data) |
4557 |
+ { |
4558 |
+- volatile struct qdio_buffer_element *sbale; |
4559 |
++ struct qdio_buffer_element *sbale; |
4560 |
+ struct zfcp_fsf_req *req = NULL; |
4561 |
+ int retval = -EIO; |
4562 |
+ |
4563 |
+- spin_lock_bh(&adapter->req_q.lock); |
4564 |
++ spin_lock_bh(&adapter->req_q_lock); |
4565 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
4566 |
+ goto out; |
4567 |
+ |
4568 |
+@@ -1334,7 +1270,7 @@ int zfcp_fsf_exchange_config_data_sync(s |
4569 |
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
4570 |
+ retval = zfcp_fsf_req_send(req); |
4571 |
+ out: |
4572 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4573 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4574 |
+ if (!retval) |
4575 |
+ wait_event(req->completion_wq, |
4576 |
+ req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
4577 |
+@@ -1351,7 +1287,7 @@ out: |
4578 |
+ */ |
4579 |
+ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) |
4580 |
+ { |
4581 |
+- volatile struct qdio_buffer_element *sbale; |
4582 |
++ struct qdio_buffer_element *sbale; |
4583 |
+ struct zfcp_fsf_req *req; |
4584 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
4585 |
+ int retval = -EIO; |
4586 |
+@@ -1359,8 +1295,8 @@ int zfcp_fsf_exchange_port_data(struct z |
4587 |
+ if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) |
4588 |
+ return -EOPNOTSUPP; |
4589 |
+ |
4590 |
+- spin_lock_bh(&adapter->req_q.lock); |
4591 |
+- if (!atomic_read(&adapter->req_q.count)) |
4592 |
++ spin_lock_bh(&adapter->req_q_lock); |
4593 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
4594 |
+ goto out; |
4595 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, |
4596 |
+ ZFCP_REQ_AUTO_CLEANUP, |
4597 |
+@@ -1385,7 +1321,7 @@ int zfcp_fsf_exchange_port_data(struct z |
4598 |
+ erp_action->fsf_req = NULL; |
4599 |
+ } |
4600 |
+ out: |
4601 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4602 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4603 |
+ return retval; |
4604 |
+ } |
4605 |
+ |
4606 |
+@@ -1398,15 +1334,15 @@ out: |
4607 |
+ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, |
4608 |
+ struct fsf_qtcb_bottom_port *data) |
4609 |
+ { |
4610 |
+- volatile struct qdio_buffer_element *sbale; |
4611 |
++ struct qdio_buffer_element *sbale; |
4612 |
+ struct zfcp_fsf_req *req = NULL; |
4613 |
+ int retval = -EIO; |
4614 |
+ |
4615 |
+ if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) |
4616 |
+ return -EOPNOTSUPP; |
4617 |
+ |
4618 |
+- spin_lock_bh(&adapter->req_q.lock); |
4619 |
+- if (!atomic_read(&adapter->req_q.count)) |
4620 |
++ spin_lock_bh(&adapter->req_q_lock); |
4621 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
4622 |
+ goto out; |
4623 |
+ |
4624 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0, |
4625 |
+@@ -1427,7 +1363,7 @@ int zfcp_fsf_exchange_port_data_sync(str |
4626 |
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
4627 |
+ retval = zfcp_fsf_req_send(req); |
4628 |
+ out: |
4629 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4630 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4631 |
+ if (!retval) |
4632 |
+ wait_event(req->completion_wq, |
4633 |
+ req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
4634 |
+@@ -1443,7 +1379,7 @@ static void zfcp_fsf_open_port_handler(s |
4635 |
+ struct fsf_plogi *plogi; |
4636 |
+ |
4637 |
+ if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
4638 |
+- goto skip_fsfstatus; |
4639 |
++ return; |
4640 |
+ |
4641 |
+ switch (header->fsf_status) { |
4642 |
+ case FSF_PORT_ALREADY_OPEN: |
4643 |
+@@ -1453,9 +1389,9 @@ static void zfcp_fsf_open_port_handler(s |
4644 |
+ break; |
4645 |
+ case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: |
4646 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4647 |
+- "The adapter is out of resources. The remote port " |
4648 |
+- "0x%016Lx could not be opened, disabling it.\n", |
4649 |
+- port->wwpn); |
4650 |
++ "Not enough FCP adapter resources to open " |
4651 |
++ "remote port 0x%016Lx\n", |
4652 |
++ (unsigned long long)port->wwpn); |
4653 |
+ zfcp_erp_port_failed(port, 31, req); |
4654 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4655 |
+ break; |
4656 |
+@@ -1467,8 +1403,8 @@ static void zfcp_fsf_open_port_handler(s |
4657 |
+ break; |
4658 |
+ case FSF_SQ_NO_RETRY_POSSIBLE: |
4659 |
+ dev_warn(&req->adapter->ccw_device->dev, |
4660 |
+- "The remote port 0x%016Lx could not be " |
4661 |
+- "opened. Disabling it.\n", port->wwpn); |
4662 |
++ "Remote port 0x%016Lx could not be opened\n", |
4663 |
++ (unsigned long long)port->wwpn); |
4664 |
+ zfcp_erp_port_failed(port, 32, req); |
4665 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4666 |
+ break; |
4667 |
+@@ -1496,9 +1432,6 @@ static void zfcp_fsf_open_port_handler(s |
4668 |
+ * another GID_PN straight after a port has been opened. |
4669 |
+ * Alternately, an ADISC/PDISC ELS should suffice, as well. |
4670 |
+ */ |
4671 |
+- if (atomic_read(&port->status) & ZFCP_STATUS_PORT_NO_WWPN) |
4672 |
+- break; |
4673 |
+- |
4674 |
+ plogi = (struct fsf_plogi *) req->qtcb->bottom.support.els; |
4675 |
+ if (req->qtcb->bottom.support.els1_length >= sizeof(*plogi)) { |
4676 |
+ if (plogi->serv_param.wwpn != port->wwpn) |
4677 |
+@@ -1514,9 +1447,6 @@ static void zfcp_fsf_open_port_handler(s |
4678 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4679 |
+ break; |
4680 |
+ } |
4681 |
+- |
4682 |
+-skip_fsfstatus: |
4683 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING, &port->status); |
4684 |
+ } |
4685 |
+ |
4686 |
+ /** |
4687 |
+@@ -1526,12 +1456,12 @@ skip_fsfstatus: |
4688 |
+ */ |
4689 |
+ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) |
4690 |
+ { |
4691 |
+- volatile struct qdio_buffer_element *sbale; |
4692 |
++ struct qdio_buffer_element *sbale; |
4693 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
4694 |
+ struct zfcp_fsf_req *req; |
4695 |
+ int retval = -EIO; |
4696 |
+ |
4697 |
+- spin_lock_bh(&adapter->req_q.lock); |
4698 |
++ spin_lock_bh(&adapter->req_q_lock); |
4699 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
4700 |
+ goto out; |
4701 |
+ |
4702 |
+@@ -1553,7 +1483,6 @@ int zfcp_fsf_open_port(struct zfcp_erp_a |
4703 |
+ req->data = erp_action->port; |
4704 |
+ req->erp_action = erp_action; |
4705 |
+ erp_action->fsf_req = req; |
4706 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->port->status); |
4707 |
+ |
4708 |
+ zfcp_fsf_start_erp_timer(req); |
4709 |
+ retval = zfcp_fsf_req_send(req); |
4710 |
+@@ -1562,7 +1491,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_a |
4711 |
+ erp_action->fsf_req = NULL; |
4712 |
+ } |
4713 |
+ out: |
4714 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4715 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4716 |
+ return retval; |
4717 |
+ } |
4718 |
+ |
4719 |
+@@ -1571,7 +1500,7 @@ static void zfcp_fsf_close_port_handler( |
4720 |
+ struct zfcp_port *port = req->data; |
4721 |
+ |
4722 |
+ if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
4723 |
+- goto skip_fsfstatus; |
4724 |
++ return; |
4725 |
+ |
4726 |
+ switch (req->qtcb->header.fsf_status) { |
4727 |
+ case FSF_PORT_HANDLE_NOT_VALID: |
4728 |
+@@ -1586,9 +1515,6 @@ static void zfcp_fsf_close_port_handler( |
4729 |
+ ZFCP_CLEAR); |
4730 |
+ break; |
4731 |
+ } |
4732 |
+- |
4733 |
+-skip_fsfstatus: |
4734 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_CLOSING, &port->status); |
4735 |
+ } |
4736 |
+ |
4737 |
+ /** |
4738 |
+@@ -1598,12 +1524,12 @@ skip_fsfstatus: |
4739 |
+ */ |
4740 |
+ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) |
4741 |
+ { |
4742 |
+- volatile struct qdio_buffer_element *sbale; |
4743 |
++ struct qdio_buffer_element *sbale; |
4744 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
4745 |
+ struct zfcp_fsf_req *req; |
4746 |
+ int retval = -EIO; |
4747 |
+ |
4748 |
+- spin_lock_bh(&adapter->req_q.lock); |
4749 |
++ spin_lock_bh(&adapter->req_q_lock); |
4750 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
4751 |
+ goto out; |
4752 |
+ |
4753 |
+@@ -1624,7 +1550,6 @@ int zfcp_fsf_close_port(struct zfcp_erp_ |
4754 |
+ req->erp_action = erp_action; |
4755 |
+ req->qtcb->header.port_handle = erp_action->port->handle; |
4756 |
+ erp_action->fsf_req = req; |
4757 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->port->status); |
4758 |
+ |
4759 |
+ zfcp_fsf_start_erp_timer(req); |
4760 |
+ retval = zfcp_fsf_req_send(req); |
4761 |
+@@ -1633,7 +1558,131 @@ int zfcp_fsf_close_port(struct zfcp_erp_ |
4762 |
+ erp_action->fsf_req = NULL; |
4763 |
+ } |
4764 |
+ out: |
4765 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4766 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4767 |
++ return retval; |
4768 |
++} |
4769 |
++ |
4770 |
++static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req) |
4771 |
++{ |
4772 |
++ struct zfcp_wka_port *wka_port = req->data; |
4773 |
++ struct fsf_qtcb_header *header = &req->qtcb->header; |
4774 |
++ |
4775 |
++ if (req->status & ZFCP_STATUS_FSFREQ_ERROR) { |
4776 |
++ wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
4777 |
++ goto out; |
4778 |
++ } |
4779 |
++ |
4780 |
++ switch (header->fsf_status) { |
4781 |
++ case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: |
4782 |
++ dev_warn(&req->adapter->ccw_device->dev, |
4783 |
++ "Opening WKA port 0x%x failed\n", wka_port->d_id); |
4784 |
++ case FSF_ADAPTER_STATUS_AVAILABLE: |
4785 |
++ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4786 |
++ case FSF_ACCESS_DENIED: |
4787 |
++ wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
4788 |
++ break; |
4789 |
++ case FSF_PORT_ALREADY_OPEN: |
4790 |
++ case FSF_GOOD: |
4791 |
++ wka_port->handle = header->port_handle; |
4792 |
++ wka_port->status = ZFCP_WKA_PORT_ONLINE; |
4793 |
++ } |
4794 |
++out: |
4795 |
++ wake_up(&wka_port->completion_wq); |
4796 |
++} |
4797 |
++ |
4798 |
++/** |
4799 |
++ * zfcp_fsf_open_wka_port - create and send open wka-port request |
4800 |
++ * @wka_port: pointer to struct zfcp_wka_port |
4801 |
++ * Returns: 0 on success, error otherwise |
4802 |
++ */ |
4803 |
++int zfcp_fsf_open_wka_port(struct zfcp_wka_port *wka_port) |
4804 |
++{ |
4805 |
++ struct qdio_buffer_element *sbale; |
4806 |
++ struct zfcp_adapter *adapter = wka_port->adapter; |
4807 |
++ struct zfcp_fsf_req *req; |
4808 |
++ int retval = -EIO; |
4809 |
++ |
4810 |
++ spin_lock_bh(&adapter->req_q_lock); |
4811 |
++ if (zfcp_fsf_req_sbal_get(adapter)) |
4812 |
++ goto out; |
4813 |
++ |
4814 |
++ req = zfcp_fsf_req_create(adapter, |
4815 |
++ FSF_QTCB_OPEN_PORT_WITH_DID, |
4816 |
++ ZFCP_REQ_AUTO_CLEANUP, |
4817 |
++ adapter->pool.fsf_req_erp); |
4818 |
++ if (unlikely(IS_ERR(req))) { |
4819 |
++ retval = PTR_ERR(req); |
4820 |
++ goto out; |
4821 |
++ } |
4822 |
++ |
4823 |
++ sbale = zfcp_qdio_sbale_req(req); |
4824 |
++ sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
4825 |
++ sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
4826 |
++ |
4827 |
++ req->handler = zfcp_fsf_open_wka_port_handler; |
4828 |
++ req->qtcb->bottom.support.d_id = wka_port->d_id; |
4829 |
++ req->data = wka_port; |
4830 |
++ |
4831 |
++ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
4832 |
++ retval = zfcp_fsf_req_send(req); |
4833 |
++ if (retval) |
4834 |
++ zfcp_fsf_req_free(req); |
4835 |
++out: |
4836 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4837 |
++ return retval; |
4838 |
++} |
4839 |
++ |
4840 |
++static void zfcp_fsf_close_wka_port_handler(struct zfcp_fsf_req *req) |
4841 |
++{ |
4842 |
++ struct zfcp_wka_port *wka_port = req->data; |
4843 |
++ |
4844 |
++ if (req->qtcb->header.fsf_status == FSF_PORT_HANDLE_NOT_VALID) { |
4845 |
++ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4846 |
++ zfcp_erp_adapter_reopen(wka_port->adapter, 0, 84, req); |
4847 |
++ } |
4848 |
++ |
4849 |
++ wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
4850 |
++ wake_up(&wka_port->completion_wq); |
4851 |
++} |
4852 |
++ |
4853 |
++/** |
4854 |
++ * zfcp_fsf_close_wka_port - create and send close wka port request |
4855 |
++ * @erp_action: pointer to struct zfcp_erp_action |
4856 |
++ * Returns: 0 on success, error otherwise |
4857 |
++ */ |
4858 |
++int zfcp_fsf_close_wka_port(struct zfcp_wka_port *wka_port) |
4859 |
++{ |
4860 |
++ struct qdio_buffer_element *sbale; |
4861 |
++ struct zfcp_adapter *adapter = wka_port->adapter; |
4862 |
++ struct zfcp_fsf_req *req; |
4863 |
++ int retval = -EIO; |
4864 |
++ |
4865 |
++ spin_lock_bh(&adapter->req_q_lock); |
4866 |
++ if (zfcp_fsf_req_sbal_get(adapter)) |
4867 |
++ goto out; |
4868 |
++ |
4869 |
++ req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PORT, |
4870 |
++ ZFCP_REQ_AUTO_CLEANUP, |
4871 |
++ adapter->pool.fsf_req_erp); |
4872 |
++ if (unlikely(IS_ERR(req))) { |
4873 |
++ retval = PTR_ERR(req); |
4874 |
++ goto out; |
4875 |
++ } |
4876 |
++ |
4877 |
++ sbale = zfcp_qdio_sbale_req(req); |
4878 |
++ sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
4879 |
++ sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
4880 |
++ |
4881 |
++ req->handler = zfcp_fsf_close_wka_port_handler; |
4882 |
++ req->data = wka_port; |
4883 |
++ req->qtcb->header.port_handle = wka_port->handle; |
4884 |
++ |
4885 |
++ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
4886 |
++ retval = zfcp_fsf_req_send(req); |
4887 |
++ if (retval) |
4888 |
++ zfcp_fsf_req_free(req); |
4889 |
++out: |
4890 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4891 |
+ return retval; |
4892 |
+ } |
4893 |
+ |
4894 |
+@@ -1695,12 +1744,12 @@ skip_fsfstatus: |
4895 |
+ */ |
4896 |
+ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) |
4897 |
+ { |
4898 |
+- volatile struct qdio_buffer_element *sbale; |
4899 |
++ struct qdio_buffer_element *sbale; |
4900 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
4901 |
+ struct zfcp_fsf_req *req; |
4902 |
+ int retval = -EIO; |
4903 |
+ |
4904 |
+- spin_lock_bh(&adapter->req_q.lock); |
4905 |
++ spin_lock_bh(&adapter->req_q_lock); |
4906 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
4907 |
+ goto out; |
4908 |
+ |
4909 |
+@@ -1731,7 +1780,7 @@ int zfcp_fsf_close_physical_port(struct |
4910 |
+ erp_action->fsf_req = NULL; |
4911 |
+ } |
4912 |
+ out: |
4913 |
+- spin_unlock_bh(&adapter->req_q.lock); |
4914 |
++ spin_unlock_bh(&adapter->req_q_lock); |
4915 |
+ return retval; |
4916 |
+ } |
4917 |
+ |
4918 |
+@@ -1746,7 +1795,7 @@ static void zfcp_fsf_open_unit_handler(s |
4919 |
+ int exclusive, readwrite; |
4920 |
+ |
4921 |
+ if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
4922 |
+- goto skip_fsfstatus; |
4923 |
++ return; |
4924 |
+ |
4925 |
+ atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | |
4926 |
+ ZFCP_STATUS_COMMON_ACCESS_BOXED | |
4927 |
+@@ -1774,14 +1823,12 @@ static void zfcp_fsf_open_unit_handler(s |
4928 |
+ case FSF_LUN_SHARING_VIOLATION: |
4929 |
+ if (header->fsf_status_qual.word[0]) |
4930 |
+ dev_warn(&adapter->ccw_device->dev, |
4931 |
+- "FCP-LUN 0x%Lx at the remote port " |
4932 |
+- "with WWPN 0x%Lx " |
4933 |
+- "connected to the adapter " |
4934 |
+- "is already in use in LPAR%d, CSS%d.\n", |
4935 |
+- unit->fcp_lun, |
4936 |
+- unit->port->wwpn, |
4937 |
+- queue_designator->hla, |
4938 |
+- queue_designator->cssid); |
4939 |
++ "LUN 0x%Lx on port 0x%Lx is already in " |
4940 |
++ "use by CSS%d, MIF Image ID %x\n", |
4941 |
++ (unsigned long long)unit->fcp_lun, |
4942 |
++ (unsigned long long)unit->port->wwpn, |
4943 |
++ queue_designator->cssid, |
4944 |
++ queue_designator->hla); |
4945 |
+ else |
4946 |
+ zfcp_act_eval_err(adapter, |
4947 |
+ header->fsf_status_qual.word[2]); |
4948 |
+@@ -1792,9 +1839,10 @@ static void zfcp_fsf_open_unit_handler(s |
4949 |
+ break; |
4950 |
+ case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED: |
4951 |
+ dev_warn(&adapter->ccw_device->dev, |
4952 |
+- "The adapter ran out of resources. There is no " |
4953 |
+- "handle available for unit 0x%016Lx on port 0x%016Lx.", |
4954 |
+- unit->fcp_lun, unit->port->wwpn); |
4955 |
++ "No handle is available for LUN " |
4956 |
++ "0x%016Lx on port 0x%016Lx\n", |
4957 |
++ (unsigned long long)unit->fcp_lun, |
4958 |
++ (unsigned long long)unit->port->wwpn); |
4959 |
+ zfcp_erp_unit_failed(unit, 34, req); |
4960 |
+ /* fall through */ |
4961 |
+ case FSF_INVALID_COMMAND_OPTION: |
4962 |
+@@ -1831,26 +1879,29 @@ static void zfcp_fsf_open_unit_handler(s |
4963 |
+ atomic_set_mask(ZFCP_STATUS_UNIT_READONLY, |
4964 |
+ &unit->status); |
4965 |
+ dev_info(&adapter->ccw_device->dev, |
4966 |
+- "Read-only access for unit 0x%016Lx " |
4967 |
+- "on port 0x%016Lx.\n", |
4968 |
+- unit->fcp_lun, unit->port->wwpn); |
4969 |
++ "SCSI device at LUN 0x%016Lx on port " |
4970 |
++ "0x%016Lx opened read-only\n", |
4971 |
++ (unsigned long long)unit->fcp_lun, |
4972 |
++ (unsigned long long)unit->port->wwpn); |
4973 |
+ } |
4974 |
+ |
4975 |
+ if (exclusive && !readwrite) { |
4976 |
+ dev_err(&adapter->ccw_device->dev, |
4977 |
+- "Exclusive access of read-only unit " |
4978 |
+- "0x%016Lx on port 0x%016Lx not " |
4979 |
+- "supported, disabling unit.\n", |
4980 |
+- unit->fcp_lun, unit->port->wwpn); |
4981 |
++ "Exclusive read-only access not " |
4982 |
++ "supported (unit 0x%016Lx, " |
4983 |
++ "port 0x%016Lx)\n", |
4984 |
++ (unsigned long long)unit->fcp_lun, |
4985 |
++ (unsigned long long)unit->port->wwpn); |
4986 |
+ zfcp_erp_unit_failed(unit, 35, req); |
4987 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
4988 |
+ zfcp_erp_unit_shutdown(unit, 0, 80, req); |
4989 |
+ } else if (!exclusive && readwrite) { |
4990 |
+ dev_err(&adapter->ccw_device->dev, |
4991 |
+- "Shared access of read-write unit " |
4992 |
+- "0x%016Lx on port 0x%016Lx not " |
4993 |
+- "supported, disabling unit.\n", |
4994 |
+- unit->fcp_lun, unit->port->wwpn); |
4995 |
++ "Shared read-write access not " |
4996 |
++ "supported (unit 0x%016Lx, port " |
4997 |
++ "0x%016Lx\n)", |
4998 |
++ (unsigned long long)unit->fcp_lun, |
4999 |
++ (unsigned long long)unit->port->wwpn); |
5000 |
+ zfcp_erp_unit_failed(unit, 36, req); |
5001 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
5002 |
+ zfcp_erp_unit_shutdown(unit, 0, 81, req); |
5003 |
+@@ -1858,9 +1909,6 @@ static void zfcp_fsf_open_unit_handler(s |
5004 |
+ } |
5005 |
+ break; |
5006 |
+ } |
5007 |
+- |
5008 |
+-skip_fsfstatus: |
5009 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING, &unit->status); |
5010 |
+ } |
5011 |
+ |
5012 |
+ /** |
5013 |
+@@ -1870,12 +1918,12 @@ skip_fsfstatus: |
5014 |
+ */ |
5015 |
+ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) |
5016 |
+ { |
5017 |
+- volatile struct qdio_buffer_element *sbale; |
5018 |
++ struct qdio_buffer_element *sbale; |
5019 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
5020 |
+ struct zfcp_fsf_req *req; |
5021 |
+ int retval = -EIO; |
5022 |
+ |
5023 |
+- spin_lock_bh(&adapter->req_q.lock); |
5024 |
++ spin_lock_bh(&adapter->req_q_lock); |
5025 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
5026 |
+ goto out; |
5027 |
+ |
5028 |
+@@ -1901,8 +1949,6 @@ int zfcp_fsf_open_unit(struct zfcp_erp_a |
5029 |
+ if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) |
5030 |
+ req->qtcb->bottom.support.option = FSF_OPEN_LUN_SUPPRESS_BOXING; |
5031 |
+ |
5032 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); |
5033 |
+- |
5034 |
+ zfcp_fsf_start_erp_timer(req); |
5035 |
+ retval = zfcp_fsf_req_send(req); |
5036 |
+ if (retval) { |
5037 |
+@@ -1910,7 +1956,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_a |
5038 |
+ erp_action->fsf_req = NULL; |
5039 |
+ } |
5040 |
+ out: |
5041 |
+- spin_unlock_bh(&adapter->req_q.lock); |
5042 |
++ spin_unlock_bh(&adapter->req_q_lock); |
5043 |
+ return retval; |
5044 |
+ } |
5045 |
+ |
5046 |
+@@ -1919,7 +1965,7 @@ static void zfcp_fsf_close_unit_handler( |
5047 |
+ struct zfcp_unit *unit = req->data; |
5048 |
+ |
5049 |
+ if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
5050 |
+- goto skip_fsfstatus; |
5051 |
++ return; |
5052 |
+ |
5053 |
+ switch (req->qtcb->header.fsf_status) { |
5054 |
+ case FSF_PORT_HANDLE_NOT_VALID: |
5055 |
+@@ -1949,8 +1995,6 @@ static void zfcp_fsf_close_unit_handler( |
5056 |
+ atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); |
5057 |
+ break; |
5058 |
+ } |
5059 |
+-skip_fsfstatus: |
5060 |
+- atomic_clear_mask(ZFCP_STATUS_COMMON_CLOSING, &unit->status); |
5061 |
+ } |
5062 |
+ |
5063 |
+ /** |
5064 |
+@@ -1960,12 +2004,12 @@ skip_fsfstatus: |
5065 |
+ */ |
5066 |
+ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) |
5067 |
+ { |
5068 |
+- volatile struct qdio_buffer_element *sbale; |
5069 |
++ struct qdio_buffer_element *sbale; |
5070 |
+ struct zfcp_adapter *adapter = erp_action->adapter; |
5071 |
+ struct zfcp_fsf_req *req; |
5072 |
+ int retval = -EIO; |
5073 |
+ |
5074 |
+- spin_lock_bh(&adapter->req_q.lock); |
5075 |
++ spin_lock_bh(&adapter->req_q_lock); |
5076 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
5077 |
+ goto out; |
5078 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN, |
5079 |
+@@ -1986,7 +2030,6 @@ int zfcp_fsf_close_unit(struct zfcp_erp_ |
5080 |
+ req->data = erp_action->unit; |
5081 |
+ req->erp_action = erp_action; |
5082 |
+ erp_action->fsf_req = req; |
5083 |
+- atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->unit->status); |
5084 |
+ |
5085 |
+ zfcp_fsf_start_erp_timer(req); |
5086 |
+ retval = zfcp_fsf_req_send(req); |
5087 |
+@@ -1995,7 +2038,7 @@ int zfcp_fsf_close_unit(struct zfcp_erp_ |
5088 |
+ erp_action->fsf_req = NULL; |
5089 |
+ } |
5090 |
+ out: |
5091 |
+- spin_unlock_bh(&adapter->req_q.lock); |
5092 |
++ spin_unlock_bh(&adapter->req_q_lock); |
5093 |
+ return retval; |
5094 |
+ } |
5095 |
+ |
5096 |
+@@ -2038,18 +2081,21 @@ static void zfcp_fsf_req_latency(struct |
5097 |
+ |
5098 |
+ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req) |
5099 |
+ { |
5100 |
+- struct scsi_cmnd *scpnt = req->data; |
5101 |
++ struct scsi_cmnd *scpnt; |
5102 |
+ struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *) |
5103 |
+ &(req->qtcb->bottom.io.fcp_rsp); |
5104 |
+ u32 sns_len; |
5105 |
+ char *fcp_rsp_info = (unsigned char *) &fcp_rsp_iu[1]; |
5106 |
+ unsigned long flags; |
5107 |
+ |
5108 |
+- if (unlikely(!scpnt)) |
5109 |
+- return; |
5110 |
+- |
5111 |
+ read_lock_irqsave(&req->adapter->abort_lock, flags); |
5112 |
+ |
5113 |
++ scpnt = req->data; |
5114 |
++ if (unlikely(!scpnt)) { |
5115 |
++ read_unlock_irqrestore(&req->adapter->abort_lock, flags); |
5116 |
++ return; |
5117 |
++ } |
5118 |
++ |
5119 |
+ if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ABORTED)) { |
5120 |
+ set_host_byte(scpnt, DID_SOFT_ERROR); |
5121 |
+ set_driver_byte(scpnt, SUGGEST_RETRY); |
5122 |
+@@ -2156,21 +2202,21 @@ static void zfcp_fsf_send_fcp_command_ha |
5123 |
+ break; |
5124 |
+ case FSF_DIRECTION_INDICATOR_NOT_VALID: |
5125 |
+ dev_err(&req->adapter->ccw_device->dev, |
5126 |
+- "Invalid data direction (%d) given for unit " |
5127 |
+- "0x%016Lx on port 0x%016Lx, shutting down " |
5128 |
+- "adapter.\n", |
5129 |
++ "Incorrect direction %d, unit 0x%016Lx on port " |
5130 |
++ "0x%016Lx closed\n", |
5131 |
+ req->qtcb->bottom.io.data_direction, |
5132 |
+- unit->fcp_lun, unit->port->wwpn); |
5133 |
++ (unsigned long long)unit->fcp_lun, |
5134 |
++ (unsigned long long)unit->port->wwpn); |
5135 |
+ zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, req); |
5136 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
5137 |
+ break; |
5138 |
+ case FSF_CMND_LENGTH_NOT_VALID: |
5139 |
+ dev_err(&req->adapter->ccw_device->dev, |
5140 |
+- "An invalid control-data-block length field (%d) " |
5141 |
+- "was found in a command for unit 0x%016Lx on port " |
5142 |
+- "0x%016Lx. Shutting down adapter.\n", |
5143 |
++ "Incorrect CDB length %d, unit 0x%016Lx on " |
5144 |
++ "port 0x%016Lx closed\n", |
5145 |
+ req->qtcb->bottom.io.fcp_cmnd_length, |
5146 |
+- unit->fcp_lun, unit->port->wwpn); |
5147 |
++ (unsigned long long)unit->fcp_lun, |
5148 |
++ (unsigned long long)unit->port->wwpn); |
5149 |
+ zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, req); |
5150 |
+ req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
5151 |
+ break; |
5152 |
+@@ -2201,6 +2247,20 @@ skip_fsfstatus: |
5153 |
+ } |
5154 |
+ } |
5155 |
+ |
5156 |
++static void zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, u32 fcp_dl) |
5157 |
++{ |
5158 |
++ u32 *fcp_dl_ptr; |
5159 |
++ |
5160 |
++ /* |
5161 |
++ * fcp_dl_addr = start address of fcp_cmnd structure + |
5162 |
++ * size of fixed part + size of dynamically sized add_dcp_cdb field |
5163 |
++ * SEE FCP-2 documentation |
5164 |
++ */ |
5165 |
++ fcp_dl_ptr = (u32 *) ((unsigned char *) &fcp_cmd[1] + |
5166 |
++ (fcp_cmd->add_fcp_cdb_length << 2)); |
5167 |
++ *fcp_dl_ptr = fcp_dl; |
5168 |
++} |
5169 |
++ |
5170 |
+ /** |
5171 |
+ * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command) |
5172 |
+ * @adapter: adapter where scsi command is issued |
5173 |
+@@ -2223,8 +2283,8 @@ int zfcp_fsf_send_fcp_command_task(struc |
5174 |
+ ZFCP_STATUS_COMMON_UNBLOCKED))) |
5175 |
+ return -EBUSY; |
5176 |
+ |
5177 |
+- spin_lock(&adapter->req_q.lock); |
5178 |
+- if (!atomic_read(&adapter->req_q.count)) |
5179 |
++ spin_lock(&adapter->req_q_lock); |
5180 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
5181 |
+ goto out; |
5182 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, |
5183 |
+ adapter->pool.fsf_req_scsi); |
5184 |
+@@ -2286,7 +2346,7 @@ int zfcp_fsf_send_fcp_command_task(struc |
5185 |
+ memcpy(fcp_cmnd_iu->fcp_cdb, scsi_cmnd->cmnd, scsi_cmnd->cmd_len); |
5186 |
+ |
5187 |
+ req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) + |
5188 |
+- fcp_cmnd_iu->add_fcp_cdb_length + sizeof(fcp_dl_t); |
5189 |
++ fcp_cmnd_iu->add_fcp_cdb_length + sizeof(u32); |
5190 |
+ |
5191 |
+ real_bytes = zfcp_qdio_sbals_from_sg(req, sbtype, |
5192 |
+ scsi_sglist(scsi_cmnd), |
5193 |
+@@ -2296,10 +2356,10 @@ int zfcp_fsf_send_fcp_command_task(struc |
5194 |
+ retval = -EIO; |
5195 |
+ else { |
5196 |
+ dev_err(&adapter->ccw_device->dev, |
5197 |
+- "SCSI request too large. " |
5198 |
+- "Shutting down unit 0x%016Lx on port " |
5199 |
+- "0x%016Lx.\n", unit->fcp_lun, |
5200 |
+- unit->port->wwpn); |
5201 |
++ "Oversize data package, unit 0x%016Lx " |
5202 |
++ "on port 0x%016Lx closed\n", |
5203 |
++ (unsigned long long)unit->fcp_lun, |
5204 |
++ (unsigned long long)unit->port->wwpn); |
5205 |
+ zfcp_erp_unit_shutdown(unit, 0, 131, req); |
5206 |
+ retval = -EINVAL; |
5207 |
+ } |
5208 |
+@@ -2322,7 +2382,7 @@ failed_scsi_cmnd: |
5209 |
+ zfcp_fsf_req_free(req); |
5210 |
+ scsi_cmnd->host_scribble = NULL; |
5211 |
+ out: |
5212 |
+- spin_unlock(&adapter->req_q.lock); |
5213 |
++ spin_unlock(&adapter->req_q_lock); |
5214 |
+ return retval; |
5215 |
+ } |
5216 |
+ |
5217 |
+@@ -2338,7 +2398,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c |
5218 |
+ struct zfcp_unit *unit, |
5219 |
+ u8 tm_flags, int req_flags) |
5220 |
+ { |
5221 |
+- volatile struct qdio_buffer_element *sbale; |
5222 |
++ struct qdio_buffer_element *sbale; |
5223 |
+ struct zfcp_fsf_req *req = NULL; |
5224 |
+ struct fcp_cmnd_iu *fcp_cmnd_iu; |
5225 |
+ |
5226 |
+@@ -2346,8 +2406,8 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c |
5227 |
+ ZFCP_STATUS_COMMON_UNBLOCKED))) |
5228 |
+ return NULL; |
5229 |
+ |
5230 |
+- spin_lock(&adapter->req_q.lock); |
5231 |
+- if (!atomic_read(&adapter->req_q.count)) |
5232 |
++ spin_lock(&adapter->req_q_lock); |
5233 |
++ if (!zfcp_fsf_sbal_available(adapter)) |
5234 |
+ goto out; |
5235 |
+ req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, |
5236 |
+ adapter->pool.fsf_req_scsi); |
5237 |
+@@ -2362,7 +2422,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c |
5238 |
+ req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; |
5239 |
+ req->qtcb->bottom.io.service_class = FSF_CLASS_3; |
5240 |
+ req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) + |
5241 |
+- sizeof(fcp_dl_t); |
5242 |
++ sizeof(u32); |
5243 |
+ |
5244 |
+ sbale = zfcp_qdio_sbale_req(req); |
5245 |
+ sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE; |
5246 |
+@@ -2379,7 +2439,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c |
5247 |
+ zfcp_fsf_req_free(req); |
5248 |
+ req = NULL; |
5249 |
+ out: |
5250 |
+- spin_unlock(&adapter->req_q.lock); |
5251 |
++ spin_unlock(&adapter->req_q_lock); |
5252 |
+ return req; |
5253 |
+ } |
5254 |
+ |
5255 |
+@@ -2398,7 +2458,7 @@ static void zfcp_fsf_control_file_handle |
5256 |
+ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, |
5257 |
+ struct zfcp_fsf_cfdc *fsf_cfdc) |
5258 |
+ { |
5259 |
+- volatile struct qdio_buffer_element *sbale; |
5260 |
++ struct qdio_buffer_element *sbale; |
5261 |
+ struct zfcp_fsf_req *req = NULL; |
5262 |
+ struct fsf_qtcb_bottom_support *bottom; |
5263 |
+ int direction, retval = -EIO, bytes; |
5264 |
+@@ -2417,7 +2477,7 @@ struct zfcp_fsf_req *zfcp_fsf_control_fi |
5265 |
+ return ERR_PTR(-EINVAL); |
5266 |
+ } |
5267 |
+ |
5268 |
+- spin_lock_bh(&adapter->req_q.lock); |
5269 |
++ spin_lock_bh(&adapter->req_q_lock); |
5270 |
+ if (zfcp_fsf_req_sbal_get(adapter)) |
5271 |
+ goto out; |
5272 |
+ |
5273 |
+@@ -2447,7 +2507,7 @@ struct zfcp_fsf_req *zfcp_fsf_control_fi |
5274 |
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
5275 |
+ retval = zfcp_fsf_req_send(req); |
5276 |
+ out: |
5277 |
+- spin_unlock_bh(&adapter->req_q.lock); |
5278 |
++ spin_unlock_bh(&adapter->req_q_lock); |
5279 |
+ |
5280 |
+ if (!retval) { |
5281 |
+ wait_event(req->completion_wq, |
5282 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.h |
5283 |
+=================================================================== |
5284 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_fsf.h |
5285 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.h |
5286 |
+@@ -71,13 +71,6 @@ |
5287 |
+ #define FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED 0x00000041 |
5288 |
+ #define FSF_ELS_COMMAND_REJECTED 0x00000050 |
5289 |
+ #define FSF_GENERIC_COMMAND_REJECTED 0x00000051 |
5290 |
+-#define FSF_OPERATION_PARTIALLY_SUCCESSFUL 0x00000052 |
5291 |
+-#define FSF_AUTHORIZATION_FAILURE 0x00000053 |
5292 |
+-#define FSF_CFDC_ERROR_DETECTED 0x00000054 |
5293 |
+-#define FSF_CONTROL_FILE_UPDATE_ERROR 0x00000055 |
5294 |
+-#define FSF_CONTROL_FILE_TOO_LARGE 0x00000056 |
5295 |
+-#define FSF_ACCESS_CONFLICT_DETECTED 0x00000057 |
5296 |
+-#define FSF_CONFLICTS_OVERRULED 0x00000058 |
5297 |
+ #define FSF_PORT_BOXED 0x00000059 |
5298 |
+ #define FSF_LUN_BOXED 0x0000005A |
5299 |
+ #define FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE 0x0000005B |
5300 |
+@@ -85,9 +78,7 @@ |
5301 |
+ #define FSF_REQUEST_SIZE_TOO_LARGE 0x00000061 |
5302 |
+ #define FSF_RESPONSE_SIZE_TOO_LARGE 0x00000062 |
5303 |
+ #define FSF_SBAL_MISMATCH 0x00000063 |
5304 |
+-#define FSF_OPEN_PORT_WITHOUT_PRLI 0x00000064 |
5305 |
+ #define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD |
5306 |
+-#define FSF_FCP_RSP_AVAILABLE 0x000000AF |
5307 |
+ #define FSF_UNKNOWN_COMMAND 0x000000E2 |
5308 |
+ #define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3 |
5309 |
+ #define FSF_INVALID_COMMAND_OPTION 0x000000E5 |
5310 |
+@@ -102,20 +93,9 @@ |
5311 |
+ #define FSF_SQ_RETRY_IF_POSSIBLE 0x02 |
5312 |
+ #define FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED 0x03 |
5313 |
+ #define FSF_SQ_INVOKE_LINK_TEST_PROCEDURE 0x04 |
5314 |
+-#define FSF_SQ_ULP_PROGRAMMING_ERROR 0x05 |
5315 |
+ #define FSF_SQ_COMMAND_ABORTED 0x06 |
5316 |
+ #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 |
5317 |
+ |
5318 |
+-/* FSF status qualifier for CFDC commands */ |
5319 |
+-#define FSF_SQ_CFDC_HARDENED_ON_SE 0x00000000 |
5320 |
+-#define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 |
5321 |
+-#define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 |
5322 |
+-/* CFDC subtable codes */ |
5323 |
+-#define FSF_SQ_CFDC_SUBTABLE_OS 0x0001 |
5324 |
+-#define FSF_SQ_CFDC_SUBTABLE_PORT_WWPN 0x0002 |
5325 |
+-#define FSF_SQ_CFDC_SUBTABLE_PORT_DID 0x0003 |
5326 |
+-#define FSF_SQ_CFDC_SUBTABLE_LUN 0x0004 |
5327 |
+- |
5328 |
+ /* FSF status qualifier (most significant 4 bytes), local link down */ |
5329 |
+ #define FSF_PSQ_LINK_NO_LIGHT 0x00000004 |
5330 |
+ #define FSF_PSQ_LINK_WRAP_PLUG 0x00000008 |
5331 |
+@@ -145,7 +125,6 @@ |
5332 |
+ #define FSF_STATUS_READ_LINK_UP 0x00000006 |
5333 |
+ #define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009 |
5334 |
+ #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A |
5335 |
+-#define FSF_STATUS_READ_CFDC_HARDENED 0x0000000B |
5336 |
+ #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C |
5337 |
+ |
5338 |
+ /* status subtypes in status read buffer */ |
5339 |
+@@ -159,20 +138,9 @@ |
5340 |
+ |
5341 |
+ /* status subtypes for unsolicited status notification lost */ |
5342 |
+ #define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 |
5343 |
+-#define FSF_STATUS_READ_SUB_SENSE_DATA 0x00000002 |
5344 |
+-#define FSF_STATUS_READ_SUB_LINK_STATUS 0x00000004 |
5345 |
+-#define FSF_STATUS_READ_SUB_PORT_CLOSED 0x00000008 |
5346 |
+-#define FSF_STATUS_READ_SUB_BIT_ERROR_THRESHOLD 0x00000010 |
5347 |
+ #define FSF_STATUS_READ_SUB_ACT_UPDATED 0x00000020 |
5348 |
+-#define FSF_STATUS_READ_SUB_ACT_HARDENED 0x00000040 |
5349 |
+-#define FSF_STATUS_READ_SUB_FEATURE_UPDATE_ALERT 0x00000080 |
5350 |
+- |
5351 |
+-/* status subtypes for CFDC */ |
5352 |
+-#define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE 0x00000002 |
5353 |
+-#define FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE2 0x0000000F |
5354 |
+ |
5355 |
+ /* topologie that is detected by the adapter */ |
5356 |
+-#define FSF_TOPO_ERROR 0x00000000 |
5357 |
+ #define FSF_TOPO_P2P 0x00000001 |
5358 |
+ #define FSF_TOPO_FABRIC 0x00000002 |
5359 |
+ #define FSF_TOPO_AL 0x00000003 |
5360 |
+@@ -180,17 +148,13 @@ |
5361 |
+ /* data direction for FCP commands */ |
5362 |
+ #define FSF_DATADIR_WRITE 0x00000001 |
5363 |
+ #define FSF_DATADIR_READ 0x00000002 |
5364 |
+-#define FSF_DATADIR_READ_WRITE 0x00000003 |
5365 |
+ #define FSF_DATADIR_CMND 0x00000004 |
5366 |
+ |
5367 |
+ /* fc service class */ |
5368 |
+-#define FSF_CLASS_1 0x00000001 |
5369 |
+-#define FSF_CLASS_2 0x00000002 |
5370 |
+ #define FSF_CLASS_3 0x00000003 |
5371 |
+ |
5372 |
+ /* SBAL chaining */ |
5373 |
+ #define FSF_MAX_SBALS_PER_REQ 36 |
5374 |
+-#define FSF_MAX_SBALS_PER_ELS_REQ 2 |
5375 |
+ |
5376 |
+ /* logging space behind QTCB */ |
5377 |
+ #define FSF_QTCB_LOG_SIZE 1024 |
5378 |
+@@ -200,50 +164,16 @@ |
5379 |
+ #define FSF_FEATURE_LUN_SHARING 0x00000004 |
5380 |
+ #define FSF_FEATURE_NOTIFICATION_LOST 0x00000008 |
5381 |
+ #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 |
5382 |
+-#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 |
5383 |
+ #define FSF_FEATURE_UPDATE_ALERT 0x00000100 |
5384 |
+ #define FSF_FEATURE_MEASUREMENT_DATA 0x00000200 |
5385 |
+ |
5386 |
+ /* host connection features */ |
5387 |
+ #define FSF_FEATURE_NPIV_MODE 0x00000001 |
5388 |
+-#define FSF_FEATURE_VM_ASSIGNED_WWPN 0x00000002 |
5389 |
+ |
5390 |
+ /* option */ |
5391 |
+ #define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 |
5392 |
+-#define FSF_OPEN_LUN_REPLICATE_SENSE 0x00000002 |
5393 |
+- |
5394 |
+-/* adapter types */ |
5395 |
+-#define FSF_ADAPTER_TYPE_FICON 0x00000001 |
5396 |
+-#define FSF_ADAPTER_TYPE_FICON_EXPRESS 0x00000002 |
5397 |
+- |
5398 |
+-/* port types */ |
5399 |
+-#define FSF_HBA_PORTTYPE_UNKNOWN 0x00000001 |
5400 |
+-#define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003 |
5401 |
+-#define FSF_HBA_PORTTYPE_NPORT 0x00000005 |
5402 |
+-#define FSF_HBA_PORTTYPE_PTP 0x00000021 |
5403 |
+-/* following are not defined and used by FSF Spec |
5404 |
+- but are additionally defined by FC-HBA */ |
5405 |
+-#define FSF_HBA_PORTTYPE_OTHER 0x00000002 |
5406 |
+-#define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003 |
5407 |
+-#define FSF_HBA_PORTTYPE_NLPORT 0x00000006 |
5408 |
+-#define FSF_HBA_PORTTYPE_FLPORT 0x00000007 |
5409 |
+-#define FSF_HBA_PORTTYPE_FPORT 0x00000008 |
5410 |
+-#define FSF_HBA_PORTTYPE_LPORT 0x00000020 |
5411 |
+- |
5412 |
+-/* port states */ |
5413 |
+-#define FSF_HBA_PORTSTATE_UNKNOWN 0x00000001 |
5414 |
+-#define FSF_HBA_PORTSTATE_ONLINE 0x00000002 |
5415 |
+-#define FSF_HBA_PORTSTATE_OFFLINE 0x00000003 |
5416 |
+-#define FSF_HBA_PORTSTATE_LINKDOWN 0x00000006 |
5417 |
+-#define FSF_HBA_PORTSTATE_ERROR 0x00000007 |
5418 |
+- |
5419 |
+-/* IO states of adapter */ |
5420 |
+-#define FSF_IOSTAT_NPORT_RJT 0x00000004 |
5421 |
+-#define FSF_IOSTAT_FABRIC_RJT 0x00000005 |
5422 |
+-#define FSF_IOSTAT_LS_RJT 0x00000009 |
5423 |
+ |
5424 |
+ /* open LUN access flags*/ |
5425 |
+-#define FSF_UNIT_ACCESS_OPEN_LUN_ALLOWED 0x01000000 |
5426 |
+ #define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000 |
5427 |
+ #define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000 |
5428 |
+ |
5429 |
+@@ -265,11 +195,6 @@ struct fsf_queue_designator { |
5430 |
+ u32 res1; |
5431 |
+ } __attribute__ ((packed)); |
5432 |
+ |
5433 |
+-struct fsf_port_closed_payload { |
5434 |
+- struct fsf_queue_designator queue_designator; |
5435 |
+- u32 port_handle; |
5436 |
+-} __attribute__ ((packed)); |
5437 |
+- |
5438 |
+ struct fsf_bit_error_payload { |
5439 |
+ u32 res1; |
5440 |
+ u32 link_failure_error_count; |
5441 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_qdio.c |
5442 |
+=================================================================== |
5443 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_qdio.c |
5444 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_qdio.c |
5445 |
+@@ -28,7 +28,7 @@ static int zfcp_qdio_buffers_enqueue(str |
5446 |
+ return 0; |
5447 |
+ } |
5448 |
+ |
5449 |
+-static volatile struct qdio_buffer_element * |
5450 |
++static struct qdio_buffer_element * |
5451 |
+ zfcp_qdio_sbale(struct zfcp_qdio_queue *q, int sbal_idx, int sbale_idx) |
5452 |
+ { |
5453 |
+ return &q->sbal[sbal_idx]->element[sbale_idx]; |
5454 |
+@@ -57,7 +57,7 @@ void zfcp_qdio_free(struct zfcp_adapter |
5455 |
+ |
5456 |
+ static void zfcp_qdio_handler_error(struct zfcp_adapter *adapter, u8 id) |
5457 |
+ { |
5458 |
+- dev_warn(&adapter->ccw_device->dev, "QDIO problem occurred.\n"); |
5459 |
++ dev_warn(&adapter->ccw_device->dev, "A QDIO problem occurred\n"); |
5460 |
+ |
5461 |
+ zfcp_erp_adapter_reopen(adapter, |
5462 |
+ ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | |
5463 |
+@@ -145,7 +145,7 @@ static void zfcp_qdio_int_resp(struct cc |
5464 |
+ { |
5465 |
+ struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; |
5466 |
+ struct zfcp_qdio_queue *queue = &adapter->resp_q; |
5467 |
+- volatile struct qdio_buffer_element *sbale; |
5468 |
++ struct qdio_buffer_element *sbale; |
5469 |
+ int sbal_idx, sbale_idx, sbal_no; |
5470 |
+ |
5471 |
+ if (unlikely(qdio_err)) { |
5472 |
+@@ -174,8 +174,8 @@ static void zfcp_qdio_int_resp(struct cc |
5473 |
+ |
5474 |
+ if (unlikely(!(sbale->flags & SBAL_FLAGS_LAST_ENTRY))) |
5475 |
+ dev_warn(&adapter->ccw_device->dev, |
5476 |
+- "Protocol violation by adapter. " |
5477 |
+- "Continuing operations.\n"); |
5478 |
++ "A QDIO protocol error occurred, " |
5479 |
++ "operations continue\n"); |
5480 |
+ } |
5481 |
+ |
5482 |
+ /* |
5483 |
+@@ -190,8 +190,7 @@ static void zfcp_qdio_int_resp(struct cc |
5484 |
+ * @fsf_req: pointer to struct fsf_req |
5485 |
+ * Returns: pointer to qdio_buffer_element (SBALE) structure |
5486 |
+ */ |
5487 |
+-volatile struct qdio_buffer_element * |
5488 |
+-zfcp_qdio_sbale_req(struct zfcp_fsf_req *req) |
5489 |
++struct qdio_buffer_element *zfcp_qdio_sbale_req(struct zfcp_fsf_req *req) |
5490 |
+ { |
5491 |
+ return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, 0); |
5492 |
+ } |
5493 |
+@@ -201,8 +200,7 @@ zfcp_qdio_sbale_req(struct zfcp_fsf_req |
5494 |
+ * @fsf_req: pointer to struct fsf_req |
5495 |
+ * Returns: pointer to qdio_buffer_element (SBALE) structure |
5496 |
+ */ |
5497 |
+-volatile struct qdio_buffer_element * |
5498 |
+-zfcp_qdio_sbale_curr(struct zfcp_fsf_req *req) |
5499 |
++struct qdio_buffer_element *zfcp_qdio_sbale_curr(struct zfcp_fsf_req *req) |
5500 |
+ { |
5501 |
+ return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, |
5502 |
+ req->sbale_curr); |
5503 |
+@@ -216,10 +214,10 @@ static void zfcp_qdio_sbal_limit(struct |
5504 |
+ % QDIO_MAX_BUFFERS_PER_Q; |
5505 |
+ } |
5506 |
+ |
5507 |
+-static volatile struct qdio_buffer_element * |
5508 |
++static struct qdio_buffer_element * |
5509 |
+ zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) |
5510 |
+ { |
5511 |
+- volatile struct qdio_buffer_element *sbale; |
5512 |
++ struct qdio_buffer_element *sbale; |
5513 |
+ |
5514 |
+ /* set last entry flag in current SBALE of current SBAL */ |
5515 |
+ sbale = zfcp_qdio_sbale_curr(fsf_req); |
5516 |
+@@ -250,7 +248,7 @@ zfcp_qdio_sbal_chain(struct zfcp_fsf_req |
5517 |
+ return sbale; |
5518 |
+ } |
5519 |
+ |
5520 |
+-static volatile struct qdio_buffer_element * |
5521 |
++static struct qdio_buffer_element * |
5522 |
+ zfcp_qdio_sbale_next(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) |
5523 |
+ { |
5524 |
+ if (fsf_req->sbale_curr == ZFCP_LAST_SBALE_PER_SBAL) |
5525 |
+@@ -273,7 +271,7 @@ static int zfcp_qdio_fill_sbals(struct z |
5526 |
+ unsigned int sbtype, void *start_addr, |
5527 |
+ unsigned int total_length) |
5528 |
+ { |
5529 |
+- volatile struct qdio_buffer_element *sbale; |
5530 |
++ struct qdio_buffer_element *sbale; |
5531 |
+ unsigned long remaining, length; |
5532 |
+ void *addr; |
5533 |
+ |
5534 |
+@@ -282,6 +280,7 @@ static int zfcp_qdio_fill_sbals(struct z |
5535 |
+ addr += length, remaining -= length) { |
5536 |
+ sbale = zfcp_qdio_sbale_next(fsf_req, sbtype); |
5537 |
+ if (!sbale) { |
5538 |
++ atomic_inc(&fsf_req->adapter->qdio_outb_full); |
5539 |
+ zfcp_qdio_undo_sbals(fsf_req); |
5540 |
+ return -EINVAL; |
5541 |
+ } |
5542 |
+@@ -307,7 +306,7 @@ static int zfcp_qdio_fill_sbals(struct z |
5543 |
+ int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, |
5544 |
+ struct scatterlist *sg, int max_sbals) |
5545 |
+ { |
5546 |
+- volatile struct qdio_buffer_element *sbale; |
5547 |
++ struct qdio_buffer_element *sbale; |
5548 |
+ int retval, bytes = 0; |
5549 |
+ |
5550 |
+ /* figure out last allowed SBAL */ |
5551 |
+@@ -344,10 +343,10 @@ int zfcp_qdio_send(struct zfcp_fsf_req * |
5552 |
+ int first = fsf_req->sbal_first; |
5553 |
+ int count = fsf_req->sbal_number; |
5554 |
+ int retval, pci, pci_batch; |
5555 |
+- volatile struct qdio_buffer_element *sbale; |
5556 |
++ struct qdio_buffer_element *sbale; |
5557 |
+ |
5558 |
+ /* acknowledgements for transferred buffers */ |
5559 |
+- pci_batch = req_q->pci_batch + count; |
5560 |
++ pci_batch = adapter->req_q_pci_batch + count; |
5561 |
+ if (unlikely(pci_batch >= ZFCP_QDIO_PCI_INTERVAL)) { |
5562 |
+ pci_batch %= ZFCP_QDIO_PCI_INTERVAL; |
5563 |
+ pci = first + count - (pci_batch + 1); |
5564 |
+@@ -367,7 +366,7 @@ int zfcp_qdio_send(struct zfcp_fsf_req * |
5565 |
+ atomic_sub(count, &req_q->count); |
5566 |
+ req_q->first += count; |
5567 |
+ req_q->first %= QDIO_MAX_BUFFERS_PER_Q; |
5568 |
+- req_q->pci_batch = pci_batch; |
5569 |
++ adapter->req_q_pci_batch = pci_batch; |
5570 |
+ return 0; |
5571 |
+ } |
5572 |
+ |
5573 |
+@@ -418,14 +417,14 @@ void zfcp_qdio_close(struct zfcp_adapter |
5574 |
+ struct zfcp_qdio_queue *req_q; |
5575 |
+ int first, count; |
5576 |
+ |
5577 |
+- if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) |
5578 |
++ if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) |
5579 |
+ return; |
5580 |
+ |
5581 |
+ /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ |
5582 |
+ req_q = &adapter->req_q; |
5583 |
+- spin_lock_bh(&req_q->lock); |
5584 |
++ spin_lock_bh(&adapter->req_q_lock); |
5585 |
+ atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); |
5586 |
+- spin_unlock_bh(&req_q->lock); |
5587 |
++ spin_unlock_bh(&adapter->req_q_lock); |
5588 |
+ |
5589 |
+ qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); |
5590 |
+ |
5591 |
+@@ -438,7 +437,7 @@ void zfcp_qdio_close(struct zfcp_adapter |
5592 |
+ } |
5593 |
+ req_q->first = 0; |
5594 |
+ atomic_set(&req_q->count, 0); |
5595 |
+- req_q->pci_batch = 0; |
5596 |
++ adapter->req_q_pci_batch = 0; |
5597 |
+ adapter->resp_q.first = 0; |
5598 |
+ atomic_set(&adapter->resp_q.count, 0); |
5599 |
+ } |
5600 |
+@@ -450,23 +449,17 @@ void zfcp_qdio_close(struct zfcp_adapter |
5601 |
+ */ |
5602 |
+ int zfcp_qdio_open(struct zfcp_adapter *adapter) |
5603 |
+ { |
5604 |
+- volatile struct qdio_buffer_element *sbale; |
5605 |
++ struct qdio_buffer_element *sbale; |
5606 |
+ int cc; |
5607 |
+ |
5608 |
+- if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) |
5609 |
++ if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP) |
5610 |
+ return -EIO; |
5611 |
+ |
5612 |
+- if (qdio_establish(&adapter->qdio_init_data)) { |
5613 |
+- dev_err(&adapter->ccw_device->dev, |
5614 |
+- "Establish of QDIO queues failed.\n"); |
5615 |
+- return -EIO; |
5616 |
+- } |
5617 |
++ if (qdio_establish(&adapter->qdio_init_data)) |
5618 |
++ goto failed_establish; |
5619 |
+ |
5620 |
+- if (qdio_activate(adapter->ccw_device)) { |
5621 |
+- dev_err(&adapter->ccw_device->dev, |
5622 |
+- "Activate of QDIO queues failed.\n"); |
5623 |
++ if (qdio_activate(adapter->ccw_device)) |
5624 |
+ goto failed_qdio; |
5625 |
+- } |
5626 |
+ |
5627 |
+ for (cc = 0; cc < QDIO_MAX_BUFFERS_PER_Q; cc++) { |
5628 |
+ sbale = &(adapter->resp_q.sbal[cc]->element[0]); |
5629 |
+@@ -476,20 +469,20 @@ int zfcp_qdio_open(struct zfcp_adapter * |
5630 |
+ } |
5631 |
+ |
5632 |
+ if (do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_INPUT, 0, 0, |
5633 |
+- QDIO_MAX_BUFFERS_PER_Q)) { |
5634 |
+- dev_err(&adapter->ccw_device->dev, |
5635 |
+- "Init of QDIO response queue failed.\n"); |
5636 |
++ QDIO_MAX_BUFFERS_PER_Q)) |
5637 |
+ goto failed_qdio; |
5638 |
+- } |
5639 |
+ |
5640 |
+ /* set index of first avalable SBALS / number of available SBALS */ |
5641 |
+ adapter->req_q.first = 0; |
5642 |
+ atomic_set(&adapter->req_q.count, QDIO_MAX_BUFFERS_PER_Q); |
5643 |
+- adapter->req_q.pci_batch = 0; |
5644 |
++ adapter->req_q_pci_batch = 0; |
5645 |
+ |
5646 |
+ return 0; |
5647 |
+ |
5648 |
+ failed_qdio: |
5649 |
+ qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); |
5650 |
++failed_establish: |
5651 |
++ dev_err(&adapter->ccw_device->dev, |
5652 |
++ "Setting up the QDIO connection to the FCP adapter failed\n"); |
5653 |
+ return -EIO; |
5654 |
+ } |
5655 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_scsi.c |
5656 |
+=================================================================== |
5657 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_scsi.c |
5658 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_scsi.c |
5659 |
+@@ -21,31 +21,13 @@ char *zfcp_get_fcp_sns_info_ptr(struct f |
5660 |
+ return fcp_sns_info_ptr; |
5661 |
+ } |
5662 |
+ |
5663 |
+-void zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, fcp_dl_t fcp_dl) |
5664 |
+-{ |
5665 |
+- fcp_dl_t *fcp_dl_ptr; |
5666 |
+- |
5667 |
+- /* |
5668 |
+- * fcp_dl_addr = start address of fcp_cmnd structure + |
5669 |
+- * size of fixed part + size of dynamically sized add_dcp_cdb field |
5670 |
+- * SEE FCP-2 documentation |
5671 |
+- */ |
5672 |
+- fcp_dl_ptr = (fcp_dl_t *) ((unsigned char *) &fcp_cmd[1] + |
5673 |
+- (fcp_cmd->add_fcp_cdb_length << 2)); |
5674 |
+- *fcp_dl_ptr = fcp_dl; |
5675 |
+-} |
5676 |
+- |
5677 |
+ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) |
5678 |
+ { |
5679 |
+ struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; |
5680 |
+- WARN_ON(!unit); |
5681 |
+- if (unit) { |
5682 |
+- atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); |
5683 |
+- sdpnt->hostdata = NULL; |
5684 |
+- unit->device = NULL; |
5685 |
+- zfcp_erp_unit_failed(unit, 12, NULL); |
5686 |
+- zfcp_unit_put(unit); |
5687 |
+- } |
5688 |
++ atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); |
5689 |
++ unit->device = NULL; |
5690 |
++ zfcp_erp_unit_failed(unit, 12, NULL); |
5691 |
++ zfcp_unit_put(unit); |
5692 |
+ } |
5693 |
+ |
5694 |
+ static int zfcp_scsi_slave_configure(struct scsi_device *sdp) |
5695 |
+@@ -119,13 +101,17 @@ static struct zfcp_unit *zfcp_unit_looku |
5696 |
+ { |
5697 |
+ struct zfcp_port *port; |
5698 |
+ struct zfcp_unit *unit; |
5699 |
++ int scsi_lun; |
5700 |
+ |
5701 |
+ list_for_each_entry(port, &adapter->port_list_head, list) { |
5702 |
+ if (!port->rport || (id != port->rport->scsi_target_id)) |
5703 |
+ continue; |
5704 |
+- list_for_each_entry(unit, &port->unit_list_head, list) |
5705 |
+- if (lun == unit->scsi_lun) |
5706 |
++ list_for_each_entry(unit, &port->unit_list_head, list) { |
5707 |
++ scsi_lun = scsilun_to_int( |
5708 |
++ (struct scsi_lun *)&unit->fcp_lun); |
5709 |
++ if (lun == scsi_lun) |
5710 |
+ return unit; |
5711 |
++ } |
5712 |
+ } |
5713 |
+ |
5714 |
+ return NULL; |
5715 |
+@@ -183,7 +169,6 @@ static int zfcp_scsi_eh_abort_handler(st |
5716 |
+ return retval; |
5717 |
+ } |
5718 |
+ fsf_req->data = NULL; |
5719 |
+- fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTING; |
5720 |
+ |
5721 |
+ /* don't access old fsf_req after releasing the abort_lock */ |
5722 |
+ write_unlock_irqrestore(&adapter->abort_lock, flags); |
5723 |
+@@ -294,7 +279,8 @@ int zfcp_adapter_scsi_register(struct zf |
5724 |
+ sizeof (struct zfcp_adapter *)); |
5725 |
+ if (!adapter->scsi_host) { |
5726 |
+ dev_err(&adapter->ccw_device->dev, |
5727 |
+- "registration with SCSI stack failed."); |
5728 |
++ "Registering the FCP device with the " |
5729 |
++ "SCSI stack failed\n"); |
5730 |
+ return -EIO; |
5731 |
+ } |
5732 |
+ |
5733 |
+@@ -312,7 +298,6 @@ int zfcp_adapter_scsi_register(struct zf |
5734 |
+ scsi_host_put(adapter->scsi_host); |
5735 |
+ return -EIO; |
5736 |
+ } |
5737 |
+- atomic_set_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status); |
5738 |
+ |
5739 |
+ return 0; |
5740 |
+ } |
5741 |
+@@ -336,7 +321,6 @@ void zfcp_adapter_scsi_unregister(struct |
5742 |
+ scsi_remove_host(shost); |
5743 |
+ scsi_host_put(shost); |
5744 |
+ adapter->scsi_host = NULL; |
5745 |
+- atomic_clear_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status); |
5746 |
+ |
5747 |
+ return; |
5748 |
+ } |
5749 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_sysfs.c |
5750 |
+=================================================================== |
5751 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_sysfs.c |
5752 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_sysfs.c |
5753 |
+@@ -26,9 +26,9 @@ static ZFCP_DEV_ATTR(_feat, _name, S_IRU |
5754 |
+ ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, status, "0x%08x\n", |
5755 |
+ atomic_read(&adapter->status)); |
5756 |
+ ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_wwnn, "0x%016llx\n", |
5757 |
+- adapter->peer_wwnn); |
5758 |
++ (unsigned long long) adapter->peer_wwnn); |
5759 |
+ ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_wwpn, "0x%016llx\n", |
5760 |
+- adapter->peer_wwpn); |
5761 |
++ (unsigned long long) adapter->peer_wwpn); |
5762 |
+ ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_d_id, "0x%06x\n", |
5763 |
+ adapter->peer_d_id); |
5764 |
+ ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, card_version, "0x%04x\n", |
5765 |
+@@ -135,8 +135,9 @@ static ssize_t zfcp_sysfs_port_remove_st |
5766 |
+ { |
5767 |
+ struct zfcp_adapter *adapter = dev_get_drvdata(dev); |
5768 |
+ struct zfcp_port *port; |
5769 |
+- wwn_t wwpn; |
5770 |
++ u64 wwpn; |
5771 |
+ int retval = 0; |
5772 |
++ LIST_HEAD(port_remove_lh); |
5773 |
+ |
5774 |
+ down(&zfcp_data.config_sema); |
5775 |
+ if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE) { |
5776 |
+@@ -144,7 +145,7 @@ static ssize_t zfcp_sysfs_port_remove_st |
5777 |
+ goto out; |
5778 |
+ } |
5779 |
+ |
5780 |
+- if (strict_strtoull(buf, 0, &wwpn)) { |
5781 |
++ if (strict_strtoull(buf, 0, (unsigned long long *) &wwpn)) { |
5782 |
+ retval = -EINVAL; |
5783 |
+ goto out; |
5784 |
+ } |
5785 |
+@@ -154,7 +155,7 @@ static ssize_t zfcp_sysfs_port_remove_st |
5786 |
+ if (port && (atomic_read(&port->refcount) == 0)) { |
5787 |
+ zfcp_port_get(port); |
5788 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); |
5789 |
+- list_move(&port->list, &adapter->port_remove_lh); |
5790 |
++ list_move(&port->list, &port_remove_lh); |
5791 |
+ } else |
5792 |
+ port = NULL; |
5793 |
+ write_unlock_irq(&zfcp_data.config_lock); |
5794 |
+@@ -200,7 +201,7 @@ static ssize_t zfcp_sysfs_unit_add_store |
5795 |
+ { |
5796 |
+ struct zfcp_port *port = dev_get_drvdata(dev); |
5797 |
+ struct zfcp_unit *unit; |
5798 |
+- fcp_lun_t fcp_lun; |
5799 |
++ u64 fcp_lun; |
5800 |
+ int retval = -EINVAL; |
5801 |
+ |
5802 |
+ down(&zfcp_data.config_sema); |
5803 |
+@@ -209,7 +210,7 @@ static ssize_t zfcp_sysfs_unit_add_store |
5804 |
+ goto out; |
5805 |
+ } |
5806 |
+ |
5807 |
+- if (strict_strtoull(buf, 0, &fcp_lun)) |
5808 |
++ if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) |
5809 |
+ goto out; |
5810 |
+ |
5811 |
+ unit = zfcp_unit_enqueue(port, fcp_lun); |
5812 |
+@@ -233,8 +234,9 @@ static ssize_t zfcp_sysfs_unit_remove_st |
5813 |
+ { |
5814 |
+ struct zfcp_port *port = dev_get_drvdata(dev); |
5815 |
+ struct zfcp_unit *unit; |
5816 |
+- fcp_lun_t fcp_lun; |
5817 |
++ u64 fcp_lun; |
5818 |
+ int retval = 0; |
5819 |
++ LIST_HEAD(unit_remove_lh); |
5820 |
+ |
5821 |
+ down(&zfcp_data.config_sema); |
5822 |
+ if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE) { |
5823 |
+@@ -242,7 +244,7 @@ static ssize_t zfcp_sysfs_unit_remove_st |
5824 |
+ goto out; |
5825 |
+ } |
5826 |
+ |
5827 |
+- if (strict_strtoull(buf, 0, &fcp_lun)) { |
5828 |
++ if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) { |
5829 |
+ retval = -EINVAL; |
5830 |
+ goto out; |
5831 |
+ } |
5832 |
+@@ -252,7 +254,7 @@ static ssize_t zfcp_sysfs_unit_remove_st |
5833 |
+ if (unit && (atomic_read(&unit->refcount) == 0)) { |
5834 |
+ zfcp_unit_get(unit); |
5835 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status); |
5836 |
+- list_move(&unit->list, &port->unit_remove_lh); |
5837 |
++ list_move(&unit->list, &unit_remove_lh); |
5838 |
+ } else |
5839 |
+ unit = NULL; |
5840 |
+ |
5841 |
+@@ -273,22 +275,7 @@ out: |
5842 |
+ } |
5843 |
+ static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); |
5844 |
+ |
5845 |
+-static struct attribute *zfcp_port_ns_attrs[] = { |
5846 |
+- &dev_attr_port_failed.attr, |
5847 |
+- &dev_attr_port_in_recovery.attr, |
5848 |
+- &dev_attr_port_status.attr, |
5849 |
+- &dev_attr_port_access_denied.attr, |
5850 |
+- NULL |
5851 |
+-}; |
5852 |
+- |
5853 |
+-/** |
5854 |
+- * zfcp_sysfs_ns_port_attrs - sysfs attributes for nameserver |
5855 |
+- */ |
5856 |
+-struct attribute_group zfcp_sysfs_ns_port_attrs = { |
5857 |
+- .attrs = zfcp_port_ns_attrs, |
5858 |
+-}; |
5859 |
+- |
5860 |
+-static struct attribute *zfcp_port_no_ns_attrs[] = { |
5861 |
++static struct attribute *zfcp_port_attrs[] = { |
5862 |
+ &dev_attr_unit_add.attr, |
5863 |
+ &dev_attr_unit_remove.attr, |
5864 |
+ &dev_attr_port_failed.attr, |
5865 |
+@@ -302,7 +289,7 @@ static struct attribute *zfcp_port_no_ns |
5866 |
+ * zfcp_sysfs_port_attrs - sysfs attributes for all other ports |
5867 |
+ */ |
5868 |
+ struct attribute_group zfcp_sysfs_port_attrs = { |
5869 |
+- .attrs = zfcp_port_no_ns_attrs, |
5870 |
++ .attrs = zfcp_port_attrs, |
5871 |
+ }; |
5872 |
+ |
5873 |
+ static struct attribute *zfcp_unit_attrs[] = { |
5874 |
+@@ -395,8 +382,10 @@ static DEVICE_ATTR(_name, S_IRUGO, zfcp_ |
5875 |
+ |
5876 |
+ ZFCP_DEFINE_SCSI_ATTR(hba_id, "%s\n", |
5877 |
+ unit->port->adapter->ccw_device->dev.bus_id); |
5878 |
+-ZFCP_DEFINE_SCSI_ATTR(wwpn, "0x%016llx\n", unit->port->wwpn); |
5879 |
+-ZFCP_DEFINE_SCSI_ATTR(fcp_lun, "0x%016llx\n", unit->fcp_lun); |
5880 |
++ZFCP_DEFINE_SCSI_ATTR(wwpn, "0x%016llx\n", |
5881 |
++ (unsigned long long) unit->port->wwpn); |
5882 |
++ZFCP_DEFINE_SCSI_ATTR(fcp_lun, "0x%016llx\n", |
5883 |
++ (unsigned long long) unit->fcp_lun); |
5884 |
+ |
5885 |
+ struct device_attribute *zfcp_sysfs_sdev_attrs[] = { |
5886 |
+ &dev_attr_fcp_lun, |
5887 |
+@@ -487,10 +476,23 @@ ZFCP_SHOST_ATTR(megabytes, "%llu %llu\n" |
5888 |
+ ZFCP_SHOST_ATTR(seconds_active, "%llu\n", |
5889 |
+ (unsigned long long) stat_info.seconds_act); |
5890 |
+ |
5891 |
++static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev, |
5892 |
++ struct device_attribute *attr, |
5893 |
++ char *buf) |
5894 |
++{ |
5895 |
++ struct Scsi_Host *scsi_host = class_to_shost(dev); |
5896 |
++ struct zfcp_adapter *adapter = |
5897 |
++ (struct zfcp_adapter *) scsi_host->hostdata[0]; |
5898 |
++ |
5899 |
++ return sprintf(buf, "%d\n", atomic_read(&adapter->qdio_outb_full)); |
5900 |
++} |
5901 |
++static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); |
5902 |
++ |
5903 |
+ struct device_attribute *zfcp_sysfs_shost_attrs[] = { |
5904 |
+ &dev_attr_utilization, |
5905 |
+ &dev_attr_requests, |
5906 |
+ &dev_attr_megabytes, |
5907 |
+ &dev_attr_seconds_active, |
5908 |
++ &dev_attr_queue_full, |
5909 |
+ NULL |
5910 |
+ }; |
5911 |
|
5912 |
Added: genpatches-2.6/trunk/2.6.27/1710_s390-01.patch |
5913 |
=================================================================== |
5914 |
--- genpatches-2.6/trunk/2.6.27/1710_s390-01.patch (rev 0) |
5915 |
+++ genpatches-2.6/trunk/2.6.27/1710_s390-01.patch 2008-12-30 20:30:00 UTC (rev 1452) |
5916 |
@@ -0,0 +1,6971 @@ |
5917 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/Kconfig |
5918 |
+=================================================================== |
5919 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/Kconfig |
5920 |
++++ linux-2.6.27-gentoo-r7/arch/s390/Kconfig |
5921 |
+@@ -222,6 +222,14 @@ config MARCH_Z9_109 |
5922 |
+ Class (z9 BC). The kernel will be slightly faster but will not |
5923 |
+ work on older machines such as the z990, z890, z900, and z800. |
5924 |
+ |
5925 |
++config MARCH_Z10 |
5926 |
++ bool "IBM System z10" |
5927 |
++ help |
5928 |
++ Select this to enable optimizations for IBM System z10. The |
5929 |
++ kernel will be slightly faster but will not work on older |
5930 |
++ machines such as the z990, z890, z900, z800, z9-109, z9-ec |
5931 |
++ and z9-bc. |
5932 |
++ |
5933 |
+ endchoice |
5934 |
+ |
5935 |
+ config PACK_STACK |
5936 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/Makefile |
5937 |
+=================================================================== |
5938 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/Makefile |
5939 |
++++ linux-2.6.27-gentoo-r7/arch/s390/Makefile |
5940 |
+@@ -34,6 +34,7 @@ cflags-$(CONFIG_MARCH_G5) += $(call cc |
5941 |
+ cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) |
5942 |
+ cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) |
5943 |
+ cflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109) |
5944 |
++cflags-$(CONFIG_MARCH_Z10) += $(call cc-option,-march=z10) |
5945 |
+ |
5946 |
+ #KBUILD_IMAGE is necessary for make rpm |
5947 |
+ KBUILD_IMAGE :=arch/s390/boot/image |
5948 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/appldata/appldata.h |
5949 |
+=================================================================== |
5950 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/appldata/appldata.h |
5951 |
++++ linux-2.6.27-gentoo-r7/arch/s390/appldata/appldata.h |
5952 |
+@@ -26,10 +26,6 @@ |
5953 |
+ #define CTL_APPLDATA_NET_SUM 2125 |
5954 |
+ #define CTL_APPLDATA_PROC 2126 |
5955 |
+ |
5956 |
+-#define P_INFO(x...) printk(KERN_INFO MY_PRINT_NAME " info: " x) |
5957 |
+-#define P_ERROR(x...) printk(KERN_ERR MY_PRINT_NAME " error: " x) |
5958 |
+-#define P_WARNING(x...) printk(KERN_WARNING MY_PRINT_NAME " status: " x) |
5959 |
+- |
5960 |
+ struct appldata_ops { |
5961 |
+ struct list_head list; |
5962 |
+ struct ctl_table_header *sysctl_header; |
5963 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/appldata/appldata_base.c |
5964 |
+=================================================================== |
5965 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/appldata/appldata_base.c |
5966 |
++++ linux-2.6.27-gentoo-r7/arch/s390/appldata/appldata_base.c |
5967 |
+@@ -10,6 +10,9 @@ |
5968 |
+ * Author: Gerald Schaefer <gerald.schaefer@××××××.com> |
5969 |
+ */ |
5970 |
+ |
5971 |
++#define KMSG_COMPONENT "appldata" |
5972 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
5973 |
++ |
5974 |
+ #include <linux/module.h> |
5975 |
+ #include <linux/init.h> |
5976 |
+ #include <linux/slab.h> |
5977 |
+@@ -32,7 +35,6 @@ |
5978 |
+ #include "appldata.h" |
5979 |
+ |
5980 |
+ |
5981 |
+-#define MY_PRINT_NAME "appldata" /* for debug messages, etc. */ |
5982 |
+ #define APPLDATA_CPU_INTERVAL 10000 /* default (CPU) time for |
5983 |
+ sampling interval in |
5984 |
+ milliseconds */ |
5985 |
+@@ -390,8 +392,8 @@ appldata_generic_handler(ctl_table *ctl, |
5986 |
+ (unsigned long) ops->data, ops->size, |
5987 |
+ ops->mod_lvl); |
5988 |
+ if (rc != 0) { |
5989 |
+- P_ERROR("START DIAG 0xDC for %s failed, " |
5990 |
+- "return code: %d\n", ops->name, rc); |
5991 |
++ pr_err("Starting the data collection for %s " |
5992 |
++ "failed with rc=%d\n", ops->name, rc); |
5993 |
+ module_put(ops->owner); |
5994 |
+ } else |
5995 |
+ ops->active = 1; |
5996 |
+@@ -401,8 +403,8 @@ appldata_generic_handler(ctl_table *ctl, |
5997 |
+ (unsigned long) ops->data, ops->size, |
5998 |
+ ops->mod_lvl); |
5999 |
+ if (rc != 0) |
6000 |
+- P_ERROR("STOP DIAG 0xDC for %s failed, " |
6001 |
+- "return code: %d\n", ops->name, rc); |
6002 |
++ pr_err("Stopping the data collection for %s " |
6003 |
++ "failed with rc=%d\n", ops->name, rc); |
6004 |
+ module_put(ops->owner); |
6005 |
+ } |
6006 |
+ spin_unlock(&appldata_ops_lock); |
6007 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/appldata/appldata_os.c |
6008 |
+=================================================================== |
6009 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/appldata/appldata_os.c |
6010 |
++++ linux-2.6.27-gentoo-r7/arch/s390/appldata/appldata_os.c |
6011 |
+@@ -9,6 +9,9 @@ |
6012 |
+ * Author: Gerald Schaefer <gerald.schaefer@××××××.com> |
6013 |
+ */ |
6014 |
+ |
6015 |
++#define KMSG_COMPONENT "appldata" |
6016 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6017 |
++ |
6018 |
+ #include <linux/module.h> |
6019 |
+ #include <linux/init.h> |
6020 |
+ #include <linux/slab.h> |
6021 |
+@@ -22,7 +25,6 @@ |
6022 |
+ #include "appldata.h" |
6023 |
+ |
6024 |
+ |
6025 |
+-#define MY_PRINT_NAME "appldata_os" /* for debug messages, etc. */ |
6026 |
+ #define LOAD_INT(x) ((x) >> FSHIFT) |
6027 |
+ #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) |
6028 |
+ |
6029 |
+@@ -143,21 +145,16 @@ static void appldata_get_os_data(void *d |
6030 |
+ (unsigned long) ops.data, new_size, |
6031 |
+ ops.mod_lvl); |
6032 |
+ if (rc != 0) |
6033 |
+- P_ERROR("os: START NEW DIAG 0xDC failed, " |
6034 |
+- "return code: %d, new size = %i\n", rc, |
6035 |
+- new_size); |
6036 |
++ pr_err("Starting a new OS data collection " |
6037 |
++ "failed with rc=%d\n", rc); |
6038 |
+ |
6039 |
+ rc = appldata_diag(APPLDATA_RECORD_OS_ID, |
6040 |
+ APPLDATA_STOP_REC, |
6041 |
+ (unsigned long) ops.data, ops.size, |
6042 |
+ ops.mod_lvl); |
6043 |
+ if (rc != 0) |
6044 |
+- P_ERROR("os: STOP OLD DIAG 0xDC failed, " |
6045 |
+- "return code: %d, old size = %i\n", rc, |
6046 |
+- ops.size); |
6047 |
+- else |
6048 |
+- P_INFO("os: old record size = %i stopped\n", |
6049 |
+- ops.size); |
6050 |
++ pr_err("Stopping a faulty OS data " |
6051 |
++ "collection failed with rc=%d\n", rc); |
6052 |
+ } |
6053 |
+ ops.size = new_size; |
6054 |
+ } |
6055 |
+@@ -178,8 +175,8 @@ static int __init appldata_os_init(void) |
6056 |
+ max_size = sizeof(struct appldata_os_data) + |
6057 |
+ (NR_CPUS * sizeof(struct appldata_os_per_cpu)); |
6058 |
+ if (max_size > APPLDATA_MAX_REC_SIZE) { |
6059 |
+- P_ERROR("Max. size of OS record = %i, bigger than maximum " |
6060 |
+- "record size (%i)\n", max_size, APPLDATA_MAX_REC_SIZE); |
6061 |
++ pr_err("Maximum OS record size %i exceeds the maximum " |
6062 |
++ "record size %i\n", max_size, APPLDATA_MAX_REC_SIZE); |
6063 |
+ rc = -ENOMEM; |
6064 |
+ goto out; |
6065 |
+ } |
6066 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/crypto/aes_s390.c |
6067 |
+=================================================================== |
6068 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/crypto/aes_s390.c |
6069 |
++++ linux-2.6.27-gentoo-r7/arch/s390/crypto/aes_s390.c |
6070 |
+@@ -17,6 +17,9 @@ |
6071 |
+ * |
6072 |
+ */ |
6073 |
+ |
6074 |
++#define KMSG_COMPONENT "aes_s390" |
6075 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6076 |
++ |
6077 |
+ #include <crypto/aes.h> |
6078 |
+ #include <crypto/algapi.h> |
6079 |
+ #include <linux/err.h> |
6080 |
+@@ -169,7 +172,8 @@ static int fallback_init_cip(struct cryp |
6081 |
+ CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK); |
6082 |
+ |
6083 |
+ if (IS_ERR(sctx->fallback.cip)) { |
6084 |
+- printk(KERN_ERR "Error allocating fallback algo %s\n", name); |
6085 |
++ pr_err("Allocating AES fallback algorithm %s failed\n", |
6086 |
++ name); |
6087 |
+ return PTR_ERR(sctx->fallback.blk); |
6088 |
+ } |
6089 |
+ |
6090 |
+@@ -349,7 +353,8 @@ static int fallback_init_blk(struct cryp |
6091 |
+ CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK); |
6092 |
+ |
6093 |
+ if (IS_ERR(sctx->fallback.blk)) { |
6094 |
+- printk(KERN_ERR "Error allocating fallback algo %s\n", name); |
6095 |
++ pr_err("Allocating AES fallback algorithm %s failed\n", |
6096 |
++ name); |
6097 |
+ return PTR_ERR(sctx->fallback.blk); |
6098 |
+ } |
6099 |
+ |
6100 |
+@@ -515,9 +520,8 @@ static int __init aes_s390_init(void) |
6101 |
+ |
6102 |
+ /* z9 109 and z9 BC/EC only support 128 bit key length */ |
6103 |
+ if (keylen_flag == AES_KEYLEN_128) |
6104 |
+- printk(KERN_INFO |
6105 |
+- "aes_s390: hardware acceleration only available for " |
6106 |
+- "128 bit keys\n"); |
6107 |
++ pr_info("AES hardware acceleration is only available for" |
6108 |
++ " 128-bit keys\n"); |
6109 |
+ |
6110 |
+ ret = crypto_register_alg(&aes_alg); |
6111 |
+ if (ret) |
6112 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/hypfs/hypfs_diag.c |
6113 |
+=================================================================== |
6114 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/hypfs/hypfs_diag.c |
6115 |
++++ linux-2.6.27-gentoo-r7/arch/s390/hypfs/hypfs_diag.c |
6116 |
+@@ -3,10 +3,13 @@ |
6117 |
+ * Hypervisor filesystem for Linux on s390. Diag 204 and 224 |
6118 |
+ * implementation. |
6119 |
+ * |
6120 |
+- * Copyright (C) IBM Corp. 2006 |
6121 |
++ * Copyright IBM Corp. 2006, 2008 |
6122 |
+ * Author(s): Michael Holzheu <holzheu@××××××.com> |
6123 |
+ */ |
6124 |
+ |
6125 |
++#define KMSG_COMPONENT "hypfs" |
6126 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6127 |
++ |
6128 |
+ #include <linux/types.h> |
6129 |
+ #include <linux/errno.h> |
6130 |
+ #include <linux/string.h> |
6131 |
+@@ -527,13 +530,14 @@ __init int hypfs_diag_init(void) |
6132 |
+ int rc; |
6133 |
+ |
6134 |
+ if (diag204_probe()) { |
6135 |
+- printk(KERN_ERR "hypfs: diag 204 not working."); |
6136 |
++ pr_err("The hardware system does not support hypfs\n"); |
6137 |
+ return -ENODATA; |
6138 |
+ } |
6139 |
+ rc = diag224_get_name_table(); |
6140 |
+ if (rc) { |
6141 |
+ diag204_free_buffer(); |
6142 |
+- printk(KERN_ERR "hypfs: could not get name table.\n"); |
6143 |
++ pr_err("The hardware system does not provide all " |
6144 |
++ "functions required by hypfs\n"); |
6145 |
+ } |
6146 |
+ return rc; |
6147 |
+ } |
6148 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/hypfs/inode.c |
6149 |
+=================================================================== |
6150 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/hypfs/inode.c |
6151 |
++++ linux-2.6.27-gentoo-r7/arch/s390/hypfs/inode.c |
6152 |
+@@ -2,10 +2,13 @@ |
6153 |
+ * arch/s390/hypfs/inode.c |
6154 |
+ * Hypervisor filesystem for Linux on s390. |
6155 |
+ * |
6156 |
+- * Copyright (C) IBM Corp. 2006 |
6157 |
++ * Copyright IBM Corp. 2006, 2008 |
6158 |
+ * Author(s): Michael Holzheu <holzheu@××××××.com> |
6159 |
+ */ |
6160 |
+ |
6161 |
++#define KMSG_COMPONENT "hypfs" |
6162 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6163 |
++ |
6164 |
+ #include <linux/types.h> |
6165 |
+ #include <linux/errno.h> |
6166 |
+ #include <linux/fs.h> |
6167 |
+@@ -200,7 +203,7 @@ static ssize_t hypfs_aio_write(struct ki |
6168 |
+ else |
6169 |
+ rc = hypfs_diag_create_files(sb, sb->s_root); |
6170 |
+ if (rc) { |
6171 |
+- printk(KERN_ERR "hypfs: Update failed\n"); |
6172 |
++ pr_err("Updating the hypfs tree failed\n"); |
6173 |
+ hypfs_delete_tree(sb->s_root); |
6174 |
+ goto out; |
6175 |
+ } |
6176 |
+@@ -252,8 +255,7 @@ static int hypfs_parse_options(char *opt |
6177 |
+ break; |
6178 |
+ case opt_err: |
6179 |
+ default: |
6180 |
+- printk(KERN_ERR "hypfs: Unrecognized mount option " |
6181 |
+- "\"%s\" or missing value\n", str); |
6182 |
++ pr_err("%s is not a valid mount option\n", str); |
6183 |
+ return -EINVAL; |
6184 |
+ } |
6185 |
+ } |
6186 |
+@@ -317,7 +319,7 @@ static int hypfs_fill_super(struct super |
6187 |
+ } |
6188 |
+ hypfs_update_update(sb); |
6189 |
+ sb->s_root = root_dentry; |
6190 |
+- printk(KERN_INFO "hypfs: Hypervisor filesystem mounted\n"); |
6191 |
++ pr_info("Hypervisor filesystem mounted\n"); |
6192 |
+ return 0; |
6193 |
+ |
6194 |
+ err_tree: |
6195 |
+@@ -513,7 +515,7 @@ fail_sysfs: |
6196 |
+ if (!MACHINE_IS_VM) |
6197 |
+ hypfs_diag_exit(); |
6198 |
+ fail_diag: |
6199 |
+- printk(KERN_ERR "hypfs: Initialization failed with rc = %i.\n", rc); |
6200 |
++ pr_err("Initialization of hypfs failed with rc=%i\n", rc); |
6201 |
+ return rc; |
6202 |
+ } |
6203 |
+ |
6204 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/include/asm/isc.h |
6205 |
+=================================================================== |
6206 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/include/asm/isc.h |
6207 |
++++ linux-2.6.27-gentoo-r7/arch/s390/include/asm/isc.h |
6208 |
+@@ -17,6 +17,7 @@ |
6209 |
+ #define CHSC_SCH_ISC 7 /* CHSC subchannels */ |
6210 |
+ /* Adapter interrupts. */ |
6211 |
+ #define QDIO_AIRQ_ISC IO_SCH_ISC /* I/O subchannel in qdio mode */ |
6212 |
++#define AP_ISC 6 /* adjunct processor (crypto) devices */ |
6213 |
+ |
6214 |
+ /* Functions for registration of I/O interruption subclasses */ |
6215 |
+ void isc_register(unsigned int isc); |
6216 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/include/asm/qdio.h |
6217 |
+=================================================================== |
6218 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/include/asm/qdio.h |
6219 |
++++ linux-2.6.27-gentoo-r7/arch/s390/include/asm/qdio.h |
6220 |
+@@ -299,7 +299,13 @@ struct qdio_ssqd_desc { |
6221 |
+ u8 mbccnt; |
6222 |
+ u16 qdioac2; |
6223 |
+ u64 sch_token; |
6224 |
+- u64:64; |
6225 |
++ u8 mro; |
6226 |
++ u8 mri; |
6227 |
++ u8:8; |
6228 |
++ u8 sbalic; |
6229 |
++ u16:16; |
6230 |
++ u8:8; |
6231 |
++ u8 mmwc; |
6232 |
+ } __attribute__ ((packed)); |
6233 |
+ |
6234 |
+ /* params are: ccw_device, qdio_error, queue_number, |
6235 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/include/asm/sysinfo.h |
6236 |
+=================================================================== |
6237 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/include/asm/sysinfo.h |
6238 |
++++ linux-2.6.27-gentoo-r7/arch/s390/include/asm/sysinfo.h |
6239 |
+@@ -118,4 +118,15 @@ static inline int stsi(void *sysinfo, in |
6240 |
+ return r0; |
6241 |
+ } |
6242 |
+ |
6243 |
++/* |
6244 |
++ * Service level reporting interface. |
6245 |
++ */ |
6246 |
++struct service_level { |
6247 |
++ struct list_head list; |
6248 |
++ void (*seq_print)(struct seq_file *, struct service_level *); |
6249 |
++}; |
6250 |
++ |
6251 |
++int register_service_level(struct service_level *); |
6252 |
++int unregister_service_level(struct service_level *); |
6253 |
++ |
6254 |
+ #endif /* __ASM_S390_SYSINFO_H */ |
6255 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/include/asm/system.h |
6256 |
+=================================================================== |
6257 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/include/asm/system.h |
6258 |
++++ linux-2.6.27-gentoo-r7/arch/s390/include/asm/system.h |
6259 |
+@@ -12,6 +12,7 @@ |
6260 |
+ #define __ASM_SYSTEM_H |
6261 |
+ |
6262 |
+ #include <linux/kernel.h> |
6263 |
++#include <linux/errno.h> |
6264 |
+ #include <asm/types.h> |
6265 |
+ #include <asm/ptrace.h> |
6266 |
+ #include <asm/setup.h> |
6267 |
+@@ -413,8 +414,6 @@ __set_psw_mask(unsigned long mask) |
6268 |
+ #define local_mcck_enable() __set_psw_mask(psw_kernel_bits) |
6269 |
+ #define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK) |
6270 |
+ |
6271 |
+-int stfle(unsigned long long *list, int doublewords); |
6272 |
+- |
6273 |
+ #ifdef CONFIG_SMP |
6274 |
+ |
6275 |
+ extern void smp_ctl_set_bit(int cr, int bit); |
6276 |
+@@ -438,6 +437,23 @@ static inline unsigned int stfl(void) |
6277 |
+ return S390_lowcore.stfl_fac_list; |
6278 |
+ } |
6279 |
+ |
6280 |
++static inline int __stfle(unsigned long long *list, int doublewords) |
6281 |
++{ |
6282 |
++ typedef struct { unsigned long long _[doublewords]; } addrtype; |
6283 |
++ register unsigned long __nr asm("0") = doublewords - 1; |
6284 |
++ |
6285 |
++ asm volatile(".insn s,0xb2b00000,%0" /* stfle */ |
6286 |
++ : "=m" (*(addrtype *) list), "+d" (__nr) : : "cc"); |
6287 |
++ return __nr + 1; |
6288 |
++} |
6289 |
++ |
6290 |
++static inline int stfle(unsigned long long *list, int doublewords) |
6291 |
++{ |
6292 |
++ if (!(stfl() & (1UL << 24))) |
6293 |
++ return -EOPNOTSUPP; |
6294 |
++ return __stfle(list, doublewords); |
6295 |
++} |
6296 |
++ |
6297 |
+ static inline unsigned short stap(void) |
6298 |
+ { |
6299 |
+ unsigned short cpu_address; |
6300 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/Makefile |
6301 |
+=================================================================== |
6302 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/Makefile |
6303 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/Makefile |
6304 |
+@@ -12,8 +12,8 @@ CFLAGS_smp.o := -Wno-nonnull |
6305 |
+ # |
6306 |
+ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
6307 |
+ |
6308 |
+-obj-y := bitmap.o traps.o time.o process.o base.o early.o \ |
6309 |
+- setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ |
6310 |
++obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ |
6311 |
++ processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ |
6312 |
+ s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o |
6313 |
+ |
6314 |
+ obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) |
6315 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/cpcmd.c |
6316 |
+=================================================================== |
6317 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/cpcmd.c |
6318 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/cpcmd.c |
6319 |
+@@ -7,6 +7,9 @@ |
6320 |
+ * Christian Borntraeger (cborntra@××××××.com), |
6321 |
+ */ |
6322 |
+ |
6323 |
++#define KMSG_COMPONENT "cpcmd" |
6324 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6325 |
++ |
6326 |
+ #include <linux/kernel.h> |
6327 |
+ #include <linux/module.h> |
6328 |
+ #include <linux/slab.h> |
6329 |
+@@ -104,8 +107,8 @@ int cpcmd(const char *cmd, char *respons |
6330 |
+ (((unsigned long)response + rlen) >> 31)) { |
6331 |
+ lowbuf = kmalloc(rlen, GFP_KERNEL | GFP_DMA); |
6332 |
+ if (!lowbuf) { |
6333 |
+- printk(KERN_WARNING |
6334 |
+- "cpcmd: could not allocate response buffer\n"); |
6335 |
++ pr_warning("The cpcmd kernel function failed to " |
6336 |
++ "allocate a response buffer\n"); |
6337 |
+ return -ENOMEM; |
6338 |
+ } |
6339 |
+ spin_lock_irqsave(&cpcmd_lock, flags); |
6340 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/debug.c |
6341 |
+=================================================================== |
6342 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/debug.c |
6343 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/debug.c |
6344 |
+@@ -10,6 +10,9 @@ |
6345 |
+ * Bugreports to: <Linux390@××××××.com> |
6346 |
+ */ |
6347 |
+ |
6348 |
++#define KMSG_COMPONENT "s390dbf" |
6349 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6350 |
++ |
6351 |
+ #include <linux/stddef.h> |
6352 |
+ #include <linux/kernel.h> |
6353 |
+ #include <linux/errno.h> |
6354 |
+@@ -693,8 +696,8 @@ debug_info_t *debug_register_mode(const |
6355 |
+ /* Since debugfs currently does not support uid/gid other than root, */ |
6356 |
+ /* we do not allow gid/uid != 0 until we get support for that. */ |
6357 |
+ if ((uid != 0) || (gid != 0)) |
6358 |
+- printk(KERN_WARNING "debug: Warning - Currently only uid/gid " |
6359 |
+- "= 0 are supported. Using root as owner now!"); |
6360 |
++ pr_warning("Root becomes the owner of all s390dbf files " |
6361 |
++ "in sysfs\n"); |
6362 |
+ if (!initialized) |
6363 |
+ BUG(); |
6364 |
+ mutex_lock(&debug_mutex); |
6365 |
+@@ -709,7 +712,7 @@ debug_info_t *debug_register_mode(const |
6366 |
+ debug_register_view(rc, &debug_pages_view); |
6367 |
+ out: |
6368 |
+ if (!rc){ |
6369 |
+- printk(KERN_ERR "debug: debug_register failed for %s\n",name); |
6370 |
++ pr_err("Registering debug feature %s failed\n", name); |
6371 |
+ } |
6372 |
+ mutex_unlock(&debug_mutex); |
6373 |
+ return rc; |
6374 |
+@@ -763,8 +766,8 @@ debug_set_size(debug_info_t* id, int nr_ |
6375 |
+ if(pages_per_area > 0){ |
6376 |
+ new_areas = debug_areas_alloc(pages_per_area, nr_areas); |
6377 |
+ if(!new_areas) { |
6378 |
+- printk(KERN_WARNING "debug: could not allocate memory "\ |
6379 |
+- "for pagenumber: %i\n",pages_per_area); |
6380 |
++ pr_info("Allocating memory for %i pages failed\n", |
6381 |
++ pages_per_area); |
6382 |
+ rc = -ENOMEM; |
6383 |
+ goto out; |
6384 |
+ } |
6385 |
+@@ -780,8 +783,7 @@ debug_set_size(debug_info_t* id, int nr_ |
6386 |
+ memset(id->active_entries,0,sizeof(int)*id->nr_areas); |
6387 |
+ memset(id->active_pages, 0, sizeof(int)*id->nr_areas); |
6388 |
+ spin_unlock_irqrestore(&id->lock,flags); |
6389 |
+- printk(KERN_INFO "debug: %s: set new size (%i pages)\n"\ |
6390 |
+- ,id->name, pages_per_area); |
6391 |
++ pr_info("%s: set new size (%i pages)\n" ,id->name, pages_per_area); |
6392 |
+ out: |
6393 |
+ return rc; |
6394 |
+ } |
6395 |
+@@ -800,10 +802,9 @@ debug_set_level(debug_info_t* id, int ne |
6396 |
+ spin_lock_irqsave(&id->lock,flags); |
6397 |
+ if(new_level == DEBUG_OFF_LEVEL){ |
6398 |
+ id->level = DEBUG_OFF_LEVEL; |
6399 |
+- printk(KERN_INFO "debug: %s: switched off\n",id->name); |
6400 |
++ pr_info("%s: switched off\n",id->name); |
6401 |
+ } else if ((new_level > DEBUG_MAX_LEVEL) || (new_level < 0)) { |
6402 |
+- printk(KERN_INFO |
6403 |
+- "debug: %s: level %i is out of range (%i - %i)\n", |
6404 |
++ pr_info("%s: level %i is out of range (%i - %i)\n", |
6405 |
+ id->name, new_level, 0, DEBUG_MAX_LEVEL); |
6406 |
+ } else { |
6407 |
+ id->level = new_level; |
6408 |
+@@ -1108,8 +1109,8 @@ debug_register_view(debug_info_t * id, s |
6409 |
+ pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry, |
6410 |
+ id , &debug_file_ops); |
6411 |
+ if (!pde){ |
6412 |
+- printk(KERN_WARNING "debug: debugfs_create_file() failed!"\ |
6413 |
+- " Cannot register view %s/%s\n", id->name,view->name); |
6414 |
++ pr_err("Registering view %s/%s failed due to out of " |
6415 |
++ "memory\n", id->name,view->name); |
6416 |
+ rc = -1; |
6417 |
+ goto out; |
6418 |
+ } |
6419 |
+@@ -1119,10 +1120,8 @@ debug_register_view(debug_info_t * id, s |
6420 |
+ break; |
6421 |
+ } |
6422 |
+ if (i == DEBUG_MAX_VIEWS) { |
6423 |
+- printk(KERN_WARNING "debug: cannot register view %s/%s\n", |
6424 |
+- id->name,view->name); |
6425 |
+- printk(KERN_WARNING |
6426 |
+- "debug: maximum number of views reached (%i)!\n", i); |
6427 |
++ pr_err("Registering view %s/%s would exceed the maximum " |
6428 |
++ "number of views %i\n", id->name, view->name, i); |
6429 |
+ debugfs_remove(pde); |
6430 |
+ rc = -1; |
6431 |
+ } else { |
6432 |
+@@ -1303,7 +1302,8 @@ debug_input_level_fn(debug_info_t * id, |
6433 |
+ new_level = debug_get_uint(str); |
6434 |
+ } |
6435 |
+ if(new_level < 0) { |
6436 |
+- printk(KERN_INFO "debug: level `%s` is not valid\n", str); |
6437 |
++ pr_warning("%s is not a valid level for a debug " |
6438 |
++ "feature\n", str); |
6439 |
+ rc = -EINVAL; |
6440 |
+ } else { |
6441 |
+ debug_set_level(id, new_level); |
6442 |
+@@ -1380,7 +1380,8 @@ debug_input_flush_fn(debug_info_t * id, |
6443 |
+ goto out; |
6444 |
+ } |
6445 |
+ |
6446 |
+- printk(KERN_INFO "debug: area `%c` is not valid\n", input_buf[0]); |
6447 |
++ pr_info("Flushing debug data failed because %c is not a valid " |
6448 |
++ "area\n", input_buf[0]); |
6449 |
+ |
6450 |
+ out: |
6451 |
+ *offset += user_len; |
6452 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/head.S |
6453 |
+=================================================================== |
6454 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/head.S |
6455 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/head.S |
6456 |
+@@ -461,6 +461,55 @@ start: |
6457 |
+ .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7 |
6458 |
+ .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff |
6459 |
+ |
6460 |
++# |
6461 |
++# startup-code at 0x10000, running in absolute addressing mode |
6462 |
++# this is called either by the ipl loader or directly by PSW restart |
6463 |
++# or linload or SALIPL |
6464 |
++# |
6465 |
++ .org 0x10000 |
6466 |
++startup:basr %r13,0 # get base |
6467 |
++.LPG0: |
6468 |
++ |
6469 |
++#ifndef CONFIG_MARCH_G5 |
6470 |
++ # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10} |
6471 |
++ stidp __LC_CPUID # store cpuid |
6472 |
++ lhi %r0,(3f-2f) / 2 |
6473 |
++ la %r1,2f-.LPG0(%r13) |
6474 |
++0: clc __LC_CPUID+4(2),0(%r1) |
6475 |
++ jne 3f |
6476 |
++ lpsw 1f-.LPG0(13) # machine type not good enough, crash |
6477 |
++ .align 16 |
6478 |
++1: .long 0x000a0000,0x00000000 |
6479 |
++2: |
6480 |
++#if defined(CONFIG_MARCH_Z10) |
6481 |
++ .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086, 0x2094, 0x2096 |
6482 |
++#elif defined(CONFIG_MARCH_Z9_109) |
6483 |
++ .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086 |
6484 |
++#elif defined(CONFIG_MARCH_Z990) |
6485 |
++ .short 0x9672, 0x2064, 0x2066 |
6486 |
++#elif defined(CONFIG_MARCH_Z900) |
6487 |
++ .short 0x9672 |
6488 |
++#endif |
6489 |
++3: la %r1,2(%r1) |
6490 |
++ brct %r0,0b |
6491 |
++#endif |
6492 |
++ |
6493 |
++ l %r13,0f-.LPG0(%r13) |
6494 |
++ b 0(%r13) |
6495 |
++0: .long startup_continue |
6496 |
++ |
6497 |
++# |
6498 |
++# params at 10400 (setup.h) |
6499 |
++# |
6500 |
++ .org PARMAREA |
6501 |
++ .long 0,0 # IPL_DEVICE |
6502 |
++ .long 0,0 # INITRD_START |
6503 |
++ .long 0,0 # INITRD_SIZE |
6504 |
++ |
6505 |
++ .org COMMAND_LINE |
6506 |
++ .byte "root=/dev/ram0 ro" |
6507 |
++ .byte 0 |
6508 |
++ |
6509 |
+ #ifdef CONFIG_64BIT |
6510 |
+ #include "head64.S" |
6511 |
+ #else |
6512 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/head31.S |
6513 |
+=================================================================== |
6514 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/head31.S |
6515 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/head31.S |
6516 |
+@@ -10,34 +10,13 @@ |
6517 |
+ * |
6518 |
+ */ |
6519 |
+ |
6520 |
+-# |
6521 |
+-# startup-code at 0x10000, running in absolute addressing mode |
6522 |
+-# this is called either by the ipl loader or directly by PSW restart |
6523 |
+-# or linload or SALIPL |
6524 |
+-# |
6525 |
+- .org 0x10000 |
6526 |
+-startup:basr %r13,0 # get base |
6527 |
+-.LPG0: l %r13,0f-.LPG0(%r13) |
6528 |
+- b 0(%r13) |
6529 |
+-0: .long startup_continue |
6530 |
+- |
6531 |
+-# |
6532 |
+-# params at 10400 (setup.h) |
6533 |
+-# |
6534 |
+- .org PARMAREA |
6535 |
+- .long 0,0 # IPL_DEVICE |
6536 |
+- .long 0,0 # INITRD_START |
6537 |
+- .long 0,0 # INITRD_SIZE |
6538 |
+- |
6539 |
+- .org COMMAND_LINE |
6540 |
+- .byte "root=/dev/ram0 ro" |
6541 |
+- .byte 0 |
6542 |
+- |
6543 |
+ .org 0x11000 |
6544 |
+ |
6545 |
+ startup_continue: |
6546 |
+ basr %r13,0 # get base |
6547 |
+-.LPG1: mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) |
6548 |
++.LPG1: |
6549 |
++ |
6550 |
++ mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) |
6551 |
+ lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers |
6552 |
+ l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area |
6553 |
+ # move IPL device to lowcore |
6554 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/head64.S |
6555 |
+=================================================================== |
6556 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/head64.S |
6557 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/head64.S |
6558 |
+@@ -10,29 +10,6 @@ |
6559 |
+ * |
6560 |
+ */ |
6561 |
+ |
6562 |
+-# |
6563 |
+-# startup-code at 0x10000, running in absolute addressing mode |
6564 |
+-# this is called either by the ipl loader or directly by PSW restart |
6565 |
+-# or linload or SALIPL |
6566 |
+-# |
6567 |
+- .org 0x10000 |
6568 |
+-startup:basr %r13,0 # get base |
6569 |
+-.LPG0: l %r13,0f-.LPG0(%r13) |
6570 |
+- b 0(%r13) |
6571 |
+-0: .long startup_continue |
6572 |
+- |
6573 |
+-# |
6574 |
+-# params at 10400 (setup.h) |
6575 |
+-# |
6576 |
+- .org PARMAREA |
6577 |
+- .quad 0 # IPL_DEVICE |
6578 |
+- .quad 0 # INITRD_START |
6579 |
+- .quad 0 # INITRD_SIZE |
6580 |
+- |
6581 |
+- .org COMMAND_LINE |
6582 |
+- .byte "root=/dev/ram0 ro" |
6583 |
+- .byte 0 |
6584 |
+- |
6585 |
+ .org 0x11000 |
6586 |
+ |
6587 |
+ startup_continue: |
6588 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/processor.c |
6589 |
+=================================================================== |
6590 |
+--- /dev/null |
6591 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/processor.c |
6592 |
+@@ -0,0 +1,98 @@ |
6593 |
++/* |
6594 |
++ * arch/s390/kernel/processor.c |
6595 |
++ * |
6596 |
++ * Copyright IBM Corp. 2008 |
6597 |
++ * Author(s): Martin Schwidefsky (schwidefsky@××××××.com) |
6598 |
++ */ |
6599 |
++ |
6600 |
++#define KMSG_COMPONENT "cpu" |
6601 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6602 |
++ |
6603 |
++#include <linux/kernel.h> |
6604 |
++#include <linux/init.h> |
6605 |
++#include <linux/smp.h> |
6606 |
++#include <linux/seq_file.h> |
6607 |
++#include <linux/delay.h> |
6608 |
++ |
6609 |
++#include <asm/elf.h> |
6610 |
++#include <asm/lowcore.h> |
6611 |
++#include <asm/param.h> |
6612 |
++ |
6613 |
++void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) |
6614 |
++{ |
6615 |
++ pr_info("Processor %d started, address %d, identification %06X\n", |
6616 |
++ cpuinfo->cpu_nr, cpuinfo->cpu_addr, cpuinfo->cpu_id.ident); |
6617 |
++} |
6618 |
++ |
6619 |
++/* |
6620 |
++ * show_cpuinfo - Get information on one CPU for use by procfs. |
6621 |
++ */ |
6622 |
++ |
6623 |
++static int show_cpuinfo(struct seq_file *m, void *v) |
6624 |
++{ |
6625 |
++ static const char *hwcap_str[8] = { |
6626 |
++ "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
6627 |
++ "edat" |
6628 |
++ }; |
6629 |
++ struct cpuinfo_S390 *cpuinfo; |
6630 |
++ unsigned long n = (unsigned long) v - 1; |
6631 |
++ int i; |
6632 |
++ |
6633 |
++ s390_adjust_jiffies(); |
6634 |
++ preempt_disable(); |
6635 |
++ if (!n) { |
6636 |
++ seq_printf(m, "vendor_id : IBM/S390\n" |
6637 |
++ "# processors : %i\n" |
6638 |
++ "bogomips per cpu: %lu.%02lu\n", |
6639 |
++ num_online_cpus(), loops_per_jiffy/(500000/HZ), |
6640 |
++ (loops_per_jiffy/(5000/HZ))%100); |
6641 |
++ seq_puts(m, "features\t: "); |
6642 |
++ for (i = 0; i < 8; i++) |
6643 |
++ if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
6644 |
++ seq_printf(m, "%s ", hwcap_str[i]); |
6645 |
++ seq_puts(m, "\n"); |
6646 |
++ } |
6647 |
++ |
6648 |
++ if (cpu_online(n)) { |
6649 |
++#ifdef CONFIG_SMP |
6650 |
++ if (smp_processor_id() == n) |
6651 |
++ cpuinfo = &S390_lowcore.cpu_data; |
6652 |
++ else |
6653 |
++ cpuinfo = &lowcore_ptr[n]->cpu_data; |
6654 |
++#else |
6655 |
++ cpuinfo = &S390_lowcore.cpu_data; |
6656 |
++#endif |
6657 |
++ seq_printf(m, "processor %li: " |
6658 |
++ "version = %02X, " |
6659 |
++ "identification = %06X, " |
6660 |
++ "machine = %04X\n", |
6661 |
++ n, cpuinfo->cpu_id.version, |
6662 |
++ cpuinfo->cpu_id.ident, |
6663 |
++ cpuinfo->cpu_id.machine); |
6664 |
++ } |
6665 |
++ preempt_enable(); |
6666 |
++ return 0; |
6667 |
++} |
6668 |
++ |
6669 |
++static void *c_start(struct seq_file *m, loff_t *pos) |
6670 |
++{ |
6671 |
++ return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL; |
6672 |
++} |
6673 |
++ |
6674 |
++static void *c_next(struct seq_file *m, void *v, loff_t *pos) |
6675 |
++{ |
6676 |
++ ++*pos; |
6677 |
++ return c_start(m, pos); |
6678 |
++} |
6679 |
++ |
6680 |
++static void c_stop(struct seq_file *m, void *v) |
6681 |
++{ |
6682 |
++} |
6683 |
++ |
6684 |
++const struct seq_operations cpuinfo_op = { |
6685 |
++ .start = c_start, |
6686 |
++ .next = c_next, |
6687 |
++ .stop = c_stop, |
6688 |
++ .show = show_cpuinfo, |
6689 |
++}; |
6690 |
++ |
6691 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/setup.c |
6692 |
+=================================================================== |
6693 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/setup.c |
6694 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/setup.c |
6695 |
+@@ -14,6 +14,9 @@ |
6696 |
+ * This file handles the architecture-dependent parts of initialization |
6697 |
+ */ |
6698 |
+ |
6699 |
++#define KMSG_COMPONENT "setup" |
6700 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6701 |
++ |
6702 |
+ #include <linux/errno.h> |
6703 |
+ #include <linux/module.h> |
6704 |
+ #include <linux/sched.h> |
6705 |
+@@ -32,7 +35,6 @@ |
6706 |
+ #include <linux/bootmem.h> |
6707 |
+ #include <linux/root_dev.h> |
6708 |
+ #include <linux/console.h> |
6709 |
+-#include <linux/seq_file.h> |
6710 |
+ #include <linux/kernel_stat.h> |
6711 |
+ #include <linux/device.h> |
6712 |
+ #include <linux/notifier.h> |
6713 |
+@@ -291,8 +293,8 @@ unsigned int switch_amode = 0; |
6714 |
+ #endif |
6715 |
+ EXPORT_SYMBOL_GPL(switch_amode); |
6716 |
+ |
6717 |
+-static void set_amode_and_uaccess(unsigned long user_amode, |
6718 |
+- unsigned long user32_amode) |
6719 |
++static int set_amode_and_uaccess(unsigned long user_amode, |
6720 |
++ unsigned long user32_amode) |
6721 |
+ { |
6722 |
+ psw_user_bits = PSW_BASE_BITS | PSW_MASK_DAT | user_amode | |
6723 |
+ PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | |
6724 |
+@@ -309,11 +311,11 @@ static void set_amode_and_uaccess(unsign |
6725 |
+ PSW_MASK_MCHECK | PSW_DEFAULT_KEY; |
6726 |
+ |
6727 |
+ if (MACHINE_HAS_MVCOS) { |
6728 |
+- printk("mvcos available.\n"); |
6729 |
+ memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess)); |
6730 |
++ return 1; |
6731 |
+ } else { |
6732 |
+- printk("mvcos not available.\n"); |
6733 |
+ memcpy(&uaccess, &uaccess_pt, sizeof(uaccess)); |
6734 |
++ return 0; |
6735 |
+ } |
6736 |
+ } |
6737 |
+ |
6738 |
+@@ -328,9 +330,10 @@ static int __init early_parse_switch_amo |
6739 |
+ early_param("switch_amode", early_parse_switch_amode); |
6740 |
+ |
6741 |
+ #else /* CONFIG_S390_SWITCH_AMODE */ |
6742 |
+-static inline void set_amode_and_uaccess(unsigned long user_amode, |
6743 |
+- unsigned long user32_amode) |
6744 |
++static inline int set_amode_and_uaccess(unsigned long user_amode, |
6745 |
++ unsigned long user32_amode) |
6746 |
+ { |
6747 |
++ return 0; |
6748 |
+ } |
6749 |
+ #endif /* CONFIG_S390_SWITCH_AMODE */ |
6750 |
+ |
6751 |
+@@ -355,11 +358,20 @@ early_param("noexec", early_parse_noexec |
6752 |
+ static void setup_addressing_mode(void) |
6753 |
+ { |
6754 |
+ if (s390_noexec) { |
6755 |
+- printk("S390 execute protection active, "); |
6756 |
+- set_amode_and_uaccess(PSW_ASC_SECONDARY, PSW32_ASC_SECONDARY); |
6757 |
++ if (set_amode_and_uaccess(PSW_ASC_SECONDARY, |
6758 |
++ PSW32_ASC_SECONDARY)) |
6759 |
++ pr_info("Execute protection active, " |
6760 |
++ "mvcos available\n"); |
6761 |
++ else |
6762 |
++ pr_info("Execute protection active, " |
6763 |
++ "mvcos not available\n"); |
6764 |
+ } else if (switch_amode) { |
6765 |
+- printk("S390 address spaces switched, "); |
6766 |
+- set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY); |
6767 |
++ if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY)) |
6768 |
++ pr_info("Address spaces switched, " |
6769 |
++ "mvcos available\n"); |
6770 |
++ else |
6771 |
++ pr_info("Address spaces switched, " |
6772 |
++ "mvcos not available\n"); |
6773 |
+ } |
6774 |
+ #ifdef CONFIG_TRACE_IRQFLAGS |
6775 |
+ sysc_restore_trace_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK; |
6776 |
+@@ -572,15 +584,15 @@ setup_memory(void) |
6777 |
+ start = PFN_PHYS(start_pfn) + bmap_size + PAGE_SIZE; |
6778 |
+ |
6779 |
+ if (start + INITRD_SIZE > memory_end) { |
6780 |
+- printk("initrd extends beyond end of memory " |
6781 |
+- "(0x%08lx > 0x%08lx)\n" |
6782 |
++ pr_err("initrd extends beyond end of " |
6783 |
++ "memory (0x%08lx > 0x%08lx) " |
6784 |
+ "disabling initrd\n", |
6785 |
+ start + INITRD_SIZE, memory_end); |
6786 |
+ INITRD_START = INITRD_SIZE = 0; |
6787 |
+ } else { |
6788 |
+- printk("Moving initrd (0x%08lx -> 0x%08lx, " |
6789 |
+- "size: %ld)\n", |
6790 |
+- INITRD_START, start, INITRD_SIZE); |
6791 |
++ pr_info("Moving initrd (0x%08lx -> " |
6792 |
++ "0x%08lx, size: %ld)\n", |
6793 |
++ INITRD_START, start, INITRD_SIZE); |
6794 |
+ memmove((void *) start, (void *) INITRD_START, |
6795 |
+ INITRD_SIZE); |
6796 |
+ INITRD_START = start; |
6797 |
+@@ -642,8 +654,9 @@ setup_memory(void) |
6798 |
+ initrd_start = INITRD_START; |
6799 |
+ initrd_end = initrd_start + INITRD_SIZE; |
6800 |
+ } else { |
6801 |
+- printk("initrd extends beyond end of memory " |
6802 |
+- "(0x%08lx > 0x%08lx)\ndisabling initrd\n", |
6803 |
++ pr_err("initrd extends beyond end of " |
6804 |
++ "memory (0x%08lx > 0x%08lx) " |
6805 |
++ "disabling initrd\n", |
6806 |
+ initrd_start + INITRD_SIZE, memory_end); |
6807 |
+ initrd_start = initrd_end = 0; |
6808 |
+ } |
6809 |
+@@ -651,23 +664,6 @@ setup_memory(void) |
6810 |
+ #endif |
6811 |
+ } |
6812 |
+ |
6813 |
+-static int __init __stfle(unsigned long long *list, int doublewords) |
6814 |
+-{ |
6815 |
+- typedef struct { unsigned long long _[doublewords]; } addrtype; |
6816 |
+- register unsigned long __nr asm("0") = doublewords - 1; |
6817 |
+- |
6818 |
+- asm volatile(".insn s,0xb2b00000,%0" /* stfle */ |
6819 |
+- : "=m" (*(addrtype *) list), "+d" (__nr) : : "cc"); |
6820 |
+- return __nr + 1; |
6821 |
+-} |
6822 |
+- |
6823 |
+-int __init stfle(unsigned long long *list, int doublewords) |
6824 |
+-{ |
6825 |
+- if (!(stfl() & (1UL << 24))) |
6826 |
+- return -EOPNOTSUPP; |
6827 |
+- return __stfle(list, doublewords); |
6828 |
+-} |
6829 |
+- |
6830 |
+ /* |
6831 |
+ * Setup hardware capabilities. |
6832 |
+ */ |
6833 |
+@@ -756,21 +752,27 @@ setup_arch(char **cmdline_p) |
6834 |
+ * print what head.S has found out about the machine |
6835 |
+ */ |
6836 |
+ #ifndef CONFIG_64BIT |
6837 |
+- printk((MACHINE_IS_VM) ? |
6838 |
+- "We are running under VM (31 bit mode)\n" : |
6839 |
+- "We are running native (31 bit mode)\n"); |
6840 |
+- printk((MACHINE_HAS_IEEE) ? |
6841 |
+- "This machine has an IEEE fpu\n" : |
6842 |
+- "This machine has no IEEE fpu\n"); |
6843 |
++ if (MACHINE_IS_VM) |
6844 |
++ pr_info("Linux is running as a z/VM " |
6845 |
++ "guest operating system in 31-bit mode\n"); |
6846 |
++ else |
6847 |
++ pr_info("Linux is running natively in 31-bit mode\n"); |
6848 |
++ if (MACHINE_HAS_IEEE) |
6849 |
++ pr_info("The hardware system has IEEE compatible " |
6850 |
++ "floating point units\n"); |
6851 |
++ else |
6852 |
++ pr_info("The hardware system has no IEEE compatible " |
6853 |
++ "floating point units\n"); |
6854 |
+ #else /* CONFIG_64BIT */ |
6855 |
+ if (MACHINE_IS_VM) |
6856 |
+- printk("We are running under VM (64 bit mode)\n"); |
6857 |
++ pr_info("Linux is running as a z/VM " |
6858 |
++ "guest operating system in 64-bit mode\n"); |
6859 |
+ else if (MACHINE_IS_KVM) { |
6860 |
+- printk("We are running under KVM (64 bit mode)\n"); |
6861 |
++ pr_info("Linux is running under KVM in 64-bit mode\n"); |
6862 |
+ add_preferred_console("hvc", 0, NULL); |
6863 |
+ s390_virtio_console_init(); |
6864 |
+ } else |
6865 |
+- printk("We are running native (64 bit mode)\n"); |
6866 |
++ pr_info("Linux is running natively in 64-bit mode\n"); |
6867 |
+ #endif /* CONFIG_64BIT */ |
6868 |
+ |
6869 |
+ /* Have one command line that is parsed and saved in /proc/cmdline */ |
6870 |
+@@ -818,90 +820,3 @@ setup_arch(char **cmdline_p) |
6871 |
+ /* Setup zfcpdump support */ |
6872 |
+ setup_zfcpdump(console_devno); |
6873 |
+ } |
6874 |
+- |
6875 |
+-void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) |
6876 |
+-{ |
6877 |
+- printk(KERN_INFO "cpu %d " |
6878 |
+-#ifdef CONFIG_SMP |
6879 |
+- "phys_idx=%d " |
6880 |
+-#endif |
6881 |
+- "vers=%02X ident=%06X machine=%04X unused=%04X\n", |
6882 |
+- cpuinfo->cpu_nr, |
6883 |
+-#ifdef CONFIG_SMP |
6884 |
+- cpuinfo->cpu_addr, |
6885 |
+-#endif |
6886 |
+- cpuinfo->cpu_id.version, |
6887 |
+- cpuinfo->cpu_id.ident, |
6888 |
+- cpuinfo->cpu_id.machine, |
6889 |
+- cpuinfo->cpu_id.unused); |
6890 |
+-} |
6891 |
+- |
6892 |
+-/* |
6893 |
+- * show_cpuinfo - Get information on one CPU for use by procfs. |
6894 |
+- */ |
6895 |
+- |
6896 |
+-static int show_cpuinfo(struct seq_file *m, void *v) |
6897 |
+-{ |
6898 |
+- static const char *hwcap_str[8] = { |
6899 |
+- "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
6900 |
+- "edat" |
6901 |
+- }; |
6902 |
+- struct cpuinfo_S390 *cpuinfo; |
6903 |
+- unsigned long n = (unsigned long) v - 1; |
6904 |
+- int i; |
6905 |
+- |
6906 |
+- s390_adjust_jiffies(); |
6907 |
+- preempt_disable(); |
6908 |
+- if (!n) { |
6909 |
+- seq_printf(m, "vendor_id : IBM/S390\n" |
6910 |
+- "# processors : %i\n" |
6911 |
+- "bogomips per cpu: %lu.%02lu\n", |
6912 |
+- num_online_cpus(), loops_per_jiffy/(500000/HZ), |
6913 |
+- (loops_per_jiffy/(5000/HZ))%100); |
6914 |
+- seq_puts(m, "features\t: "); |
6915 |
+- for (i = 0; i < 8; i++) |
6916 |
+- if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
6917 |
+- seq_printf(m, "%s ", hwcap_str[i]); |
6918 |
+- seq_puts(m, "\n"); |
6919 |
+- } |
6920 |
+- |
6921 |
+- if (cpu_online(n)) { |
6922 |
+-#ifdef CONFIG_SMP |
6923 |
+- if (smp_processor_id() == n) |
6924 |
+- cpuinfo = &S390_lowcore.cpu_data; |
6925 |
+- else |
6926 |
+- cpuinfo = &lowcore_ptr[n]->cpu_data; |
6927 |
+-#else |
6928 |
+- cpuinfo = &S390_lowcore.cpu_data; |
6929 |
+-#endif |
6930 |
+- seq_printf(m, "processor %li: " |
6931 |
+- "version = %02X, " |
6932 |
+- "identification = %06X, " |
6933 |
+- "machine = %04X\n", |
6934 |
+- n, cpuinfo->cpu_id.version, |
6935 |
+- cpuinfo->cpu_id.ident, |
6936 |
+- cpuinfo->cpu_id.machine); |
6937 |
+- } |
6938 |
+- preempt_enable(); |
6939 |
+- return 0; |
6940 |
+-} |
6941 |
+- |
6942 |
+-static void *c_start(struct seq_file *m, loff_t *pos) |
6943 |
+-{ |
6944 |
+- return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL; |
6945 |
+-} |
6946 |
+-static void *c_next(struct seq_file *m, void *v, loff_t *pos) |
6947 |
+-{ |
6948 |
+- ++*pos; |
6949 |
+- return c_start(m, pos); |
6950 |
+-} |
6951 |
+-static void c_stop(struct seq_file *m, void *v) |
6952 |
+-{ |
6953 |
+-} |
6954 |
+-const struct seq_operations cpuinfo_op = { |
6955 |
+- .start = c_start, |
6956 |
+- .next = c_next, |
6957 |
+- .stop = c_stop, |
6958 |
+- .show = show_cpuinfo, |
6959 |
+-}; |
6960 |
+- |
6961 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/smp.c |
6962 |
+=================================================================== |
6963 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/smp.c |
6964 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/smp.c |
6965 |
+@@ -20,6 +20,9 @@ |
6966 |
+ * cpu_number_map in other architectures. |
6967 |
+ */ |
6968 |
+ |
6969 |
++#define KMSG_COMPONENT "cpu" |
6970 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
6971 |
++ |
6972 |
+ #include <linux/module.h> |
6973 |
+ #include <linux/init.h> |
6974 |
+ #include <linux/mm.h> |
6975 |
+@@ -388,8 +391,8 @@ static void __init smp_get_save_area(uns |
6976 |
+ if (ipl_info.type != IPL_TYPE_FCP_DUMP) |
6977 |
+ return; |
6978 |
+ if (cpu >= NR_CPUS) { |
6979 |
+- printk(KERN_WARNING "Registers for cpu %i not saved since dump " |
6980 |
+- "kernel was compiled with NR_CPUS=%i\n", cpu, NR_CPUS); |
6981 |
++ pr_warning("CPU %i exceeds the maximum %i and is excluded from " |
6982 |
++ "the dump\n", cpu, NR_CPUS - 1); |
6983 |
+ return; |
6984 |
+ } |
6985 |
+ zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL); |
6986 |
+@@ -562,7 +565,7 @@ static void __init smp_detect_cpus(void) |
6987 |
+ } |
6988 |
+ out: |
6989 |
+ kfree(info); |
6990 |
+- printk(KERN_INFO "CPUs: %d configured, %d standby\n", c_cpus, s_cpus); |
6991 |
++ pr_info("%d configured CPUs, %d standby CPUs\n", c_cpus, s_cpus); |
6992 |
+ get_online_cpus(); |
6993 |
+ __smp_rescan_cpus(); |
6994 |
+ put_online_cpus(); |
6995 |
+@@ -688,12 +691,8 @@ int __cpuinit __cpu_up(unsigned int cpu) |
6996 |
+ |
6997 |
+ ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]), |
6998 |
+ cpu, sigp_set_prefix); |
6999 |
+- if (ccode) { |
7000 |
+- printk("sigp_set_prefix failed for cpu %d " |
7001 |
+- "with condition code %d\n", |
7002 |
+- (int) cpu, (int) ccode); |
7003 |
++ if (ccode) |
7004 |
+ return -EIO; |
7005 |
+- } |
7006 |
+ |
7007 |
+ idle = current_set[cpu]; |
7008 |
+ cpu_lowcore = lowcore_ptr[cpu]; |
7009 |
+@@ -776,7 +775,7 @@ void __cpu_die(unsigned int cpu) |
7010 |
+ while (!smp_cpu_not_running(cpu)) |
7011 |
+ cpu_relax(); |
7012 |
+ smp_free_lowcore(cpu); |
7013 |
+- printk(KERN_INFO "Processor %d spun down\n", cpu); |
7014 |
++ pr_info("Processor %d stopped\n", cpu); |
7015 |
+ } |
7016 |
+ |
7017 |
+ void cpu_die(void) |
7018 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/time.c |
7019 |
+=================================================================== |
7020 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/time.c |
7021 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/time.c |
7022 |
+@@ -12,6 +12,9 @@ |
7023 |
+ * Copyright (C) 1991, 1992, 1995 Linus Torvalds |
7024 |
+ */ |
7025 |
+ |
7026 |
++#define KMSG_COMPONENT "time" |
7027 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
7028 |
++ |
7029 |
+ #include <linux/errno.h> |
7030 |
+ #include <linux/module.h> |
7031 |
+ #include <linux/sched.h> |
7032 |
+@@ -291,8 +294,8 @@ static unsigned long long adjust_time(un |
7033 |
+ } |
7034 |
+ jiffies_timer_cc += delta; |
7035 |
+ if (adjust.offset != 0) { |
7036 |
+- printk(KERN_NOTICE "etr: time adjusted by %li micro-seconds\n", |
7037 |
+- adjust.offset); |
7038 |
++ pr_notice("The ETR interface has adjusted the clock " |
7039 |
++ "by %li microseconds\n", adjust.offset); |
7040 |
+ adjust.modes = ADJ_OFFSET_SINGLESHOT; |
7041 |
+ do_adjtimex(&adjust); |
7042 |
+ } |
7043 |
+@@ -443,8 +446,8 @@ static void etr_reset(void) |
7044 |
+ etr_tolec = get_clock(); |
7045 |
+ set_bit(CLOCK_SYNC_HAS_ETR, &clock_sync_flags); |
7046 |
+ } else if (etr_port0_online || etr_port1_online) { |
7047 |
+- printk(KERN_WARNING "Running on non ETR capable " |
7048 |
+- "machine, only local mode available.\n"); |
7049 |
++ pr_warning("The real or virtual hardware system does " |
7050 |
++ "not provide an ETR interface\n"); |
7051 |
+ etr_port0_online = etr_port1_online = 0; |
7052 |
+ } |
7053 |
+ } |
7054 |
+@@ -1359,7 +1362,8 @@ static void __init stp_reset(void) |
7055 |
+ if (rc == 0) |
7056 |
+ set_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags); |
7057 |
+ else if (stp_online) { |
7058 |
+- printk(KERN_WARNING "Running on non STP capable machine.\n"); |
7059 |
++ pr_warning("The real or virtual hardware system does " |
7060 |
++ "not provide an STP interface\n"); |
7061 |
+ free_bootmem((unsigned long) stp_page, PAGE_SIZE); |
7062 |
+ stp_page = NULL; |
7063 |
+ stp_online = 0; |
7064 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/kernel/topology.c |
7065 |
+=================================================================== |
7066 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/kernel/topology.c |
7067 |
++++ linux-2.6.27-gentoo-r7/arch/s390/kernel/topology.c |
7068 |
+@@ -3,6 +3,9 @@ |
7069 |
+ * Author(s): Heiko Carstens <heiko.carstens@××××××.com> |
7070 |
+ */ |
7071 |
+ |
7072 |
++#define KMSG_COMPONENT "cpu" |
7073 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
7074 |
++ |
7075 |
+ #include <linux/kernel.h> |
7076 |
+ #include <linux/mm.h> |
7077 |
+ #include <linux/init.h> |
7078 |
+@@ -311,7 +314,7 @@ void __init s390_init_cpu_topology(void) |
7079 |
+ for (i = 0; i < info->mnest - 2; i++) |
7080 |
+ nr_cores *= info->mag[NR_MAG - 3 - i]; |
7081 |
+ |
7082 |
+- printk(KERN_INFO "CPU topology:"); |
7083 |
++ pr_info("The CPU configuration topology of the machine is:"); |
7084 |
+ for (i = 0; i < NR_MAG; i++) |
7085 |
+ printk(" %d", info->mag[i]); |
7086 |
+ printk(" / %d\n", info->mnest); |
7087 |
+Index: linux-2.6.27-gentoo-r7/arch/s390/mm/extmem.c |
7088 |
+=================================================================== |
7089 |
+--- linux-2.6.27-gentoo-r7.orig/arch/s390/mm/extmem.c |
7090 |
++++ linux-2.6.27-gentoo-r7/arch/s390/mm/extmem.c |
7091 |
+@@ -7,6 +7,9 @@ |
7092 |
+ * (C) IBM Corporation 2002-2004 |
7093 |
+ */ |
7094 |
+ |
7095 |
++#define KMSG_COMPONENT "extmem" |
7096 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
7097 |
++ |
7098 |
+ #include <linux/kernel.h> |
7099 |
+ #include <linux/string.h> |
7100 |
+ #include <linux/spinlock.h> |
7101 |
+@@ -24,39 +27,46 @@ |
7102 |
+ #include <asm/cpcmd.h> |
7103 |
+ #include <asm/setup.h> |
7104 |
+ |
7105 |
+-#define DCSS_DEBUG /* Debug messages on/off */ |
7106 |
+- |
7107 |
+-#define DCSS_NAME "extmem" |
7108 |
+-#ifdef DCSS_DEBUG |
7109 |
+-#define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSS_NAME " debug:" x) |
7110 |
+-#else |
7111 |
+-#define PRINT_DEBUG(x...) do {} while (0) |
7112 |
+-#endif |
7113 |
+-#define PRINT_INFO(x...) printk(KERN_INFO DCSS_NAME " info:" x) |
7114 |
+-#define PRINT_WARN(x...) printk(KERN_WARNING DCSS_NAME " warning:" x) |
7115 |
+-#define PRINT_ERR(x...) printk(KERN_ERR DCSS_NAME " error:" x) |
7116 |
+- |
7117 |
+- |
7118 |
+ #define DCSS_LOADSHR 0x00 |
7119 |
+ #define DCSS_LOADNSR 0x04 |
7120 |
+ #define DCSS_PURGESEG 0x08 |
7121 |
+ #define DCSS_FINDSEG 0x0c |
7122 |
+ #define DCSS_LOADNOLY 0x10 |
7123 |
+ #define DCSS_SEGEXT 0x18 |
7124 |
++#define DCSS_LOADSHRX 0x20 |
7125 |
++#define DCSS_LOADNSRX 0x24 |
7126 |
++#define DCSS_FINDSEGX 0x2c |
7127 |
++#define DCSS_SEGEXTX 0x38 |
7128 |
+ #define DCSS_FINDSEGA 0x0c |
7129 |
+ |
7130 |
+ struct qrange { |
7131 |
+- unsigned int start; // 3byte start address, 1 byte type |
7132 |
+- unsigned int end; // 3byte end address, 1 byte reserved |
7133 |
++ unsigned long start; /* last byte type */ |
7134 |
++ unsigned long end; /* last byte reserved */ |
7135 |
+ }; |
7136 |
+ |
7137 |
+ struct qout64 { |
7138 |
++ unsigned long segstart; |
7139 |
++ unsigned long segend; |
7140 |
++ int segcnt; |
7141 |
++ int segrcnt; |
7142 |
++ struct qrange range[6]; |
7143 |
++}; |
7144 |
++ |
7145 |
++#ifdef CONFIG_64BIT |
7146 |
++struct qrange_old { |
7147 |
++ unsigned int start; /* last byte type */ |
7148 |
++ unsigned int end; /* last byte reserved */ |
7149 |
++}; |
7150 |
++ |
7151 |
++/* output area format for the Diag x'64' old subcode x'18' */ |
7152 |
++struct qout64_old { |
7153 |
+ int segstart; |
7154 |
+ int segend; |
7155 |
+ int segcnt; |
7156 |
+ int segrcnt; |
7157 |
+- struct qrange range[6]; |
7158 |
++ struct qrange_old range[6]; |
7159 |
+ }; |
7160 |
++#endif |
7161 |
+ |
7162 |
+ struct qin64 { |
7163 |
+ char qopcode; |
7164 |
+@@ -86,6 +96,55 @@ static DEFINE_MUTEX(dcss_lock); |
7165 |
+ static LIST_HEAD(dcss_list); |
7166 |
+ static char *segtype_string[] = { "SW", "EW", "SR", "ER", "SN", "EN", "SC", |
7167 |
+ "EW/EN-MIXED" }; |
7168 |
++static int loadshr_scode, loadnsr_scode, findseg_scode; |
7169 |
++static int segext_scode, purgeseg_scode; |
7170 |
++static int scode_set; |
7171 |
++ |
7172 |
++/* set correct Diag x'64' subcodes. */ |
7173 |
++static int |
7174 |
++dcss_set_subcodes(void) |
7175 |
++{ |
7176 |
++#ifdef CONFIG_64BIT |
7177 |
++ char *name = kmalloc(8 * sizeof(char), GFP_DMA); |
7178 |
++ unsigned long rx, ry; |
7179 |
++ int rc; |
7180 |
++ |
7181 |
++ if (name == NULL) |
7182 |
++ return -ENOMEM; |
7183 |
++ |
7184 |
++ rx = (unsigned long) name; |
7185 |
++ ry = DCSS_FINDSEGX; |
7186 |
++ |
7187 |
++ strcpy(name, "dummy"); |
7188 |
++ asm volatile( |
7189 |
++ " diag %0,%1,0x64\n" |
7190 |
++ "0: ipm %2\n" |
7191 |
++ " srl %2,28\n" |
7192 |
++ " j 2f\n" |
7193 |
++ "1: la %2,3\n" |
7194 |
++ "2:\n" |
7195 |
++ EX_TABLE(0b, 1b) |
7196 |
++ : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc"); |
7197 |
++ |
7198 |
++ kfree(name); |
7199 |
++ /* Diag x'64' new subcodes are supported, set to new subcodes */ |
7200 |
++ if (rc != 3) { |
7201 |
++ loadshr_scode = DCSS_LOADSHRX; |
7202 |
++ loadnsr_scode = DCSS_LOADNSRX; |
7203 |
++ purgeseg_scode = DCSS_PURGESEG; |
7204 |
++ findseg_scode = DCSS_FINDSEGX; |
7205 |
++ segext_scode = DCSS_SEGEXTX; |
7206 |
++ return 0; |
7207 |
++ } |
7208 |
++#endif |
7209 |
++ /* Diag x'64' new subcodes are not supported, set to old subcodes */ |
7210 |
++ loadshr_scode = DCSS_LOADNOLY; |
7211 |
++ loadnsr_scode = DCSS_LOADNSR; |
7212 |
++ purgeseg_scode = DCSS_PURGESEG; |
7213 |
++ findseg_scode = DCSS_FINDSEG; |
7214 |
++ segext_scode = DCSS_SEGEXT; |
7215 |
++ return 0; |
7216 |
++} |
7217 |
+ |
7218 |
+ /* |
7219 |
+ * Create the 8 bytes, ebcdic VM segment name from |
7220 |
+@@ -135,25 +194,45 @@ segment_by_name (char *name) |
7221 |
+ * Perform a function on a dcss segment. |
7222 |
+ */ |
7223 |
+ static inline int |
7224 |
+-dcss_diag (__u8 func, void *parameter, |
7225 |
++dcss_diag(int *func, void *parameter, |
7226 |
+ unsigned long *ret1, unsigned long *ret2) |
7227 |
+ { |
7228 |
+ unsigned long rx, ry; |
7229 |
+ int rc; |
7230 |
+ |
7231 |
++ if (scode_set == 0) { |
7232 |
++ rc = dcss_set_subcodes(); |
7233 |
++ if (rc < 0) |
7234 |
++ return rc; |
7235 |
++ scode_set = 1; |
7236 |
++ } |
7237 |
+ rx = (unsigned long) parameter; |
7238 |
+- ry = (unsigned long) func; |
7239 |
+- asm volatile( |
7240 |
++ ry = (unsigned long) *func; |
7241 |
++ |
7242 |
+ #ifdef CONFIG_64BIT |
7243 |
+- " sam31\n" |
7244 |
+- " diag %0,%1,0x64\n" |
7245 |
+- " sam64\n" |
7246 |
++ /* 64-bit Diag x'64' new subcode, keep in 64-bit addressing mode */ |
7247 |
++ if (*func > DCSS_SEGEXT) |
7248 |
++ asm volatile( |
7249 |
++ " diag %0,%1,0x64\n" |
7250 |
++ " ipm %2\n" |
7251 |
++ " srl %2,28\n" |
7252 |
++ : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc"); |
7253 |
++ /* 31-bit Diag x'64' old subcode, switch to 31-bit addressing mode */ |
7254 |
++ else |
7255 |
++ asm volatile( |
7256 |
++ " sam31\n" |
7257 |
++ " diag %0,%1,0x64\n" |
7258 |
++ " sam64\n" |
7259 |
++ " ipm %2\n" |
7260 |
++ " srl %2,28\n" |
7261 |
++ : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc"); |
7262 |
+ #else |
7263 |
++ asm volatile( |
7264 |
+ " diag %0,%1,0x64\n" |
7265 |
+-#endif |
7266 |
+ " ipm %2\n" |
7267 |
+ " srl %2,28\n" |
7268 |
+ : "+d" (rx), "+d" (ry), "=d" (rc) : : "cc"); |
7269 |
++#endif |
7270 |
+ *ret1 = rx; |
7271 |
+ *ret2 = ry; |
7272 |
+ return rc; |
7273 |
+@@ -190,14 +269,45 @@ query_segment_type (struct dcss_segment |
7274 |
+ qin->qoutlen = sizeof(struct qout64); |
7275 |
+ memcpy (qin->qname, seg->dcss_name, 8); |
7276 |
+ |
7277 |
+- diag_cc = dcss_diag (DCSS_SEGEXT, qin, &dummy, &vmrc); |
7278 |
++ diag_cc = dcss_diag(&segext_scode, qin, &dummy, &vmrc); |
7279 |
+ |
7280 |
++ if (diag_cc < 0) { |
7281 |
++ rc = diag_cc; |
7282 |
++ goto out_free; |
7283 |
++ } |
7284 |
+ if (diag_cc > 1) { |
7285 |
+- PRINT_WARN ("segment_type: diag returned error %ld\n", vmrc); |
7286 |
++ pr_warning("Querying a DCSS type failed with rc=%ld\n", vmrc); |
7287 |
+ rc = dcss_diag_translate_rc (vmrc); |
7288 |
+ goto out_free; |
7289 |
+ } |
7290 |
+ |
7291 |
++#ifdef CONFIG_64BIT |
7292 |
++ /* Only old format of output area of Diagnose x'64' is supported, |
7293 |
++ copy data for the new format. */ |
7294 |
++ if (segext_scode == DCSS_SEGEXT) { |
7295 |
++ struct qout64_old *qout_old; |
7296 |
++ qout_old = kzalloc(sizeof(struct qout64_old), GFP_DMA); |
7297 |
++ if (qout_old == NULL) { |
7298 |
++ rc = -ENOMEM; |
7299 |
++ goto out_free; |
7300 |
++ } |
7301 |
++ memcpy(qout_old, qout, sizeof(struct qout64_old)); |
7302 |
++ qout->segstart = (unsigned long) qout_old->segstart; |
7303 |
++ qout->segend = (unsigned long) qout_old->segend; |
7304 |
++ qout->segcnt = qout_old->segcnt; |
7305 |
++ qout->segrcnt = qout_old->segrcnt; |
7306 |
++ |
7307 |
++ if (qout->segcnt > 6) |
7308 |
++ qout->segrcnt = 6; |
7309 |
++ for (i = 0; i < qout->segrcnt; i++) { |
7310 |
++ qout->range[i].start = |
7311 |
++ (unsigned long) qout_old->range[i].start; |
7312 |
++ qout->range[i].end = |
7313 |
++ (unsigned long) qout_old->range[i].end; |
7314 |
++ } |
7315 |
++ kfree(qout_old); |
7316 |
++ } |
7317 |
++#endif |
7318 |
+ if (qout->segcnt > 6) { |
7319 |
+ rc = -ENOTSUPP; |
7320 |
+ goto out_free; |
7321 |
+@@ -248,7 +358,6 @@ query_segment_type (struct dcss_segment |
7322 |
+ * -EIO : could not perform query diagnose |
7323 |
+ * -ENOENT : no such segment |
7324 |
+ * -ENOTSUPP: multi-part segment cannot be used with linux |
7325 |
+- * -ENOSPC : segment cannot be used (overlaps with storage) |
7326 |
+ * -ENOMEM : out of memory |
7327 |
+ * 0 .. 6 : type of segment as defined in include/asm-s390/extmem.h |
7328 |
+ */ |
7329 |
+@@ -269,6 +378,30 @@ segment_type (char* name) |
7330 |
+ } |
7331 |
+ |
7332 |
+ /* |
7333 |
++ * check if segment collides with other segments that are currently loaded |
7334 |
++ * returns 1 if this is the case, 0 if no collision was found |
7335 |
++ */ |
7336 |
++static int |
7337 |
++segment_overlaps_others (struct dcss_segment *seg) |
7338 |
++{ |
7339 |
++ struct list_head *l; |
7340 |
++ struct dcss_segment *tmp; |
7341 |
++ |
7342 |
++ BUG_ON(!mutex_is_locked(&dcss_lock)); |
7343 |
++ list_for_each(l, &dcss_list) { |
7344 |
++ tmp = list_entry(l, struct dcss_segment, list); |
7345 |
++ if ((tmp->start_addr >> 20) > (seg->end >> 20)) |
7346 |
++ continue; |
7347 |
++ if ((tmp->end >> 20) < (seg->start_addr >> 20)) |
7348 |
++ continue; |
7349 |
++ if (seg == tmp) |
7350 |
++ continue; |
7351 |
++ return 1; |
7352 |
++ } |
7353 |
++ return 0; |
7354 |
++} |
7355 |
++ |
7356 |
++/* |
7357 |
+ * real segment loading function, called from segment_load |
7358 |
+ */ |
7359 |
+ static int |
7360 |
+@@ -276,7 +409,8 @@ __segment_load (char *name, int do_nonsh |
7361 |
+ { |
7362 |
+ struct dcss_segment *seg = kmalloc(sizeof(struct dcss_segment), |
7363 |
+ GFP_DMA); |
7364 |
+- int dcss_command, rc, diag_cc; |
7365 |
++ int rc, diag_cc; |
7366 |
++ unsigned long start_addr, end_addr, dummy; |
7367 |
+ |
7368 |
+ if (seg == NULL) { |
7369 |
+ rc = -ENOMEM; |
7370 |
+@@ -287,6 +421,13 @@ __segment_load (char *name, int do_nonsh |
7371 |
+ if (rc < 0) |
7372 |
+ goto out_free; |
7373 |
+ |
7374 |
++ if (loadshr_scode == DCSS_LOADSHRX) { |
7375 |
++ if (segment_overlaps_others(seg)) { |
7376 |
++ rc = -EBUSY; |
7377 |
++ goto out_free; |
7378 |
++ } |
7379 |
++ } |
7380 |
++ |
7381 |
+ rc = vmem_add_mapping(seg->start_addr, seg->end - seg->start_addr + 1); |
7382 |
+ |
7383 |
+ if (rc) |
7384 |
+@@ -316,35 +457,40 @@ __segment_load (char *name, int do_nonsh |
7385 |
+ } |
7386 |
+ |
7387 |
+ if (do_nonshared) |
7388 |
+- dcss_command = DCSS_LOADNSR; |
7389 |
++ diag_cc = dcss_diag(&loadnsr_scode, seg->dcss_name, |
7390 |
++ &start_addr, &end_addr); |
7391 |
+ else |
7392 |
+- dcss_command = DCSS_LOADNOLY; |
7393 |
+- |
7394 |
+- diag_cc = dcss_diag(dcss_command, seg->dcss_name, |
7395 |
+- &seg->start_addr, &seg->end); |
7396 |
++ diag_cc = dcss_diag(&loadshr_scode, seg->dcss_name, |
7397 |
++ &start_addr, &end_addr); |
7398 |
++ if (diag_cc < 0) { |
7399 |
++ dcss_diag(&purgeseg_scode, seg->dcss_name, |
7400 |
++ &dummy, &dummy); |
7401 |
++ rc = diag_cc; |
7402 |
++ goto out_resource; |
7403 |
++ } |
7404 |
+ if (diag_cc > 1) { |
7405 |
+- PRINT_WARN ("segment_load: could not load segment %s - " |
7406 |
+- "diag returned error (%ld)\n",name,seg->end); |
7407 |
+- rc = dcss_diag_translate_rc (seg->end); |
7408 |
+- dcss_diag(DCSS_PURGESEG, seg->dcss_name, |
7409 |
+- &seg->start_addr, &seg->end); |
7410 |
++ pr_warning("Loading DCSS %s failed with rc=%ld\n", name, |
7411 |
++ end_addr); |
7412 |
++ rc = dcss_diag_translate_rc(end_addr); |
7413 |
++ dcss_diag(&purgeseg_scode, seg->dcss_name, |
7414 |
++ &dummy, &dummy); |
7415 |
+ goto out_resource; |
7416 |
+ } |
7417 |
++ seg->start_addr = start_addr; |
7418 |
++ seg->end = end_addr; |
7419 |
+ seg->do_nonshared = do_nonshared; |
7420 |
+ atomic_set(&seg->ref_count, 1); |
7421 |
+ list_add(&seg->list, &dcss_list); |
7422 |
+ *addr = seg->start_addr; |
7423 |
+ *end = seg->end; |
7424 |
+ if (do_nonshared) |
7425 |
+- PRINT_INFO ("segment_load: loaded segment %s range %p .. %p " |
7426 |
+- "type %s in non-shared mode\n", name, |
7427 |
+- (void*)seg->start_addr, (void*)seg->end, |
7428 |
+- segtype_string[seg->vm_segtype]); |
7429 |
++ pr_info("DCSS %s of range %p to %p and type %s loaded as " |
7430 |
++ "exclusive-writable\n", name, (void*) seg->start_addr, |
7431 |
++ (void*) seg->end, segtype_string[seg->vm_segtype]); |
7432 |
+ else { |
7433 |
+- PRINT_INFO ("segment_load: loaded segment %s range %p .. %p " |
7434 |
+- "type %s in shared mode\n", name, |
7435 |
+- (void*)seg->start_addr, (void*)seg->end, |
7436 |
+- segtype_string[seg->vm_segtype]); |
7437 |
++ pr_info("DCSS %s of range %p to %p and type %s loaded in " |
7438 |
++ "shared access mode\n", name, (void*) seg->start_addr, |
7439 |
++ (void*) seg->end, segtype_string[seg->vm_segtype]); |
7440 |
+ } |
7441 |
+ goto out; |
7442 |
+ out_resource: |
7443 |
+@@ -423,8 +569,8 @@ int |
7444 |
+ segment_modify_shared (char *name, int do_nonshared) |
7445 |
+ { |
7446 |
+ struct dcss_segment *seg; |
7447 |
+- unsigned long dummy; |
7448 |
+- int dcss_command, rc, diag_cc; |
7449 |
++ unsigned long start_addr, end_addr, dummy; |
7450 |
++ int rc, diag_cc; |
7451 |
+ |
7452 |
+ mutex_lock(&dcss_lock); |
7453 |
+ seg = segment_by_name (name); |
7454 |
+@@ -433,50 +579,62 @@ segment_modify_shared (char *name, int d |
7455 |
+ goto out_unlock; |
7456 |
+ } |
7457 |
+ if (do_nonshared == seg->do_nonshared) { |
7458 |
+- PRINT_INFO ("segment_modify_shared: not reloading segment %s" |
7459 |
+- " - already in requested mode\n",name); |
7460 |
++ pr_info("DCSS %s is already in the requested access " |
7461 |
++ "mode\n", name); |
7462 |
+ rc = 0; |
7463 |
+ goto out_unlock; |
7464 |
+ } |
7465 |
+ if (atomic_read (&seg->ref_count) != 1) { |
7466 |
+- PRINT_WARN ("segment_modify_shared: not reloading segment %s - " |
7467 |
+- "segment is in use by other driver(s)\n",name); |
7468 |
++ pr_warning("DCSS %s is in use and cannot be reloaded\n", |
7469 |
++ name); |
7470 |
+ rc = -EAGAIN; |
7471 |
+ goto out_unlock; |
7472 |
+ } |
7473 |
+ release_resource(seg->res); |
7474 |
+- if (do_nonshared) { |
7475 |
+- dcss_command = DCSS_LOADNSR; |
7476 |
++ if (do_nonshared) |
7477 |
+ seg->res->flags &= ~IORESOURCE_READONLY; |
7478 |
+- } else { |
7479 |
+- dcss_command = DCSS_LOADNOLY; |
7480 |
++ else |
7481 |
+ if (seg->vm_segtype == SEG_TYPE_SR || |
7482 |
+ seg->vm_segtype == SEG_TYPE_ER) |
7483 |
+ seg->res->flags |= IORESOURCE_READONLY; |
7484 |
+- } |
7485 |
++ |
7486 |
+ if (request_resource(&iomem_resource, seg->res)) { |
7487 |
+- PRINT_WARN("segment_modify_shared: could not reload segment %s" |
7488 |
+- " - overlapping resources\n", name); |
7489 |
++ pr_warning("DCSS %s overlaps with used memory resources " |
7490 |
++ "and cannot be reloaded\n", name); |
7491 |
+ rc = -EBUSY; |
7492 |
+ kfree(seg->res); |
7493 |
+- goto out_del; |
7494 |
++ goto out_del_mem; |
7495 |
++ } |
7496 |
++ |
7497 |
++ dcss_diag(&purgeseg_scode, seg->dcss_name, &dummy, &dummy); |
7498 |
++ if (do_nonshared) |
7499 |
++ diag_cc = dcss_diag(&loadnsr_scode, seg->dcss_name, |
7500 |
++ &start_addr, &end_addr); |
7501 |
++ else |
7502 |
++ diag_cc = dcss_diag(&loadshr_scode, seg->dcss_name, |
7503 |
++ &start_addr, &end_addr); |
7504 |
++ if (diag_cc < 0) { |
7505 |
++ rc = diag_cc; |
7506 |
++ goto out_del_res; |
7507 |
+ } |
7508 |
+- dcss_diag(DCSS_PURGESEG, seg->dcss_name, &dummy, &dummy); |
7509 |
+- diag_cc = dcss_diag(dcss_command, seg->dcss_name, |
7510 |
+- &seg->start_addr, &seg->end); |
7511 |
+ if (diag_cc > 1) { |
7512 |
+- PRINT_WARN ("segment_modify_shared: could not reload segment %s" |
7513 |
+- " - diag returned error (%ld)\n",name,seg->end); |
7514 |
+- rc = dcss_diag_translate_rc (seg->end); |
7515 |
+- goto out_del; |
7516 |
++ pr_warning("Reloading DCSS %s failed with rc=%ld\n", name, |
7517 |
++ end_addr); |
7518 |
++ rc = dcss_diag_translate_rc(end_addr); |
7519 |
++ goto out_del_res; |
7520 |
+ } |
7521 |
++ seg->start_addr = start_addr; |
7522 |
++ seg->end = end_addr; |
7523 |
+ seg->do_nonshared = do_nonshared; |
7524 |
+ rc = 0; |
7525 |
+ goto out_unlock; |
7526 |
+- out_del: |
7527 |
++ out_del_res: |
7528 |
++ release_resource(seg->res); |
7529 |
++ kfree(seg->res); |
7530 |
++ out_del_mem: |
7531 |
+ vmem_remove_mapping(seg->start_addr, seg->end - seg->start_addr + 1); |
7532 |
+ list_del(&seg->list); |
7533 |
+- dcss_diag(DCSS_PURGESEG, seg->dcss_name, &dummy, &dummy); |
7534 |
++ dcss_diag(&purgeseg_scode, seg->dcss_name, &dummy, &dummy); |
7535 |
+ kfree(seg); |
7536 |
+ out_unlock: |
7537 |
+ mutex_unlock(&dcss_lock); |
7538 |
+@@ -500,8 +658,7 @@ segment_unload(char *name) |
7539 |
+ mutex_lock(&dcss_lock); |
7540 |
+ seg = segment_by_name (name); |
7541 |
+ if (seg == NULL) { |
7542 |
+- PRINT_ERR ("could not find segment %s in segment_unload, " |
7543 |
+- "please report to linux390@××××××.com\n",name); |
7544 |
++ pr_err("Unloading unknown DCSS %s failed\n", name); |
7545 |
+ goto out_unlock; |
7546 |
+ } |
7547 |
+ if (atomic_dec_return(&seg->ref_count) != 0) |
7548 |
+@@ -510,7 +667,7 @@ segment_unload(char *name) |
7549 |
+ kfree(seg->res); |
7550 |
+ vmem_remove_mapping(seg->start_addr, seg->end - seg->start_addr + 1); |
7551 |
+ list_del(&seg->list); |
7552 |
+- dcss_diag(DCSS_PURGESEG, seg->dcss_name, &dummy, &dummy); |
7553 |
++ dcss_diag(&purgeseg_scode, seg->dcss_name, &dummy, &dummy); |
7554 |
+ kfree(seg); |
7555 |
+ out_unlock: |
7556 |
+ mutex_unlock(&dcss_lock); |
7557 |
+@@ -536,8 +693,7 @@ segment_save(char *name) |
7558 |
+ seg = segment_by_name (name); |
7559 |
+ |
7560 |
+ if (seg == NULL) { |
7561 |
+- PRINT_ERR("could not find segment %s in segment_save, please " |
7562 |
+- "report to linux390@××××××.com\n", name); |
7563 |
++ pr_err("Saving unknown DCSS %s failed\n", name); |
7564 |
+ goto out; |
7565 |
+ } |
7566 |
+ |
7567 |
+@@ -545,7 +701,7 @@ segment_save(char *name) |
7568 |
+ endpfn = (seg->end) >> PAGE_SHIFT; |
7569 |
+ sprintf(cmd1, "DEFSEG %s", name); |
7570 |
+ for (i=0; i<seg->segcnt; i++) { |
7571 |
+- sprintf(cmd1+strlen(cmd1), " %X-%X %s", |
7572 |
++ sprintf(cmd1+strlen(cmd1), " %lX-%lX %s", |
7573 |
+ seg->range[i].start >> PAGE_SHIFT, |
7574 |
+ seg->range[i].end >> PAGE_SHIFT, |
7575 |
+ segtype_string[seg->range[i].start & 0xff]); |
7576 |
+@@ -554,14 +710,14 @@ segment_save(char *name) |
7577 |
+ response = 0; |
7578 |
+ cpcmd(cmd1, NULL, 0, &response); |
7579 |
+ if (response) { |
7580 |
+- PRINT_ERR("segment_save: DEFSEG failed with response code %i\n", |
7581 |
+- response); |
7582 |
++ pr_err("Saving a DCSS failed with DEFSEG response code " |
7583 |
++ "%i\n", response); |
7584 |
+ goto out; |
7585 |
+ } |
7586 |
+ cpcmd(cmd2, NULL, 0, &response); |
7587 |
+ if (response) { |
7588 |
+- PRINT_ERR("segment_save: SAVESEG failed with response code %i\n", |
7589 |
+- response); |
7590 |
++ pr_err("Saving a DCSS failed with SAVESEG response code " |
7591 |
++ "%i\n", response); |
7592 |
+ goto out; |
7593 |
+ } |
7594 |
+ out: |
7595 |
+@@ -576,44 +732,41 @@ void segment_warning(int rc, char *seg_n |
7596 |
+ { |
7597 |
+ switch (rc) { |
7598 |
+ case -ENOENT: |
7599 |
+- PRINT_WARN("cannot load/query segment %s, " |
7600 |
+- "does not exist\n", seg_name); |
7601 |
++ pr_err("DCSS %s cannot be loaded or queried\n", seg_name); |
7602 |
+ break; |
7603 |
+ case -ENOSYS: |
7604 |
+- PRINT_WARN("cannot load/query segment %s, " |
7605 |
+- "not running on VM\n", seg_name); |
7606 |
++ pr_err("DCSS %s cannot be loaded or queried without " |
7607 |
++ "z/VM\n", seg_name); |
7608 |
+ break; |
7609 |
+ case -EIO: |
7610 |
+- PRINT_WARN("cannot load/query segment %s, " |
7611 |
+- "hardware error\n", seg_name); |
7612 |
++ pr_err("Loading or querying DCSS %s resulted in a " |
7613 |
++ "hardware error\n", seg_name); |
7614 |
+ break; |
7615 |
+ case -ENOTSUPP: |
7616 |
+- PRINT_WARN("cannot load/query segment %s, " |
7617 |
+- "is a multi-part segment\n", seg_name); |
7618 |
++ pr_err("DCSS %s has multiple page ranges and cannot be " |
7619 |
++ "loaded or queried\n", seg_name); |
7620 |
+ break; |
7621 |
+ case -ENOSPC: |
7622 |
+- PRINT_WARN("cannot load/query segment %s, " |
7623 |
+- "overlaps with storage\n", seg_name); |
7624 |
++ pr_err("DCSS %s overlaps with used storage and cannot " |
7625 |
++ "be loaded\n", seg_name); |
7626 |
+ break; |
7627 |
+ case -EBUSY: |
7628 |
+- PRINT_WARN("cannot load/query segment %s, " |
7629 |
+- "overlaps with already loaded dcss\n", seg_name); |
7630 |
++ pr_err("%s needs used memory resources and cannot be " |
7631 |
++ "loaded or queried\n", seg_name); |
7632 |
+ break; |
7633 |
+ case -EPERM: |
7634 |
+- PRINT_WARN("cannot load/query segment %s, " |
7635 |
+- "already loaded in incompatible mode\n", seg_name); |
7636 |
++ pr_err("DCSS %s is already loaded in a different access " |
7637 |
++ "mode\n", seg_name); |
7638 |
+ break; |
7639 |
+ case -ENOMEM: |
7640 |
+- PRINT_WARN("cannot load/query segment %s, " |
7641 |
+- "out of memory\n", seg_name); |
7642 |
++ pr_err("There is not enough memory to load or query " |
7643 |
++ "DCSS %s\n", seg_name); |
7644 |
+ break; |
7645 |
+ case -ERANGE: |
7646 |
+- PRINT_WARN("cannot load/query segment %s, " |
7647 |
+- "exceeds kernel mapping range\n", seg_name); |
7648 |
++ pr_err("DCSS %s exceeds the kernel mapping range (%lu) " |
7649 |
++ "and cannot be loaded\n", seg_name, VMEM_MAX_PHYS); |
7650 |
+ break; |
7651 |
+ default: |
7652 |
+- PRINT_WARN("cannot load/query segment %s, " |
7653 |
+- "return value %i\n", seg_name, rc); |
7654 |
+ break; |
7655 |
+ } |
7656 |
+ } |
7657 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/block/dcssblk.c |
7658 |
+=================================================================== |
7659 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/block/dcssblk.c |
7660 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/block/dcssblk.c |
7661 |
+@@ -4,6 +4,9 @@ |
7662 |
+ * Authors: Carsten Otte, Stefan Weinhuber, Gerald Schaefer |
7663 |
+ */ |
7664 |
+ |
7665 |
++#define KMSG_COMPONENT "dcssblk" |
7666 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
7667 |
++ |
7668 |
+ #include <linux/module.h> |
7669 |
+ #include <linux/moduleparam.h> |
7670 |
+ #include <linux/ctype.h> |
7671 |
+@@ -17,21 +20,10 @@ |
7672 |
+ #include <linux/interrupt.h> |
7673 |
+ #include <asm/s390_rdev.h> |
7674 |
+ |
7675 |
+-//#define DCSSBLK_DEBUG /* Debug messages on/off */ |
7676 |
+ #define DCSSBLK_NAME "dcssblk" |
7677 |
+ #define DCSSBLK_MINORS_PER_DISK 1 |
7678 |
+ #define DCSSBLK_PARM_LEN 400 |
7679 |
+ |
7680 |
+-#ifdef DCSSBLK_DEBUG |
7681 |
+-#define PRINT_DEBUG(x...) printk(KERN_DEBUG DCSSBLK_NAME " debug: " x) |
7682 |
+-#else |
7683 |
+-#define PRINT_DEBUG(x...) do {} while (0) |
7684 |
+-#endif |
7685 |
+-#define PRINT_INFO(x...) printk(KERN_INFO DCSSBLK_NAME " info: " x) |
7686 |
+-#define PRINT_WARN(x...) printk(KERN_WARNING DCSSBLK_NAME " warning: " x) |
7687 |
+-#define PRINT_ERR(x...) printk(KERN_ERR DCSSBLK_NAME " error: " x) |
7688 |
+- |
7689 |
+- |
7690 |
+ static int dcssblk_open(struct inode *inode, struct file *filp); |
7691 |
+ static int dcssblk_release(struct inode *inode, struct file *filp); |
7692 |
+ static int dcssblk_make_request(struct request_queue *q, struct bio *bio); |
7693 |
+@@ -48,6 +40,30 @@ static struct block_device_operations dc |
7694 |
+ .direct_access = dcssblk_direct_access, |
7695 |
+ }; |
7696 |
+ |
7697 |
++struct dcssblk_dev_info { |
7698 |
++ struct list_head lh; |
7699 |
++ struct device dev; |
7700 |
++ char segment_name[BUS_ID_SIZE]; |
7701 |
++ atomic_t use_count; |
7702 |
++ struct gendisk *gd; |
7703 |
++ unsigned long start; |
7704 |
++ unsigned long end; |
7705 |
++ int segment_type; |
7706 |
++ unsigned char save_pending; |
7707 |
++ unsigned char is_shared; |
7708 |
++ struct request_queue *dcssblk_queue; |
7709 |
++ int num_of_segments; |
7710 |
++ struct list_head seg_list; |
7711 |
++}; |
7712 |
++ |
7713 |
++struct segment_info { |
7714 |
++ struct list_head lh; |
7715 |
++ char segment_name[BUS_ID_SIZE]; |
7716 |
++ unsigned long start; |
7717 |
++ unsigned long end; |
7718 |
++ int segment_type; |
7719 |
++}; |
7720 |
++ |
7721 |
+ static ssize_t dcssblk_add_store(struct device * dev, struct device_attribute *attr, const char * buf, |
7722 |
+ size_t count); |
7723 |
+ static ssize_t dcssblk_remove_store(struct device * dev, struct device_attribute *attr, const char * buf, |
7724 |
+@@ -58,30 +74,20 @@ static ssize_t dcssblk_save_show(struct |
7725 |
+ static ssize_t dcssblk_shared_store(struct device * dev, struct device_attribute *attr, const char * buf, |
7726 |
+ size_t count); |
7727 |
+ static ssize_t dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf); |
7728 |
++static ssize_t dcssblk_seglist_show(struct device *dev, |
7729 |
++ struct device_attribute *attr, |
7730 |
++ char *buf); |
7731 |
+ |
7732 |
+ static DEVICE_ATTR(add, S_IWUSR, NULL, dcssblk_add_store); |
7733 |
+ static DEVICE_ATTR(remove, S_IWUSR, NULL, dcssblk_remove_store); |
7734 |
+-static DEVICE_ATTR(save, S_IWUSR | S_IRUGO, dcssblk_save_show, |
7735 |
++static DEVICE_ATTR(save, S_IWUSR | S_IRUSR, dcssblk_save_show, |
7736 |
+ dcssblk_save_store); |
7737 |
+-static DEVICE_ATTR(shared, S_IWUSR | S_IRUGO, dcssblk_shared_show, |
7738 |
++static DEVICE_ATTR(shared, S_IWUSR | S_IRUSR, dcssblk_shared_show, |
7739 |
+ dcssblk_shared_store); |
7740 |
++static DEVICE_ATTR(seglist, S_IRUSR, dcssblk_seglist_show, NULL); |
7741 |
+ |
7742 |
+ static struct device *dcssblk_root_dev; |
7743 |
+ |
7744 |
+-struct dcssblk_dev_info { |
7745 |
+- struct list_head lh; |
7746 |
+- struct device dev; |
7747 |
+- char segment_name[BUS_ID_SIZE]; |
7748 |
+- atomic_t use_count; |
7749 |
+- struct gendisk *gd; |
7750 |
+- unsigned long start; |
7751 |
+- unsigned long end; |
7752 |
+- int segment_type; |
7753 |
+- unsigned char save_pending; |
7754 |
+- unsigned char is_shared; |
7755 |
+- struct request_queue *dcssblk_queue; |
7756 |
+-}; |
7757 |
+- |
7758 |
+ static LIST_HEAD(dcssblk_devices); |
7759 |
+ static struct rw_semaphore dcssblk_devices_sem; |
7760 |
+ |
7761 |
+@@ -91,8 +97,15 @@ static struct rw_semaphore dcssblk_devic |
7762 |
+ static void |
7763 |
+ dcssblk_release_segment(struct device *dev) |
7764 |
+ { |
7765 |
+- PRINT_DEBUG("segment release fn called for %s\n", dev->bus_id); |
7766 |
+- kfree(container_of(dev, struct dcssblk_dev_info, dev)); |
7767 |
++ struct dcssblk_dev_info *dev_info; |
7768 |
++ struct segment_info *entry, *temp; |
7769 |
++ |
7770 |
++ dev_info = container_of(dev, struct dcssblk_dev_info, dev); |
7771 |
++ list_for_each_entry_safe(entry, temp, &dev_info->seg_list, lh) { |
7772 |
++ list_del(&entry->lh); |
7773 |
++ kfree(entry); |
7774 |
++ } |
7775 |
++ kfree(dev_info); |
7776 |
+ module_put(THIS_MODULE); |
7777 |
+ } |
7778 |
+ |
7779 |
+@@ -142,6 +155,168 @@ dcssblk_get_device_by_name(char *name) |
7780 |
+ return NULL; |
7781 |
+ } |
7782 |
+ |
7783 |
++/* |
7784 |
++ * get the struct segment_info from seg_list |
7785 |
++ * for the given name. |
7786 |
++ * down_read(&dcssblk_devices_sem) must be held. |
7787 |
++ */ |
7788 |
++static struct segment_info * |
7789 |
++dcssblk_get_segment_by_name(char *name) |
7790 |
++{ |
7791 |
++ struct dcssblk_dev_info *dev_info; |
7792 |
++ struct segment_info *entry; |
7793 |
++ |
7794 |
++ list_for_each_entry(dev_info, &dcssblk_devices, lh) { |
7795 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
7796 |
++ if (!strcmp(name, entry->segment_name)) |
7797 |
++ return entry; |
7798 |
++ } |
7799 |
++ } |
7800 |
++ return NULL; |
7801 |
++} |
7802 |
++ |
7803 |
++/* |
7804 |
++ * get the highest address of the multi-segment block. |
7805 |
++ */ |
7806 |
++static unsigned long |
7807 |
++dcssblk_find_highest_addr(struct dcssblk_dev_info *dev_info) |
7808 |
++{ |
7809 |
++ unsigned long highest_addr; |
7810 |
++ struct segment_info *entry; |
7811 |
++ |
7812 |
++ highest_addr = 0; |
7813 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
7814 |
++ if (highest_addr < entry->end) |
7815 |
++ highest_addr = entry->end; |
7816 |
++ } |
7817 |
++ return highest_addr; |
7818 |
++} |
7819 |
++ |
7820 |
++/* |
7821 |
++ * get the lowest address of the multi-segment block. |
7822 |
++ */ |
7823 |
++static unsigned long |
7824 |
++dcssblk_find_lowest_addr(struct dcssblk_dev_info *dev_info) |
7825 |
++{ |
7826 |
++ int set_first; |
7827 |
++ unsigned long lowest_addr; |
7828 |
++ struct segment_info *entry; |
7829 |
++ |
7830 |
++ set_first = 0; |
7831 |
++ lowest_addr = 0; |
7832 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
7833 |
++ if (set_first == 0) { |
7834 |
++ lowest_addr = entry->start; |
7835 |
++ set_first = 1; |
7836 |
++ } else { |
7837 |
++ if (lowest_addr > entry->start) |
7838 |
++ lowest_addr = entry->start; |
7839 |
++ } |
7840 |
++ } |
7841 |
++ return lowest_addr; |
7842 |
++} |
7843 |
++ |
7844 |
++/* |
7845 |
++ * Check continuity of segments. |
7846 |
++ */ |
7847 |
++static int |
7848 |
++dcssblk_is_continuous(struct dcssblk_dev_info *dev_info) |
7849 |
++{ |
7850 |
++ int i, j, rc; |
7851 |
++ struct segment_info *sort_list, *entry, temp; |
7852 |
++ |
7853 |
++ if (dev_info->num_of_segments <= 1) |
7854 |
++ return 0; |
7855 |
++ |
7856 |
++ sort_list = kzalloc( |
7857 |
++ sizeof(struct segment_info) * dev_info->num_of_segments, |
7858 |
++ GFP_KERNEL); |
7859 |
++ if (sort_list == NULL) |
7860 |
++ return -ENOMEM; |
7861 |
++ i = 0; |
7862 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
7863 |
++ memcpy(&sort_list[i], entry, sizeof(struct segment_info)); |
7864 |
++ i++; |
7865 |
++ } |
7866 |
++ |
7867 |
++ /* sort segments */ |
7868 |
++ for (i = 0; i < dev_info->num_of_segments; i++) |
7869 |
++ for (j = 0; j < dev_info->num_of_segments; j++) |
7870 |
++ if (sort_list[j].start > sort_list[i].start) { |
7871 |
++ memcpy(&temp, &sort_list[i], |
7872 |
++ sizeof(struct segment_info)); |
7873 |
++ memcpy(&sort_list[i], &sort_list[j], |
7874 |
++ sizeof(struct segment_info)); |
7875 |
++ memcpy(&sort_list[j], &temp, |
7876 |
++ sizeof(struct segment_info)); |
7877 |
++ } |
7878 |
++ |
7879 |
++ /* check continuity */ |
7880 |
++ for (i = 0; i < dev_info->num_of_segments - 1; i++) { |
7881 |
++ if ((sort_list[i].end + 1) != sort_list[i+1].start) { |
7882 |
++ pr_err("Adjacent DCSSs %s and %s are not " |
7883 |
++ "contiguous\n", sort_list[i].segment_name, |
7884 |
++ sort_list[i+1].segment_name); |
7885 |
++ rc = -EINVAL; |
7886 |
++ goto out; |
7887 |
++ } |
7888 |
++ /* EN and EW are allowed in a block device */ |
7889 |
++ if (sort_list[i].segment_type != sort_list[i+1].segment_type) { |
7890 |
++ if (!(sort_list[i].segment_type & SEGMENT_EXCLUSIVE) || |
7891 |
++ (sort_list[i].segment_type == SEG_TYPE_ER) || |
7892 |
++ !(sort_list[i+1].segment_type & |
7893 |
++ SEGMENT_EXCLUSIVE) || |
7894 |
++ (sort_list[i+1].segment_type == SEG_TYPE_ER)) { |
7895 |
++ pr_err("DCSS %s and DCSS %s have " |
7896 |
++ "incompatible types\n", |
7897 |
++ sort_list[i].segment_name, |
7898 |
++ sort_list[i+1].segment_name); |
7899 |
++ rc = -EINVAL; |
7900 |
++ goto out; |
7901 |
++ } |
7902 |
++ } |
7903 |
++ } |
7904 |
++ rc = 0; |
7905 |
++out: |
7906 |
++ kfree(sort_list); |
7907 |
++ return rc; |
7908 |
++} |
7909 |
++ |
7910 |
++/* |
7911 |
++ * Load a segment |
7912 |
++ */ |
7913 |
++static int |
7914 |
++dcssblk_load_segment(char *name, struct segment_info **seg_info) |
7915 |
++{ |
7916 |
++ int rc; |
7917 |
++ |
7918 |
++ /* already loaded? */ |
7919 |
++ down_read(&dcssblk_devices_sem); |
7920 |
++ *seg_info = dcssblk_get_segment_by_name(name); |
7921 |
++ up_read(&dcssblk_devices_sem); |
7922 |
++ if (*seg_info != NULL) |
7923 |
++ return -EEXIST; |
7924 |
++ |
7925 |
++ /* get a struct segment_info */ |
7926 |
++ *seg_info = kzalloc(sizeof(struct segment_info), GFP_KERNEL); |
7927 |
++ if (*seg_info == NULL) |
7928 |
++ return -ENOMEM; |
7929 |
++ |
7930 |
++ strcpy((*seg_info)->segment_name, name); |
7931 |
++ |
7932 |
++ /* load the segment */ |
7933 |
++ rc = segment_load(name, SEGMENT_SHARED, |
7934 |
++ &(*seg_info)->start, &(*seg_info)->end); |
7935 |
++ if (rc < 0) { |
7936 |
++ segment_warning(rc, (*seg_info)->segment_name); |
7937 |
++ kfree(*seg_info); |
7938 |
++ } else { |
7939 |
++ INIT_LIST_HEAD(&(*seg_info)->lh); |
7940 |
++ (*seg_info)->segment_type = rc; |
7941 |
++ } |
7942 |
++ return rc; |
7943 |
++} |
7944 |
++ |
7945 |
+ static void dcssblk_unregister_callback(struct device *dev) |
7946 |
+ { |
7947 |
+ device_unregister(dev); |
7948 |
+@@ -165,6 +340,7 @@ static ssize_t |
7949 |
+ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count) |
7950 |
+ { |
7951 |
+ struct dcssblk_dev_info *dev_info; |
7952 |
++ struct segment_info *entry, *temp; |
7953 |
+ int rc; |
7954 |
+ |
7955 |
+ if ((count > 1) && (inbuf[1] != '\n') && (inbuf[1] != '\0')) |
7956 |
+@@ -172,46 +348,47 @@ dcssblk_shared_store(struct device *dev, |
7957 |
+ down_write(&dcssblk_devices_sem); |
7958 |
+ dev_info = container_of(dev, struct dcssblk_dev_info, dev); |
7959 |
+ if (atomic_read(&dev_info->use_count)) { |
7960 |
+- PRINT_ERR("share: segment %s is busy!\n", |
7961 |
+- dev_info->segment_name); |
7962 |
+ rc = -EBUSY; |
7963 |
+ goto out; |
7964 |
+ } |
7965 |
+ if (inbuf[0] == '1') { |
7966 |
+- // reload segment in shared mode |
7967 |
+- rc = segment_modify_shared(dev_info->segment_name, |
7968 |
+- SEGMENT_SHARED); |
7969 |
+- if (rc < 0) { |
7970 |
+- BUG_ON(rc == -EINVAL); |
7971 |
+- if (rc != -EAGAIN) |
7972 |
+- goto removeseg; |
7973 |
+- } else { |
7974 |
+- dev_info->is_shared = 1; |
7975 |
+- switch (dev_info->segment_type) { |
7976 |
+- case SEG_TYPE_SR: |
7977 |
+- case SEG_TYPE_ER: |
7978 |
+- case SEG_TYPE_SC: |
7979 |
+- set_disk_ro(dev_info->gd,1); |
7980 |
++ /* reload segments in shared mode */ |
7981 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
7982 |
++ rc = segment_modify_shared(entry->segment_name, |
7983 |
++ SEGMENT_SHARED); |
7984 |
++ if (rc < 0) { |
7985 |
++ BUG_ON(rc == -EINVAL); |
7986 |
++ if (rc != -EAGAIN) |
7987 |
++ goto removeseg; |
7988 |
+ } |
7989 |
+ } |
7990 |
++ dev_info->is_shared = 1; |
7991 |
++ switch (dev_info->segment_type) { |
7992 |
++ case SEG_TYPE_SR: |
7993 |
++ case SEG_TYPE_ER: |
7994 |
++ case SEG_TYPE_SC: |
7995 |
++ set_disk_ro(dev_info->gd, 1); |
7996 |
++ } |
7997 |
+ } else if (inbuf[0] == '0') { |
7998 |
+- // reload segment in exclusive mode |
7999 |
++ /* reload segments in exclusive mode */ |
8000 |
+ if (dev_info->segment_type == SEG_TYPE_SC) { |
8001 |
+- PRINT_ERR("Segment type SC (%s) cannot be loaded in " |
8002 |
+- "non-shared mode\n", dev_info->segment_name); |
8003 |
++ pr_err("DCSS %s is of type SC and cannot be " |
8004 |
++ "loaded as exclusive-writable\n", |
8005 |
++ dev_info->segment_name); |
8006 |
+ rc = -EINVAL; |
8007 |
+ goto out; |
8008 |
+ } |
8009 |
+- rc = segment_modify_shared(dev_info->segment_name, |
8010 |
+- SEGMENT_EXCLUSIVE); |
8011 |
+- if (rc < 0) { |
8012 |
+- BUG_ON(rc == -EINVAL); |
8013 |
+- if (rc != -EAGAIN) |
8014 |
+- goto removeseg; |
8015 |
+- } else { |
8016 |
+- dev_info->is_shared = 0; |
8017 |
+- set_disk_ro(dev_info->gd, 0); |
8018 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
8019 |
++ rc = segment_modify_shared(entry->segment_name, |
8020 |
++ SEGMENT_EXCLUSIVE); |
8021 |
++ if (rc < 0) { |
8022 |
++ BUG_ON(rc == -EINVAL); |
8023 |
++ if (rc != -EAGAIN) |
8024 |
++ goto removeseg; |
8025 |
++ } |
8026 |
+ } |
8027 |
++ dev_info->is_shared = 0; |
8028 |
++ set_disk_ro(dev_info->gd, 0); |
8029 |
+ } else { |
8030 |
+ rc = -EINVAL; |
8031 |
+ goto out; |
8032 |
+@@ -220,8 +397,13 @@ dcssblk_shared_store(struct device *dev, |
8033 |
+ goto out; |
8034 |
+ |
8035 |
+ removeseg: |
8036 |
+- PRINT_ERR("Could not reload segment %s, removing it now!\n", |
8037 |
+- dev_info->segment_name); |
8038 |
++ pr_err("DCSS device %s is removed after a failed access mode " |
8039 |
++ "change\n", dev_info->segment_name); |
8040 |
++ temp = entry; |
8041 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
8042 |
++ if (entry != temp) |
8043 |
++ segment_unload(entry->segment_name); |
8044 |
++ } |
8045 |
+ list_del(&dev_info->lh); |
8046 |
+ |
8047 |
+ del_gendisk(dev_info->gd); |
8048 |
+@@ -254,6 +436,7 @@ static ssize_t |
8049 |
+ dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count) |
8050 |
+ { |
8051 |
+ struct dcssblk_dev_info *dev_info; |
8052 |
++ struct segment_info *entry; |
8053 |
+ |
8054 |
+ if ((count > 1) && (inbuf[1] != '\n') && (inbuf[1] != '\0')) |
8055 |
+ return -EINVAL; |
8056 |
+@@ -263,15 +446,17 @@ dcssblk_save_store(struct device *dev, s |
8057 |
+ if (inbuf[0] == '1') { |
8058 |
+ if (atomic_read(&dev_info->use_count) == 0) { |
8059 |
+ // device is idle => we save immediately |
8060 |
+- PRINT_INFO("Saving segment %s\n", |
8061 |
+- dev_info->segment_name); |
8062 |
+- segment_save(dev_info->segment_name); |
8063 |
++ pr_info("All DCSSs that map to device %s are " |
8064 |
++ "saved\n", dev_info->segment_name); |
8065 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
8066 |
++ segment_save(entry->segment_name); |
8067 |
++ } |
8068 |
+ } else { |
8069 |
+ // device is busy => we save it when it becomes |
8070 |
+ // idle in dcssblk_release |
8071 |
+- PRINT_INFO("Segment %s is currently busy, it will " |
8072 |
+- "be saved when it becomes idle...\n", |
8073 |
+- dev_info->segment_name); |
8074 |
++ pr_info("Device %s is in use, its DCSSs will be " |
8075 |
++ "saved when it becomes idle\n", |
8076 |
++ dev_info->segment_name); |
8077 |
+ dev_info->save_pending = 1; |
8078 |
+ } |
8079 |
+ } else if (inbuf[0] == '0') { |
8080 |
+@@ -279,8 +464,9 @@ dcssblk_save_store(struct device *dev, s |
8081 |
+ // device is busy & the user wants to undo his save |
8082 |
+ // request |
8083 |
+ dev_info->save_pending = 0; |
8084 |
+- PRINT_INFO("Pending save for segment %s deactivated\n", |
8085 |
+- dev_info->segment_name); |
8086 |
++ pr_info("A pending save request for device %s " |
8087 |
++ "has been canceled\n", |
8088 |
++ dev_info->segment_name); |
8089 |
+ } |
8090 |
+ } else { |
8091 |
+ up_write(&dcssblk_devices_sem); |
8092 |
+@@ -291,66 +477,123 @@ dcssblk_save_store(struct device *dev, s |
8093 |
+ } |
8094 |
+ |
8095 |
+ /* |
8096 |
++ * device attribute for showing all segments in a device |
8097 |
++ */ |
8098 |
++static ssize_t |
8099 |
++dcssblk_seglist_show(struct device *dev, struct device_attribute *attr, |
8100 |
++ char *buf) |
8101 |
++{ |
8102 |
++ int i; |
8103 |
++ |
8104 |
++ struct dcssblk_dev_info *dev_info; |
8105 |
++ struct segment_info *entry; |
8106 |
++ |
8107 |
++ down_read(&dcssblk_devices_sem); |
8108 |
++ dev_info = container_of(dev, struct dcssblk_dev_info, dev); |
8109 |
++ i = 0; |
8110 |
++ buf[0] = '\0'; |
8111 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
8112 |
++ strcpy(&buf[i], entry->segment_name); |
8113 |
++ i += strlen(entry->segment_name); |
8114 |
++ buf[i] = '\n'; |
8115 |
++ i++; |
8116 |
++ } |
8117 |
++ up_read(&dcssblk_devices_sem); |
8118 |
++ return i; |
8119 |
++} |
8120 |
++ |
8121 |
++/* |
8122 |
+ * device attribute for adding devices |
8123 |
+ */ |
8124 |
+ static ssize_t |
8125 |
+ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
8126 |
+ { |
8127 |
+- int rc, i; |
8128 |
++ int rc, i, j, num_of_segments; |
8129 |
+ struct dcssblk_dev_info *dev_info; |
8130 |
++ struct segment_info *seg_info, *temp; |
8131 |
+ char *local_buf; |
8132 |
+ unsigned long seg_byte_size; |
8133 |
+ |
8134 |
+ dev_info = NULL; |
8135 |
++ seg_info = NULL; |
8136 |
+ if (dev != dcssblk_root_dev) { |
8137 |
+ rc = -EINVAL; |
8138 |
+ goto out_nobuf; |
8139 |
+ } |
8140 |
++ if ((count < 1) || (buf[0] == '\0') || (buf[0] == '\n')) { |
8141 |
++ rc = -ENAMETOOLONG; |
8142 |
++ goto out_nobuf; |
8143 |
++ } |
8144 |
++ |
8145 |
+ local_buf = kmalloc(count + 1, GFP_KERNEL); |
8146 |
+ if (local_buf == NULL) { |
8147 |
+ rc = -ENOMEM; |
8148 |
+ goto out_nobuf; |
8149 |
+ } |
8150 |
++ |
8151 |
+ /* |
8152 |
+ * parse input |
8153 |
+ */ |
8154 |
++ num_of_segments = 0; |
8155 |
+ for (i = 0; ((buf[i] != '\0') && (buf[i] != '\n') && i < count); i++) { |
8156 |
+- local_buf[i] = toupper(buf[i]); |
8157 |
++ for (j = i; (buf[j] != ':') && |
8158 |
++ (buf[j] != '\0') && |
8159 |
++ (buf[j] != '\n') && |
8160 |
++ j < count; j++) { |
8161 |
++ local_buf[j-i] = toupper(buf[j]); |
8162 |
++ } |
8163 |
++ local_buf[j-i] = '\0'; |
8164 |
++ if (((j - i) == 0) || ((j - i) > 8)) { |
8165 |
++ rc = -ENAMETOOLONG; |
8166 |
++ goto seg_list_del; |
8167 |
++ } |
8168 |
++ |
8169 |
++ rc = dcssblk_load_segment(local_buf, &seg_info); |
8170 |
++ if (rc < 0) |
8171 |
++ goto seg_list_del; |
8172 |
++ /* |
8173 |
++ * get a struct dcssblk_dev_info |
8174 |
++ */ |
8175 |
++ if (num_of_segments == 0) { |
8176 |
++ dev_info = kzalloc(sizeof(struct dcssblk_dev_info), |
8177 |
++ GFP_KERNEL); |
8178 |
++ if (dev_info == NULL) { |
8179 |
++ rc = -ENOMEM; |
8180 |
++ goto out; |
8181 |
++ } |
8182 |
++ strcpy(dev_info->segment_name, local_buf); |
8183 |
++ dev_info->segment_type = seg_info->segment_type; |
8184 |
++ INIT_LIST_HEAD(&dev_info->seg_list); |
8185 |
++ } |
8186 |
++ list_add_tail(&seg_info->lh, &dev_info->seg_list); |
8187 |
++ num_of_segments++; |
8188 |
++ i = j; |
8189 |
++ |
8190 |
++ if ((buf[j] == '\0') || (buf[j] == '\n')) |
8191 |
++ break; |
8192 |
+ } |
8193 |
+- local_buf[i] = '\0'; |
8194 |
+- if ((i == 0) || (i > 8)) { |
8195 |
++ |
8196 |
++ /* no trailing colon at the end of the input */ |
8197 |
++ if ((i > 0) && (buf[i-1] == ':')) { |
8198 |
+ rc = -ENAMETOOLONG; |
8199 |
+- goto out; |
8200 |
+- } |
8201 |
+- /* |
8202 |
+- * already loaded? |
8203 |
+- */ |
8204 |
+- down_read(&dcssblk_devices_sem); |
8205 |
+- dev_info = dcssblk_get_device_by_name(local_buf); |
8206 |
+- up_read(&dcssblk_devices_sem); |
8207 |
+- if (dev_info != NULL) { |
8208 |
+- PRINT_WARN("Segment %s already loaded!\n", local_buf); |
8209 |
+- rc = -EEXIST; |
8210 |
+- goto out; |
8211 |
+- } |
8212 |
+- /* |
8213 |
+- * get a struct dcssblk_dev_info |
8214 |
+- */ |
8215 |
+- dev_info = kzalloc(sizeof(struct dcssblk_dev_info), GFP_KERNEL); |
8216 |
+- if (dev_info == NULL) { |
8217 |
+- rc = -ENOMEM; |
8218 |
+- goto out; |
8219 |
++ goto seg_list_del; |
8220 |
+ } |
8221 |
++ strlcpy(local_buf, buf, i + 1); |
8222 |
++ dev_info->num_of_segments = num_of_segments; |
8223 |
++ rc = dcssblk_is_continuous(dev_info); |
8224 |
++ if (rc < 0) |
8225 |
++ goto seg_list_del; |
8226 |
+ |
8227 |
+- strcpy(dev_info->segment_name, local_buf); |
8228 |
+- strlcpy(dev_info->dev.bus_id, local_buf, BUS_ID_SIZE); |
8229 |
++ dev_info->start = dcssblk_find_lowest_addr(dev_info); |
8230 |
++ dev_info->end = dcssblk_find_highest_addr(dev_info); |
8231 |
++ |
8232 |
++ dev_set_name(&dev_info->dev, dev_info->segment_name); |
8233 |
+ dev_info->dev.release = dcssblk_release_segment; |
8234 |
+ INIT_LIST_HEAD(&dev_info->lh); |
8235 |
+- |
8236 |
+ dev_info->gd = alloc_disk(DCSSBLK_MINORS_PER_DISK); |
8237 |
+ if (dev_info->gd == NULL) { |
8238 |
+ rc = -ENOMEM; |
8239 |
+- goto free_dev_info; |
8240 |
++ goto seg_list_del; |
8241 |
+ } |
8242 |
+ dev_info->gd->major = dcssblk_major; |
8243 |
+ dev_info->gd->fops = &dcssblk_devops; |
8244 |
+@@ -360,59 +603,42 @@ dcssblk_add_store(struct device *dev, st |
8245 |
+ dev_info->gd->driverfs_dev = &dev_info->dev; |
8246 |
+ blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request); |
8247 |
+ blk_queue_hardsect_size(dev_info->dcssblk_queue, 4096); |
8248 |
+- /* |
8249 |
+- * load the segment |
8250 |
+- */ |
8251 |
+- rc = segment_load(local_buf, SEGMENT_SHARED, |
8252 |
+- &dev_info->start, &dev_info->end); |
8253 |
+- if (rc < 0) { |
8254 |
+- segment_warning(rc, dev_info->segment_name); |
8255 |
+- goto dealloc_gendisk; |
8256 |
+- } |
8257 |
++ |
8258 |
+ seg_byte_size = (dev_info->end - dev_info->start + 1); |
8259 |
+ set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors |
8260 |
+- PRINT_INFO("Loaded segment %s, size = %lu Byte, " |
8261 |
+- "capacity = %lu (512 Byte) sectors\n", local_buf, |
8262 |
+- seg_byte_size, seg_byte_size >> 9); |
8263 |
++ pr_info("Loaded %s with total size %lu bytes and capacity %lu " |
8264 |
++ "sectors\n", local_buf, seg_byte_size, seg_byte_size >> 9); |
8265 |
+ |
8266 |
+- dev_info->segment_type = rc; |
8267 |
+ dev_info->save_pending = 0; |
8268 |
+ dev_info->is_shared = 1; |
8269 |
+ dev_info->dev.parent = dcssblk_root_dev; |
8270 |
+ |
8271 |
+ /* |
8272 |
+- * get minor, add to list |
8273 |
++ *get minor, add to list |
8274 |
+ */ |
8275 |
+ down_write(&dcssblk_devices_sem); |
8276 |
+- if (dcssblk_get_device_by_name(local_buf)) { |
8277 |
+- up_write(&dcssblk_devices_sem); |
8278 |
++ if (dcssblk_get_segment_by_name(local_buf)) { |
8279 |
+ rc = -EEXIST; |
8280 |
+- goto unload_seg; |
8281 |
++ goto release_gd; |
8282 |
+ } |
8283 |
+ rc = dcssblk_assign_free_minor(dev_info); |
8284 |
+- if (rc) { |
8285 |
+- up_write(&dcssblk_devices_sem); |
8286 |
+- PRINT_ERR("No free minor number available! " |
8287 |
+- "Unloading segment...\n"); |
8288 |
+- goto unload_seg; |
8289 |
+- } |
8290 |
++ if (rc) |
8291 |
++ goto release_gd; |
8292 |
+ sprintf(dev_info->gd->disk_name, "dcssblk%d", |
8293 |
+ dev_info->gd->first_minor); |
8294 |
+ list_add_tail(&dev_info->lh, &dcssblk_devices); |
8295 |
+ |
8296 |
+ if (!try_module_get(THIS_MODULE)) { |
8297 |
+ rc = -ENODEV; |
8298 |
+- goto list_del; |
8299 |
++ goto dev_list_del; |
8300 |
+ } |
8301 |
+ /* |
8302 |
+ * register the device |
8303 |
+ */ |
8304 |
+ rc = device_register(&dev_info->dev); |
8305 |
+ if (rc) { |
8306 |
+- PRINT_ERR("Segment %s could not be registered RC=%d\n", |
8307 |
+- local_buf, rc); |
8308 |
+ module_put(THIS_MODULE); |
8309 |
+- goto list_del; |
8310 |
++ goto dev_list_del; |
8311 |
+ } |
8312 |
+ get_device(&dev_info->dev); |
8313 |
+ rc = device_create_file(&dev_info->dev, &dev_attr_shared); |
8314 |
+@@ -421,6 +647,9 @@ dcssblk_add_store(struct device *dev, st |
8315 |
+ rc = device_create_file(&dev_info->dev, &dev_attr_save); |
8316 |
+ if (rc) |
8317 |
+ goto unregister_dev; |
8318 |
++ rc = device_create_file(&dev_info->dev, &dev_attr_seglist); |
8319 |
++ if (rc) |
8320 |
++ goto unregister_dev; |
8321 |
+ |
8322 |
+ add_disk(dev_info->gd); |
8323 |
+ |
8324 |
+@@ -434,7 +663,6 @@ dcssblk_add_store(struct device *dev, st |
8325 |
+ set_disk_ro(dev_info->gd,0); |
8326 |
+ break; |
8327 |
+ } |
8328 |
+- PRINT_DEBUG("Segment %s loaded successfully\n", local_buf); |
8329 |
+ up_write(&dcssblk_devices_sem); |
8330 |
+ rc = count; |
8331 |
+ goto out; |
8332 |
+@@ -445,20 +673,27 @@ unregister_dev: |
8333 |
+ dev_info->gd->queue = NULL; |
8334 |
+ put_disk(dev_info->gd); |
8335 |
+ device_unregister(&dev_info->dev); |
8336 |
+- segment_unload(dev_info->segment_name); |
8337 |
++ list_for_each_entry(seg_info, &dev_info->seg_list, lh) { |
8338 |
++ segment_unload(seg_info->segment_name); |
8339 |
++ } |
8340 |
+ put_device(&dev_info->dev); |
8341 |
+ up_write(&dcssblk_devices_sem); |
8342 |
+ goto out; |
8343 |
+-list_del: |
8344 |
++dev_list_del: |
8345 |
+ list_del(&dev_info->lh); |
8346 |
+- up_write(&dcssblk_devices_sem); |
8347 |
+-unload_seg: |
8348 |
+- segment_unload(local_buf); |
8349 |
+-dealloc_gendisk: |
8350 |
++release_gd: |
8351 |
+ blk_cleanup_queue(dev_info->dcssblk_queue); |
8352 |
+ dev_info->gd->queue = NULL; |
8353 |
+ put_disk(dev_info->gd); |
8354 |
+-free_dev_info: |
8355 |
++ up_write(&dcssblk_devices_sem); |
8356 |
++seg_list_del: |
8357 |
++ if (dev_info == NULL) |
8358 |
++ goto out; |
8359 |
++ list_for_each_entry_safe(seg_info, temp, &dev_info->seg_list, lh) { |
8360 |
++ list_del(&seg_info->lh); |
8361 |
++ segment_unload(seg_info->segment_name); |
8362 |
++ kfree(seg_info); |
8363 |
++ } |
8364 |
+ kfree(dev_info); |
8365 |
+ out: |
8366 |
+ kfree(local_buf); |
8367 |
+@@ -473,6 +708,7 @@ static ssize_t |
8368 |
+ dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
8369 |
+ { |
8370 |
+ struct dcssblk_dev_info *dev_info; |
8371 |
++ struct segment_info *entry; |
8372 |
+ int rc, i; |
8373 |
+ char *local_buf; |
8374 |
+ |
8375 |
+@@ -499,26 +735,30 @@ dcssblk_remove_store(struct device *dev, |
8376 |
+ dev_info = dcssblk_get_device_by_name(local_buf); |
8377 |
+ if (dev_info == NULL) { |
8378 |
+ up_write(&dcssblk_devices_sem); |
8379 |
+- PRINT_WARN("Segment %s is not loaded!\n", local_buf); |
8380 |
++ pr_warning("Device %s cannot be removed because it is not a " |
8381 |
++ "known device\n", local_buf); |
8382 |
+ rc = -ENODEV; |
8383 |
+ goto out_buf; |
8384 |
+ } |
8385 |
+ if (atomic_read(&dev_info->use_count) != 0) { |
8386 |
+ up_write(&dcssblk_devices_sem); |
8387 |
+- PRINT_WARN("Segment %s is in use!\n", local_buf); |
8388 |
++ pr_warning("Device %s cannot be removed while it is in " |
8389 |
++ "use\n", local_buf); |
8390 |
+ rc = -EBUSY; |
8391 |
+ goto out_buf; |
8392 |
+ } |
8393 |
+- list_del(&dev_info->lh); |
8394 |
+ |
8395 |
++ list_del(&dev_info->lh); |
8396 |
+ del_gendisk(dev_info->gd); |
8397 |
+ blk_cleanup_queue(dev_info->dcssblk_queue); |
8398 |
+ dev_info->gd->queue = NULL; |
8399 |
+ put_disk(dev_info->gd); |
8400 |
+ device_unregister(&dev_info->dev); |
8401 |
+- segment_unload(dev_info->segment_name); |
8402 |
+- PRINT_DEBUG("Segment %s unloaded successfully\n", |
8403 |
+- dev_info->segment_name); |
8404 |
++ |
8405 |
++ /* unload all related segments */ |
8406 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) |
8407 |
++ segment_unload(entry->segment_name); |
8408 |
++ |
8409 |
+ put_device(&dev_info->dev); |
8410 |
+ up_write(&dcssblk_devices_sem); |
8411 |
+ |
8412 |
+@@ -550,6 +790,7 @@ static int |
8413 |
+ dcssblk_release(struct inode *inode, struct file *filp) |
8414 |
+ { |
8415 |
+ struct dcssblk_dev_info *dev_info; |
8416 |
++ struct segment_info *entry; |
8417 |
+ int rc; |
8418 |
+ |
8419 |
+ dev_info = inode->i_bdev->bd_disk->private_data; |
8420 |
+@@ -560,9 +801,11 @@ dcssblk_release(struct inode *inode, str |
8421 |
+ down_write(&dcssblk_devices_sem); |
8422 |
+ if (atomic_dec_and_test(&dev_info->use_count) |
8423 |
+ && (dev_info->save_pending)) { |
8424 |
+- PRINT_INFO("Segment %s became idle and is being saved now\n", |
8425 |
+- dev_info->segment_name); |
8426 |
+- segment_save(dev_info->segment_name); |
8427 |
++ pr_info("Device %s has become idle and is being saved " |
8428 |
++ "now\n", dev_info->segment_name); |
8429 |
++ list_for_each_entry(entry, &dev_info->seg_list, lh) { |
8430 |
++ segment_save(entry->segment_name); |
8431 |
++ } |
8432 |
+ dev_info->save_pending = 0; |
8433 |
+ } |
8434 |
+ up_write(&dcssblk_devices_sem); |
8435 |
+@@ -602,7 +845,9 @@ dcssblk_make_request(struct request_queu |
8436 |
+ case SEG_TYPE_SC: |
8437 |
+ /* cannot write to these segments */ |
8438 |
+ if (bio_data_dir(bio) == WRITE) { |
8439 |
+- PRINT_WARN("rejecting write to ro segment %s\n", dev_info->dev.bus_id); |
8440 |
++ pr_warning("Writing to %s failed because it " |
8441 |
++ "is a read-only device\n", |
8442 |
++ dev_name(&dev_info->dev)); |
8443 |
+ goto fail; |
8444 |
+ } |
8445 |
+ } |
8446 |
+@@ -657,7 +902,7 @@ static void |
8447 |
+ dcssblk_check_params(void) |
8448 |
+ { |
8449 |
+ int rc, i, j, k; |
8450 |
+- char buf[9]; |
8451 |
++ char buf[DCSSBLK_PARM_LEN + 1]; |
8452 |
+ struct dcssblk_dev_info *dev_info; |
8453 |
+ |
8454 |
+ for (i = 0; (i < DCSSBLK_PARM_LEN) && (dcssblk_segments[i] != '\0'); |
8455 |
+@@ -665,15 +910,16 @@ dcssblk_check_params(void) |
8456 |
+ for (j = i; (dcssblk_segments[j] != ',') && |
8457 |
+ (dcssblk_segments[j] != '\0') && |
8458 |
+ (dcssblk_segments[j] != '(') && |
8459 |
+- (j - i) < 8; j++) |
8460 |
++ (j < DCSSBLK_PARM_LEN); j++) |
8461 |
+ { |
8462 |
+ buf[j-i] = dcssblk_segments[j]; |
8463 |
+ } |
8464 |
+ buf[j-i] = '\0'; |
8465 |
+ rc = dcssblk_add_store(dcssblk_root_dev, NULL, buf, j-i); |
8466 |
+ if ((rc >= 0) && (dcssblk_segments[j] == '(')) { |
8467 |
+- for (k = 0; buf[k] != '\0'; k++) |
8468 |
++ for (k = 0; (buf[k] != ':') && (buf[k] != '\0'); k++) |
8469 |
+ buf[k] = toupper(buf[k]); |
8470 |
++ buf[k] = '\0'; |
8471 |
+ if (!strncmp(&dcssblk_segments[j], "(local)", 7)) { |
8472 |
+ down_read(&dcssblk_devices_sem); |
8473 |
+ dev_info = dcssblk_get_device_by_name(buf); |
8474 |
+@@ -740,10 +986,12 @@ module_exit(dcssblk_exit); |
8475 |
+ |
8476 |
+ module_param_string(segments, dcssblk_segments, DCSSBLK_PARM_LEN, 0444); |
8477 |
+ MODULE_PARM_DESC(segments, "Name of DCSS segment(s) to be loaded, " |
8478 |
+- "comma-separated list, each name max. 8 chars.\n" |
8479 |
+- "Adding \"(local)\" to segment name equals echoing 0 to " |
8480 |
+- "/sys/devices/dcssblk/<segment name>/shared after loading " |
8481 |
+- "the segment - \n" |
8482 |
+- "e.g. segments=\"mydcss1,mydcss2,mydcss3(local)\""); |
8483 |
++ "comma-separated list, names in each set separated " |
8484 |
++ "by commas are separated by colons, each set contains " |
8485 |
++ "names of contiguous segments and each name max. 8 chars.\n" |
8486 |
++ "Adding \"(local)\" to the end of each set equals echoing 0 " |
8487 |
++ "to /sys/devices/dcssblk/<device name>/shared after loading " |
8488 |
++ "the contiguous segments - \n" |
8489 |
++ "e.g. segments=\"mydcss1,mydcss2:mydcss3,mydcss4(local)\""); |
8490 |
+ |
8491 |
+ MODULE_LICENSE("GPL"); |
8492 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/block/xpram.c |
8493 |
+=================================================================== |
8494 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/block/xpram.c |
8495 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/block/xpram.c |
8496 |
+@@ -25,6 +25,9 @@ |
8497 |
+ * generic hard disk support to replace ad-hoc partitioning |
8498 |
+ */ |
8499 |
+ |
8500 |
++#define KMSG_COMPONENT "xpram" |
8501 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8502 |
++ |
8503 |
+ #include <linux/module.h> |
8504 |
+ #include <linux/moduleparam.h> |
8505 |
+ #include <linux/ctype.h> /* isdigit, isxdigit */ |
8506 |
+@@ -42,12 +45,6 @@ |
8507 |
+ #define XPRAM_DEVS 1 /* one partition */ |
8508 |
+ #define XPRAM_MAX_DEVS 32 /* maximal number of devices (partitions) */ |
8509 |
+ |
8510 |
+-#define PRINT_DEBUG(x...) printk(KERN_DEBUG XPRAM_NAME " debug:" x) |
8511 |
+-#define PRINT_INFO(x...) printk(KERN_INFO XPRAM_NAME " info:" x) |
8512 |
+-#define PRINT_WARN(x...) printk(KERN_WARNING XPRAM_NAME " warning:" x) |
8513 |
+-#define PRINT_ERR(x...) printk(KERN_ERR XPRAM_NAME " error:" x) |
8514 |
+- |
8515 |
+- |
8516 |
+ typedef struct { |
8517 |
+ unsigned int size; /* size of xpram segment in pages */ |
8518 |
+ unsigned int offset; /* start page of xpram segment */ |
8519 |
+@@ -264,7 +261,7 @@ static int __init xpram_setup_sizes(unsi |
8520 |
+ |
8521 |
+ /* Check number of devices. */ |
8522 |
+ if (devs <= 0 || devs > XPRAM_MAX_DEVS) { |
8523 |
+- PRINT_ERR("invalid number %d of devices\n",devs); |
8524 |
++ pr_err("%d is not a valid number of XPRAM devices\n",devs); |
8525 |
+ return -EINVAL; |
8526 |
+ } |
8527 |
+ xpram_devs = devs; |
8528 |
+@@ -295,22 +292,22 @@ static int __init xpram_setup_sizes(unsi |
8529 |
+ mem_auto_no++; |
8530 |
+ } |
8531 |
+ |
8532 |
+- PRINT_INFO(" number of devices (partitions): %d \n", xpram_devs); |
8533 |
++ pr_info(" number of devices (partitions): %d \n", xpram_devs); |
8534 |
+ for (i = 0; i < xpram_devs; i++) { |
8535 |
+ if (xpram_sizes[i]) |
8536 |
+- PRINT_INFO(" size of partition %d: %u kB\n", |
8537 |
+- i, xpram_sizes[i]); |
8538 |
++ pr_info(" size of partition %d: %u kB\n", |
8539 |
++ i, xpram_sizes[i]); |
8540 |
+ else |
8541 |
+- PRINT_INFO(" size of partition %d to be set " |
8542 |
+- "automatically\n",i); |
8543 |
++ pr_info(" size of partition %d to be set " |
8544 |
++ "automatically\n",i); |
8545 |
+ } |
8546 |
+- PRINT_DEBUG(" memory needed (for sized partitions): %lu kB\n", |
8547 |
+- mem_needed); |
8548 |
+- PRINT_DEBUG(" partitions to be sized automatically: %d\n", |
8549 |
+- mem_auto_no); |
8550 |
++ pr_info(" memory needed (for sized partitions): %lu kB\n", |
8551 |
++ mem_needed); |
8552 |
++ pr_info(" partitions to be sized automatically: %d\n", |
8553 |
++ mem_auto_no); |
8554 |
+ |
8555 |
+ if (mem_needed > pages * 4) { |
8556 |
+- PRINT_ERR("Not enough expanded memory available\n"); |
8557 |
++ pr_err("Not enough expanded memory available\n"); |
8558 |
+ return -EINVAL; |
8559 |
+ } |
8560 |
+ |
8561 |
+@@ -322,8 +319,8 @@ static int __init xpram_setup_sizes(unsi |
8562 |
+ */ |
8563 |
+ if (mem_auto_no) { |
8564 |
+ mem_auto = ((pages - mem_needed / 4) / mem_auto_no) * 4; |
8565 |
+- PRINT_INFO(" automatically determined " |
8566 |
+- "partition size: %lu kB\n", mem_auto); |
8567 |
++ pr_info(" automatically determined " |
8568 |
++ "partition size: %lu kB\n", mem_auto); |
8569 |
+ for (i = 0; i < xpram_devs; i++) |
8570 |
+ if (xpram_sizes[i] == 0) |
8571 |
+ xpram_sizes[i] = mem_auto; |
8572 |
+@@ -405,12 +402,12 @@ static int __init xpram_init(void) |
8573 |
+ |
8574 |
+ /* Find out size of expanded memory. */ |
8575 |
+ if (xpram_present() != 0) { |
8576 |
+- PRINT_WARN("No expanded memory available\n"); |
8577 |
++ pr_err("No expanded memory available\n"); |
8578 |
+ return -ENODEV; |
8579 |
+ } |
8580 |
+ xpram_pages = xpram_highest_page_index() + 1; |
8581 |
+- PRINT_INFO(" %u pages expanded memory found (%lu KB).\n", |
8582 |
+- xpram_pages, (unsigned long) xpram_pages*4); |
8583 |
++ pr_info(" %u pages expanded memory found (%lu KB).\n", |
8584 |
++ xpram_pages, (unsigned long) xpram_pages*4); |
8585 |
+ rc = xpram_setup_sizes(xpram_pages); |
8586 |
+ if (rc) |
8587 |
+ return rc; |
8588 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/monreader.c |
8589 |
+=================================================================== |
8590 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/monreader.c |
8591 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/monreader.c |
8592 |
+@@ -7,6 +7,9 @@ |
8593 |
+ * Author: Gerald Schaefer <gerald.schaefer@××××××.com> |
8594 |
+ */ |
8595 |
+ |
8596 |
++#define KMSG_COMPONENT "monreader" |
8597 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8598 |
++ |
8599 |
+ #include <linux/module.h> |
8600 |
+ #include <linux/moduleparam.h> |
8601 |
+ #include <linux/init.h> |
8602 |
+@@ -24,19 +27,6 @@ |
8603 |
+ #include <asm/ebcdic.h> |
8604 |
+ #include <asm/extmem.h> |
8605 |
+ |
8606 |
+-//#define MON_DEBUG /* Debug messages on/off */ |
8607 |
+- |
8608 |
+-#define MON_NAME "monreader" |
8609 |
+- |
8610 |
+-#define P_INFO(x...) printk(KERN_INFO MON_NAME " info: " x) |
8611 |
+-#define P_ERROR(x...) printk(KERN_ERR MON_NAME " error: " x) |
8612 |
+-#define P_WARNING(x...) printk(KERN_WARNING MON_NAME " warning: " x) |
8613 |
+- |
8614 |
+-#ifdef MON_DEBUG |
8615 |
+-#define P_DEBUG(x...) printk(KERN_DEBUG MON_NAME " debug: " x) |
8616 |
+-#else |
8617 |
+-#define P_DEBUG(x...) do {} while (0) |
8618 |
+-#endif |
8619 |
+ |
8620 |
+ #define MON_COLLECT_SAMPLE 0x80 |
8621 |
+ #define MON_COLLECT_EVENT 0x40 |
8622 |
+@@ -172,7 +162,7 @@ static int mon_send_reply(struct mon_msg |
8623 |
+ } else |
8624 |
+ monmsg->replied_msglim = 1; |
8625 |
+ if (rc) { |
8626 |
+- P_ERROR("read, IUCV reply failed with rc = %i\n\n", rc); |
8627 |
++ pr_err("Reading monitor data failed with rc=%i\n", rc); |
8628 |
+ return -EIO; |
8629 |
+ } |
8630 |
+ return 0; |
8631 |
+@@ -251,7 +241,8 @@ static void mon_iucv_path_severed(struct |
8632 |
+ { |
8633 |
+ struct mon_private *monpriv = path->private; |
8634 |
+ |
8635 |
+- P_ERROR("IUCV connection severed with rc = 0x%X\n", ipuser[0]); |
8636 |
++ pr_err("z/VM *MONITOR system service disconnected with rc=%i\n", |
8637 |
++ ipuser[0]); |
8638 |
+ iucv_path_sever(path, NULL); |
8639 |
+ atomic_set(&monpriv->iucv_severed, 1); |
8640 |
+ wake_up(&mon_conn_wait_queue); |
8641 |
+@@ -266,8 +257,7 @@ static void mon_iucv_message_pending(str |
8642 |
+ memcpy(&monpriv->msg_array[monpriv->write_index]->msg, |
8643 |
+ msg, sizeof(*msg)); |
8644 |
+ if (atomic_inc_return(&monpriv->msglim_count) == MON_MSGLIM) { |
8645 |
+- P_WARNING("IUCV message pending, message limit (%i) reached\n", |
8646 |
+- MON_MSGLIM); |
8647 |
++ pr_warning("The read queue for monitor data is full\n"); |
8648 |
+ monpriv->msg_array[monpriv->write_index]->msglim_reached = 1; |
8649 |
+ } |
8650 |
+ monpriv->write_index = (monpriv->write_index + 1) % MON_MSGLIM; |
8651 |
+@@ -311,8 +301,8 @@ static int mon_open(struct inode *inode, |
8652 |
+ rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler, |
8653 |
+ MON_SERVICE, NULL, user_data_connect, monpriv); |
8654 |
+ if (rc) { |
8655 |
+- P_ERROR("iucv connection to *MONITOR failed with " |
8656 |
+- "IPUSER SEVER code = %i\n", rc); |
8657 |
++ pr_err("Connecting to the z/VM *MONITOR system service " |
8658 |
++ "failed with rc=%i\n", rc); |
8659 |
+ rc = -EIO; |
8660 |
+ goto out_path; |
8661 |
+ } |
8662 |
+@@ -353,7 +343,8 @@ static int mon_close(struct inode *inode |
8663 |
+ */ |
8664 |
+ rc = iucv_path_sever(monpriv->path, user_data_sever); |
8665 |
+ if (rc) |
8666 |
+- P_ERROR("close, iucv_sever failed with rc = %i\n", rc); |
8667 |
++ pr_warning("Disconnecting the z/VM *MONITOR system service " |
8668 |
++ "failed with rc=%i\n", rc); |
8669 |
+ |
8670 |
+ atomic_set(&monpriv->iucv_severed, 0); |
8671 |
+ atomic_set(&monpriv->iucv_connected, 0); |
8672 |
+@@ -469,7 +460,8 @@ static int __init mon_init(void) |
8673 |
+ int rc; |
8674 |
+ |
8675 |
+ if (!MACHINE_IS_VM) { |
8676 |
+- P_ERROR("not running under z/VM, driver not loaded\n"); |
8677 |
++ pr_err("The z/VM *MONITOR record device driver cannot be " |
8678 |
++ "loaded without z/VM\n"); |
8679 |
+ return -ENODEV; |
8680 |
+ } |
8681 |
+ |
8682 |
+@@ -478,7 +470,8 @@ static int __init mon_init(void) |
8683 |
+ */ |
8684 |
+ rc = iucv_register(&monreader_iucv_handler, 1); |
8685 |
+ if (rc) { |
8686 |
+- P_ERROR("failed to register with iucv driver\n"); |
8687 |
++ pr_err("The z/VM *MONITOR record device driver failed to " |
8688 |
++ "register with IUCV\n"); |
8689 |
+ return rc; |
8690 |
+ } |
8691 |
+ |
8692 |
+@@ -488,8 +481,8 @@ static int __init mon_init(void) |
8693 |
+ goto out_iucv; |
8694 |
+ } |
8695 |
+ if (rc != SEG_TYPE_SC) { |
8696 |
+- P_ERROR("segment %s has unsupported type, should be SC\n", |
8697 |
+- mon_dcss_name); |
8698 |
++ pr_err("The specified *MONITOR DCSS %s does not have the " |
8699 |
++ "required type SC\n", mon_dcss_name); |
8700 |
+ rc = -EINVAL; |
8701 |
+ goto out_iucv; |
8702 |
+ } |
8703 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/monwriter.c |
8704 |
+=================================================================== |
8705 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/monwriter.c |
8706 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/monwriter.c |
8707 |
+@@ -8,6 +8,9 @@ |
8708 |
+ * Author(s): Melissa Howland <Melissa.Howland@××××××.com> |
8709 |
+ */ |
8710 |
+ |
8711 |
++#define KMSG_COMPONENT "monwriter" |
8712 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8713 |
++ |
8714 |
+ #include <linux/module.h> |
8715 |
+ #include <linux/moduleparam.h> |
8716 |
+ #include <linux/init.h> |
8717 |
+@@ -64,9 +67,9 @@ static int monwrite_diag(struct monwrite |
8718 |
+ rc = appldata_asm(&id, fcn, (void *) buffer, myhdr->datalen); |
8719 |
+ if (rc <= 0) |
8720 |
+ return rc; |
8721 |
++ pr_err("Writing monitor data failed with rc=%i\n", rc); |
8722 |
+ if (rc == 5) |
8723 |
+ return -EPERM; |
8724 |
+- printk("DIAG X'DC' error with return code: %i\n", rc); |
8725 |
+ return -EINVAL; |
8726 |
+ } |
8727 |
+ |
8728 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_cmd.c |
8729 |
+=================================================================== |
8730 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_cmd.c |
8731 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_cmd.c |
8732 |
+@@ -6,6 +6,9 @@ |
8733 |
+ * Peter Oberparleiter <peter.oberparleiter@××××××.com> |
8734 |
+ */ |
8735 |
+ |
8736 |
++#define KMSG_COMPONENT "sclp_cmd" |
8737 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8738 |
++ |
8739 |
+ #include <linux/completion.h> |
8740 |
+ #include <linux/init.h> |
8741 |
+ #include <linux/errno.h> |
8742 |
+@@ -16,9 +19,8 @@ |
8743 |
+ #include <linux/memory.h> |
8744 |
+ #include <asm/chpid.h> |
8745 |
+ #include <asm/sclp.h> |
8746 |
+-#include "sclp.h" |
8747 |
+ |
8748 |
+-#define TAG "sclp_cmd: " |
8749 |
++#include "sclp.h" |
8750 |
+ |
8751 |
+ #define SCLP_CMDW_READ_SCP_INFO 0x00020001 |
8752 |
+ #define SCLP_CMDW_READ_SCP_INFO_FORCED 0x00120001 |
8753 |
+@@ -169,8 +171,8 @@ static int do_sync_request(sclp_cmdw_t c |
8754 |
+ |
8755 |
+ /* Check response. */ |
8756 |
+ if (request->status != SCLP_REQ_DONE) { |
8757 |
+- printk(KERN_WARNING TAG "sync request failed " |
8758 |
+- "(cmd=0x%08x, status=0x%02x)\n", cmd, request->status); |
8759 |
++ pr_warning("sync request failed (cmd=0x%08x, " |
8760 |
++ "status=0x%02x)\n", cmd, request->status); |
8761 |
+ rc = -EIO; |
8762 |
+ } |
8763 |
+ out: |
8764 |
+@@ -224,8 +226,8 @@ int sclp_get_cpu_info(struct sclp_cpu_in |
8765 |
+ if (rc) |
8766 |
+ goto out; |
8767 |
+ if (sccb->header.response_code != 0x0010) { |
8768 |
+- printk(KERN_WARNING TAG "readcpuinfo failed " |
8769 |
+- "(response=0x%04x)\n", sccb->header.response_code); |
8770 |
++ pr_warning("readcpuinfo failed (response=0x%04x)\n", |
8771 |
++ sccb->header.response_code); |
8772 |
+ rc = -EIO; |
8773 |
+ goto out; |
8774 |
+ } |
8775 |
+@@ -262,8 +264,9 @@ static int do_cpu_configure(sclp_cmdw_t |
8776 |
+ case 0x0120: |
8777 |
+ break; |
8778 |
+ default: |
8779 |
+- printk(KERN_WARNING TAG "configure cpu failed (cmd=0x%08x, " |
8780 |
+- "response=0x%04x)\n", cmd, sccb->header.response_code); |
8781 |
++ pr_warning("configure cpu failed (cmd=0x%08x, " |
8782 |
++ "response=0x%04x)\n", cmd, |
8783 |
++ sccb->header.response_code); |
8784 |
+ rc = -EIO; |
8785 |
+ break; |
8786 |
+ } |
8787 |
+@@ -626,9 +629,9 @@ static int do_chp_configure(sclp_cmdw_t |
8788 |
+ case 0x0450: |
8789 |
+ break; |
8790 |
+ default: |
8791 |
+- printk(KERN_WARNING TAG "configure channel-path failed " |
8792 |
+- "(cmd=0x%08x, response=0x%04x)\n", cmd, |
8793 |
+- sccb->header.response_code); |
8794 |
++ pr_warning("configure channel-path failed " |
8795 |
++ "(cmd=0x%08x, response=0x%04x)\n", cmd, |
8796 |
++ sccb->header.response_code); |
8797 |
+ rc = -EIO; |
8798 |
+ break; |
8799 |
+ } |
8800 |
+@@ -695,8 +698,8 @@ int sclp_chp_read_info(struct sclp_chp_i |
8801 |
+ if (rc) |
8802 |
+ goto out; |
8803 |
+ if (sccb->header.response_code != 0x0010) { |
8804 |
+- printk(KERN_WARNING TAG "read channel-path info failed " |
8805 |
+- "(response=0x%04x)\n", sccb->header.response_code); |
8806 |
++ pr_warning("read channel-path info failed " |
8807 |
++ "(response=0x%04x)\n", sccb->header.response_code); |
8808 |
+ rc = -EIO; |
8809 |
+ goto out; |
8810 |
+ } |
8811 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_config.c |
8812 |
+=================================================================== |
8813 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_config.c |
8814 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_config.c |
8815 |
+@@ -5,15 +5,17 @@ |
8816 |
+ * Author(s): Heiko Carstens <heiko.carstens@××××××.com> |
8817 |
+ */ |
8818 |
+ |
8819 |
++#define KMSG_COMPONENT "sclp_config" |
8820 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8821 |
++ |
8822 |
+ #include <linux/init.h> |
8823 |
+ #include <linux/errno.h> |
8824 |
+ #include <linux/cpu.h> |
8825 |
+ #include <linux/sysdev.h> |
8826 |
+ #include <linux/workqueue.h> |
8827 |
+ #include <asm/smp.h> |
8828 |
+-#include "sclp.h" |
8829 |
+ |
8830 |
+-#define TAG "sclp_config: " |
8831 |
++#include "sclp.h" |
8832 |
+ |
8833 |
+ struct conf_mgm_data { |
8834 |
+ u8 reserved; |
8835 |
+@@ -31,7 +33,7 @@ static void sclp_cpu_capability_notify(s |
8836 |
+ int cpu; |
8837 |
+ struct sys_device *sysdev; |
8838 |
+ |
8839 |
+- printk(KERN_WARNING TAG "cpu capability changed.\n"); |
8840 |
++ pr_warning("cpu capability changed.\n"); |
8841 |
+ get_online_cpus(); |
8842 |
+ for_each_online_cpu(cpu) { |
8843 |
+ sysdev = get_cpu_sysdev(cpu); |
8844 |
+@@ -78,7 +80,7 @@ static int __init sclp_conf_init(void) |
8845 |
+ return rc; |
8846 |
+ |
8847 |
+ if (!(sclp_conf_register.sclp_send_mask & EVTYP_CONFMGMDATA_MASK)) { |
8848 |
+- printk(KERN_WARNING TAG "no configuration management.\n"); |
8849 |
++ pr_warning("no configuration management.\n"); |
8850 |
+ sclp_unregister(&sclp_conf_register); |
8851 |
+ rc = -ENOSYS; |
8852 |
+ } |
8853 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_cpi_sys.c |
8854 |
+=================================================================== |
8855 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_cpi_sys.c |
8856 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_cpi_sys.c |
8857 |
+@@ -7,6 +7,9 @@ |
8858 |
+ * Michael Ernst <mernst@××××××.com> |
8859 |
+ */ |
8860 |
+ |
8861 |
++#define KMSG_COMPONENT "sclp_cpi" |
8862 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8863 |
++ |
8864 |
+ #include <linux/kernel.h> |
8865 |
+ #include <linux/init.h> |
8866 |
+ #include <linux/stat.h> |
8867 |
+@@ -20,6 +23,7 @@ |
8868 |
+ #include <linux/completion.h> |
8869 |
+ #include <asm/ebcdic.h> |
8870 |
+ #include <asm/sclp.h> |
8871 |
++ |
8872 |
+ #include "sclp.h" |
8873 |
+ #include "sclp_rw.h" |
8874 |
+ #include "sclp_cpi_sys.h" |
8875 |
+@@ -150,16 +154,16 @@ static int cpi_req(void) |
8876 |
+ wait_for_completion(&completion); |
8877 |
+ |
8878 |
+ if (req->status != SCLP_REQ_DONE) { |
8879 |
+- printk(KERN_WARNING "cpi: request failed (status=0x%02x)\n", |
8880 |
+- req->status); |
8881 |
++ pr_warning("request failed (status=0x%02x)\n", |
8882 |
++ req->status); |
8883 |
+ rc = -EIO; |
8884 |
+ goto out_free_req; |
8885 |
+ } |
8886 |
+ |
8887 |
+ response = ((struct cpi_sccb *) req->sccb)->header.response_code; |
8888 |
+ if (response != 0x0020) { |
8889 |
+- printk(KERN_WARNING "cpi: failed with " |
8890 |
+- "response code 0x%x\n", response); |
8891 |
++ pr_warning("request failed with response code 0x%x\n", |
8892 |
++ response); |
8893 |
+ rc = -EIO; |
8894 |
+ } |
8895 |
+ |
8896 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_sdias.c |
8897 |
+=================================================================== |
8898 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/sclp_sdias.c |
8899 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/sclp_sdias.c |
8900 |
+@@ -5,15 +5,18 @@ |
8901 |
+ * Author(s): Michael Holzheu |
8902 |
+ */ |
8903 |
+ |
8904 |
++#define KMSG_COMPONENT "sclp_sdias" |
8905 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8906 |
++ |
8907 |
+ #include <linux/sched.h> |
8908 |
+ #include <asm/sclp.h> |
8909 |
+ #include <asm/debug.h> |
8910 |
+ #include <asm/ipl.h> |
8911 |
++ |
8912 |
+ #include "sclp.h" |
8913 |
+ #include "sclp_rw.h" |
8914 |
+ |
8915 |
+ #define TRACE(x...) debug_sprintf_event(sdias_dbf, 1, x) |
8916 |
+-#define ERROR_MSG(x...) printk ( KERN_ALERT "SDIAS: " x ) |
8917 |
+ |
8918 |
+ #define SDIAS_RETRIES 300 |
8919 |
+ #define SDIAS_SLEEP_TICKS 50 |
8920 |
+@@ -131,7 +134,7 @@ int sclp_sdias_blk_count(void) |
8921 |
+ |
8922 |
+ rc = sdias_sclp_send(&request); |
8923 |
+ if (rc) { |
8924 |
+- ERROR_MSG("sclp_send failed for get_nr_blocks\n"); |
8925 |
++ pr_err("sclp_send failed for get_nr_blocks\n"); |
8926 |
+ goto out; |
8927 |
+ } |
8928 |
+ if (sccb.hdr.response_code != 0x0020) { |
8929 |
+@@ -145,7 +148,8 @@ int sclp_sdias_blk_count(void) |
8930 |
+ rc = sccb.evbuf.blk_cnt; |
8931 |
+ break; |
8932 |
+ default: |
8933 |
+- ERROR_MSG("SCLP error: %x\n", sccb.evbuf.event_status); |
8934 |
++ pr_err("SCLP error: %x\n", |
8935 |
++ sccb.evbuf.event_status); |
8936 |
+ rc = -EIO; |
8937 |
+ goto out; |
8938 |
+ } |
8939 |
+@@ -201,7 +205,7 @@ int sclp_sdias_copy(void *dest, int star |
8940 |
+ |
8941 |
+ rc = sdias_sclp_send(&request); |
8942 |
+ if (rc) { |
8943 |
+- ERROR_MSG("sclp_send failed: %x\n", rc); |
8944 |
++ pr_err("sclp_send failed: %x\n", rc); |
8945 |
+ goto out; |
8946 |
+ } |
8947 |
+ if (sccb.hdr.response_code != 0x0020) { |
8948 |
+@@ -219,9 +223,9 @@ int sclp_sdias_copy(void *dest, int star |
8949 |
+ case EVSTATE_NO_DATA: |
8950 |
+ TRACE("no data\n"); |
8951 |
+ default: |
8952 |
+- ERROR_MSG("Error from SCLP while copying hsa. " |
8953 |
+- "Event status = %x\n", |
8954 |
+- sccb.evbuf.event_status); |
8955 |
++ pr_err("Error from SCLP while copying hsa. " |
8956 |
++ "Event status = %x\n", |
8957 |
++ sccb.evbuf.event_status); |
8958 |
+ rc = -EIO; |
8959 |
+ } |
8960 |
+ out: |
8961 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/vmcp.c |
8962 |
+=================================================================== |
8963 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/vmcp.c |
8964 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/vmcp.c |
8965 |
+@@ -11,6 +11,9 @@ |
8966 |
+ * The idea of this driver is based on cpint from Neale Ferguson and #CP in CMS |
8967 |
+ */ |
8968 |
+ |
8969 |
++#define KMSG_COMPONENT "vmcp" |
8970 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8971 |
++ |
8972 |
+ #include <linux/fs.h> |
8973 |
+ #include <linux/init.h> |
8974 |
+ #include <linux/kernel.h> |
8975 |
+@@ -26,8 +29,6 @@ MODULE_LICENSE("GPL"); |
8976 |
+ MODULE_AUTHOR("Christian Borntraeger <borntraeger@××××××.com>"); |
8977 |
+ MODULE_DESCRIPTION("z/VM CP interface"); |
8978 |
+ |
8979 |
+-#define PRINTK_HEADER "vmcp: " |
8980 |
+- |
8981 |
+ static debug_info_t *vmcp_debug; |
8982 |
+ |
8983 |
+ static int vmcp_open(struct inode *inode, struct file *file) |
8984 |
+@@ -193,7 +194,8 @@ static int __init vmcp_init(void) |
8985 |
+ int ret; |
8986 |
+ |
8987 |
+ if (!MACHINE_IS_VM) { |
8988 |
+- PRINT_WARN("z/VM CP interface is only available under z/VM\n"); |
8989 |
++ pr_warning("The z/VM CP interface device driver cannot be " |
8990 |
++ "loaded without z/VM\n"); |
8991 |
+ return -ENODEV; |
8992 |
+ } |
8993 |
+ |
8994 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/vmlogrdr.c |
8995 |
+=================================================================== |
8996 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/vmlogrdr.c |
8997 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/vmlogrdr.c |
8998 |
+@@ -10,6 +10,10 @@ |
8999 |
+ * Stefan Weinhuber <wein@××××××.com> |
9000 |
+ * |
9001 |
+ */ |
9002 |
++ |
9003 |
++#define KMSG_COMPONENT "vmlogrdr" |
9004 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9005 |
++ |
9006 |
+ #include <linux/module.h> |
9007 |
+ #include <linux/init.h> |
9008 |
+ #include <linux/errno.h> |
9009 |
+@@ -28,8 +32,6 @@ |
9010 |
+ #include <linux/smp_lock.h> |
9011 |
+ #include <linux/string.h> |
9012 |
+ |
9013 |
+- |
9014 |
+- |
9015 |
+ MODULE_AUTHOR |
9016 |
+ ("(C) 2004 IBM Corporation by Xenia Tkatschow (xenia@××××××.com)\n" |
9017 |
+ " Stefan Weinhuber (wein@××××××.com)"); |
9018 |
+@@ -174,8 +176,7 @@ static void vmlogrdr_iucv_path_severed(s |
9019 |
+ struct vmlogrdr_priv_t * logptr = path->private; |
9020 |
+ u8 reason = (u8) ipuser[8]; |
9021 |
+ |
9022 |
+- printk (KERN_ERR "vmlogrdr: connection severed with" |
9023 |
+- " reason %i\n", reason); |
9024 |
++ pr_err("vmlogrdr: connection severed with reason %i\n", reason); |
9025 |
+ |
9026 |
+ iucv_path_sever(path, NULL); |
9027 |
+ kfree(path); |
9028 |
+@@ -333,8 +334,8 @@ static int vmlogrdr_open (struct inode * |
9029 |
+ if (logptr->autorecording) { |
9030 |
+ ret = vmlogrdr_recording(logptr,1,logptr->autopurge); |
9031 |
+ if (ret) |
9032 |
+- printk (KERN_WARNING "vmlogrdr: failed to start " |
9033 |
+- "recording automatically\n"); |
9034 |
++ pr_warning("vmlogrdr: failed to start " |
9035 |
++ "recording automatically\n"); |
9036 |
+ } |
9037 |
+ |
9038 |
+ /* create connection to the system service */ |
9039 |
+@@ -345,9 +346,9 @@ static int vmlogrdr_open (struct inode * |
9040 |
+ logptr->system_service, NULL, NULL, |
9041 |
+ logptr); |
9042 |
+ if (connect_rc) { |
9043 |
+- printk (KERN_ERR "vmlogrdr: iucv connection to %s " |
9044 |
+- "failed with rc %i \n", logptr->system_service, |
9045 |
+- connect_rc); |
9046 |
++ pr_err("vmlogrdr: iucv connection to %s " |
9047 |
++ "failed with rc %i \n", |
9048 |
++ logptr->system_service, connect_rc); |
9049 |
+ goto out_path; |
9050 |
+ } |
9051 |
+ |
9052 |
+@@ -388,8 +389,8 @@ static int vmlogrdr_release (struct inod |
9053 |
+ if (logptr->autorecording) { |
9054 |
+ ret = vmlogrdr_recording(logptr,0,logptr->autopurge); |
9055 |
+ if (ret) |
9056 |
+- printk (KERN_WARNING "vmlogrdr: failed to stop " |
9057 |
+- "recording automatically\n"); |
9058 |
++ pr_warning("vmlogrdr: failed to stop " |
9059 |
++ "recording automatically\n"); |
9060 |
+ } |
9061 |
+ logptr->dev_in_use = 0; |
9062 |
+ |
9063 |
+@@ -824,8 +825,7 @@ static int __init vmlogrdr_init(void) |
9064 |
+ dev_t dev; |
9065 |
+ |
9066 |
+ if (! MACHINE_IS_VM) { |
9067 |
+- printk (KERN_ERR "vmlogrdr: not running under VM, " |
9068 |
+- "driver not loaded.\n"); |
9069 |
++ pr_err("not running under VM, driver not loaded.\n"); |
9070 |
+ return -ENODEV; |
9071 |
+ } |
9072 |
+ |
9073 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/vmur.c |
9074 |
+=================================================================== |
9075 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/vmur.c |
9076 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/vmur.c |
9077 |
+@@ -8,6 +8,9 @@ |
9078 |
+ * Frank Munzert <munzert@××××××.com> |
9079 |
+ */ |
9080 |
+ |
9081 |
++#define KMSG_COMPONENT "vmur" |
9082 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9083 |
++ |
9084 |
+ #include <linux/cdev.h> |
9085 |
+ #include <linux/smp_lock.h> |
9086 |
+ |
9087 |
+@@ -40,8 +43,6 @@ MODULE_AUTHOR("IBM Corporation"); |
9088 |
+ MODULE_DESCRIPTION("s390 z/VM virtual unit record device driver"); |
9089 |
+ MODULE_LICENSE("GPL"); |
9090 |
+ |
9091 |
+-#define PRINTK_HEADER "vmur: " |
9092 |
+- |
9093 |
+ static dev_t ur_first_dev_maj_min; |
9094 |
+ static struct class *vmur_class; |
9095 |
+ static struct debug_info *vmur_dbf; |
9096 |
+@@ -988,7 +989,8 @@ static int __init ur_init(void) |
9097 |
+ dev_t dev; |
9098 |
+ |
9099 |
+ if (!MACHINE_IS_VM) { |
9100 |
+- PRINT_ERR("%s is only available under z/VM.\n", ur_banner); |
9101 |
++ pr_err("The %s cannot be loaded without z/VM\n", |
9102 |
++ ur_banner); |
9103 |
+ return -ENODEV; |
9104 |
+ } |
9105 |
+ |
9106 |
+@@ -1007,7 +1009,8 @@ static int __init ur_init(void) |
9107 |
+ |
9108 |
+ rc = alloc_chrdev_region(&dev, 0, NUM_MINORS, "vmur"); |
9109 |
+ if (rc) { |
9110 |
+- PRINT_ERR("alloc_chrdev_region failed: err = %d\n", rc); |
9111 |
++ pr_err("Kernel function alloc_chrdev_region failed with " |
9112 |
++ "error code %d\n", rc); |
9113 |
+ goto fail_unregister_driver; |
9114 |
+ } |
9115 |
+ ur_first_dev_maj_min = MKDEV(MAJOR(dev), 0); |
9116 |
+@@ -1017,7 +1020,7 @@ static int __init ur_init(void) |
9117 |
+ rc = PTR_ERR(vmur_class); |
9118 |
+ goto fail_unregister_region; |
9119 |
+ } |
9120 |
+- PRINT_INFO("%s loaded.\n", ur_banner); |
9121 |
++ pr_info("%s loaded.\n", ur_banner); |
9122 |
+ return 0; |
9123 |
+ |
9124 |
+ fail_unregister_region: |
9125 |
+@@ -1035,7 +1038,7 @@ static void __exit ur_exit(void) |
9126 |
+ unregister_chrdev_region(ur_first_dev_maj_min, NUM_MINORS); |
9127 |
+ ccw_driver_unregister(&ur_driver); |
9128 |
+ debug_unregister(vmur_dbf); |
9129 |
+- PRINT_INFO("%s unloaded.\n", ur_banner); |
9130 |
++ pr_info("%s unloaded.\n", ur_banner); |
9131 |
+ } |
9132 |
+ |
9133 |
+ module_init(ur_init); |
9134 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/char/zcore.c |
9135 |
+=================================================================== |
9136 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/char/zcore.c |
9137 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/char/zcore.c |
9138 |
+@@ -9,6 +9,9 @@ |
9139 |
+ * Author(s): Michael Holzheu |
9140 |
+ */ |
9141 |
+ |
9142 |
++#define KMSG_COMPONENT "zdump" |
9143 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9144 |
++ |
9145 |
+ #include <linux/init.h> |
9146 |
+ #include <linux/miscdevice.h> |
9147 |
+ #include <linux/utsname.h> |
9148 |
+@@ -24,8 +27,6 @@ |
9149 |
+ #include "sclp.h" |
9150 |
+ |
9151 |
+ #define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x) |
9152 |
+-#define MSG(x...) printk( KERN_ALERT x ) |
9153 |
+-#define ERROR_MSG(x...) printk ( KERN_ALERT "DUMP: " x ) |
9154 |
+ |
9155 |
+ #define TO_USER 0 |
9156 |
+ #define TO_KERNEL 1 |
9157 |
+@@ -563,19 +564,19 @@ static int __init sys_info_init(enum arc |
9158 |
+ |
9159 |
+ switch (arch) { |
9160 |
+ case ARCH_S390X: |
9161 |
+- MSG("DETECTED 'S390X (64 bit) OS'\n"); |
9162 |
++ pr_alert("DETECTED 'S390X (64 bit) OS'\n"); |
9163 |
+ sys_info.sa_base = SAVE_AREA_BASE_S390X; |
9164 |
+ sys_info.sa_size = sizeof(struct save_area_s390x); |
9165 |
+ set_s390x_lc_mask(&sys_info.lc_mask); |
9166 |
+ break; |
9167 |
+ case ARCH_S390: |
9168 |
+- MSG("DETECTED 'S390 (32 bit) OS'\n"); |
9169 |
++ pr_alert("DETECTED 'S390 (32 bit) OS'\n"); |
9170 |
+ sys_info.sa_base = SAVE_AREA_BASE_S390; |
9171 |
+ sys_info.sa_size = sizeof(struct save_area_s390); |
9172 |
+ set_s390_lc_mask(&sys_info.lc_mask); |
9173 |
+ break; |
9174 |
+ default: |
9175 |
+- ERROR_MSG("unknown architecture 0x%x.\n",arch); |
9176 |
++ pr_alert("0x%x is an unknown architecture.\n",arch); |
9177 |
+ return -EINVAL; |
9178 |
+ } |
9179 |
+ sys_info.arch = arch; |
9180 |
+@@ -674,7 +675,8 @@ static int __init zcore_init(void) |
9181 |
+ |
9182 |
+ #ifndef __s390x__ |
9183 |
+ if (arch == ARCH_S390X) { |
9184 |
+- ERROR_MSG("32 bit dumper can't dump 64 bit system!\n"); |
9185 |
++ pr_alert("The 32-bit dump tool cannot be used for a " |
9186 |
++ "64-bit system\n"); |
9187 |
+ rc = -EINVAL; |
9188 |
+ goto fail; |
9189 |
+ } |
9190 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/blacklist.c |
9191 |
+=================================================================== |
9192 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/blacklist.c |
9193 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/blacklist.c |
9194 |
+@@ -9,6 +9,9 @@ |
9195 |
+ * Arnd Bergmann (arndb@××××××.com) |
9196 |
+ */ |
9197 |
+ |
9198 |
++#define KMSG_COMPONENT "cio" |
9199 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9200 |
++ |
9201 |
+ #include <linux/init.h> |
9202 |
+ #include <linux/vmalloc.h> |
9203 |
+ #include <linux/slab.h> |
9204 |
+@@ -50,9 +53,10 @@ static int blacklist_range(range_action |
9205 |
+ { |
9206 |
+ if ((from_ssid > to_ssid) || ((from_ssid == to_ssid) && (from > to))) { |
9207 |
+ if (msgtrigger) |
9208 |
+- printk(KERN_WARNING "cio: Invalid cio_ignore range " |
9209 |
+- "0.%x.%04x-0.%x.%04x\n", from_ssid, from, |
9210 |
+- to_ssid, to); |
9211 |
++ pr_warning("0.%x.%04x to 0.%x.%04x is not a valid " |
9212 |
++ "range for cio_ignore\n", from_ssid, from, |
9213 |
++ to_ssid, to); |
9214 |
++ |
9215 |
+ return 1; |
9216 |
+ } |
9217 |
+ |
9218 |
+@@ -140,8 +144,8 @@ static int parse_busid(char *str, unsign |
9219 |
+ rc = 0; |
9220 |
+ out: |
9221 |
+ if (rc && msgtrigger) |
9222 |
+- printk(KERN_WARNING "cio: Invalid cio_ignore device '%s'\n", |
9223 |
+- str); |
9224 |
++ pr_warning("%s is not a valid device for the cio_ignore " |
9225 |
++ "kernel parameter\n", str); |
9226 |
+ |
9227 |
+ return rc; |
9228 |
+ } |
9229 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/chsc.c |
9230 |
+=================================================================== |
9231 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/chsc.c |
9232 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/chsc.c |
9233 |
+@@ -8,6 +8,9 @@ |
9234 |
+ * Arnd Bergmann (arndb@××××××.com) |
9235 |
+ */ |
9236 |
+ |
9237 |
++#define KMSG_COMPONENT "cio" |
9238 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9239 |
++ |
9240 |
+ #include <linux/module.h> |
9241 |
+ #include <linux/slab.h> |
9242 |
+ #include <linux/init.h> |
9243 |
+@@ -333,6 +336,7 @@ static void chsc_process_sei_chp_config( |
9244 |
+ struct chp_config_data *data; |
9245 |
+ struct chp_id chpid; |
9246 |
+ int num; |
9247 |
++ char *events[3] = {"configure", "deconfigure", "cancel deconfigure"}; |
9248 |
+ |
9249 |
+ CIO_CRW_EVENT(4, "chsc: channel-path-configuration notification\n"); |
9250 |
+ if (sei_area->rs != 0) |
9251 |
+@@ -343,8 +347,8 @@ static void chsc_process_sei_chp_config( |
9252 |
+ if (!chp_test_bit(data->map, num)) |
9253 |
+ continue; |
9254 |
+ chpid.id = num; |
9255 |
+- printk(KERN_WARNING "cio: processing configure event %d for " |
9256 |
+- "chpid %x.%02x\n", data->op, chpid.cssid, chpid.id); |
9257 |
++ pr_notice("Processing %s for channel path %x.%02x\n", |
9258 |
++ events[data->op], chpid.cssid, chpid.id); |
9259 |
+ switch (data->op) { |
9260 |
+ case 0: |
9261 |
+ chp_cfg_schedule(chpid, 1); |
9262 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/cio.c |
9263 |
+=================================================================== |
9264 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/cio.c |
9265 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/cio.c |
9266 |
+@@ -9,6 +9,9 @@ |
9267 |
+ * Martin Schwidefsky (schwidefsky@××××××.com) |
9268 |
+ */ |
9269 |
+ |
9270 |
++#define KMSG_COMPONENT "cio" |
9271 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9272 |
++ |
9273 |
+ #include <linux/module.h> |
9274 |
+ #include <linux/init.h> |
9275 |
+ #include <linux/slab.h> |
9276 |
+@@ -777,7 +780,7 @@ cio_probe_console(void) |
9277 |
+ sch_no = cio_get_console_sch_no(); |
9278 |
+ if (sch_no == -1) { |
9279 |
+ console_subchannel_in_use = 0; |
9280 |
+- printk(KERN_WARNING "cio: No ccw console found!\n"); |
9281 |
++ pr_warning("No CCW console was found\n"); |
9282 |
+ return ERR_PTR(-ENODEV); |
9283 |
+ } |
9284 |
+ memset(&console_subchannel, 0, sizeof(struct subchannel)); |
9285 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/cmf.c |
9286 |
+=================================================================== |
9287 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/cmf.c |
9288 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/cmf.c |
9289 |
+@@ -25,6 +25,9 @@ |
9290 |
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
9291 |
+ */ |
9292 |
+ |
9293 |
++#define KMSG_COMPONENT "cio" |
9294 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9295 |
++ |
9296 |
+ #include <linux/bootmem.h> |
9297 |
+ #include <linux/device.h> |
9298 |
+ #include <linux/init.h> |
9299 |
+@@ -1359,9 +1362,8 @@ static int __init init_cmf(void) |
9300 |
+ default: |
9301 |
+ return 1; |
9302 |
+ } |
9303 |
+- |
9304 |
+- printk(KERN_INFO "cio: Channel measurement facility using %s " |
9305 |
+- "format (%s)\n", format_string, detect_string); |
9306 |
++ pr_info("Channel measurement facility initialized using format " |
9307 |
++ "%s (mode %s)\n", format_string, detect_string); |
9308 |
+ return 0; |
9309 |
+ } |
9310 |
+ |
9311 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/css.c |
9312 |
+=================================================================== |
9313 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/css.c |
9314 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/css.c |
9315 |
+@@ -6,6 +6,10 @@ |
9316 |
+ * Author(s): Arnd Bergmann (arndb@××××××.com) |
9317 |
+ * Cornelia Huck (cornelia.huck@××××××.com) |
9318 |
+ */ |
9319 |
++ |
9320 |
++#define KMSG_COMPONENT "cio" |
9321 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9322 |
++ |
9323 |
+ #include <linux/module.h> |
9324 |
+ #include <linux/init.h> |
9325 |
+ #include <linux/device.h> |
9326 |
+@@ -844,8 +848,8 @@ out: |
9327 |
+ s390_unregister_crw_handler(CRW_RSC_CSS); |
9328 |
+ chsc_free_sei_area(); |
9329 |
+ kfree(slow_subchannel_set); |
9330 |
+- printk(KERN_WARNING"cio: failed to initialize css driver (%d)!\n", |
9331 |
+- ret); |
9332 |
++ pr_alert("The CSS device driver initialization failed with " |
9333 |
++ "errno=%d\n", ret); |
9334 |
+ return ret; |
9335 |
+ } |
9336 |
+ |
9337 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio.h |
9338 |
+=================================================================== |
9339 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/qdio.h |
9340 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio.h |
9341 |
+@@ -203,6 +203,9 @@ struct qdio_output_q { |
9342 |
+ /* PCIs are enabled for the queue */ |
9343 |
+ int pci_out_enabled; |
9344 |
+ |
9345 |
++ /* IQDIO: output multiple buffers (enhanced SIGA) */ |
9346 |
++ int use_enh_siga; |
9347 |
++ |
9348 |
+ /* timer to check for more outbound work */ |
9349 |
+ struct timer_list timer; |
9350 |
+ }; |
9351 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_main.c |
9352 |
+=================================================================== |
9353 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/cio/qdio_main.c |
9354 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/cio/qdio_main.c |
9355 |
+@@ -316,6 +316,9 @@ static inline int qdio_do_siga_output(st |
9356 |
+ unsigned int fc = 0; |
9357 |
+ unsigned long schid; |
9358 |
+ |
9359 |
++ if (q->u.out.use_enh_siga) { |
9360 |
++ fc = 3; |
9361 |
++ } |
9362 |
+ if (!is_qebsm(q)) |
9363 |
+ schid = *((u32 *)&q->irq_ptr->schid); |
9364 |
+ else { |
9365 |
+@@ -1448,6 +1451,8 @@ int qdio_establish(struct qdio_initializ |
9366 |
+ } |
9367 |
+ |
9368 |
+ qdio_setup_ssqd_info(irq_ptr); |
9369 |
++ sprintf(dbf_text, "qDmmwc%2x", irq_ptr->ssqd_desc.mmwc); |
9370 |
++ QDIO_DBF_TEXT2(0, setup, dbf_text); |
9371 |
+ sprintf(dbf_text, "qib ac%2x", irq_ptr->qib.ac); |
9372 |
+ QDIO_DBF_TEXT2(0, setup, dbf_text); |
9373 |
+ |
9374 |
+@@ -1620,12 +1625,21 @@ static void handle_outbound(struct qdio_ |
9375 |
+ if (multicast_outbound(q)) |
9376 |
+ qdio_kick_outbound_q(q); |
9377 |
+ else |
9378 |
+- /* |
9379 |
+- * One siga-w per buffer required for unicast |
9380 |
+- * HiperSockets. |
9381 |
+- */ |
9382 |
+- while (count--) |
9383 |
++ if ((q->irq_ptr->ssqd_desc.mmwc > 1) && |
9384 |
++ (count > 1) && |
9385 |
++ (count <= q->irq_ptr->ssqd_desc.mmwc)) { |
9386 |
++ /* exploit enhanced SIGA */ |
9387 |
++ q->u.out.use_enh_siga = 1; |
9388 |
+ qdio_kick_outbound_q(q); |
9389 |
++ } else { |
9390 |
++ /* |
9391 |
++ * One siga-w per buffer required for unicast |
9392 |
++ * HiperSockets. |
9393 |
++ */ |
9394 |
++ q->u.out.use_enh_siga = 0; |
9395 |
++ while (count--) |
9396 |
++ qdio_kick_outbound_q(q); |
9397 |
++ } |
9398 |
+ goto out; |
9399 |
+ } |
9400 |
+ |
9401 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/crypto/ap_bus.c |
9402 |
+=================================================================== |
9403 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/crypto/ap_bus.c |
9404 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/crypto/ap_bus.c |
9405 |
+@@ -5,6 +5,7 @@ |
9406 |
+ * Author(s): Cornelia Huck <cornelia.huck@××××××.com> |
9407 |
+ * Martin Schwidefsky <schwidefsky@××××××.com> |
9408 |
+ * Ralph Wuerthner <rwuerthn@××××××.com> |
9409 |
++ * Felix Beck <felix.beck@××××××.com> |
9410 |
+ * |
9411 |
+ * Adjunct processor bus. |
9412 |
+ * |
9413 |
+@@ -23,6 +24,9 @@ |
9414 |
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
9415 |
+ */ |
9416 |
+ |
9417 |
++#define KMSG_COMPONENT "ap" |
9418 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
9419 |
++ |
9420 |
+ #include <linux/module.h> |
9421 |
+ #include <linux/init.h> |
9422 |
+ #include <linux/delay.h> |
9423 |
+@@ -34,6 +38,10 @@ |
9424 |
+ #include <linux/mutex.h> |
9425 |
+ #include <asm/s390_rdev.h> |
9426 |
+ #include <asm/reset.h> |
9427 |
++#include <asm/airq.h> |
9428 |
++#include <asm/atomic.h> |
9429 |
++#include <asm/system.h> |
9430 |
++#include <asm/isc.h> |
9431 |
+ #include <linux/hrtimer.h> |
9432 |
+ #include <linux/ktime.h> |
9433 |
+ |
9434 |
+@@ -46,6 +54,7 @@ static enum hrtimer_restart ap_poll_time |
9435 |
+ static int ap_poll_thread_start(void); |
9436 |
+ static void ap_poll_thread_stop(void); |
9437 |
+ static void ap_request_timeout(unsigned long); |
9438 |
++static inline void ap_schedule_poll_timer(void); |
9439 |
+ |
9440 |
+ /* |
9441 |
+ * Module description. |
9442 |
+@@ -80,19 +89,29 @@ static int ap_config_time = AP_CONFIG_TI |
9443 |
+ static DECLARE_WORK(ap_config_work, ap_scan_bus); |
9444 |
+ |
9445 |
+ /* |
9446 |
+- * Tasklet & timer for AP request polling. |
9447 |
++ * Tasklet & timer for AP request polling and interrupts |
9448 |
+ */ |
9449 |
+ static DECLARE_TASKLET(ap_tasklet, ap_poll_all, 0); |
9450 |
+ static atomic_t ap_poll_requests = ATOMIC_INIT(0); |
9451 |
+ static DECLARE_WAIT_QUEUE_HEAD(ap_poll_wait); |
9452 |
+ static struct task_struct *ap_poll_kthread = NULL; |
9453 |
+ static DEFINE_MUTEX(ap_poll_thread_mutex); |
9454 |
++static void *ap_interrupt_indicator; |
9455 |
+ static struct hrtimer ap_poll_timer; |
9456 |
+ /* In LPAR poll with 4kHz frequency. Poll every 250000 nanoseconds. |
9457 |
+ * If z/VM change to 1500000 nanoseconds to adjust to z/VM polling.*/ |
9458 |
+ static unsigned long long poll_timeout = 250000; |
9459 |
+ |
9460 |
+ /** |
9461 |
++ * ap_using_interrupts() - Returns non-zero if interrupt support is |
9462 |
++ * available. |
9463 |
++ */ |
9464 |
++static inline int ap_using_interrupts(void) |
9465 |
++{ |
9466 |
++ return ap_interrupt_indicator != NULL; |
9467 |
++} |
9468 |
++ |
9469 |
++/** |
9470 |
+ * ap_intructions_available() - Test if AP instructions are available. |
9471 |
+ * |
9472 |
+ * Returns 0 if the AP instructions are installed. |
9473 |
+@@ -113,6 +132,23 @@ static inline int ap_instructions_availa |
9474 |
+ } |
9475 |
+ |
9476 |
+ /** |
9477 |
++ * ap_interrupts_available(): Test if AP interrupts are available. |
9478 |
++ * |
9479 |
++ * Returns 1 if AP interrupts are available. |
9480 |
++ */ |
9481 |
++static int ap_interrupts_available(void) |
9482 |
++{ |
9483 |
++ unsigned long long facility_bits[2]; |
9484 |
++ |
9485 |
++ if (stfle(facility_bits, 2) <= 1) |
9486 |
++ return 0; |
9487 |
++ if (!(facility_bits[0] & (1ULL << 61)) || |
9488 |
++ !(facility_bits[1] & (1ULL << 62))) |
9489 |
++ return 0; |
9490 |
++ return 1; |
9491 |
++} |
9492 |
++ |
9493 |
++/** |
9494 |
+ * ap_test_queue(): Test adjunct processor queue. |
9495 |
+ * @qid: The AP queue number |
9496 |
+ * @queue_depth: Pointer to queue depth value |
9497 |
+@@ -152,6 +188,80 @@ static inline struct ap_queue_status ap_ |
9498 |
+ return reg1; |
9499 |
+ } |
9500 |
+ |
9501 |
++#ifdef CONFIG_64BIT |
9502 |
++/** |
9503 |
++ * ap_queue_interruption_control(): Enable interruption for a specific AP. |
9504 |
++ * @qid: The AP queue number |
9505 |
++ * @ind: The notification indicator byte |
9506 |
++ * |
9507 |
++ * Returns AP queue status. |
9508 |
++ */ |
9509 |
++static inline struct ap_queue_status |
9510 |
++ap_queue_interruption_control(ap_qid_t qid, void *ind) |
9511 |
++{ |
9512 |
++ register unsigned long reg0 asm ("0") = qid | 0x03000000UL; |
9513 |
++ register unsigned long reg1_in asm ("1") = 0x0000800000000000UL | AP_ISC; |
9514 |
++ register struct ap_queue_status reg1_out asm ("1"); |
9515 |
++ register void *reg2 asm ("2") = ind; |
9516 |
++ asm volatile( |
9517 |
++ ".long 0xb2af0000" /* PQAP(RAPQ) */ |
9518 |
++ : "+d" (reg0), "+d" (reg1_in), "=d" (reg1_out), "+d" (reg2) |
9519 |
++ : |
9520 |
++ : "cc" ); |
9521 |
++ return reg1_out; |
9522 |
++} |
9523 |
++#endif |
9524 |
++ |
9525 |
++/** |
9526 |
++ * ap_queue_enable_interruption(): Enable interruption on an AP. |
9527 |
++ * @qid: The AP queue number |
9528 |
++ * @ind: the notification indicator byte |
9529 |
++ * |
9530 |
++ * Enables interruption on AP queue via ap_queue_interruption_control(). Based |
9531 |
++ * on the return value it waits a while and tests the AP queue if interrupts |
9532 |
++ * have been switched on using ap_test_queue(). |
9533 |
++ */ |
9534 |
++static int ap_queue_enable_interruption(ap_qid_t qid, void *ind) |
9535 |
++{ |
9536 |
++#ifdef CONFIG_64BIT |
9537 |
++ struct ap_queue_status status; |
9538 |
++ int t_depth, t_device_type, rc, i; |
9539 |
++ |
9540 |
++ rc = -EBUSY; |
9541 |
++ status = ap_queue_interruption_control(qid, ind); |
9542 |
++ |
9543 |
++ for (i = 0; i < AP_MAX_RESET; i++) { |
9544 |
++ switch (status.response_code) { |
9545 |
++ case AP_RESPONSE_NORMAL: |
9546 |
++ if (status.int_enabled) |
9547 |
++ return 0; |
9548 |
++ break; |
9549 |
++ case AP_RESPONSE_RESET_IN_PROGRESS: |
9550 |
++ case AP_RESPONSE_BUSY: |
9551 |
++ break; |
9552 |
++ case AP_RESPONSE_Q_NOT_AVAIL: |
9553 |
++ case AP_RESPONSE_DECONFIGURED: |
9554 |
++ case AP_RESPONSE_CHECKSTOPPED: |
9555 |
++ case AP_RESPONSE_INVALID_ADDRESS: |
9556 |
++ return -ENODEV; |
9557 |
++ case AP_RESPONSE_OTHERWISE_CHANGED: |
9558 |
++ if (status.int_enabled) |
9559 |
++ return 0; |
9560 |
++ break; |
9561 |
++ default: |
9562 |
++ break; |
9563 |
++ } |
9564 |
++ if (i < AP_MAX_RESET - 1) { |
9565 |
++ udelay(5); |
9566 |
++ status = ap_test_queue(qid, &t_depth, &t_device_type); |
9567 |
++ } |
9568 |
++ } |
9569 |
++ return rc; |
9570 |
++#else |
9571 |
++ return -EINVAL; |
9572 |
++#endif |
9573 |
++} |
9574 |
++ |
9575 |
+ /** |
9576 |
+ * __ap_send(): Send message to adjunct processor queue. |
9577 |
+ * @qid: The AP queue number |
9578 |
+@@ -295,6 +405,11 @@ static int ap_query_queue(ap_qid_t qid, |
9579 |
+ case AP_RESPONSE_CHECKSTOPPED: |
9580 |
+ rc = -ENODEV; |
9581 |
+ break; |
9582 |
++ case AP_RESPONSE_INVALID_ADDRESS: |
9583 |
++ rc = -ENODEV; |
9584 |
++ break; |
9585 |
++ case AP_RESPONSE_OTHERWISE_CHANGED: |
9586 |
++ break; |
9587 |
+ case AP_RESPONSE_BUSY: |
9588 |
+ break; |
9589 |
+ default: |
9590 |
+@@ -345,6 +460,15 @@ static int ap_init_queue(ap_qid_t qid) |
9591 |
+ status = ap_test_queue(qid, &dummy, &dummy); |
9592 |
+ } |
9593 |
+ } |
9594 |
++ if (rc == 0 && ap_using_interrupts()) { |
9595 |
++ rc = ap_queue_enable_interruption(qid, ap_interrupt_indicator); |
9596 |
++ /* If interruption mode is supported by the machine, |
9597 |
++ * but an AP can not be enabled for interruption then |
9598 |
++ * the AP will be discarded. */ |
9599 |
++ if (rc) |
9600 |
++ pr_err("Registering adapter interrupts for " |
9601 |
++ "AP %d failed\n", AP_QID_DEVICE(qid)); |
9602 |
++ } |
9603 |
+ return rc; |
9604 |
+ } |
9605 |
+ |
9606 |
+@@ -599,6 +723,14 @@ static ssize_t ap_config_time_show(struc |
9607 |
+ return snprintf(buf, PAGE_SIZE, "%d\n", ap_config_time); |
9608 |
+ } |
9609 |
+ |
9610 |
++static ssize_t ap_interrupts_show(struct bus_type *bus, char *buf) |
9611 |
++{ |
9612 |
++ return snprintf(buf, PAGE_SIZE, "%d\n", |
9613 |
++ ap_using_interrupts() ? 1 : 0); |
9614 |
++} |
9615 |
++ |
9616 |
++static BUS_ATTR(ap_interrupts, 0444, ap_interrupts_show, NULL); |
9617 |
++ |
9618 |
+ static ssize_t ap_config_time_store(struct bus_type *bus, |
9619 |
+ const char *buf, size_t count) |
9620 |
+ { |
9621 |
+@@ -653,7 +785,8 @@ static ssize_t poll_timeout_store(struct |
9622 |
+ ktime_t hr_time; |
9623 |
+ |
9624 |
+ /* 120 seconds = maximum poll interval */ |
9625 |
+- if (sscanf(buf, "%llu\n", &time) != 1 || time < 1 || time > 120000000000) |
9626 |
++ if (sscanf(buf, "%llu\n", &time) != 1 || time < 1 || |
9627 |
++ time > 120000000000ULL) |
9628 |
+ return -EINVAL; |
9629 |
+ poll_timeout = time; |
9630 |
+ hr_time = ktime_set(0, poll_timeout); |
9631 |
+@@ -672,6 +805,7 @@ static struct bus_attribute *const ap_bu |
9632 |
+ &bus_attr_ap_domain, |
9633 |
+ &bus_attr_config_time, |
9634 |
+ &bus_attr_poll_thread, |
9635 |
++ &bus_attr_ap_interrupts, |
9636 |
+ &bus_attr_poll_timeout, |
9637 |
+ NULL, |
9638 |
+ }; |
9639 |
+@@ -814,6 +948,11 @@ out: |
9640 |
+ return rc; |
9641 |
+ } |
9642 |
+ |
9643 |
++static void ap_interrupt_handler(void *unused1, void *unused2) |
9644 |
++{ |
9645 |
++ tasklet_schedule(&ap_tasklet); |
9646 |
++} |
9647 |
++ |
9648 |
+ /** |
9649 |
+ * __ap_scan_bus(): Scan the AP bus. |
9650 |
+ * @dev: Pointer to device |
9651 |
+@@ -928,6 +1067,8 @@ ap_config_timeout(unsigned long ptr) |
9652 |
+ */ |
9653 |
+ static inline void ap_schedule_poll_timer(void) |
9654 |
+ { |
9655 |
++ if (ap_using_interrupts()) |
9656 |
++ return; |
9657 |
+ if (hrtimer_is_queued(&ap_poll_timer)) |
9658 |
+ return; |
9659 |
+ hrtimer_start(&ap_poll_timer, ktime_set(0, poll_timeout), |
9660 |
+@@ -1207,6 +1348,12 @@ static void ap_poll_all(unsigned long du |
9661 |
+ unsigned long flags; |
9662 |
+ struct ap_device *ap_dev; |
9663 |
+ |
9664 |
++ /* Reset the indicator if interrupts are used. Thus new interrupts can |
9665 |
++ * be received. Doing it in the beginning of the tasklet is therefor |
9666 |
++ * important that no requests on any AP get lost. |
9667 |
++ */ |
9668 |
++ if (ap_using_interrupts()) |
9669 |
++ xchg((u8 *)ap_interrupt_indicator, 0); |
9670 |
+ do { |
9671 |
+ flags = 0; |
9672 |
+ spin_lock(&ap_device_lock); |
9673 |
+@@ -1268,6 +1415,8 @@ static int ap_poll_thread_start(void) |
9674 |
+ { |
9675 |
+ int rc; |
9676 |
+ |
9677 |
++ if (ap_using_interrupts()) |
9678 |
++ return 0; |
9679 |
+ mutex_lock(&ap_poll_thread_mutex); |
9680 |
+ if (!ap_poll_kthread) { |
9681 |
+ ap_poll_kthread = kthread_run(ap_poll_thread, NULL, "appoll"); |
9682 |
+@@ -1301,8 +1450,12 @@ static void ap_request_timeout(unsigned |
9683 |
+ { |
9684 |
+ struct ap_device *ap_dev = (struct ap_device *) data; |
9685 |
+ |
9686 |
+- if (ap_dev->reset == AP_RESET_ARMED) |
9687 |
++ if (ap_dev->reset == AP_RESET_ARMED) { |
9688 |
+ ap_dev->reset = AP_RESET_DO; |
9689 |
++ |
9690 |
++ if (ap_using_interrupts()) |
9691 |
++ tasklet_schedule(&ap_tasklet); |
9692 |
++ } |
9693 |
+ } |
9694 |
+ |
9695 |
+ static void ap_reset_domain(void) |
9696 |
+@@ -1337,14 +1490,25 @@ int __init ap_module_init(void) |
9697 |
+ int rc, i; |
9698 |
+ |
9699 |
+ if (ap_domain_index < -1 || ap_domain_index >= AP_DOMAINS) { |
9700 |
+- printk(KERN_WARNING "Invalid param: domain = %d. " |
9701 |
+- " Not loading.\n", ap_domain_index); |
9702 |
++ pr_warning("%d is not a valid cryptographic domain\n", |
9703 |
++ ap_domain_index); |
9704 |
+ return -EINVAL; |
9705 |
+ } |
9706 |
+ if (ap_instructions_available() != 0) { |
9707 |
+- printk(KERN_WARNING "AP instructions not installed.\n"); |
9708 |
++ pr_warning("The hardware system does not support " |
9709 |
++ "AP instructions\n"); |
9710 |
+ return -ENODEV; |
9711 |
+ } |
9712 |
++ if (ap_interrupts_available()) { |
9713 |
++ isc_register(AP_ISC); |
9714 |
++ ap_interrupt_indicator = s390_register_adapter_interrupt( |
9715 |
++ &ap_interrupt_handler, NULL, AP_ISC); |
9716 |
++ if (IS_ERR(ap_interrupt_indicator)) { |
9717 |
++ ap_interrupt_indicator = NULL; |
9718 |
++ isc_unregister(AP_ISC); |
9719 |
++ } |
9720 |
++ } |
9721 |
++ |
9722 |
+ register_reset_call(&ap_reset_call); |
9723 |
+ |
9724 |
+ /* Create /sys/bus/ap. */ |
9725 |
+@@ -1408,6 +1572,10 @@ out_bus: |
9726 |
+ bus_unregister(&ap_bus_type); |
9727 |
+ out: |
9728 |
+ unregister_reset_call(&ap_reset_call); |
9729 |
++ if (ap_using_interrupts()) { |
9730 |
++ s390_unregister_adapter_interrupt(ap_interrupt_indicator, AP_ISC); |
9731 |
++ isc_unregister(AP_ISC); |
9732 |
++ } |
9733 |
+ return rc; |
9734 |
+ } |
9735 |
+ |
9736 |
+@@ -1443,6 +1611,10 @@ void ap_module_exit(void) |
9737 |
+ bus_remove_file(&ap_bus_type, ap_bus_attrs[i]); |
9738 |
+ bus_unregister(&ap_bus_type); |
9739 |
+ unregister_reset_call(&ap_reset_call); |
9740 |
++ if (ap_using_interrupts()) { |
9741 |
++ s390_unregister_adapter_interrupt(ap_interrupt_indicator, AP_ISC); |
9742 |
++ isc_unregister(AP_ISC); |
9743 |
++ } |
9744 |
+ } |
9745 |
+ |
9746 |
+ #ifndef CONFIG_ZCRYPT_MONOLITHIC |
9747 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/crypto/ap_bus.h |
9748 |
+=================================================================== |
9749 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/crypto/ap_bus.h |
9750 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/crypto/ap_bus.h |
9751 |
+@@ -5,6 +5,7 @@ |
9752 |
+ * Author(s): Cornelia Huck <cornelia.huck@××××××.com> |
9753 |
+ * Martin Schwidefsky <schwidefsky@××××××.com> |
9754 |
+ * Ralph Wuerthner <rwuerthn@××××××.com> |
9755 |
++ * Felix Beck <felix.beck@××××××.com> |
9756 |
+ * |
9757 |
+ * Adjunct processor bus header file. |
9758 |
+ * |
9759 |
+@@ -67,7 +68,8 @@ struct ap_queue_status { |
9760 |
+ unsigned int queue_empty : 1; |
9761 |
+ unsigned int replies_waiting : 1; |
9762 |
+ unsigned int queue_full : 1; |
9763 |
+- unsigned int pad1 : 5; |
9764 |
++ unsigned int pad1 : 4; |
9765 |
++ unsigned int int_enabled : 1; |
9766 |
+ unsigned int response_code : 8; |
9767 |
+ unsigned int pad2 : 16; |
9768 |
+ }; |
9769 |
+@@ -78,6 +80,8 @@ struct ap_queue_status { |
9770 |
+ #define AP_RESPONSE_DECONFIGURED 0x03 |
9771 |
+ #define AP_RESPONSE_CHECKSTOPPED 0x04 |
9772 |
+ #define AP_RESPONSE_BUSY 0x05 |
9773 |
++#define AP_RESPONSE_INVALID_ADDRESS 0x06 |
9774 |
++#define AP_RESPONSE_OTHERWISE_CHANGED 0x07 |
9775 |
+ #define AP_RESPONSE_Q_FULL 0x10 |
9776 |
+ #define AP_RESPONSE_NO_PENDING_REPLY 0x10 |
9777 |
+ #define AP_RESPONSE_INDEX_TOO_BIG 0x11 |
9778 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/claw.c |
9779 |
+=================================================================== |
9780 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/claw.c |
9781 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/claw.c |
9782 |
+@@ -60,6 +60,9 @@ |
9783 |
+ * 1.25 Added Packing support |
9784 |
+ * 1.5 |
9785 |
+ */ |
9786 |
++ |
9787 |
++#define KMSG_COMPONENT "claw" |
9788 |
++ |
9789 |
+ #include <asm/ccwdev.h> |
9790 |
+ #include <asm/ccwgroup.h> |
9791 |
+ #include <asm/debug.h> |
9792 |
+@@ -94,7 +97,7 @@ |
9793 |
+ CLAW uses the s390dbf file system see claw_trace and claw_setup |
9794 |
+ */ |
9795 |
+ |
9796 |
+- |
9797 |
++static char version[] __initdata = "CLAW driver"; |
9798 |
+ static char debug_buffer[255]; |
9799 |
+ /** |
9800 |
+ * Debug Facility Stuff |
9801 |
+@@ -298,8 +301,7 @@ claw_probe(struct ccwgroup_device *cgdev |
9802 |
+ if (rc) { |
9803 |
+ probe_error(cgdev); |
9804 |
+ put_device(&cgdev->dev); |
9805 |
+- printk(KERN_WARNING "add_files failed %s %s Exit Line %d \n", |
9806 |
+- cgdev->cdev[0]->dev.bus_id,__func__,__LINE__); |
9807 |
++ dev_warn(&cgdev->dev, "add_files failed\n"); |
9808 |
+ CLAW_DBF_TEXT_(2, setup, "probex%d", rc); |
9809 |
+ return rc; |
9810 |
+ } |
9811 |
+@@ -496,7 +498,8 @@ claw_open(struct net_device *dev) |
9812 |
+ ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) || |
9813 |
+ (((privptr->channel[READ].flag | |
9814 |
+ privptr->channel[WRITE].flag) & CLAW_TIMER) != 0x00)) { |
9815 |
+- printk(KERN_INFO "%s: remote side is not ready\n", dev->name); |
9816 |
++ dev_info(&privptr->channel[READ].cdev->dev, |
9817 |
++ "%s: remote side is not ready\n", dev->name); |
9818 |
+ CLAW_DBF_TEXT(2, trace, "notrdy"); |
9819 |
+ |
9820 |
+ for ( i = 0; i < 2; i++) { |
9821 |
+@@ -582,10 +585,9 @@ claw_irq_handler(struct ccw_device *cdev |
9822 |
+ CLAW_DBF_TEXT(4, trace, "clawirq"); |
9823 |
+ /* Bypass all 'unsolicited interrupts' */ |
9824 |
+ if (!cdev->dev.driver_data) { |
9825 |
+- printk(KERN_WARNING "claw: unsolicited interrupt for device:" |
9826 |
+- "%s received c-%02x d-%02x\n", |
9827 |
+- cdev->dev.bus_id, irb->scsw.cmd.cstat, |
9828 |
+- irb->scsw.cmd.dstat); |
9829 |
++ dev_warn(&cdev->dev, "unsolicited interrupt for device " |
9830 |
++ "received c-%02x d-%02x\n", |
9831 |
++ irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); |
9832 |
+ CLAW_DBF_TEXT(2, trace, "badirq"); |
9833 |
+ return; |
9834 |
+ } |
9835 |
+@@ -597,8 +599,8 @@ claw_irq_handler(struct ccw_device *cdev |
9836 |
+ else if (privptr->channel[WRITE].cdev == cdev) |
9837 |
+ p_ch = &privptr->channel[WRITE]; |
9838 |
+ else { |
9839 |
+- printk(KERN_WARNING "claw: Can't determine channel for " |
9840 |
+- "interrupt, device %s\n", cdev->dev.bus_id); |
9841 |
++ dev_warn(&cdev->dev, "Can't determine channel for " |
9842 |
++ "interrupt\n"); |
9843 |
+ CLAW_DBF_TEXT(2, trace, "badchan"); |
9844 |
+ return; |
9845 |
+ } |
9846 |
+@@ -612,7 +614,8 @@ claw_irq_handler(struct ccw_device *cdev |
9847 |
+ |
9848 |
+ /* Check for good subchannel return code, otherwise info message */ |
9849 |
+ if (irb->scsw.cmd.cstat && !(irb->scsw.cmd.cstat & SCHN_STAT_PCI)) { |
9850 |
+- printk(KERN_INFO "%s: subchannel check for device: %04x -" |
9851 |
++ dev_info(&cdev->dev, |
9852 |
++ "%s: subchannel check for device: %04x -" |
9853 |
+ " Sch Stat %02x Dev Stat %02x CPA - %04x\n", |
9854 |
+ dev->name, p_ch->devno, |
9855 |
+ irb->scsw.cmd.cstat, irb->scsw.cmd.dstat, |
9856 |
+@@ -651,7 +654,7 @@ claw_irq_handler(struct ccw_device *cdev |
9857 |
+ wake_up(&p_ch->wait); /* wake claw_open (READ)*/ |
9858 |
+ } else if (p_ch->flag == CLAW_WRITE) { |
9859 |
+ p_ch->claw_state = CLAW_START_WRITE; |
9860 |
+- /* send SYSTEM_VALIDATE */ |
9861 |
++ /* send SYSTEM_VALIDATE */ |
9862 |
+ claw_strt_read(dev, LOCK_NO); |
9863 |
+ claw_send_control(dev, |
9864 |
+ SYSTEM_VALIDATE_REQUEST, |
9865 |
+@@ -659,10 +662,9 @@ claw_irq_handler(struct ccw_device *cdev |
9866 |
+ p_env->host_name, |
9867 |
+ p_env->adapter_name); |
9868 |
+ } else { |
9869 |
+- printk(KERN_WARNING "claw: unsolicited " |
9870 |
+- "interrupt for device:" |
9871 |
+- "%s received c-%02x d-%02x\n", |
9872 |
+- cdev->dev.bus_id, |
9873 |
++ dev_warn(&cdev->dev, "unsolicited " |
9874 |
++ "interrupt for device " |
9875 |
++ "received c-%02x d-%02x\n", |
9876 |
+ irb->scsw.cmd.cstat, |
9877 |
+ irb->scsw.cmd.dstat); |
9878 |
+ return; |
9879 |
+@@ -677,8 +679,8 @@ claw_irq_handler(struct ccw_device *cdev |
9880 |
+ (p_ch->irb->ecw[0] & 0x40) == 0x40 || |
9881 |
+ (p_ch->irb->ecw[0]) == 0) { |
9882 |
+ privptr->stats.rx_errors++; |
9883 |
+- printk(KERN_INFO "%s: Restart is " |
9884 |
+- "required after remote " |
9885 |
++ dev_info(&cdev->dev, |
9886 |
++ "%s: Restart is required after remote " |
9887 |
+ "side recovers \n", |
9888 |
+ dev->name); |
9889 |
+ } |
9890 |
+@@ -713,11 +715,13 @@ claw_irq_handler(struct ccw_device *cdev |
9891 |
+ return; |
9892 |
+ case CLAW_START_WRITE: |
9893 |
+ if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { |
9894 |
+- printk(KERN_INFO "%s: Unit Check Occured in " |
9895 |
++ dev_info(&cdev->dev, |
9896 |
++ "%s: Unit Check Occured in " |
9897 |
+ "write channel\n", dev->name); |
9898 |
+ clear_bit(0, (void *)&p_ch->IO_active); |
9899 |
+ if (p_ch->irb->ecw[0] & 0x80) { |
9900 |
+- printk(KERN_INFO "%s: Resetting Event " |
9901 |
++ dev_info(&cdev->dev, |
9902 |
++ "%s: Resetting Event " |
9903 |
+ "occurred:\n", dev->name); |
9904 |
+ init_timer(&p_ch->timer); |
9905 |
+ p_ch->timer.function = |
9906 |
+@@ -725,7 +729,8 @@ claw_irq_handler(struct ccw_device *cdev |
9907 |
+ p_ch->timer.data = (unsigned long)p_ch; |
9908 |
+ p_ch->timer.expires = jiffies + 10*HZ; |
9909 |
+ add_timer(&p_ch->timer); |
9910 |
+- printk(KERN_INFO "%s: write connection " |
9911 |
++ dev_info(&cdev->dev, |
9912 |
++ "%s: write connection " |
9913 |
+ "restarting\n", dev->name); |
9914 |
+ } |
9915 |
+ CLAW_DBF_TEXT(4, trace, "rstrtwrt"); |
9916 |
+@@ -733,9 +738,10 @@ claw_irq_handler(struct ccw_device *cdev |
9917 |
+ } |
9918 |
+ if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) { |
9919 |
+ clear_bit(0, (void *)&p_ch->IO_active); |
9920 |
+- printk(KERN_INFO "%s: Unit Exception " |
9921 |
+- "Occured in write channel\n", |
9922 |
+- dev->name); |
9923 |
++ dev_info(&cdev->dev, |
9924 |
++ "%s: Unit Exception " |
9925 |
++ "occurred in write channel\n", |
9926 |
++ dev->name); |
9927 |
+ } |
9928 |
+ if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) || |
9929 |
+ (p_ch->irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND) || |
9930 |
+@@ -757,7 +763,8 @@ claw_irq_handler(struct ccw_device *cdev |
9931 |
+ CLAW_DBF_TEXT(4, trace, "StWtExit"); |
9932 |
+ return; |
9933 |
+ default: |
9934 |
+- printk(KERN_WARNING "%s: wrong selection code - irq " |
9935 |
++ dev_warn(&cdev->dev, |
9936 |
++ "%s: wrong selection code - irq " |
9937 |
+ "state=%d\n", dev->name, p_ch->claw_state); |
9938 |
+ CLAW_DBF_TEXT(2, trace, "badIRQ"); |
9939 |
+ return; |
9940 |
+@@ -910,7 +917,8 @@ claw_release(struct net_device *dev) |
9941 |
+ if (((privptr->channel[READ].last_dstat | |
9942 |
+ privptr->channel[WRITE].last_dstat) & |
9943 |
+ ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) { |
9944 |
+- printk(KERN_WARNING "%s: channel problems during close - " |
9945 |
++ dev_warn(&privptr->channel[READ].cdev->dev, |
9946 |
++ "%s: channel problems during close - " |
9947 |
+ "read: %02x - write: %02x\n", |
9948 |
+ dev->name, |
9949 |
+ privptr->channel[READ].last_dstat, |
9950 |
+@@ -1135,20 +1143,19 @@ ccw_check_return_code(struct ccw_device |
9951 |
+ case -EBUSY: /* BUSY is a transient state no action needed */ |
9952 |
+ break; |
9953 |
+ case -ENODEV: |
9954 |
+- printk(KERN_EMERG "%s: Missing device called " |
9955 |
+- "for IO ENODEV\n", cdev->dev.bus_id); |
9956 |
++ dev_err(&cdev->dev, "Device not found " |
9957 |
++ "for IO ENODEV\n"); |
9958 |
+ break; |
9959 |
+ case -EIO: |
9960 |
+- printk(KERN_EMERG "%s: Status pending... EIO \n", |
9961 |
+- cdev->dev.bus_id); |
9962 |
++ dev_err(&cdev->dev, "Status pending... EIO \n"); |
9963 |
+ break; |
9964 |
+ case -EINVAL: |
9965 |
+- printk(KERN_EMERG "%s: Invalid Dev State EINVAL \n", |
9966 |
+- cdev->dev.bus_id); |
9967 |
++ dev_err(&cdev->dev, |
9968 |
++ "Invalid Dev State EINVAL \n"); |
9969 |
+ break; |
9970 |
+ default: |
9971 |
+- printk(KERN_EMERG "%s: Unknown error in " |
9972 |
+- "Do_IO %d\n",cdev->dev.bus_id, return_code); |
9973 |
++ dev_err(&cdev->dev, "Unknown error in " |
9974 |
++ "Do_IO %d\n", return_code); |
9975 |
+ } |
9976 |
+ } |
9977 |
+ CLAW_DBF_TEXT(4, trace, "ccwret"); |
9978 |
+@@ -1162,39 +1169,40 @@ static void |
9979 |
+ ccw_check_unit_check(struct chbk * p_ch, unsigned char sense ) |
9980 |
+ { |
9981 |
+ struct net_device *ndev = p_ch->ndev; |
9982 |
++ struct device *dev = &p_ch->cdev->dev; |
9983 |
+ |
9984 |
+ CLAW_DBF_TEXT(4, trace, "unitchek"); |
9985 |
+- printk(KERN_INFO "%s: Unit Check with sense byte:0x%04x\n", |
9986 |
+- ndev->name, sense); |
9987 |
++ dev_info(dev, "%s: Unit Check with sense byte:0x%04x\n", |
9988 |
++ ndev->name, sense); |
9989 |
+ |
9990 |
+ if (sense & 0x40) { |
9991 |
+ if (sense & 0x01) { |
9992 |
+- printk(KERN_WARNING "%s: Interface disconnect or " |
9993 |
++ dev_warn(dev, "%s: Interface disconnect or " |
9994 |
+ "Selective reset " |
9995 |
+ "occurred (remote side)\n", ndev->name); |
9996 |
+ } |
9997 |
+ else { |
9998 |
+- printk(KERN_WARNING "%s: System reset occured" |
9999 |
++ dev_warn(dev, "%s: System reset occurred" |
10000 |
+ " (remote side)\n", ndev->name); |
10001 |
+ } |
10002 |
+ } |
10003 |
+ else if (sense & 0x20) { |
10004 |
+ if (sense & 0x04) { |
10005 |
+- printk(KERN_WARNING "%s: Data-streaming " |
10006 |
++ dev_warn(dev, "%s: Data-streaming " |
10007 |
+ "timeout)\n", ndev->name); |
10008 |
+ } |
10009 |
+ else { |
10010 |
+- printk(KERN_WARNING "%s: Data-transfer parity" |
10011 |
++ dev_warn(dev, "%s: Data-transfer parity" |
10012 |
+ " error\n", ndev->name); |
10013 |
+ } |
10014 |
+ } |
10015 |
+ else if (sense & 0x10) { |
10016 |
+ if (sense & 0x20) { |
10017 |
+- printk(KERN_WARNING "%s: Hardware malfunction " |
10018 |
++ dev_warn(dev, "%s: Hardware malfunction " |
10019 |
+ "(remote side)\n", ndev->name); |
10020 |
+ } |
10021 |
+ else { |
10022 |
+- printk(KERN_WARNING "%s: read-data parity error " |
10023 |
++ dev_warn(dev, "%s: read-data parity error " |
10024 |
+ "(remote side)\n", ndev->name); |
10025 |
+ } |
10026 |
+ } |
10027 |
+@@ -2002,7 +2010,7 @@ claw_process_control( struct net_device |
10028 |
+ tdev = &privptr->channel[READ].cdev->dev; |
10029 |
+ memcpy( &temp_host_name, p_env->host_name, 8); |
10030 |
+ memcpy( &temp_ws_name, p_env->adapter_name , 8); |
10031 |
+- printk(KERN_INFO "%s: CLAW device %.8s: " |
10032 |
++ dev_info(tdev, "%s: CLAW device %.8s: " |
10033 |
+ "Received Control Packet\n", |
10034 |
+ dev->name, temp_ws_name); |
10035 |
+ if (privptr->release_pend==1) { |
10036 |
+@@ -2021,30 +2029,28 @@ claw_process_control( struct net_device |
10037 |
+ if (p_ctlbk->version != CLAW_VERSION_ID) { |
10038 |
+ claw_snd_sys_validate_rsp(dev, p_ctlbk, |
10039 |
+ CLAW_RC_WRONG_VERSION); |
10040 |
+- printk("%s: %d is wrong version id. " |
10041 |
+- "Expected %d\n", |
10042 |
+- dev->name, p_ctlbk->version, |
10043 |
+- CLAW_VERSION_ID); |
10044 |
++ dev_info(tdev, "%s: %d is wrong version id. " |
10045 |
++ "Expected %d\n", dev->name, p_ctlbk->version, |
10046 |
++ CLAW_VERSION_ID); |
10047 |
+ } |
10048 |
+ p_sysval = (struct sysval *)&(p_ctlbk->data); |
10049 |
+- printk("%s: Recv Sys Validate Request: " |
10050 |
+- "Vers=%d,link_id=%d,Corr=%d,WS name=%." |
10051 |
+- "8s,Host name=%.8s\n", |
10052 |
+- dev->name, p_ctlbk->version, |
10053 |
+- p_ctlbk->linkid, |
10054 |
+- p_ctlbk->correlator, |
10055 |
+- p_sysval->WS_name, |
10056 |
+- p_sysval->host_name); |
10057 |
++ dev_info(tdev, "%s: Recv Sys Validate Request: " |
10058 |
++ "Vers=%d,link_id=%d,Corr=%d,WS name=%.8s," |
10059 |
++ "Host name=%.8s\n", |
10060 |
++ dev->name, p_ctlbk->version, |
10061 |
++ p_ctlbk->linkid, |
10062 |
++ p_ctlbk->correlator, |
10063 |
++ p_sysval->WS_name, |
10064 |
++ p_sysval->host_name); |
10065 |
+ if (memcmp(temp_host_name, p_sysval->host_name, 8)) { |
10066 |
+ claw_snd_sys_validate_rsp(dev, p_ctlbk, |
10067 |
+ CLAW_RC_NAME_MISMATCH); |
10068 |
+ CLAW_DBF_TEXT(2, setup, "HSTBAD"); |
10069 |
+ CLAW_DBF_TEXT_(2, setup, "%s", p_sysval->host_name); |
10070 |
+ CLAW_DBF_TEXT_(2, setup, "%s", temp_host_name); |
10071 |
+- printk(KERN_INFO "%s: Host name mismatch\n", |
10072 |
+- dev->name); |
10073 |
+- printk(KERN_INFO "%s: Received :%s: " |
10074 |
+- "expected :%s: \n", |
10075 |
++ dev_info(tdev, |
10076 |
++ "%s: Host name mismatch. Received: %s " |
10077 |
++ "expected: %s\n", |
10078 |
+ dev->name, |
10079 |
+ p_sysval->host_name, |
10080 |
+ temp_host_name); |
10081 |
+@@ -2055,35 +2061,36 @@ claw_process_control( struct net_device |
10082 |
+ CLAW_DBF_TEXT(2, setup, "WSNBAD"); |
10083 |
+ CLAW_DBF_TEXT_(2, setup, "%s", p_sysval->WS_name); |
10084 |
+ CLAW_DBF_TEXT_(2, setup, "%s", temp_ws_name); |
10085 |
+- printk(KERN_INFO "%s: WS name mismatch\n", |
10086 |
+- dev->name); |
10087 |
+- printk(KERN_INFO "%s: Received :%s: " |
10088 |
+- "expected :%s: \n", |
10089 |
+- dev->name, |
10090 |
+- p_sysval->WS_name, |
10091 |
+- temp_ws_name); |
10092 |
++ dev_info(tdev, "%s: WS name mismatch." |
10093 |
++ " Received: %s expected: %s\n", |
10094 |
++ dev->name, |
10095 |
++ p_sysval->WS_name, |
10096 |
++ temp_ws_name); |
10097 |
+ } |
10098 |
+ if ((p_sysval->write_frame_size < p_env->write_size) && |
10099 |
+ (p_env->packing == 0)) { |
10100 |
+ claw_snd_sys_validate_rsp(dev, p_ctlbk, |
10101 |
+ CLAW_RC_HOST_RCV_TOO_SMALL); |
10102 |
+- printk(KERN_INFO "%s: host write size is too " |
10103 |
+- "small\n", dev->name); |
10104 |
++ dev_info(tdev, |
10105 |
++ "host write size is too small\n"); |
10106 |
+ CLAW_DBF_TEXT(2, setup, "wrtszbad"); |
10107 |
+ } |
10108 |
+ if ((p_sysval->read_frame_size < p_env->read_size) && |
10109 |
+ (p_env->packing == 0)) { |
10110 |
+ claw_snd_sys_validate_rsp(dev, p_ctlbk, |
10111 |
+ CLAW_RC_HOST_RCV_TOO_SMALL); |
10112 |
+- printk(KERN_INFO "%s: host read size is too " |
10113 |
+- "small\n", dev->name); |
10114 |
++ dev_info(tdev, |
10115 |
++ "host read size is too small\n"); |
10116 |
+ CLAW_DBF_TEXT(2, setup, "rdsizbad"); |
10117 |
+ } |
10118 |
+ claw_snd_sys_validate_rsp(dev, p_ctlbk, 0); |
10119 |
+- printk(KERN_INFO "%s: CLAW device %.8s: System validate " |
10120 |
+- "completed.\n", dev->name, temp_ws_name); |
10121 |
+- printk("%s: sys Validate Rsize:%d Wsize:%d\n", dev->name, |
10122 |
+- p_sysval->read_frame_size, p_sysval->write_frame_size); |
10123 |
++ dev_info(tdev, |
10124 |
++ "CLAW device %.8s: System validate" |
10125 |
++ " completed.\n", temp_ws_name); |
10126 |
++ dev_info(tdev, |
10127 |
++ "%s: sys Validate Rsize:%d Wsize:%d\n", |
10128 |
++ dev->name, p_sysval->read_frame_size, |
10129 |
++ p_sysval->write_frame_size); |
10130 |
+ privptr->system_validate_comp = 1; |
10131 |
+ if (strncmp(p_env->api_type, WS_APPL_NAME_PACKED, 6) == 0) |
10132 |
+ p_env->packing = PACKING_ASK; |
10133 |
+@@ -2091,8 +2098,9 @@ claw_process_control( struct net_device |
10134 |
+ break; |
10135 |
+ case SYSTEM_VALIDATE_RESPONSE: |
10136 |
+ p_sysval = (struct sysval *)&(p_ctlbk->data); |
10137 |
+- printk("%s: Recv Sys Validate Resp: Vers=%d,Corr=%d,RC=%d," |
10138 |
+- "WS name=%.8s,Host name=%.8s\n", |
10139 |
++ dev_info(tdev, |
10140 |
++ "%s: Recv Sys Validate Resp: Vers=%d,Corr=%d," |
10141 |
++ "RC=%d,WS name=%.8s,Host name=%.8s\n", |
10142 |
+ dev->name, |
10143 |
+ p_ctlbk->version, |
10144 |
+ p_ctlbk->correlator, |
10145 |
+@@ -2101,32 +2109,31 @@ claw_process_control( struct net_device |
10146 |
+ p_sysval->host_name); |
10147 |
+ switch (p_ctlbk->rc) { |
10148 |
+ case 0: |
10149 |
+- printk(KERN_INFO "%s: CLAW device " |
10150 |
+- "%.8s: System validate " |
10151 |
+- "completed.\n", |
10152 |
+- dev->name, temp_ws_name); |
10153 |
++ dev_info(tdev, "%s: CLAW device " |
10154 |
++ "%.8s: System validate completed.\n", |
10155 |
++ dev->name, temp_ws_name); |
10156 |
+ if (privptr->system_validate_comp == 0) |
10157 |
+ claw_strt_conn_req(dev); |
10158 |
+ privptr->system_validate_comp = 1; |
10159 |
+ break; |
10160 |
+ case CLAW_RC_NAME_MISMATCH: |
10161 |
+- printk(KERN_INFO "%s: Sys Validate " |
10162 |
++ dev_info(tdev, "%s: Sys Validate " |
10163 |
+ "Resp : Host, WS name is " |
10164 |
+ "mismatch\n", |
10165 |
+- dev->name); |
10166 |
++ dev->name); |
10167 |
+ break; |
10168 |
+ case CLAW_RC_WRONG_VERSION: |
10169 |
+- printk(KERN_INFO "%s: Sys Validate " |
10170 |
++ dev_info(tdev, "%s: Sys Validate " |
10171 |
+ "Resp : Wrong version\n", |
10172 |
+ dev->name); |
10173 |
+ break; |
10174 |
+ case CLAW_RC_HOST_RCV_TOO_SMALL: |
10175 |
+- printk(KERN_INFO "%s: Sys Validate " |
10176 |
++ dev_info(tdev, "%s: Sys Validate " |
10177 |
+ "Resp : bad frame size\n", |
10178 |
+ dev->name); |
10179 |
+ break; |
10180 |
+ default: |
10181 |
+- printk(KERN_INFO "%s: Sys Validate " |
10182 |
++ dev_info(tdev, "%s: Sys Validate " |
10183 |
+ "error code=%d \n", |
10184 |
+ dev->name, p_ctlbk->rc); |
10185 |
+ break; |
10186 |
+@@ -2135,7 +2142,7 @@ claw_process_control( struct net_device |
10187 |
+ |
10188 |
+ case CONNECTION_REQUEST: |
10189 |
+ p_connect = (struct conncmd *)&(p_ctlbk->data); |
10190 |
+- printk(KERN_INFO "%s: Recv Conn Req: Vers=%d,link_id=%d," |
10191 |
++ dev_info(tdev, "%s: Recv Conn Req: Vers=%d,link_id=%d," |
10192 |
+ "Corr=%d,HOST appl=%.8s,WS appl=%.8s\n", |
10193 |
+ dev->name, |
10194 |
+ p_ctlbk->version, |
10195 |
+@@ -2145,20 +2152,20 @@ claw_process_control( struct net_device |
10196 |
+ p_connect->WS_name); |
10197 |
+ if (privptr->active_link_ID != 0) { |
10198 |
+ claw_snd_disc(dev, p_ctlbk); |
10199 |
+- printk(KERN_INFO "%s: Conn Req error : " |
10200 |
++ dev_info(tdev, "%s: Conn Req error : " |
10201 |
+ "already logical link is active \n", |
10202 |
+ dev->name); |
10203 |
+ } |
10204 |
+ if (p_ctlbk->linkid != 1) { |
10205 |
+ claw_snd_disc(dev, p_ctlbk); |
10206 |
+- printk(KERN_INFO "%s: Conn Req error : " |
10207 |
++ dev_info(tdev, "%s: Conn Req error : " |
10208 |
+ "req logical link id is not 1\n", |
10209 |
+ dev->name); |
10210 |
+ } |
10211 |
+ rc = find_link(dev, p_connect->host_name, p_connect->WS_name); |
10212 |
+ if (rc != 0) { |
10213 |
+ claw_snd_disc(dev, p_ctlbk); |
10214 |
+- printk(KERN_INFO "%s: Conn Resp error: " |
10215 |
++ dev_info(tdev, "%s: Conn Req error : " |
10216 |
+ "req appl name does not match\n", |
10217 |
+ dev->name); |
10218 |
+ } |
10219 |
+@@ -2171,7 +2178,7 @@ claw_process_control( struct net_device |
10220 |
+ p_env->packing = PACK_SEND; |
10221 |
+ claw_snd_conn_req(dev, 0); |
10222 |
+ } |
10223 |
+- printk(KERN_INFO "%s: CLAW device %.8s: Connection " |
10224 |
++ dev_info(tdev, "%s: CLAW device %.8s: Connection " |
10225 |
+ "completed link_id=%d.\n", |
10226 |
+ dev->name, temp_ws_name, |
10227 |
+ p_ctlbk->linkid); |
10228 |
+@@ -2181,7 +2188,7 @@ claw_process_control( struct net_device |
10229 |
+ break; |
10230 |
+ case CONNECTION_RESPONSE: |
10231 |
+ p_connect = (struct conncmd *)&(p_ctlbk->data); |
10232 |
+- printk(KERN_INFO "%s: Revc Conn Resp: Vers=%d,link_id=%d," |
10233 |
++ dev_info(tdev, "%s: Revc Conn Resp: Vers=%d,link_id=%d," |
10234 |
+ "Corr=%d,RC=%d,Host appl=%.8s, WS appl=%.8s\n", |
10235 |
+ dev->name, |
10236 |
+ p_ctlbk->version, |
10237 |
+@@ -2192,7 +2199,7 @@ claw_process_control( struct net_device |
10238 |
+ p_connect->WS_name); |
10239 |
+ |
10240 |
+ if (p_ctlbk->rc != 0) { |
10241 |
+- printk(KERN_INFO "%s: Conn Resp error: rc=%d \n", |
10242 |
++ dev_info(tdev, "%s: Conn Resp error: rc=%d \n", |
10243 |
+ dev->name, p_ctlbk->rc); |
10244 |
+ return 1; |
10245 |
+ } |
10246 |
+@@ -2200,7 +2207,7 @@ claw_process_control( struct net_device |
10247 |
+ p_connect->host_name, p_connect->WS_name); |
10248 |
+ if (rc != 0) { |
10249 |
+ claw_snd_disc(dev, p_ctlbk); |
10250 |
+- printk(KERN_INFO "%s: Conn Resp error: " |
10251 |
++ dev_info(tdev, "%s: Conn Resp error: " |
10252 |
+ "req appl name does not match\n", |
10253 |
+ dev->name); |
10254 |
+ } |
10255 |
+@@ -2209,7 +2216,8 @@ claw_process_control( struct net_device |
10256 |
+ break; |
10257 |
+ case CONNECTION_CONFIRM: |
10258 |
+ p_connect = (struct conncmd *)&(p_ctlbk->data); |
10259 |
+- printk(KERN_INFO "%s: Recv Conn Confirm:Vers=%d,link_id=%d," |
10260 |
++ dev_info(tdev, |
10261 |
++ "%s: Recv Conn Confirm:Vers=%d,link_id=%d," |
10262 |
+ "Corr=%d,Host appl=%.8s,WS appl=%.8s\n", |
10263 |
+ dev->name, |
10264 |
+ p_ctlbk->version, |
10265 |
+@@ -2220,21 +2228,21 @@ claw_process_control( struct net_device |
10266 |
+ if (p_ctlbk->linkid == -(privptr->active_link_ID)) { |
10267 |
+ privptr->active_link_ID = p_ctlbk->linkid; |
10268 |
+ if (p_env->packing > PACKING_ASK) { |
10269 |
+- printk(KERN_INFO "%s: Confirmed Now packing\n", |
10270 |
+- dev->name); |
10271 |
++ dev_info(tdev, |
10272 |
++ "%s: Confirmed Now packing\n", dev->name); |
10273 |
+ p_env->packing = DO_PACKED; |
10274 |
+ } |
10275 |
+ p_ch = &privptr->channel[WRITE]; |
10276 |
+ wake_up(&p_ch->wait); |
10277 |
+ } else { |
10278 |
+- printk(KERN_INFO "%s: Conn confirm: " |
10279 |
++ dev_info(tdev, "%s: Conn confirm: " |
10280 |
+ "unexpected linkid=%d \n", |
10281 |
+ dev->name, p_ctlbk->linkid); |
10282 |
+ claw_snd_disc(dev, p_ctlbk); |
10283 |
+ } |
10284 |
+ break; |
10285 |
+ case DISCONNECT: |
10286 |
+- printk(KERN_INFO "%s: Disconnect: " |
10287 |
++ dev_info(tdev, "%s: Disconnect: " |
10288 |
+ "Vers=%d,link_id=%d,Corr=%d\n", |
10289 |
+ dev->name, p_ctlbk->version, |
10290 |
+ p_ctlbk->linkid, p_ctlbk->correlator); |
10291 |
+@@ -2246,11 +2254,11 @@ claw_process_control( struct net_device |
10292 |
+ privptr->active_link_ID = 0; |
10293 |
+ break; |
10294 |
+ case CLAW_ERROR: |
10295 |
+- printk(KERN_INFO "%s: CLAW ERROR detected\n", |
10296 |
++ dev_info(tdev, "%s: CLAW ERROR detected\n", |
10297 |
+ dev->name); |
10298 |
+ break; |
10299 |
+ default: |
10300 |
+- printk(KERN_INFO "%s: Unexpected command code=%d \n", |
10301 |
++ dev_info(tdev, "%s: Unexpected command code=%d \n", |
10302 |
+ dev->name, p_ctlbk->command); |
10303 |
+ break; |
10304 |
+ } |
10305 |
+@@ -2510,7 +2518,8 @@ unpack_read(struct net_device *dev ) |
10306 |
+ mtc_this_frm=1; |
10307 |
+ if (p_this_ccw->header.length!= |
10308 |
+ privptr->p_env->read_size ) { |
10309 |
+- printk(KERN_INFO " %s: Invalid frame detected " |
10310 |
++ dev_info(p_dev, |
10311 |
++ "%s: Invalid frame detected " |
10312 |
+ "length is %02x\n" , |
10313 |
+ dev->name, p_this_ccw->header.length); |
10314 |
+ } |
10315 |
+@@ -2594,8 +2603,8 @@ unpack_next: |
10316 |
+ } |
10317 |
+ else { |
10318 |
+ privptr->stats.rx_dropped++; |
10319 |
+- printk(KERN_WARNING "%s: %s() low on memory\n", |
10320 |
+- dev->name,__func__); |
10321 |
++ dev_warn(p_dev, |
10322 |
++ "buffer allocate failed on receive\n"); |
10323 |
+ } |
10324 |
+ privptr->mtc_offset=0; |
10325 |
+ privptr->mtc_logical_link=-1; |
10326 |
+@@ -2879,7 +2888,8 @@ claw_new_device(struct ccwgroup_device * |
10327 |
+ int ret; |
10328 |
+ struct ccw_dev_id dev_id; |
10329 |
+ |
10330 |
+- printk(KERN_INFO "claw: add for %s\n",cgdev->cdev[READ]->dev.bus_id); |
10331 |
++ dev_info(&cgdev->dev, "add for %s\n", |
10332 |
++ dev_name(&cgdev->cdev[READ]->dev)); |
10333 |
+ CLAW_DBF_TEXT(2, setup, "new_dev"); |
10334 |
+ privptr = cgdev->dev.driver_data; |
10335 |
+ cgdev->cdev[READ]->dev.driver_data = privptr; |
10336 |
+@@ -2895,27 +2905,28 @@ claw_new_device(struct ccwgroup_device * |
10337 |
+ if (ret == 0) |
10338 |
+ ret = add_channel(cgdev->cdev[1],1,privptr); |
10339 |
+ if (ret != 0) { |
10340 |
+- printk(KERN_WARNING |
10341 |
+- "add channel failed with ret = %d\n", ret); |
10342 |
++ dev_warn(&cgdev->dev, "add channel failed " |
10343 |
++ "with ret = %d\n", ret); |
10344 |
+ goto out; |
10345 |
+ } |
10346 |
+ ret = ccw_device_set_online(cgdev->cdev[READ]); |
10347 |
+ if (ret != 0) { |
10348 |
+- printk(KERN_WARNING |
10349 |
+- "claw: ccw_device_set_online %s READ failed " |
10350 |
+- "with ret = %d\n",cgdev->cdev[READ]->dev.bus_id,ret); |
10351 |
++ dev_warn(&cgdev->dev, |
10352 |
++ "device set online READ failed " |
10353 |
++ "with ret = %d\n", ret); |
10354 |
+ goto out; |
10355 |
+ } |
10356 |
+ ret = ccw_device_set_online(cgdev->cdev[WRITE]); |
10357 |
+ if (ret != 0) { |
10358 |
+- printk(KERN_WARNING |
10359 |
+- "claw: ccw_device_set_online %s WRITE failed " |
10360 |
+- "with ret = %d\n",cgdev->cdev[WRITE]->dev.bus_id, ret); |
10361 |
++ dev_warn(&cgdev->dev, |
10362 |
++ "device set online WRITE failed " |
10363 |
++ "with ret = %d\n", ret); |
10364 |
+ goto out; |
10365 |
+ } |
10366 |
+ dev = alloc_netdev(0,"claw%d",claw_init_netdevice); |
10367 |
+ if (!dev) { |
10368 |
+- printk(KERN_WARNING "%s:alloc_netdev failed\n",__func__); |
10369 |
++ dev_warn(&cgdev->dev, |
10370 |
++ "failed creating network device\n"); |
10371 |
+ goto out; |
10372 |
+ } |
10373 |
+ dev->ml_priv = privptr; |
10374 |
+@@ -2943,13 +2954,13 @@ claw_new_device(struct ccwgroup_device * |
10375 |
+ privptr->channel[WRITE].ndev = dev; |
10376 |
+ privptr->p_env->ndev = dev; |
10377 |
+ |
10378 |
+- printk(KERN_INFO "%s:readsize=%d writesize=%d " |
10379 |
++ dev_info(&cgdev->dev, "%s:readsize=%d writesize=%d " |
10380 |
+ "readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n", |
10381 |
+ dev->name, p_env->read_size, |
10382 |
+ p_env->write_size, p_env->read_buffers, |
10383 |
+ p_env->write_buffers, p_env->devno[READ], |
10384 |
+ p_env->devno[WRITE]); |
10385 |
+- printk(KERN_INFO "%s:host_name:%.8s, adapter_name " |
10386 |
++ dev_info(&cgdev->dev, "%s:host_name:%.8s, adapter_name " |
10387 |
+ ":%.8s api_type: %.8s\n", |
10388 |
+ dev->name, p_env->host_name, |
10389 |
+ p_env->adapter_name , p_env->api_type); |
10390 |
+@@ -2993,8 +3004,8 @@ claw_shutdown_device(struct ccwgroup_dev |
10391 |
+ ndev = priv->channel[READ].ndev; |
10392 |
+ if (ndev) { |
10393 |
+ /* Close the device */ |
10394 |
+- printk(KERN_INFO |
10395 |
+- "%s: shuting down \n",ndev->name); |
10396 |
++ dev_info(&cgdev->dev, "%s: shutting down \n", |
10397 |
++ ndev->name); |
10398 |
+ if (ndev->flags & IFF_RUNNING) |
10399 |
+ ret = claw_release(ndev); |
10400 |
+ ndev->flags &=~IFF_RUNNING; |
10401 |
+@@ -3019,8 +3030,7 @@ claw_remove_device(struct ccwgroup_devic |
10402 |
+ CLAW_DBF_TEXT_(2, setup, "%s", cgdev->dev.bus_id); |
10403 |
+ priv = cgdev->dev.driver_data; |
10404 |
+ BUG_ON(!priv); |
10405 |
+- printk(KERN_INFO "claw: %s() called %s will be removed.\n", |
10406 |
+- __func__,cgdev->cdev[0]->dev.bus_id); |
10407 |
++ dev_info(&cgdev->dev, " will be removed.\n"); |
10408 |
+ if (cgdev->state == CCWGROUP_ONLINE) |
10409 |
+ claw_shutdown_device(cgdev); |
10410 |
+ claw_remove_files(&cgdev->dev); |
10411 |
+@@ -3285,7 +3295,7 @@ claw_cleanup(void) |
10412 |
+ { |
10413 |
+ unregister_cu3088_discipline(&claw_group_driver); |
10414 |
+ claw_unregister_debug_facility(); |
10415 |
+- printk(KERN_INFO "claw: Driver unloaded\n"); |
10416 |
++ pr_info("Driver unloaded\n"); |
10417 |
+ |
10418 |
+ } |
10419 |
+ |
10420 |
+@@ -3299,12 +3309,11 @@ static int __init |
10421 |
+ claw_init(void) |
10422 |
+ { |
10423 |
+ int ret = 0; |
10424 |
+- printk(KERN_INFO "claw: starting driver\n"); |
10425 |
+ |
10426 |
++ pr_info("Loading %s\n", version); |
10427 |
+ ret = claw_register_debug_facility(); |
10428 |
+ if (ret) { |
10429 |
+- printk(KERN_WARNING "claw: %s() debug_register failed %d\n", |
10430 |
+- __func__,ret); |
10431 |
++ pr_warning("debug_register failed %d\n", ret); |
10432 |
+ return ret; |
10433 |
+ } |
10434 |
+ CLAW_DBF_TEXT(2, setup, "init_mod"); |
10435 |
+@@ -3312,8 +3321,7 @@ claw_init(void) |
10436 |
+ if (ret) { |
10437 |
+ CLAW_DBF_TEXT(2, setup, "init_bad"); |
10438 |
+ claw_unregister_debug_facility(); |
10439 |
+- printk(KERN_WARNING "claw; %s() cu3088 register failed %d\n", |
10440 |
+- __func__,ret); |
10441 |
++ pr_warning("register_cu3088_discipline() failed rc=%d\n", ret); |
10442 |
+ } |
10443 |
+ return ret; |
10444 |
+ } |
10445 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_fsms.c |
10446 |
+=================================================================== |
10447 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/ctcm_fsms.c |
10448 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_fsms.c |
10449 |
+@@ -13,6 +13,9 @@ |
10450 |
+ #undef DEBUGDATA |
10451 |
+ #undef DEBUGCCW |
10452 |
+ |
10453 |
++#define KMSG_COMPONENT "ctcm" |
10454 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
10455 |
++ |
10456 |
+ #include <linux/module.h> |
10457 |
+ #include <linux/init.h> |
10458 |
+ #include <linux/kernel.h> |
10459 |
+@@ -190,21 +193,22 @@ static void ctcmpc_chx_send_sweep(fsm_in |
10460 |
+ void ctcm_ccw_check_rc(struct channel *ch, int rc, char *msg) |
10461 |
+ { |
10462 |
+ CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, |
10463 |
+- "%s(%s): %s: %04x\n", |
10464 |
+- CTCM_FUNTAIL, ch->id, msg, rc); |
10465 |
++ "%s(%s): %s: %04x\n", |
10466 |
++ CTCM_FUNTAIL, ch->id, msg, rc); |
10467 |
+ switch (rc) { |
10468 |
+ case -EBUSY: |
10469 |
+- ctcm_pr_warn("%s (%s): Busy !\n", ch->id, msg); |
10470 |
++ pr_info("%s: The communication peer is busy\n", |
10471 |
++ ch->id); |
10472 |
+ fsm_event(ch->fsm, CTC_EVENT_IO_EBUSY, ch); |
10473 |
+ break; |
10474 |
+ case -ENODEV: |
10475 |
+- ctcm_pr_emerg("%s (%s): Invalid device called for IO\n", |
10476 |
+- ch->id, msg); |
10477 |
++ pr_err("%s: The specified target device is not valid\n", |
10478 |
++ ch->id); |
10479 |
+ fsm_event(ch->fsm, CTC_EVENT_IO_ENODEV, ch); |
10480 |
+ break; |
10481 |
+ default: |
10482 |
+- ctcm_pr_emerg("%s (%s): Unknown error in do_IO %04x\n", |
10483 |
+- ch->id, msg, rc); |
10484 |
++ pr_err("An I/O operation resulted in error %04x\n", |
10485 |
++ rc); |
10486 |
+ fsm_event(ch->fsm, CTC_EVENT_IO_UNKNOWN, ch); |
10487 |
+ } |
10488 |
+ } |
10489 |
+@@ -886,8 +890,15 @@ static void ctcm_chx_rxiniterr(fsm_insta |
10490 |
+ fsm_newstate(fi, CTC_STATE_RXERR); |
10491 |
+ fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); |
10492 |
+ } |
10493 |
+- } else |
10494 |
+- ctcm_pr_warn("%s: Error during RX init handshake\n", dev->name); |
10495 |
++ } else { |
10496 |
++ CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, |
10497 |
++ "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, |
10498 |
++ ctc_ch_event_names[event], fsm_getstate_str(fi)); |
10499 |
++ |
10500 |
++ dev_warn(&dev->dev, |
10501 |
++ "Initialization failed with RX/TX init handshake " |
10502 |
++ "error %s\n", ctc_ch_event_names[event]); |
10503 |
++ } |
10504 |
+ } |
10505 |
+ |
10506 |
+ /** |
10507 |
+@@ -969,7 +980,9 @@ static void ctcm_chx_txiniterr(fsm_insta |
10508 |
+ "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, |
10509 |
+ ctc_ch_event_names[event], fsm_getstate_str(fi)); |
10510 |
+ |
10511 |
+- ctcm_pr_warn("%s: Error during TX init handshake\n", dev->name); |
10512 |
++ dev_warn(&dev->dev, |
10513 |
++ "Initialization failed with RX/TX init handshake " |
10514 |
++ "error %s\n", ctc_ch_event_names[event]); |
10515 |
+ } |
10516 |
+ } |
10517 |
+ |
10518 |
+@@ -2101,14 +2114,11 @@ static void dev_action_restart(fsm_insta |
10519 |
+ CTCMY_DBF_DEV_NAME(TRACE, dev, ""); |
10520 |
+ |
10521 |
+ if (IS_MPC(priv)) { |
10522 |
+- ctcm_pr_info("ctcm: %s Restarting Device and " |
10523 |
+- "MPC Group in 5 seconds\n", |
10524 |
+- dev->name); |
10525 |
+ restart_timer = CTCM_TIME_1_SEC; |
10526 |
+ } else { |
10527 |
+- ctcm_pr_info("%s: Restarting\n", dev->name); |
10528 |
+ restart_timer = CTCM_TIME_5_SEC; |
10529 |
+ } |
10530 |
++ dev_info(&dev->dev, "Restarting device\n"); |
10531 |
+ |
10532 |
+ dev_action_stop(fi, event, arg); |
10533 |
+ fsm_event(priv->fsm, DEV_EVENT_STOP, dev); |
10534 |
+@@ -2150,16 +2160,16 @@ static void dev_action_chup(fsm_instance |
10535 |
+ case DEV_STATE_STARTWAIT_RX: |
10536 |
+ if (event == DEV_EVENT_RXUP) { |
10537 |
+ fsm_newstate(fi, DEV_STATE_RUNNING); |
10538 |
+- ctcm_pr_info("%s: connected with remote side\n", |
10539 |
+- dev->name); |
10540 |
++ dev_info(&dev->dev, |
10541 |
++ "Connected with remote side\n"); |
10542 |
+ ctcm_clear_busy(dev); |
10543 |
+ } |
10544 |
+ break; |
10545 |
+ case DEV_STATE_STARTWAIT_TX: |
10546 |
+ if (event == DEV_EVENT_TXUP) { |
10547 |
+ fsm_newstate(fi, DEV_STATE_RUNNING); |
10548 |
+- ctcm_pr_info("%s: connected with remote side\n", |
10549 |
+- dev->name); |
10550 |
++ dev_info(&dev->dev, |
10551 |
++ "Connected with remote side\n"); |
10552 |
+ ctcm_clear_busy(dev); |
10553 |
+ } |
10554 |
+ break; |
10555 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_main.c |
10556 |
+=================================================================== |
10557 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/ctcm_main.c |
10558 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_main.c |
10559 |
+@@ -21,6 +21,9 @@ |
10560 |
+ #undef DEBUGDATA |
10561 |
+ #undef DEBUGCCW |
10562 |
+ |
10563 |
++#define KMSG_COMPONENT "ctcm" |
10564 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
10565 |
++ |
10566 |
+ #include <linux/module.h> |
10567 |
+ #include <linux/init.h> |
10568 |
+ #include <linux/kernel.h> |
10569 |
+@@ -281,14 +284,16 @@ static long ctcm_check_irb_error(struct |
10570 |
+ |
10571 |
+ switch (PTR_ERR(irb)) { |
10572 |
+ case -EIO: |
10573 |
+- ctcm_pr_warn("i/o-error on device %s\n", cdev->dev.bus_id); |
10574 |
++ dev_err(&cdev->dev, |
10575 |
++ "An I/O-error occurred on the CTCM device\n"); |
10576 |
+ break; |
10577 |
+ case -ETIMEDOUT: |
10578 |
+- ctcm_pr_warn("timeout on device %s\n", cdev->dev.bus_id); |
10579 |
++ dev_err(&cdev->dev, |
10580 |
++ "An adapter hardware operation timed out\n"); |
10581 |
+ break; |
10582 |
+ default: |
10583 |
+- ctcm_pr_warn("unknown error %ld on device %s\n", |
10584 |
+- PTR_ERR(irb), cdev->dev.bus_id); |
10585 |
++ dev_err(&cdev->dev, |
10586 |
++ "An error occurred on the adapter hardware\n"); |
10587 |
+ } |
10588 |
+ return PTR_ERR(irb); |
10589 |
+ } |
10590 |
+@@ -309,15 +314,17 @@ static inline void ccw_unit_check(struct |
10591 |
+ if (sense & SNS0_INTERVENTION_REQ) { |
10592 |
+ if (sense & 0x01) { |
10593 |
+ if (ch->sense_rc != 0x01) { |
10594 |
+- ctcm_pr_debug("%s: Interface disc. or Sel. " |
10595 |
+- "reset (remote)\n", ch->id); |
10596 |
++ pr_notice( |
10597 |
++ "%s: The communication peer has " |
10598 |
++ "disconnected\n", ch->id); |
10599 |
+ ch->sense_rc = 0x01; |
10600 |
+ } |
10601 |
+ fsm_event(ch->fsm, CTC_EVENT_UC_RCRESET, ch); |
10602 |
+ } else { |
10603 |
+ if (ch->sense_rc != SNS0_INTERVENTION_REQ) { |
10604 |
+- ctcm_pr_debug("%s: System reset (remote)\n", |
10605 |
+- ch->id); |
10606 |
++ pr_notice( |
10607 |
++ "%s: The remote operating system is " |
10608 |
++ "not available\n", ch->id); |
10609 |
+ ch->sense_rc = SNS0_INTERVENTION_REQ; |
10610 |
+ } |
10611 |
+ fsm_event(ch->fsm, CTC_EVENT_UC_RSRESET, ch); |
10612 |
+@@ -1194,8 +1201,11 @@ static void ctcm_irq_handler(struct ccw_ |
10613 |
+ |
10614 |
+ /* Check for unsolicited interrupts. */ |
10615 |
+ if (cgdev == NULL) { |
10616 |
+- ctcm_pr_warn("ctcm: Got unsolicited irq: c-%02x d-%02x\n", |
10617 |
+- cstat, dstat); |
10618 |
++ CTCM_DBF_TEXT_(TRACE, CTC_DBF_ERROR, |
10619 |
++ "%s(%s) unsolicited irq: c-%02x d-%02x\n", |
10620 |
++ CTCM_FUNTAIL, dev_name(&cdev->dev), cstat, dstat); |
10621 |
++ dev_warn(&cdev->dev, |
10622 |
++ "The adapter received a non-specific IRQ\n"); |
10623 |
+ return; |
10624 |
+ } |
10625 |
+ |
10626 |
+@@ -1207,31 +1217,34 @@ static void ctcm_irq_handler(struct ccw_ |
10627 |
+ else if (priv->channel[WRITE]->cdev == cdev) |
10628 |
+ ch = priv->channel[WRITE]; |
10629 |
+ else { |
10630 |
+- ctcm_pr_err("ctcm: Can't determine channel for interrupt, " |
10631 |
+- "device %s\n", cdev->dev.bus_id); |
10632 |
++ dev_err(&cdev->dev, |
10633 |
++ "%s: Internal error: Can't determine channel for " |
10634 |
++ "interrupt device %s\n", |
10635 |
++ __func__, dev_name(&cdev->dev)); |
10636 |
++ /* Explain: inconsistent internal structures */ |
10637 |
+ return; |
10638 |
+ } |
10639 |
+ |
10640 |
+ dev = ch->netdev; |
10641 |
+ if (dev == NULL) { |
10642 |
+- ctcm_pr_crit("ctcm: %s dev=NULL bus_id=%s, ch=0x%p\n", |
10643 |
+- __func__, cdev->dev.bus_id, ch); |
10644 |
++ dev_err(&cdev->dev, |
10645 |
++ "%s Internal error: net_device is NULL, ch = 0x%p\n", |
10646 |
++ __func__, ch); |
10647 |
++ /* Explain: inconsistent internal structures */ |
10648 |
+ return; |
10649 |
+ } |
10650 |
+ |
10651 |
+- CTCM_DBF_TEXT_(TRACE, CTC_DBF_DEBUG, |
10652 |
+- "%s(%s): int. for %s: cstat=%02x dstat=%02x", |
10653 |
+- CTCM_FUNTAIL, dev->name, ch->id, cstat, dstat); |
10654 |
+- |
10655 |
+ /* Copy interruption response block. */ |
10656 |
+ memcpy(ch->irb, irb, sizeof(struct irb)); |
10657 |
+ |
10658 |
++ /* Issue error message and return on subchannel error code */ |
10659 |
+ if (irb->scsw.cmd.cstat) { |
10660 |
+- /* Check for good subchannel return code, otherwise error message */ |
10661 |
+ fsm_event(ch->fsm, CTC_EVENT_SC_UNKNOWN, ch); |
10662 |
+- ctcm_pr_warn("%s: subchannel check for dev: %s - %02x %02x\n", |
10663 |
+- dev->name, ch->id, irb->scsw.cmd.cstat, |
10664 |
+- irb->scsw.cmd.dstat); |
10665 |
++ CTCM_DBF_TEXT_(TRACE, CTC_DBF_WARN, |
10666 |
++ "%s(%s): sub-ch check %s: cs=%02x ds=%02x", |
10667 |
++ CTCM_FUNTAIL, dev->name, ch->id, cstat, dstat); |
10668 |
++ dev_warn(&cdev->dev, |
10669 |
++ "A check occurred on the subchannel\n"); |
10670 |
+ return; |
10671 |
+ } |
10672 |
+ |
10673 |
+@@ -1239,7 +1252,7 @@ static void ctcm_irq_handler(struct ccw_ |
10674 |
+ if (irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { |
10675 |
+ if ((irb->ecw[0] & ch->sense_rc) == 0) |
10676 |
+ /* print it only once */ |
10677 |
+- CTCM_DBF_TEXT_(TRACE, CTC_DBF_INFO, |
10678 |
++ CTCM_DBF_TEXT_(TRACE, CTC_DBF_WARN, |
10679 |
+ "%s(%s): sense=%02x, ds=%02x", |
10680 |
+ CTCM_FUNTAIL, ch->id, irb->ecw[0], dstat); |
10681 |
+ ccw_unit_check(ch, irb->ecw[0]); |
10682 |
+@@ -1574,6 +1587,11 @@ static int ctcm_new_device(struct ccwgro |
10683 |
+ |
10684 |
+ strlcpy(priv->fsm->name, dev->name, sizeof(priv->fsm->name)); |
10685 |
+ |
10686 |
++ dev_info(&dev->dev, |
10687 |
++ "setup OK : r/w = %s/%s, protocol : %d\n", |
10688 |
++ priv->channel[READ]->id, |
10689 |
++ priv->channel[WRITE]->id, priv->protocol); |
10690 |
++ |
10691 |
+ CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, |
10692 |
+ "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name, |
10693 |
+ priv->channel[READ]->id, |
10694 |
+@@ -1687,7 +1705,7 @@ static void __exit ctcm_exit(void) |
10695 |
+ { |
10696 |
+ unregister_cu3088_discipline(&ctcm_group_driver); |
10697 |
+ ctcm_unregister_dbf_views(); |
10698 |
+- ctcm_pr_info("CTCM driver unloaded\n"); |
10699 |
++ pr_info("CTCM driver unloaded\n"); |
10700 |
+ } |
10701 |
+ |
10702 |
+ /* |
10703 |
+@@ -1695,7 +1713,7 @@ static void __exit ctcm_exit(void) |
10704 |
+ */ |
10705 |
+ static void print_banner(void) |
10706 |
+ { |
10707 |
+- printk(KERN_INFO "CTCM driver initialized\n"); |
10708 |
++ pr_info("CTCM driver initialized\n"); |
10709 |
+ } |
10710 |
+ |
10711 |
+ /** |
10712 |
+@@ -1717,8 +1735,8 @@ static int __init ctcm_init(void) |
10713 |
+ ret = register_cu3088_discipline(&ctcm_group_driver); |
10714 |
+ if (ret) { |
10715 |
+ ctcm_unregister_dbf_views(); |
10716 |
+- ctcm_pr_crit("ctcm_init failed with register_cu3088_discipline " |
10717 |
+- "(rc = %d)\n", ret); |
10718 |
++ pr_err("%s / register_cu3088_discipline failed, ret = %d\n", |
10719 |
++ __func__, ret); |
10720 |
+ return ret; |
10721 |
+ } |
10722 |
+ print_banner(); |
10723 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_main.h |
10724 |
+=================================================================== |
10725 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/ctcm_main.h |
10726 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_main.h |
10727 |
+@@ -41,12 +41,6 @@ |
10728 |
+ #define LOG_FLAG_NOMEM 8 |
10729 |
+ |
10730 |
+ #define ctcm_pr_debug(fmt, arg...) printk(KERN_DEBUG fmt, ##arg) |
10731 |
+-#define ctcm_pr_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) |
10732 |
+-#define ctcm_pr_notice(fmt, arg...) printk(KERN_NOTICE fmt, ##arg) |
10733 |
+-#define ctcm_pr_warn(fmt, arg...) printk(KERN_WARNING fmt, ##arg) |
10734 |
+-#define ctcm_pr_emerg(fmt, arg...) printk(KERN_EMERG fmt, ##arg) |
10735 |
+-#define ctcm_pr_err(fmt, arg...) printk(KERN_ERR fmt, ##arg) |
10736 |
+-#define ctcm_pr_crit(fmt, arg...) printk(KERN_CRIT fmt, ##arg) |
10737 |
+ |
10738 |
+ #define CTCM_PR_DEBUG(fmt, arg...) \ |
10739 |
+ do { \ |
10740 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_mpc.c |
10741 |
+=================================================================== |
10742 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/ctcm_mpc.c |
10743 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_mpc.c |
10744 |
+@@ -19,6 +19,9 @@ |
10745 |
+ #undef DEBUGDATA |
10746 |
+ #undef DEBUGCCW |
10747 |
+ |
10748 |
++#define KMSG_COMPONENT "ctcm" |
10749 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
10750 |
++ |
10751 |
+ #include <linux/module.h> |
10752 |
+ #include <linux/init.h> |
10753 |
+ #include <linux/kernel.h> |
10754 |
+@@ -386,7 +389,7 @@ int ctc_mpc_alloc_channel(int port_num, |
10755 |
+ if (grp->allocchan_callback_retries < 4) { |
10756 |
+ if (grp->allochanfunc) |
10757 |
+ grp->allochanfunc(grp->port_num, |
10758 |
+- grp->group_max_buflen); |
10759 |
++ grp->group_max_buflen); |
10760 |
+ } else { |
10761 |
+ /* there are problems...bail out */ |
10762 |
+ /* there may be a state mismatch so restart */ |
10763 |
+@@ -1232,8 +1235,9 @@ done: |
10764 |
+ |
10765 |
+ dev_kfree_skb_any(pskb); |
10766 |
+ if (sendrc == NET_RX_DROP) { |
10767 |
+- printk(KERN_WARNING "%s %s() NETWORK BACKLOG EXCEEDED" |
10768 |
+- " - PACKET DROPPED\n", dev->name, __func__); |
10769 |
++ dev_warn(&dev->dev, |
10770 |
++ "The network backlog for %s is exceeded, " |
10771 |
++ "package dropped\n", __func__); |
10772 |
+ fsm_event(grp->fsm, MPCG_EVENT_INOP, dev); |
10773 |
+ } |
10774 |
+ |
10775 |
+@@ -1673,7 +1677,9 @@ static int mpc_validate_xid(struct mpcg_ |
10776 |
+ |
10777 |
+ done: |
10778 |
+ if (rc) { |
10779 |
+- ctcm_pr_info("ctcmpc : %s() failed\n", __FUNCTION__); |
10780 |
++ dev_warn(&dev->dev, |
10781 |
++ "The XID used in the MPC protocol is not valid, " |
10782 |
++ "rc = %d\n", rc); |
10783 |
+ priv->xid->xid2_flag2 = 0x40; |
10784 |
+ grp->saved_xid2->xid2_flag2 = 0x40; |
10785 |
+ } |
10786 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_sysfs.c |
10787 |
+=================================================================== |
10788 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/ctcm_sysfs.c |
10789 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/ctcm_sysfs.c |
10790 |
+@@ -10,6 +10,9 @@ |
10791 |
+ #undef DEBUGDATA |
10792 |
+ #undef DEBUGCCW |
10793 |
+ |
10794 |
++#define KMSG_COMPONENT "ctcm" |
10795 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
10796 |
++ |
10797 |
+ #include <linux/sysfs.h> |
10798 |
+ #include "ctcm_main.h" |
10799 |
+ |
10800 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/lcs.c |
10801 |
+=================================================================== |
10802 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/lcs.c |
10803 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/lcs.c |
10804 |
+@@ -26,6 +26,9 @@ |
10805 |
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
10806 |
+ */ |
10807 |
+ |
10808 |
++#define KMSG_COMPONENT "lcs" |
10809 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
10810 |
++ |
10811 |
+ #include <linux/module.h> |
10812 |
+ #include <linux/if.h> |
10813 |
+ #include <linux/netdevice.h> |
10814 |
+@@ -54,8 +57,6 @@ |
10815 |
+ #error Cannot compile lcs.c without some net devices switched on. |
10816 |
+ #endif |
10817 |
+ |
10818 |
+-#define PRINTK_HEADER " lcs: " |
10819 |
+- |
10820 |
+ /** |
10821 |
+ * initialization string for output |
10822 |
+ */ |
10823 |
+@@ -96,7 +97,7 @@ lcs_register_debug_facility(void) |
10824 |
+ lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8); |
10825 |
+ lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8); |
10826 |
+ if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) { |
10827 |
+- PRINT_ERR("Not enough memory for debug facility.\n"); |
10828 |
++ pr_err("Not enough memory for debug facility.\n"); |
10829 |
+ lcs_unregister_debug_facility(); |
10830 |
+ return -ENOMEM; |
10831 |
+ } |
10832 |
+@@ -502,7 +503,9 @@ lcs_start_channel(struct lcs_channel *ch |
10833 |
+ spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); |
10834 |
+ if (rc) { |
10835 |
+ LCS_DBF_TEXT_(4,trace,"essh%s", channel->ccwdev->dev.bus_id); |
10836 |
+- PRINT_ERR("Error in starting channel, rc=%d!\n", rc); |
10837 |
++ dev_err(&channel->ccwdev->dev, |
10838 |
++ "Starting an LCS device resulted in an error," |
10839 |
++ " rc=%d!\n", rc); |
10840 |
+ } |
10841 |
+ return rc; |
10842 |
+ } |
10843 |
+@@ -636,7 +639,9 @@ __lcs_resume_channel(struct lcs_channel |
10844 |
+ rc = ccw_device_resume(channel->ccwdev); |
10845 |
+ if (rc) { |
10846 |
+ LCS_DBF_TEXT_(4, trace, "ersc%s", channel->ccwdev->dev.bus_id); |
10847 |
+- PRINT_ERR("Error in lcs_resume_channel: rc=%d\n",rc); |
10848 |
++ dev_warn(&channel->ccwdev->dev, |
10849 |
++ "Sending data from the LCS device to the LAN failed" |
10850 |
++ " with rc=%d\n",rc); |
10851 |
+ } else |
10852 |
+ channel->state = LCS_CH_STATE_RUNNING; |
10853 |
+ return rc; |
10854 |
+@@ -1082,7 +1087,7 @@ lcs_check_multicast_support(struct lcs_c |
10855 |
+ cmd->cmd.lcs_qipassist.num_ip_pairs = 1; |
10856 |
+ rc = lcs_send_lancmd(card, buffer, __lcs_check_multicast_cb); |
10857 |
+ if (rc != 0) { |
10858 |
+- PRINT_ERR("Query IPAssist failed. Assuming unsupported!\n"); |
10859 |
++ pr_err("Query IPAssist failed. Assuming unsupported!\n"); |
10860 |
+ return -EOPNOTSUPP; |
10861 |
+ } |
10862 |
+ if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) |
10863 |
+@@ -1115,8 +1120,8 @@ list_modified: |
10864 |
+ rc = lcs_send_setipm(card, ipm); |
10865 |
+ spin_lock_irqsave(&card->ipm_lock, flags); |
10866 |
+ if (rc) { |
10867 |
+- PRINT_INFO("Adding multicast address failed. " |
10868 |
+- "Table possibly full!\n"); |
10869 |
++ pr_info("Adding multicast address failed." |
10870 |
++ " Table possibly full!\n"); |
10871 |
+ /* store ipm in failed list -> will be added |
10872 |
+ * to ipm_list again, so a retry will be done |
10873 |
+ * during the next call of this function */ |
10874 |
+@@ -1227,8 +1232,8 @@ lcs_set_mc_addresses(struct lcs_card *ca |
10875 |
+ ipm = (struct lcs_ipm_list *) |
10876 |
+ kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); |
10877 |
+ if (ipm == NULL) { |
10878 |
+- PRINT_INFO("Not enough memory to add " |
10879 |
+- "new multicast entry!\n"); |
10880 |
++ pr_info("Not enough memory to add" |
10881 |
++ " new multicast entry!\n"); |
10882 |
+ break; |
10883 |
+ } |
10884 |
+ memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); |
10885 |
+@@ -1302,18 +1307,21 @@ lcs_check_irb_error(struct ccw_device *c |
10886 |
+ |
10887 |
+ switch (PTR_ERR(irb)) { |
10888 |
+ case -EIO: |
10889 |
+- PRINT_WARN("i/o-error on device %s\n", cdev->dev.bus_id); |
10890 |
++ dev_warn(&cdev->dev, |
10891 |
++ "An I/O-error occurred on the LCS device\n"); |
10892 |
+ LCS_DBF_TEXT(2, trace, "ckirberr"); |
10893 |
+ LCS_DBF_TEXT_(2, trace, " rc%d", -EIO); |
10894 |
+ break; |
10895 |
+ case -ETIMEDOUT: |
10896 |
+- PRINT_WARN("timeout on device %s\n", cdev->dev.bus_id); |
10897 |
++ dev_warn(&cdev->dev, |
10898 |
++ "A command timed out on the LCS device\n"); |
10899 |
+ LCS_DBF_TEXT(2, trace, "ckirberr"); |
10900 |
+ LCS_DBF_TEXT_(2, trace, " rc%d", -ETIMEDOUT); |
10901 |
+ break; |
10902 |
+ default: |
10903 |
+- PRINT_WARN("unknown error %ld on device %s\n", PTR_ERR(irb), |
10904 |
+- cdev->dev.bus_id); |
10905 |
++ dev_warn(&cdev->dev, |
10906 |
++ "An error occurred on the LCS device, rc=%ld\n", |
10907 |
++ PTR_ERR(irb)); |
10908 |
+ LCS_DBF_TEXT(2, trace, "ckirberr"); |
10909 |
+ LCS_DBF_TEXT(2, trace, " rc???"); |
10910 |
+ } |
10911 |
+@@ -1399,8 +1407,10 @@ lcs_irq(struct ccw_device *cdev, unsigne |
10912 |
+ /* Check for channel and device errors presented */ |
10913 |
+ rc = lcs_get_problem(cdev, irb); |
10914 |
+ if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { |
10915 |
+- PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", |
10916 |
+- cdev->dev.bus_id, dstat, cstat); |
10917 |
++ dev_warn(&cdev->dev, |
10918 |
++ "The LCS device stopped because of an error," |
10919 |
++ " dstat=0x%X, cstat=0x%X \n", |
10920 |
++ dstat, cstat); |
10921 |
+ if (rc) { |
10922 |
+ channel->state = LCS_CH_STATE_ERROR; |
10923 |
+ } |
10924 |
+@@ -1757,8 +1767,8 @@ lcs_get_control(struct lcs_card *card, s |
10925 |
+ lcs_schedule_recovery(card); |
10926 |
+ break; |
10927 |
+ case LCS_CMD_STOPLAN: |
10928 |
+- PRINT_WARN("Stoplan for %s initiated by LGW.\n", |
10929 |
+- card->dev->name); |
10930 |
++ pr_warning("Stoplan for %s initiated by LGW.\n", |
10931 |
++ card->dev->name); |
10932 |
+ if (card->dev) |
10933 |
+ netif_carrier_off(card->dev); |
10934 |
+ break; |
10935 |
+@@ -1786,7 +1796,8 @@ lcs_get_skb(struct lcs_card *card, char |
10936 |
+ |
10937 |
+ skb = dev_alloc_skb(skb_len); |
10938 |
+ if (skb == NULL) { |
10939 |
+- PRINT_ERR("LCS: alloc_skb failed for device=%s\n", |
10940 |
++ dev_err(&card->dev->dev, |
10941 |
++ " Allocating a socket buffer to interface %s failed\n", |
10942 |
+ card->dev->name); |
10943 |
+ card->stats.rx_dropped++; |
10944 |
+ return; |
10945 |
+@@ -1882,7 +1893,8 @@ lcs_stop_device(struct net_device *dev) |
10946 |
+ (card->write.state != LCS_CH_STATE_RUNNING)); |
10947 |
+ rc = lcs_stopcard(card); |
10948 |
+ if (rc) |
10949 |
+- PRINT_ERR("Try it again!\n "); |
10950 |
++ dev_err(&card->dev->dev, |
10951 |
++ " Shutting down the LCS device failed\n "); |
10952 |
+ return rc; |
10953 |
+ } |
10954 |
+ |
10955 |
+@@ -1901,7 +1913,7 @@ lcs_open_device(struct net_device *dev) |
10956 |
+ /* initialize statistics */ |
10957 |
+ rc = lcs_detect(card); |
10958 |
+ if (rc) { |
10959 |
+- PRINT_ERR("LCS:Error in opening device!\n"); |
10960 |
++ pr_err("Error in opening device!\n"); |
10961 |
+ |
10962 |
+ } else { |
10963 |
+ dev->flags |= IFF_UP; |
10964 |
+@@ -2109,8 +2121,9 @@ lcs_new_device(struct ccwgroup_device *c |
10965 |
+ rc = lcs_detect(card); |
10966 |
+ if (rc) { |
10967 |
+ LCS_DBF_TEXT(2, setup, "dtctfail"); |
10968 |
+- PRINT_WARN("Detection of LCS card failed with return code " |
10969 |
+- "%d (0x%x)\n", rc, rc); |
10970 |
++ dev_warn(&card->dev->dev, |
10971 |
++ "Detecting a network adapter for LCS devices" |
10972 |
++ " failed with rc=%d (0x%x)\n", rc, rc); |
10973 |
+ lcs_stopcard(card); |
10974 |
+ goto out; |
10975 |
+ } |
10976 |
+@@ -2140,7 +2153,7 @@ lcs_new_device(struct ccwgroup_device *c |
10977 |
+ #endif |
10978 |
+ default: |
10979 |
+ LCS_DBF_TEXT(3, setup, "errinit"); |
10980 |
+- PRINT_ERR("LCS: Initialization failed\n"); |
10981 |
++ pr_err(" Initialization failed\n"); |
10982 |
+ goto out; |
10983 |
+ } |
10984 |
+ if (!dev) |
10985 |
+@@ -2172,13 +2185,13 @@ netdev_out: |
10986 |
+ goto out; |
10987 |
+ |
10988 |
+ /* Print out supported assists: IPv6 */ |
10989 |
+- PRINT_INFO("LCS device %s %s IPv6 support\n", card->dev->name, |
10990 |
+- (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ? |
10991 |
+- "with" : "without"); |
10992 |
++ pr_info("LCS device %s %s IPv6 support\n", card->dev->name, |
10993 |
++ (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ? |
10994 |
++ "with" : "without"); |
10995 |
+ /* Print out supported assist: Multicast */ |
10996 |
+- PRINT_INFO("LCS device %s %s Multicast support\n", card->dev->name, |
10997 |
+- (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ? |
10998 |
+- "with" : "without"); |
10999 |
++ pr_info("LCS device %s %s Multicast support\n", card->dev->name, |
11000 |
++ (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ? |
11001 |
++ "with" : "without"); |
11002 |
+ return 0; |
11003 |
+ out: |
11004 |
+ |
11005 |
+@@ -2244,15 +2257,16 @@ lcs_recovery(void *ptr) |
11006 |
+ return 0; |
11007 |
+ LCS_DBF_TEXT(4, trace, "recover2"); |
11008 |
+ gdev = card->gdev; |
11009 |
+- PRINT_WARN("Recovery of device %s started...\n", gdev->dev.bus_id); |
11010 |
++ dev_warn(&gdev->dev, |
11011 |
++ "A recovery process has been started for the LCS device\n"); |
11012 |
+ rc = __lcs_shutdown_device(gdev, 1); |
11013 |
+ rc = lcs_new_device(gdev); |
11014 |
+ if (!rc) |
11015 |
+- PRINT_INFO("Device %s successfully recovered!\n", |
11016 |
+- card->dev->name); |
11017 |
++ pr_info("Device %s successfully recovered!\n", |
11018 |
++ card->dev->name); |
11019 |
+ else |
11020 |
+- PRINT_INFO("Device %s could not be recovered!\n", |
11021 |
+- card->dev->name); |
11022 |
++ pr_info("Device %s could not be recovered!\n", |
11023 |
++ card->dev->name); |
11024 |
+ lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD); |
11025 |
+ return 0; |
11026 |
+ } |
11027 |
+@@ -2304,17 +2318,17 @@ __init lcs_init_module(void) |
11028 |
+ { |
11029 |
+ int rc; |
11030 |
+ |
11031 |
+- PRINT_INFO("Loading %s\n",version); |
11032 |
++ pr_info("Loading %s\n", version); |
11033 |
+ rc = lcs_register_debug_facility(); |
11034 |
+ LCS_DBF_TEXT(0, setup, "lcsinit"); |
11035 |
+ if (rc) { |
11036 |
+- PRINT_ERR("Initialization failed\n"); |
11037 |
++ pr_err("Initialization failed\n"); |
11038 |
+ return rc; |
11039 |
+ } |
11040 |
+ |
11041 |
+ rc = register_cu3088_discipline(&lcs_group_driver); |
11042 |
+ if (rc) { |
11043 |
+- PRINT_ERR("Initialization failed\n"); |
11044 |
++ pr_err("Initialization failed\n"); |
11045 |
+ return rc; |
11046 |
+ } |
11047 |
+ return 0; |
11048 |
+@@ -2327,7 +2341,7 @@ __init lcs_init_module(void) |
11049 |
+ static void |
11050 |
+ __exit lcs_cleanup_module(void) |
11051 |
+ { |
11052 |
+- PRINT_INFO("Terminating lcs module.\n"); |
11053 |
++ pr_info("Terminating lcs module.\n"); |
11054 |
+ LCS_DBF_TEXT(0, trace, "cleanup"); |
11055 |
+ unregister_cu3088_discipline(&lcs_group_driver); |
11056 |
+ lcs_unregister_debug_facility(); |
11057 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/netiucv.c |
11058 |
+=================================================================== |
11059 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/netiucv.c |
11060 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/netiucv.c |
11061 |
+@@ -31,6 +31,9 @@ |
11062 |
+ * |
11063 |
+ */ |
11064 |
+ |
11065 |
++#define KMSG_COMPONENT "netiucv" |
11066 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
11067 |
++ |
11068 |
+ #undef DEBUG |
11069 |
+ |
11070 |
+ #include <linux/module.h> |
11071 |
+@@ -846,7 +849,8 @@ static void conn_action_connsever(fsm_in |
11072 |
+ |
11073 |
+ fsm_deltimer(&conn->timer); |
11074 |
+ iucv_path_sever(conn->path, NULL); |
11075 |
+- PRINT_INFO("%s: Remote dropped connection\n", netdev->name); |
11076 |
++ dev_info(privptr->dev, "The peer interface of the IUCV device" |
11077 |
++ " has closed the connection\n"); |
11078 |
+ IUCV_DBF_TEXT(data, 2, |
11079 |
+ "conn_action_connsever: Remote dropped connection\n"); |
11080 |
+ fsm_newstate(fi, CONN_STATE_STARTWAIT); |
11081 |
+@@ -856,13 +860,15 @@ static void conn_action_connsever(fsm_in |
11082 |
+ static void conn_action_start(fsm_instance *fi, int event, void *arg) |
11083 |
+ { |
11084 |
+ struct iucv_connection *conn = arg; |
11085 |
++ struct net_device *netdev = conn->netdev; |
11086 |
++ struct netiucv_priv *privptr = netdev_priv(netdev); |
11087 |
+ int rc; |
11088 |
+ |
11089 |
+ IUCV_DBF_TEXT(trace, 3, __func__); |
11090 |
+ |
11091 |
+ fsm_newstate(fi, CONN_STATE_STARTWAIT); |
11092 |
+ IUCV_DBF_TEXT_(setup, 2, "%s('%s'): connecting ...\n", |
11093 |
+- conn->netdev->name, conn->userid); |
11094 |
++ netdev->name, conn->userid); |
11095 |
+ |
11096 |
+ /* |
11097 |
+ * We must set the state before calling iucv_connect because the |
11098 |
+@@ -876,41 +882,45 @@ static void conn_action_start(fsm_instan |
11099 |
+ NULL, iucvMagic, conn); |
11100 |
+ switch (rc) { |
11101 |
+ case 0: |
11102 |
+- conn->netdev->tx_queue_len = conn->path->msglim; |
11103 |
++ netdev->tx_queue_len = conn->path->msglim; |
11104 |
+ fsm_addtimer(&conn->timer, NETIUCV_TIMEOUT_5SEC, |
11105 |
+ CONN_EVENT_TIMER, conn); |
11106 |
+ return; |
11107 |
+ case 11: |
11108 |
+- PRINT_INFO("%s: User %s is currently not available.\n", |
11109 |
+- conn->netdev->name, |
11110 |
+- netiucv_printname(conn->userid)); |
11111 |
++ dev_warn(privptr->dev, |
11112 |
++ "The IUCV device failed to connect to z/VM guest %s\n", |
11113 |
++ netiucv_printname(conn->userid)); |
11114 |
+ fsm_newstate(fi, CONN_STATE_STARTWAIT); |
11115 |
+ break; |
11116 |
+ case 12: |
11117 |
+- PRINT_INFO("%s: User %s is currently not ready.\n", |
11118 |
+- conn->netdev->name, |
11119 |
+- netiucv_printname(conn->userid)); |
11120 |
++ dev_warn(privptr->dev, |
11121 |
++ "The IUCV device failed to connect to the peer on z/VM" |
11122 |
++ " guest %s\n", netiucv_printname(conn->userid)); |
11123 |
+ fsm_newstate(fi, CONN_STATE_STARTWAIT); |
11124 |
+ break; |
11125 |
+ case 13: |
11126 |
+- PRINT_WARN("%s: Too many IUCV connections.\n", |
11127 |
+- conn->netdev->name); |
11128 |
++ dev_err(privptr->dev, |
11129 |
++ "Connecting the IUCV device would exceed the maximum" |
11130 |
++ " number of IUCV connections\n"); |
11131 |
+ fsm_newstate(fi, CONN_STATE_CONNERR); |
11132 |
+ break; |
11133 |
+ case 14: |
11134 |
+- PRINT_WARN("%s: User %s has too many IUCV connections.\n", |
11135 |
+- conn->netdev->name, |
11136 |
+- netiucv_printname(conn->userid)); |
11137 |
++ dev_err(privptr->dev, |
11138 |
++ "z/VM guest %s has too many IUCV connections" |
11139 |
++ " to connect with the IUCV device\n", |
11140 |
++ netiucv_printname(conn->userid)); |
11141 |
+ fsm_newstate(fi, CONN_STATE_CONNERR); |
11142 |
+ break; |
11143 |
+ case 15: |
11144 |
+- PRINT_WARN("%s: No IUCV authorization in CP directory.\n", |
11145 |
+- conn->netdev->name); |
11146 |
++ dev_err(privptr->dev, |
11147 |
++ "The IUCV device cannot connect to a z/VM guest with no" |
11148 |
++ " IUCV authorization\n"); |
11149 |
+ fsm_newstate(fi, CONN_STATE_CONNERR); |
11150 |
+ break; |
11151 |
+ default: |
11152 |
+- PRINT_WARN("%s: iucv_connect returned error %d\n", |
11153 |
+- conn->netdev->name, rc); |
11154 |
++ dev_err(privptr->dev, |
11155 |
++ "Connecting the IUCV device failed with error %d\n", |
11156 |
++ rc); |
11157 |
+ fsm_newstate(fi, CONN_STATE_CONNERR); |
11158 |
+ break; |
11159 |
+ } |
11160 |
+@@ -1059,8 +1069,9 @@ dev_action_connup(fsm_instance *fi, int |
11161 |
+ switch (fsm_getstate(fi)) { |
11162 |
+ case DEV_STATE_STARTWAIT: |
11163 |
+ fsm_newstate(fi, DEV_STATE_RUNNING); |
11164 |
+- PRINT_INFO("%s: connected with remote side %s\n", |
11165 |
+- dev->name, privptr->conn->userid); |
11166 |
++ dev_info(privptr->dev, |
11167 |
++ "The IUCV device has been connected" |
11168 |
++ " successfully to %s\n", privptr->conn->userid); |
11169 |
+ IUCV_DBF_TEXT(setup, 3, |
11170 |
+ "connection is up and running\n"); |
11171 |
+ break; |
11172 |
+@@ -1982,6 +1993,8 @@ static ssize_t conn_write(struct device_ |
11173 |
+ if (rc) |
11174 |
+ goto out_unreg; |
11175 |
+ |
11176 |
++ dev_info(priv->dev, "The IUCV interface to %s has been" |
11177 |
++ " established successfully\n", netiucv_printname(username)); |
11178 |
+ |
11179 |
+ return count; |
11180 |
+ |
11181 |
+@@ -2027,10 +2040,9 @@ static ssize_t remove_write (struct devi |
11182 |
+ continue; |
11183 |
+ read_unlock_bh(&iucv_connection_rwlock); |
11184 |
+ if (ndev->flags & (IFF_UP | IFF_RUNNING)) { |
11185 |
+- PRINT_WARN("netiucv: net device %s active with peer " |
11186 |
+- "%s\n", ndev->name, priv->conn->userid); |
11187 |
+- PRINT_WARN("netiucv: %s cannot be removed\n", |
11188 |
+- ndev->name); |
11189 |
++ dev_warn(dev, "The IUCV device is connected" |
11190 |
++ " to %s and cannot be removed\n", |
11191 |
++ priv->conn->userid); |
11192 |
+ IUCV_DBF_TEXT(data, 2, "remove_write: still active\n"); |
11193 |
+ return -EPERM; |
11194 |
+ } |
11195 |
+@@ -2062,7 +2074,7 @@ static struct attribute_group *netiucv_d |
11196 |
+ |
11197 |
+ static void netiucv_banner(void) |
11198 |
+ { |
11199 |
+- PRINT_INFO("NETIUCV driver initialized\n"); |
11200 |
++ pr_info("driver initialized\n"); |
11201 |
+ } |
11202 |
+ |
11203 |
+ static void __exit netiucv_exit(void) |
11204 |
+@@ -2088,7 +2100,7 @@ static void __exit netiucv_exit(void) |
11205 |
+ iucv_unregister(&netiucv_handler, 1); |
11206 |
+ iucv_unregister_dbf_views(); |
11207 |
+ |
11208 |
+- PRINT_INFO("NETIUCV driver unloaded\n"); |
11209 |
++ pr_info("driver unloaded\n"); |
11210 |
+ return; |
11211 |
+ } |
11212 |
+ |
11213 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_core.h |
11214 |
+=================================================================== |
11215 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_core.h |
11216 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_core.h |
11217 |
+@@ -31,11 +31,10 @@ |
11218 |
+ #include <asm/qdio.h> |
11219 |
+ #include <asm/ccwdev.h> |
11220 |
+ #include <asm/ccwgroup.h> |
11221 |
++#include <asm/sysinfo.h> |
11222 |
+ |
11223 |
+ #include "qeth_core_mpc.h" |
11224 |
+ |
11225 |
+-#define KMSG_COMPONENT "qeth" |
11226 |
+- |
11227 |
+ /** |
11228 |
+ * Debug Facility stuff |
11229 |
+ */ |
11230 |
+@@ -74,11 +73,6 @@ struct qeth_dbf_info { |
11231 |
+ #define QETH_DBF_TEXT_(name, level, text...) \ |
11232 |
+ qeth_dbf_longtext(QETH_DBF_##name, level, text) |
11233 |
+ |
11234 |
+-/** |
11235 |
+- * some more debug stuff |
11236 |
+- */ |
11237 |
+-#define PRINTK_HEADER "qeth: " |
11238 |
+- |
11239 |
+ #define SENSE_COMMAND_REJECT_BYTE 0 |
11240 |
+ #define SENSE_COMMAND_REJECT_FLAG 0x80 |
11241 |
+ #define SENSE_RESETTING_EVENT_BYTE 1 |
11242 |
+@@ -733,6 +727,7 @@ struct qeth_card { |
11243 |
+ struct qeth_osn_info osn_info; |
11244 |
+ struct qeth_discipline discipline; |
11245 |
+ atomic_t force_alloc_skb; |
11246 |
++ struct service_level qeth_service_level; |
11247 |
+ }; |
11248 |
+ |
11249 |
+ struct qeth_card_list_struct { |
11250 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_core_main.c |
11251 |
+=================================================================== |
11252 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_core_main.c |
11253 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_core_main.c |
11254 |
+@@ -8,6 +8,9 @@ |
11255 |
+ * Frank Blaschka <frank.blaschka@××××××.com> |
11256 |
+ */ |
11257 |
+ |
11258 |
++#define KMSG_COMPONENT "qeth" |
11259 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
11260 |
++ |
11261 |
+ #include <linux/module.h> |
11262 |
+ #include <linux/moduleparam.h> |
11263 |
+ #include <linux/string.h> |
11264 |
+@@ -319,7 +322,10 @@ static int qeth_issue_next_read(struct q |
11265 |
+ return -EIO; |
11266 |
+ iob = qeth_get_buffer(&card->read); |
11267 |
+ if (!iob) { |
11268 |
+- PRINT_WARN("issue_next_read failed: no iob available!\n"); |
11269 |
++ dev_warn(&card->gdev->dev, "The qeth device driver " |
11270 |
++ "failed to recover an error on the device\n"); |
11271 |
++ QETH_DBF_MESSAGE(2, "%s issue_next_read failed: no iob " |
11272 |
++ "available\n", dev_name(&card->gdev->dev)); |
11273 |
+ return -ENOMEM; |
11274 |
+ } |
11275 |
+ qeth_setup_ccw(&card->read, iob->data, QETH_BUFSIZE); |
11276 |
+@@ -327,7 +333,8 @@ static int qeth_issue_next_read(struct q |
11277 |
+ rc = ccw_device_start(card->read.ccwdev, &card->read.ccw, |
11278 |
+ (addr_t) iob, 0, 0); |
11279 |
+ if (rc) { |
11280 |
+- PRINT_ERR("Error in starting next read ccw! rc=%i\n", rc); |
11281 |
++ QETH_DBF_MESSAGE(2, "%s error in starting next read ccw! " |
11282 |
++ "rc=%i\n", dev_name(&card->gdev->dev), rc); |
11283 |
+ atomic_set(&card->read.irq_pending, 0); |
11284 |
+ qeth_schedule_recovery(card); |
11285 |
+ wake_up(&card->wait_q); |
11286 |
+@@ -393,10 +400,9 @@ static struct qeth_ipa_cmd *qeth_check_i |
11287 |
+ } else { |
11288 |
+ switch (cmd->hdr.command) { |
11289 |
+ case IPA_CMD_STOPLAN: |
11290 |
+- PRINT_WARN("Link failure on %s (CHPID 0x%X) - " |
11291 |
+- "there is a network problem or " |
11292 |
+- "someone pulled the cable or " |
11293 |
+- "disabled the port.\n", |
11294 |
++ dev_warn(&card->gdev->dev, |
11295 |
++ "The link for interface %s on CHPID" |
11296 |
++ " 0x%X failed\n", |
11297 |
+ QETH_CARD_IFNAME(card), |
11298 |
+ card->info.chpid); |
11299 |
+ card->lan_online = 0; |
11300 |
+@@ -404,9 +410,9 @@ static struct qeth_ipa_cmd *qeth_check_i |
11301 |
+ netif_carrier_off(card->dev); |
11302 |
+ return NULL; |
11303 |
+ case IPA_CMD_STARTLAN: |
11304 |
+- PRINT_INFO("Link reestablished on %s " |
11305 |
+- "(CHPID 0x%X). Scheduling " |
11306 |
+- "IP address reset.\n", |
11307 |
++ dev_info(&card->gdev->dev, |
11308 |
++ "The link for %s on CHPID 0x%X has" |
11309 |
++ " been restored\n", |
11310 |
+ QETH_CARD_IFNAME(card), |
11311 |
+ card->info.chpid); |
11312 |
+ netif_carrier_on(card->dev); |
11313 |
+@@ -458,7 +464,7 @@ static int qeth_check_idx_response(unsig |
11314 |
+ |
11315 |
+ QETH_DBF_HEX(CTRL, 2, buffer, QETH_DBF_CTRL_LEN); |
11316 |
+ if ((buffer[2] & 0xc0) == 0xc0) { |
11317 |
+- PRINT_WARN("received an IDX TERMINATE " |
11318 |
++ QETH_DBF_MESSAGE(2, "received an IDX TERMINATE " |
11319 |
+ "with cause code 0x%02x%s\n", |
11320 |
+ buffer[4], |
11321 |
+ ((buffer[4] == 0x22) ? |
11322 |
+@@ -744,8 +750,10 @@ static int qeth_get_problem(struct ccw_d |
11323 |
+ SCHN_STAT_CHN_DATA_CHK | SCHN_STAT_CHAIN_CHECK | |
11324 |
+ SCHN_STAT_PROT_CHECK | SCHN_STAT_PROG_CHECK)) { |
11325 |
+ QETH_DBF_TEXT(TRACE, 2, "CGENCHK"); |
11326 |
+- PRINT_WARN("check on device %s, dstat=x%x, cstat=x%x ", |
11327 |
+- cdev->dev.bus_id, dstat, cstat); |
11328 |
++ dev_warn(&cdev->dev, "The qeth device driver " |
11329 |
++ "failed to recover an error on the device\n"); |
11330 |
++ QETH_DBF_MESSAGE(2, "%s check on device dstat=x%x, cstat=x%x ", |
11331 |
++ dev_name(&cdev->dev), dstat, cstat); |
11332 |
+ print_hex_dump(KERN_WARNING, "qeth: irb ", DUMP_PREFIX_OFFSET, |
11333 |
+ 16, 1, irb, 64, 1); |
11334 |
+ return 1; |
11335 |
+@@ -784,12 +792,14 @@ static long __qeth_check_irb_error(struc |
11336 |
+ |
11337 |
+ switch (PTR_ERR(irb)) { |
11338 |
+ case -EIO: |
11339 |
+- PRINT_WARN("i/o-error on device %s\n", cdev->dev.bus_id); |
11340 |
++ QETH_DBF_MESSAGE(2, "%s i/o-error on device\n", |
11341 |
++ dev_name(&cdev->dev)); |
11342 |
+ QETH_DBF_TEXT(TRACE, 2, "ckirberr"); |
11343 |
+ QETH_DBF_TEXT_(TRACE, 2, " rc%d", -EIO); |
11344 |
+ break; |
11345 |
+ case -ETIMEDOUT: |
11346 |
+- PRINT_WARN("timeout on device %s\n", cdev->dev.bus_id); |
11347 |
++ dev_warn(&cdev->dev, "A hardware operation timed out" |
11348 |
++ " on the device\n"); |
11349 |
+ QETH_DBF_TEXT(TRACE, 2, "ckirberr"); |
11350 |
+ QETH_DBF_TEXT_(TRACE, 2, " rc%d", -ETIMEDOUT); |
11351 |
+ if (intparm == QETH_RCD_PARM) { |
11352 |
+@@ -802,8 +812,8 @@ static long __qeth_check_irb_error(struc |
11353 |
+ } |
11354 |
+ break; |
11355 |
+ default: |
11356 |
+- PRINT_WARN("unknown error %ld on device %s\n", PTR_ERR(irb), |
11357 |
+- cdev->dev.bus_id); |
11358 |
++ QETH_DBF_MESSAGE(2, "%s unknown error %ld on device\n", |
11359 |
++ dev_name(&cdev->dev), PTR_ERR(irb)); |
11360 |
+ QETH_DBF_TEXT(TRACE, 2, "ckirberr"); |
11361 |
+ QETH_DBF_TEXT(TRACE, 2, " rc???"); |
11362 |
+ } |
11363 |
+@@ -869,10 +879,12 @@ static void qeth_irq(struct ccw_device * |
11364 |
+ (dstat & DEV_STAT_UNIT_CHECK) || |
11365 |
+ (cstat)) { |
11366 |
+ if (irb->esw.esw0.erw.cons) { |
11367 |
+- /* TODO: we should make this s390dbf */ |
11368 |
+- PRINT_WARN("sense data available on channel %s.\n", |
11369 |
+- CHANNEL_ID(channel)); |
11370 |
+- PRINT_WARN(" cstat 0x%X\n dstat 0x%X\n", cstat, dstat); |
11371 |
++ dev_warn(&channel->ccwdev->dev, |
11372 |
++ "The qeth device driver failed to recover " |
11373 |
++ "an error on the device\n"); |
11374 |
++ QETH_DBF_MESSAGE(2, "%s sense data available. cstat " |
11375 |
++ "0x%X dstat 0x%X\n", |
11376 |
++ dev_name(&channel->ccwdev->dev), cstat, dstat); |
11377 |
+ print_hex_dump(KERN_WARNING, "qeth: irb ", |
11378 |
+ DUMP_PREFIX_OFFSET, 16, 1, irb, 32, 1); |
11379 |
+ print_hex_dump(KERN_WARNING, "qeth: sense data ", |
11380 |
+@@ -1138,6 +1150,14 @@ static int qeth_setup_card(struct qeth_c |
11381 |
+ return 0; |
11382 |
+ } |
11383 |
+ |
11384 |
++static void qeth_core_sl_print(struct seq_file *m, struct service_level *slr) |
11385 |
++{ |
11386 |
++ struct qeth_card *card = container_of(slr, struct qeth_card, |
11387 |
++ qeth_service_level); |
11388 |
++ seq_printf(m, "qeth: %s firmware level %s\n", CARD_BUS_ID(card), |
11389 |
++ card->info.mcl_level); |
11390 |
++} |
11391 |
++ |
11392 |
+ static struct qeth_card *qeth_alloc_card(void) |
11393 |
+ { |
11394 |
+ struct qeth_card *card; |
11395 |
+@@ -1157,6 +1177,8 @@ static struct qeth_card *qeth_alloc_card |
11396 |
+ return NULL; |
11397 |
+ } |
11398 |
+ card->options.layer2 = -1; |
11399 |
++ card->qeth_service_level.seq_print = qeth_core_sl_print; |
11400 |
++ register_service_level(&card->qeth_service_level); |
11401 |
+ return card; |
11402 |
+ } |
11403 |
+ |
11404 |
+@@ -1175,8 +1197,8 @@ static int qeth_determine_card_type(stru |
11405 |
+ card->qdio.no_out_queues = known_devices[i][8]; |
11406 |
+ card->info.is_multicast_different = known_devices[i][9]; |
11407 |
+ if (qeth_is_1920_device(card)) { |
11408 |
+- PRINT_INFO("Priority Queueing not able " |
11409 |
+- "due to hardware limitations!\n"); |
11410 |
++ dev_info(&card->gdev->dev, |
11411 |
++ "Priority Queueing not supported\n"); |
11412 |
+ card->qdio.no_out_queues = 1; |
11413 |
+ card->qdio.default_out_queue = 0; |
11414 |
+ } |
11415 |
+@@ -1185,7 +1207,8 @@ static int qeth_determine_card_type(stru |
11416 |
+ i++; |
11417 |
+ } |
11418 |
+ card->info.type = QETH_CARD_TYPE_UNKNOWN; |
11419 |
+- PRINT_ERR("unknown card type on device %s\n", CARD_BUS_ID(card)); |
11420 |
++ dev_err(&card->gdev->dev, "The adapter hardware is of an " |
11421 |
++ "unknown type\n"); |
11422 |
+ return -ENOENT; |
11423 |
+ } |
11424 |
+ |
11425 |
+@@ -1368,8 +1391,8 @@ static int qeth_get_unitaddr(struct qeth |
11426 |
+ QETH_DBF_TEXT(SETUP, 2, "getunit"); |
11427 |
+ rc = qeth_read_conf_data(card, (void **) &prcd, &length); |
11428 |
+ if (rc) { |
11429 |
+- PRINT_ERR("qeth_read_conf_data for device %s returned %i\n", |
11430 |
+- CARD_DDEV_ID(card), rc); |
11431 |
++ QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n", |
11432 |
++ dev_name(&card->gdev->dev), rc); |
11433 |
+ return rc; |
11434 |
+ } |
11435 |
+ card->info.chpid = prcd[30]; |
11436 |
+@@ -1519,7 +1542,10 @@ static int qeth_idx_activate_channel(str |
11437 |
+ if (rc == -ERESTARTSYS) |
11438 |
+ return rc; |
11439 |
+ if (channel->state != CH_STATE_ACTIVATING) { |
11440 |
+- PRINT_WARN("IDX activate timed out!\n"); |
11441 |
++ dev_warn(&channel->ccwdev->dev, "The qeth device driver" |
11442 |
++ " failed to recover an error on the device\n"); |
11443 |
++ QETH_DBF_MESSAGE(2, "%s IDX activate timed out\n", |
11444 |
++ dev_name(&channel->ccwdev->dev)); |
11445 |
+ QETH_DBF_TEXT_(SETUP, 2, "2err%d", -ETIME); |
11446 |
+ qeth_clear_cmd_buffers(channel); |
11447 |
+ return -ETIME; |
11448 |
+@@ -1552,20 +1578,21 @@ static void qeth_idx_write_cb(struct qet |
11449 |
+ |
11450 |
+ if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { |
11451 |
+ if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19) |
11452 |
+- PRINT_ERR("IDX_ACTIVATE on write channel device %s: " |
11453 |
+- "adapter exclusively used by another host\n", |
11454 |
+- CARD_WDEV_ID(card)); |
11455 |
++ dev_err(&card->write.ccwdev->dev, |
11456 |
++ "The adapter is used exclusively by another " |
11457 |
++ "host\n"); |
11458 |
+ else |
11459 |
+- PRINT_ERR("IDX_ACTIVATE on write channel device %s: " |
11460 |
+- "negative reply\n", CARD_WDEV_ID(card)); |
11461 |
++ QETH_DBF_MESSAGE(2, "%s IDX_ACTIVATE on write channel:" |
11462 |
++ " negative reply\n", |
11463 |
++ dev_name(&card->write.ccwdev->dev)); |
11464 |
+ goto out; |
11465 |
+ } |
11466 |
+ memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); |
11467 |
+ if ((temp & ~0x0100) != qeth_peer_func_level(card->info.func_level)) { |
11468 |
+- PRINT_WARN("IDX_ACTIVATE on write channel device %s: " |
11469 |
+- "function level mismatch " |
11470 |
+- "(sent: 0x%x, received: 0x%x)\n", |
11471 |
+- CARD_WDEV_ID(card), card->info.func_level, temp); |
11472 |
++ QETH_DBF_MESSAGE(2, "%s IDX_ACTIVATE on write channel: " |
11473 |
++ "function level mismatch (sent: 0x%x, received: " |
11474 |
++ "0x%x)\n", dev_name(&card->write.ccwdev->dev), |
11475 |
++ card->info.func_level, temp); |
11476 |
+ goto out; |
11477 |
+ } |
11478 |
+ channel->state = CH_STATE_UP; |
11479 |
+@@ -1591,12 +1618,13 @@ static void qeth_idx_read_cb(struct qeth |
11480 |
+ |
11481 |
+ if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { |
11482 |
+ if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19) |
11483 |
+- PRINT_ERR("IDX_ACTIVATE on read channel device %s: " |
11484 |
+- "adapter exclusively used by another host\n", |
11485 |
+- CARD_RDEV_ID(card)); |
11486 |
++ dev_err(&card->write.ccwdev->dev, |
11487 |
++ "The adapter is used exclusively by another " |
11488 |
++ "host\n"); |
11489 |
+ else |
11490 |
+- PRINT_ERR("IDX_ACTIVATE on read channel device %s: " |
11491 |
+- "negative reply\n", CARD_RDEV_ID(card)); |
11492 |
++ QETH_DBF_MESSAGE(2, "%s IDX_ACTIVATE on read channel:" |
11493 |
++ " negative reply\n", |
11494 |
++ dev_name(&card->read.ccwdev->dev)); |
11495 |
+ goto out; |
11496 |
+ } |
11497 |
+ |
11498 |
+@@ -1610,9 +1638,10 @@ static void qeth_idx_read_cb(struct qeth |
11499 |
+ |
11500 |
+ memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); |
11501 |
+ if (temp != qeth_peer_func_level(card->info.func_level)) { |
11502 |
+- PRINT_WARN("IDX_ACTIVATE on read channel device %s: function " |
11503 |
+- "level mismatch (sent: 0x%x, received: 0x%x)\n", |
11504 |
+- CARD_RDEV_ID(card), card->info.func_level, temp); |
11505 |
++ QETH_DBF_MESSAGE(2, "%s IDX_ACTIVATE on read channel: function " |
11506 |
++ "level mismatch (sent: 0x%x, received: 0x%x)\n", |
11507 |
++ dev_name(&card->read.ccwdev->dev), |
11508 |
++ card->info.func_level, temp); |
11509 |
+ goto out; |
11510 |
+ } |
11511 |
+ memcpy(&card->token.issuer_rm_r, |
11512 |
+@@ -1686,8 +1715,9 @@ int qeth_send_control_data(struct qeth_c |
11513 |
+ (addr_t) iob, 0, 0); |
11514 |
+ spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags); |
11515 |
+ if (rc) { |
11516 |
+- PRINT_WARN("qeth_send_control_data: " |
11517 |
+- "ccw_device_start rc = %i\n", rc); |
11518 |
++ QETH_DBF_MESSAGE(2, "%s qeth_send_control_data: " |
11519 |
++ "ccw_device_start rc = %i\n", |
11520 |
++ dev_name(&card->write.ccwdev->dev), rc); |
11521 |
+ QETH_DBF_TEXT_(TRACE, 2, " err%d", rc); |
11522 |
+ spin_lock_irqsave(&card->lock, flags); |
11523 |
+ list_del_init(&reply->list); |
11524 |
+@@ -2170,11 +2200,8 @@ static void qeth_print_status_with_portn |
11525 |
+ dbf_text[i] = |
11526 |
+ (char) _ebcasc[(__u8) dbf_text[i]]; |
11527 |
+ dbf_text[8] = 0; |
11528 |
+- PRINT_INFO("Device %s/%s/%s is a%s card%s%s%s\n" |
11529 |
++ dev_info(&card->gdev->dev, "Device is a%s card%s%s%s\n" |
11530 |
+ "with link type %s (portname: %s)\n", |
11531 |
+- CARD_RDEV_ID(card), |
11532 |
+- CARD_WDEV_ID(card), |
11533 |
+- CARD_DDEV_ID(card), |
11534 |
+ qeth_get_cardname(card), |
11535 |
+ (card->info.mcl_level[0]) ? " (level: " : "", |
11536 |
+ (card->info.mcl_level[0]) ? card->info.mcl_level : "", |
11537 |
+@@ -2187,23 +2214,17 @@ static void qeth_print_status_with_portn |
11538 |
+ static void qeth_print_status_no_portname(struct qeth_card *card) |
11539 |
+ { |
11540 |
+ if (card->info.portname[0]) |
11541 |
+- PRINT_INFO("Device %s/%s/%s is a%s " |
11542 |
++ dev_info(&card->gdev->dev, "Device is a%s " |
11543 |
+ "card%s%s%s\nwith link type %s " |
11544 |
+ "(no portname needed by interface).\n", |
11545 |
+- CARD_RDEV_ID(card), |
11546 |
+- CARD_WDEV_ID(card), |
11547 |
+- CARD_DDEV_ID(card), |
11548 |
+ qeth_get_cardname(card), |
11549 |
+ (card->info.mcl_level[0]) ? " (level: " : "", |
11550 |
+ (card->info.mcl_level[0]) ? card->info.mcl_level : "", |
11551 |
+ (card->info.mcl_level[0]) ? ")" : "", |
11552 |
+ qeth_get_cardname_short(card)); |
11553 |
+ else |
11554 |
+- PRINT_INFO("Device %s/%s/%s is a%s " |
11555 |
++ dev_info(&card->gdev->dev, "Device is a%s " |
11556 |
+ "card%s%s%s\nwith link type %s.\n", |
11557 |
+- CARD_RDEV_ID(card), |
11558 |
+- CARD_WDEV_ID(card), |
11559 |
+- CARD_DDEV_ID(card), |
11560 |
+ qeth_get_cardname(card), |
11561 |
+ (card->info.mcl_level[0]) ? " (level: " : "", |
11562 |
+ (card->info.mcl_level[0]) ? card->info.mcl_level : "", |
11563 |
+@@ -2630,9 +2651,8 @@ void qeth_queue_input_buffer(struct qeth |
11564 |
+ qeth_get_micros() - |
11565 |
+ card->perf_stats.inbound_do_qdio_start_time; |
11566 |
+ if (rc) { |
11567 |
+- PRINT_WARN("qeth_queue_input_buffer's do_QDIO " |
11568 |
+- "return %i (device %s).\n", |
11569 |
+- rc, CARD_DDEV_ID(card)); |
11570 |
++ dev_warn(&card->gdev->dev, |
11571 |
++ "QDIO reported an error, rc=%i\n", rc); |
11572 |
+ QETH_DBF_TEXT(TRACE, 2, "qinberr"); |
11573 |
+ QETH_DBF_TEXT_(TRACE, 2, "%s", CARD_BUS_ID(card)); |
11574 |
+ } |
11575 |
+@@ -3730,6 +3750,7 @@ static void qeth_core_free_card(struct q |
11576 |
+ free_netdev(card->dev); |
11577 |
+ kfree(card->ip_tbd_list); |
11578 |
+ qeth_free_qdio_buffers(card); |
11579 |
++ unregister_service_level(&card->qeth_service_level); |
11580 |
+ kfree(card); |
11581 |
+ } |
11582 |
+ |
11583 |
+@@ -3766,7 +3787,8 @@ int qeth_core_hardsetup_card(struct qeth |
11584 |
+ atomic_set(&card->force_alloc_skb, 0); |
11585 |
+ retry: |
11586 |
+ if (retries < 3) { |
11587 |
+- PRINT_WARN("Retrying to do IDX activates.\n"); |
11588 |
++ QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", |
11589 |
++ dev_name(&card->gdev->dev)); |
11590 |
+ ccw_device_set_offline(CARD_DDEV(card)); |
11591 |
+ ccw_device_set_offline(CARD_WDEV(card)); |
11592 |
+ ccw_device_set_offline(CARD_RDEV(card)); |
11593 |
+@@ -3841,7 +3863,10 @@ retry: |
11594 |
+ } |
11595 |
+ return 0; |
11596 |
+ out: |
11597 |
+- PRINT_ERR("Initialization in hardsetup failed! rc=%d\n", rc); |
11598 |
++ dev_warn(&card->gdev->dev, "The qeth device driver failed to recover " |
11599 |
++ "an error on the device\n"); |
11600 |
++ QETH_DBF_MESSAGE(2, "%s Initialization in hardsetup failed! rc=%d\n", |
11601 |
++ dev_name(&card->gdev->dev), rc); |
11602 |
+ return rc; |
11603 |
+ } |
11604 |
+ EXPORT_SYMBOL_GPL(qeth_core_hardsetup_card); |
11605 |
+@@ -4061,8 +4086,8 @@ int qeth_core_load_discipline(struct qet |
11606 |
+ break; |
11607 |
+ } |
11608 |
+ if (!card->discipline.ccwgdriver) { |
11609 |
+- PRINT_ERR("Support for discipline %d not present\n", |
11610 |
+- discipline); |
11611 |
++ dev_err(&card->gdev->dev, "There is no kernel module to " |
11612 |
++ "support discipline %d\n", discipline); |
11613 |
+ rc = -EINVAL; |
11614 |
+ } |
11615 |
+ return rc; |
11616 |
+@@ -4455,7 +4480,7 @@ static int __init qeth_core_init(void) |
11617 |
+ { |
11618 |
+ int rc; |
11619 |
+ |
11620 |
+- PRINT_INFO("loading core functions\n"); |
11621 |
++ pr_info("loading core functions\n"); |
11622 |
+ INIT_LIST_HEAD(&qeth_core_card_list.list); |
11623 |
+ rwlock_init(&qeth_core_card_list.rwlock); |
11624 |
+ |
11625 |
+@@ -4495,9 +4520,10 @@ driver_err: |
11626 |
+ ccwgroup_err: |
11627 |
+ ccw_driver_unregister(&qeth_ccw_driver); |
11628 |
+ ccw_err: |
11629 |
++ QETH_DBF_MESSAGE(2, "Initialization failed with code %d\n", rc); |
11630 |
+ qeth_unregister_dbf_views(); |
11631 |
+ out_err: |
11632 |
+- PRINT_ERR("Initialization failed with code %d\n", rc); |
11633 |
++ pr_err("Initializing the qeth device driver failed\n"); |
11634 |
+ return rc; |
11635 |
+ } |
11636 |
+ |
11637 |
+@@ -4510,7 +4536,7 @@ static void __exit qeth_core_exit(void) |
11638 |
+ ccw_driver_unregister(&qeth_ccw_driver); |
11639 |
+ kmem_cache_destroy(qeth_core_header_cache); |
11640 |
+ qeth_unregister_dbf_views(); |
11641 |
+- PRINT_INFO("core functions removed\n"); |
11642 |
++ pr_info("core functions removed\n"); |
11643 |
+ } |
11644 |
+ |
11645 |
+ module_init(qeth_core_init); |
11646 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l2_main.c |
11647 |
+=================================================================== |
11648 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_l2_main.c |
11649 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l2_main.c |
11650 |
+@@ -8,6 +8,9 @@ |
11651 |
+ * Frank Blaschka <frank.blaschka@××××××.com> |
11652 |
+ */ |
11653 |
+ |
11654 |
++#define KMSG_COMPONENT "qeth" |
11655 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
11656 |
++ |
11657 |
+ #include <linux/module.h> |
11658 |
+ #include <linux/moduleparam.h> |
11659 |
+ #include <linux/string.h> |
11660 |
+@@ -503,12 +506,13 @@ static int qeth_l2_send_setmac_cb(struct |
11661 |
+ card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED; |
11662 |
+ memcpy(card->dev->dev_addr, cmd->data.setdelmac.mac, |
11663 |
+ OSA_ADDR_LEN); |
11664 |
+- PRINT_INFO("MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " |
11665 |
+- "successfully registered on device %s\n", |
11666 |
+- card->dev->dev_addr[0], card->dev->dev_addr[1], |
11667 |
+- card->dev->dev_addr[2], card->dev->dev_addr[3], |
11668 |
+- card->dev->dev_addr[4], card->dev->dev_addr[5], |
11669 |
+- card->dev->name); |
11670 |
++ dev_info(&card->gdev->dev, |
11671 |
++ "MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " |
11672 |
++ "successfully registered on device %s\n", |
11673 |
++ card->dev->dev_addr[0], card->dev->dev_addr[1], |
11674 |
++ card->dev->dev_addr[2], card->dev->dev_addr[3], |
11675 |
++ card->dev->dev_addr[4], card->dev->dev_addr[5], |
11676 |
++ card->dev->name); |
11677 |
+ } |
11678 |
+ return 0; |
11679 |
+ } |
11680 |
+@@ -1015,9 +1019,8 @@ static int __qeth_l2_set_online(struct c |
11681 |
+ if (rc) { |
11682 |
+ QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); |
11683 |
+ if (rc == 0xe080) { |
11684 |
+- PRINT_WARN("LAN on card %s if offline! " |
11685 |
+- "Waiting for STARTLAN from card.\n", |
11686 |
+- CARD_BUS_ID(card)); |
11687 |
++ dev_warn(&card->gdev->dev, |
11688 |
++ "The LAN is offline\n"); |
11689 |
+ card->lan_online = 0; |
11690 |
+ } |
11691 |
+ return rc; |
11692 |
+@@ -1117,8 +1120,8 @@ static int qeth_l2_recover(void *ptr) |
11693 |
+ if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD)) |
11694 |
+ return 0; |
11695 |
+ QETH_DBF_TEXT(TRACE, 2, "recover2"); |
11696 |
+- PRINT_WARN("Recovery of device %s started ...\n", |
11697 |
+- CARD_BUS_ID(card)); |
11698 |
++ dev_warn(&card->gdev->dev, |
11699 |
++ "A recovery process has been started for the device\n"); |
11700 |
+ card->use_hard_stop = 1; |
11701 |
+ __qeth_l2_set_offline(card->gdev, 1); |
11702 |
+ rc = __qeth_l2_set_online(card->gdev, 1); |
11703 |
+@@ -1126,27 +1129,27 @@ static int qeth_l2_recover(void *ptr) |
11704 |
+ qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); |
11705 |
+ qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); |
11706 |
+ if (!rc) |
11707 |
+- PRINT_INFO("Device %s successfully recovered!\n", |
11708 |
+- CARD_BUS_ID(card)); |
11709 |
++ dev_info(&card->gdev->dev, |
11710 |
++ "Device successfully recovered!\n"); |
11711 |
+ else { |
11712 |
+ rtnl_lock(); |
11713 |
+ dev_close(card->dev); |
11714 |
+ rtnl_unlock(); |
11715 |
+- PRINT_INFO("Device %s could not be recovered!\n", |
11716 |
+- CARD_BUS_ID(card)); |
11717 |
++ dev_warn(&card->gdev->dev, "The qeth device driver " |
11718 |
++ "failed to recover an error on the device\n"); |
11719 |
+ } |
11720 |
+ return 0; |
11721 |
+ } |
11722 |
+ |
11723 |
+ static int __init qeth_l2_init(void) |
11724 |
+ { |
11725 |
+- PRINT_INFO("register layer 2 discipline\n"); |
11726 |
++ pr_info("register layer 2 discipline\n"); |
11727 |
+ return 0; |
11728 |
+ } |
11729 |
+ |
11730 |
+ static void __exit qeth_l2_exit(void) |
11731 |
+ { |
11732 |
+- PRINT_INFO("unregister layer 2 discipline\n"); |
11733 |
++ pr_info("unregister layer 2 discipline\n"); |
11734 |
+ } |
11735 |
+ |
11736 |
+ static void qeth_l2_shutdown(struct ccwgroup_device *gdev) |
11737 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l3_main.c |
11738 |
+=================================================================== |
11739 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/net/qeth_l3_main.c |
11740 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/net/qeth_l3_main.c |
11741 |
+@@ -8,6 +8,9 @@ |
11742 |
+ * Frank Blaschka <frank.blaschka@××××××.com> |
11743 |
+ */ |
11744 |
+ |
11745 |
++#define KMSG_COMPONENT "qeth" |
11746 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
11747 |
++ |
11748 |
+ #include <linux/module.h> |
11749 |
+ #include <linux/moduleparam.h> |
11750 |
+ #include <linux/string.h> |
11751 |
+@@ -917,8 +920,8 @@ static int qeth_l3_register_addr_entry(s |
11752 |
+ if (rc) { |
11753 |
+ QETH_DBF_TEXT(TRACE, 2, "FAILED"); |
11754 |
+ qeth_l3_ipaddr_to_string(addr->proto, (u8 *)&addr->u, buf); |
11755 |
+- PRINT_WARN("Could not register IP address %s (rc=0x%x/%d)\n", |
11756 |
+- buf, rc, rc); |
11757 |
++ dev_warn(&card->gdev->dev, |
11758 |
++ "Registering IP address %s failed\n", buf); |
11759 |
+ } |
11760 |
+ return rc; |
11761 |
+ } |
11762 |
+@@ -1029,24 +1032,22 @@ static int qeth_l3_setadapter_parms(stru |
11763 |
+ QETH_DBF_TEXT(SETUP, 2, "setadprm"); |
11764 |
+ |
11765 |
+ if (!qeth_is_supported(card, IPA_SETADAPTERPARMS)) { |
11766 |
+- PRINT_WARN("set adapter parameters not supported " |
11767 |
+- "on device %s.\n", |
11768 |
+- CARD_BUS_ID(card)); |
11769 |
++ dev_info(&card->gdev->dev, |
11770 |
++ "set adapter parameters not supported.\n"); |
11771 |
+ QETH_DBF_TEXT(SETUP, 2, " notsupp"); |
11772 |
+ return 0; |
11773 |
+ } |
11774 |
+ rc = qeth_query_setadapterparms(card); |
11775 |
+ if (rc) { |
11776 |
+- PRINT_WARN("couldn't set adapter parameters on device %s: " |
11777 |
+- "x%x\n", CARD_BUS_ID(card), rc); |
11778 |
++ QETH_DBF_MESSAGE(2, "%s couldn't set adapter parameters: " |
11779 |
++ "0x%x\n", card->gdev->dev.bus_id, rc); |
11780 |
+ return rc; |
11781 |
+ } |
11782 |
+ if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) { |
11783 |
+ rc = qeth_setadpparms_change_macaddr(card); |
11784 |
+ if (rc) |
11785 |
+- PRINT_WARN("couldn't get MAC address on " |
11786 |
+- "device %s: x%x\n", |
11787 |
+- CARD_BUS_ID(card), rc); |
11788 |
++ dev_warn(&card->gdev->dev, "Reading the adapter MAC" |
11789 |
++ " address failed\n", rc); |
11790 |
+ } |
11791 |
+ |
11792 |
+ if ((card->info.link_type == QETH_LINK_TYPE_HSTR) || |
11793 |
+@@ -1160,16 +1161,17 @@ static int qeth_l3_start_ipa_arp_process |
11794 |
+ QETH_DBF_TEXT(TRACE, 3, "ipaarp"); |
11795 |
+ |
11796 |
+ if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { |
11797 |
+- PRINT_WARN("ARP processing not supported " |
11798 |
+- "on %s!\n", QETH_CARD_IFNAME(card)); |
11799 |
++ dev_info(&card->gdev->dev, |
11800 |
++ "ARP processing not supported on %s!\n", |
11801 |
++ QETH_CARD_IFNAME(card)); |
11802 |
+ return 0; |
11803 |
+ } |
11804 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, |
11805 |
+ IPA_CMD_ASS_START, 0); |
11806 |
+ if (rc) { |
11807 |
+- PRINT_WARN("Could not start ARP processing " |
11808 |
+- "assist on %s: 0x%x\n", |
11809 |
+- QETH_CARD_IFNAME(card), rc); |
11810 |
++ dev_warn(&card->gdev->dev, |
11811 |
++ "Starting ARP processing support for %s failed\n", |
11812 |
++ QETH_CARD_IFNAME(card)); |
11813 |
+ } |
11814 |
+ return rc; |
11815 |
+ } |
11816 |
+@@ -1181,19 +1183,21 @@ static int qeth_l3_start_ipa_ip_fragment |
11817 |
+ QETH_DBF_TEXT(TRACE, 3, "ipaipfrg"); |
11818 |
+ |
11819 |
+ if (!qeth_is_supported(card, IPA_IP_FRAGMENTATION)) { |
11820 |
+- PRINT_INFO("Hardware IP fragmentation not supported on %s\n", |
11821 |
+- QETH_CARD_IFNAME(card)); |
11822 |
++ dev_info(&card->gdev->dev, |
11823 |
++ "Hardware IP fragmentation not supported on %s\n", |
11824 |
++ QETH_CARD_IFNAME(card)); |
11825 |
+ return -EOPNOTSUPP; |
11826 |
+ } |
11827 |
+ |
11828 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_IP_FRAGMENTATION, |
11829 |
+ IPA_CMD_ASS_START, 0); |
11830 |
+ if (rc) { |
11831 |
+- PRINT_WARN("Could not start Hardware IP fragmentation " |
11832 |
+- "assist on %s: 0x%x\n", |
11833 |
+- QETH_CARD_IFNAME(card), rc); |
11834 |
++ dev_warn(&card->gdev->dev, |
11835 |
++ "Starting IP fragmentation support for %s failed\n", |
11836 |
++ QETH_CARD_IFNAME(card)); |
11837 |
+ } else |
11838 |
+- PRINT_INFO("Hardware IP fragmentation enabled \n"); |
11839 |
++ dev_info(&card->gdev->dev, |
11840 |
++ "Hardware IP fragmentation enabled \n"); |
11841 |
+ return rc; |
11842 |
+ } |
11843 |
+ |
11844 |
+@@ -1207,17 +1211,18 @@ static int qeth_l3_start_ipa_source_mac( |
11845 |
+ return -EOPNOTSUPP; |
11846 |
+ |
11847 |
+ if (!qeth_is_supported(card, IPA_SOURCE_MAC)) { |
11848 |
+- PRINT_INFO("Inbound source address not " |
11849 |
+- "supported on %s\n", QETH_CARD_IFNAME(card)); |
11850 |
++ dev_info(&card->gdev->dev, |
11851 |
++ "Inbound source address not supported on %s\n", |
11852 |
++ QETH_CARD_IFNAME(card)); |
11853 |
+ return -EOPNOTSUPP; |
11854 |
+ } |
11855 |
+ |
11856 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_SOURCE_MAC, |
11857 |
+ IPA_CMD_ASS_START, 0); |
11858 |
+ if (rc) |
11859 |
+- PRINT_WARN("Could not start inbound source " |
11860 |
+- "assist on %s: 0x%x\n", |
11861 |
+- QETH_CARD_IFNAME(card), rc); |
11862 |
++ dev_warn(&card->gdev->dev, |
11863 |
++ "Starting proxy ARP support for %s failed\n", |
11864 |
++ QETH_CARD_IFNAME(card)); |
11865 |
+ return rc; |
11866 |
+ } |
11867 |
+ |
11868 |
+@@ -1228,19 +1233,19 @@ static int qeth_l3_start_ipa_vlan(struct |
11869 |
+ QETH_DBF_TEXT(TRACE, 3, "strtvlan"); |
11870 |
+ |
11871 |
+ if (!qeth_is_supported(card, IPA_FULL_VLAN)) { |
11872 |
+- PRINT_WARN("VLAN not supported on %s\n", |
11873 |
+- QETH_CARD_IFNAME(card)); |
11874 |
++ dev_info(&card->gdev->dev, |
11875 |
++ "VLAN not supported on %s\n", QETH_CARD_IFNAME(card)); |
11876 |
+ return -EOPNOTSUPP; |
11877 |
+ } |
11878 |
+ |
11879 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_VLAN_PRIO, |
11880 |
+ IPA_CMD_ASS_START, 0); |
11881 |
+ if (rc) { |
11882 |
+- PRINT_WARN("Could not start vlan " |
11883 |
+- "assist on %s: 0x%x\n", |
11884 |
+- QETH_CARD_IFNAME(card), rc); |
11885 |
++ dev_warn(&card->gdev->dev, |
11886 |
++ "Starting VLAN support for %s failed\n", |
11887 |
++ QETH_CARD_IFNAME(card)); |
11888 |
+ } else { |
11889 |
+- PRINT_INFO("VLAN enabled \n"); |
11890 |
++ dev_info(&card->gdev->dev, "VLAN enabled\n"); |
11891 |
+ } |
11892 |
+ return rc; |
11893 |
+ } |
11894 |
+@@ -1252,19 +1257,20 @@ static int qeth_l3_start_ipa_multicast(s |
11895 |
+ QETH_DBF_TEXT(TRACE, 3, "stmcast"); |
11896 |
+ |
11897 |
+ if (!qeth_is_supported(card, IPA_MULTICASTING)) { |
11898 |
+- PRINT_WARN("Multicast not supported on %s\n", |
11899 |
+- QETH_CARD_IFNAME(card)); |
11900 |
++ dev_info(&card->gdev->dev, |
11901 |
++ "Multicast not supported on %s\n", |
11902 |
++ QETH_CARD_IFNAME(card)); |
11903 |
+ return -EOPNOTSUPP; |
11904 |
+ } |
11905 |
+ |
11906 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_MULTICASTING, |
11907 |
+ IPA_CMD_ASS_START, 0); |
11908 |
+ if (rc) { |
11909 |
+- PRINT_WARN("Could not start multicast " |
11910 |
+- "assist on %s: rc=%i\n", |
11911 |
+- QETH_CARD_IFNAME(card), rc); |
11912 |
++ dev_warn(&card->gdev->dev, |
11913 |
++ "Starting multicast support for %s failed\n", |
11914 |
++ QETH_CARD_IFNAME(card)); |
11915 |
+ } else { |
11916 |
+- PRINT_INFO("Multicast enabled\n"); |
11917 |
++ dev_info(&card->gdev->dev, "Multicast enabled\n"); |
11918 |
+ card->dev->flags |= IFF_MULTICAST; |
11919 |
+ } |
11920 |
+ return rc; |
11921 |
+@@ -1315,36 +1321,37 @@ static int qeth_l3_softsetup_ipv6(struct |
11922 |
+ |
11923 |
+ rc = qeth_l3_query_ipassists(card, QETH_PROT_IPV6); |
11924 |
+ if (rc) { |
11925 |
+- PRINT_ERR("IPv6 query ipassist failed on %s\n", |
11926 |
+- QETH_CARD_IFNAME(card)); |
11927 |
++ dev_err(&card->gdev->dev, |
11928 |
++ "Activating IPv6 support for %s failed\n", |
11929 |
++ QETH_CARD_IFNAME(card)); |
11930 |
+ return rc; |
11931 |
+ } |
11932 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_IPV6, |
11933 |
+ IPA_CMD_ASS_START, 3); |
11934 |
+ if (rc) { |
11935 |
+- PRINT_WARN("IPv6 start assist (version 4) failed " |
11936 |
+- "on %s: 0x%x\n", |
11937 |
+- QETH_CARD_IFNAME(card), rc); |
11938 |
++ dev_warn(&card->gdev->dev, |
11939 |
++ "Activating IPv6 support for %s failed\n", |
11940 |
++ QETH_CARD_IFNAME(card)); |
11941 |
+ return rc; |
11942 |
+ } |
11943 |
+ rc = qeth_l3_send_simple_setassparms_ipv6(card, IPA_IPV6, |
11944 |
+ IPA_CMD_ASS_START); |
11945 |
+ if (rc) { |
11946 |
+- PRINT_WARN("IPV6 start assist (version 6) failed " |
11947 |
+- "on %s: 0x%x\n", |
11948 |
+- QETH_CARD_IFNAME(card), rc); |
11949 |
++ dev_warn(&card->gdev->dev, |
11950 |
++ "Activating IPv6 support for %s failed\n", |
11951 |
++ QETH_CARD_IFNAME(card)); |
11952 |
+ return rc; |
11953 |
+ } |
11954 |
+ rc = qeth_l3_send_simple_setassparms_ipv6(card, IPA_PASSTHRU, |
11955 |
+ IPA_CMD_ASS_START); |
11956 |
+ if (rc) { |
11957 |
+- PRINT_WARN("Could not enable passthrough " |
11958 |
+- "on %s: 0x%x\n", |
11959 |
+- QETH_CARD_IFNAME(card), rc); |
11960 |
++ dev_warn(&card->gdev->dev, |
11961 |
++ "Enabling the passthrough mode for %s failed\n", |
11962 |
++ QETH_CARD_IFNAME(card)); |
11963 |
+ return rc; |
11964 |
+ } |
11965 |
+ out: |
11966 |
+- PRINT_INFO("IPV6 enabled \n"); |
11967 |
++ dev_info(&card->gdev->dev, "IPV6 enabled\n"); |
11968 |
+ return 0; |
11969 |
+ } |
11970 |
+ #endif |
11971 |
+@@ -1356,8 +1363,8 @@ static int qeth_l3_start_ipa_ipv6(struct |
11972 |
+ QETH_DBF_TEXT(TRACE, 3, "strtipv6"); |
11973 |
+ |
11974 |
+ if (!qeth_is_supported(card, IPA_IPV6)) { |
11975 |
+- PRINT_WARN("IPv6 not supported on %s\n", |
11976 |
+- QETH_CARD_IFNAME(card)); |
11977 |
++ dev_info(&card->gdev->dev, |
11978 |
++ "IPv6 not supported on %s\n", QETH_CARD_IFNAME(card)); |
11979 |
+ return 0; |
11980 |
+ } |
11981 |
+ #ifdef CONFIG_QETH_IPV6 |
11982 |
+@@ -1373,34 +1380,35 @@ static int qeth_l3_start_ipa_broadcast(s |
11983 |
+ QETH_DBF_TEXT(TRACE, 3, "stbrdcst"); |
11984 |
+ card->info.broadcast_capable = 0; |
11985 |
+ if (!qeth_is_supported(card, IPA_FILTERING)) { |
11986 |
+- PRINT_WARN("Broadcast not supported on %s\n", |
11987 |
+- QETH_CARD_IFNAME(card)); |
11988 |
++ dev_info(&card->gdev->dev, |
11989 |
++ "Broadcast not supported on %s\n", |
11990 |
++ QETH_CARD_IFNAME(card)); |
11991 |
+ rc = -EOPNOTSUPP; |
11992 |
+ goto out; |
11993 |
+ } |
11994 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_FILTERING, |
11995 |
+ IPA_CMD_ASS_START, 0); |
11996 |
+ if (rc) { |
11997 |
+- PRINT_WARN("Could not enable broadcasting filtering " |
11998 |
+- "on %s: 0x%x\n", |
11999 |
+- QETH_CARD_IFNAME(card), rc); |
12000 |
++ dev_warn(&card->gdev->dev, "Enabling broadcast filtering for " |
12001 |
++ "%s failed\n", QETH_CARD_IFNAME(card)); |
12002 |
+ goto out; |
12003 |
+ } |
12004 |
+ |
12005 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_FILTERING, |
12006 |
+ IPA_CMD_ASS_CONFIGURE, 1); |
12007 |
+ if (rc) { |
12008 |
+- PRINT_WARN("Could not set up broadcast filtering on %s: 0x%x\n", |
12009 |
+- QETH_CARD_IFNAME(card), rc); |
12010 |
++ dev_warn(&card->gdev->dev, |
12011 |
++ "Setting up broadcast filtering for %s failed\n", |
12012 |
++ QETH_CARD_IFNAME(card)); |
12013 |
+ goto out; |
12014 |
+ } |
12015 |
+ card->info.broadcast_capable = QETH_BROADCAST_WITH_ECHO; |
12016 |
+- PRINT_INFO("Broadcast enabled \n"); |
12017 |
++ dev_info(&card->gdev->dev, "Broadcast enabled\n"); |
12018 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_FILTERING, |
12019 |
+ IPA_CMD_ASS_ENABLE, 1); |
12020 |
+ if (rc) { |
12021 |
+- PRINT_WARN("Could not set up broadcast echo filtering on " |
12022 |
+- "%s: 0x%x\n", QETH_CARD_IFNAME(card), rc); |
12023 |
++ dev_warn(&card->gdev->dev, "Setting up broadcast echo " |
12024 |
++ "filtering for %s failed\n", QETH_CARD_IFNAME(card)); |
12025 |
+ goto out; |
12026 |
+ } |
12027 |
+ card->info.broadcast_capable = QETH_BROADCAST_WITHOUT_ECHO; |
12028 |
+@@ -1419,18 +1427,18 @@ static int qeth_l3_send_checksum_command |
12029 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_INBOUND_CHECKSUM, |
12030 |
+ IPA_CMD_ASS_START, 0); |
12031 |
+ if (rc) { |
12032 |
+- PRINT_WARN("Starting Inbound HW Checksumming failed on %s: " |
12033 |
+- "0x%x,\ncontinuing using Inbound SW Checksumming\n", |
12034 |
+- QETH_CARD_IFNAME(card), rc); |
12035 |
++ dev_warn(&card->gdev->dev, "Starting HW checksumming for %s " |
12036 |
++ "failed, using SW checksumming\n", |
12037 |
++ QETH_CARD_IFNAME(card)); |
12038 |
+ return rc; |
12039 |
+ } |
12040 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_INBOUND_CHECKSUM, |
12041 |
+ IPA_CMD_ASS_ENABLE, |
12042 |
+ card->info.csum_mask); |
12043 |
+ if (rc) { |
12044 |
+- PRINT_WARN("Enabling Inbound HW Checksumming failed on %s: " |
12045 |
+- "0x%x,\ncontinuing using Inbound SW Checksumming\n", |
12046 |
+- QETH_CARD_IFNAME(card), rc); |
12047 |
++ dev_warn(&card->gdev->dev, "Enabling HW checksumming for %s " |
12048 |
++ "failed, using SW checksumming\n", |
12049 |
++ QETH_CARD_IFNAME(card)); |
12050 |
+ return rc; |
12051 |
+ } |
12052 |
+ return 0; |
12053 |
+@@ -1443,26 +1451,30 @@ static int qeth_l3_start_ipa_checksum(st |
12054 |
+ QETH_DBF_TEXT(TRACE, 3, "strtcsum"); |
12055 |
+ |
12056 |
+ if (card->options.checksum_type == NO_CHECKSUMMING) { |
12057 |
+- PRINT_WARN("Using no checksumming on %s.\n", |
12058 |
+- QETH_CARD_IFNAME(card)); |
12059 |
++ dev_info(&card->gdev->dev, |
12060 |
++ "Using no checksumming on %s.\n", |
12061 |
++ QETH_CARD_IFNAME(card)); |
12062 |
+ return 0; |
12063 |
+ } |
12064 |
+ if (card->options.checksum_type == SW_CHECKSUMMING) { |
12065 |
+- PRINT_WARN("Using SW checksumming on %s.\n", |
12066 |
+- QETH_CARD_IFNAME(card)); |
12067 |
++ dev_info(&card->gdev->dev, |
12068 |
++ "Using SW checksumming on %s.\n", |
12069 |
++ QETH_CARD_IFNAME(card)); |
12070 |
+ return 0; |
12071 |
+ } |
12072 |
+ if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) { |
12073 |
+- PRINT_WARN("Inbound HW Checksumming not " |
12074 |
+- "supported on %s,\ncontinuing " |
12075 |
+- "using Inbound SW Checksumming\n", |
12076 |
+- QETH_CARD_IFNAME(card)); |
12077 |
++ dev_info(&card->gdev->dev, |
12078 |
++ "Inbound HW Checksumming not " |
12079 |
++ "supported on %s,\ncontinuing " |
12080 |
++ "using Inbound SW Checksumming\n", |
12081 |
++ QETH_CARD_IFNAME(card)); |
12082 |
+ card->options.checksum_type = SW_CHECKSUMMING; |
12083 |
+ return 0; |
12084 |
+ } |
12085 |
+ rc = qeth_l3_send_checksum_command(card); |
12086 |
+ if (!rc) |
12087 |
+- PRINT_INFO("HW Checksumming (inbound) enabled \n"); |
12088 |
++ dev_info(&card->gdev->dev, |
12089 |
++ "HW Checksumming (inbound) enabled\n"); |
12090 |
+ |
12091 |
+ return rc; |
12092 |
+ } |
12093 |
+@@ -1474,18 +1486,20 @@ static int qeth_l3_start_ipa_tso(struct |
12094 |
+ QETH_DBF_TEXT(TRACE, 3, "sttso"); |
12095 |
+ |
12096 |
+ if (!qeth_is_supported(card, IPA_OUTBOUND_TSO)) { |
12097 |
+- PRINT_WARN("Outbound TSO not supported on %s\n", |
12098 |
+- QETH_CARD_IFNAME(card)); |
12099 |
++ dev_info(&card->gdev->dev, |
12100 |
++ "Outbound TSO not supported on %s\n", |
12101 |
++ QETH_CARD_IFNAME(card)); |
12102 |
+ rc = -EOPNOTSUPP; |
12103 |
+ } else { |
12104 |
+ rc = qeth_l3_send_simple_setassparms(card, IPA_OUTBOUND_TSO, |
12105 |
+ IPA_CMD_ASS_START, 0); |
12106 |
+ if (rc) |
12107 |
+- PRINT_WARN("Could not start outbound TSO " |
12108 |
+- "assist on %s: rc=%i\n", |
12109 |
+- QETH_CARD_IFNAME(card), rc); |
12110 |
++ dev_warn(&card->gdev->dev, "Starting outbound TCP " |
12111 |
++ "segmentation offload for %s failed\n", |
12112 |
++ QETH_CARD_IFNAME(card)); |
12113 |
+ else |
12114 |
+- PRINT_INFO("Outbound TSO enabled\n"); |
12115 |
++ dev_info(&card->gdev->dev, |
12116 |
++ "Outbound TSO enabled\n"); |
12117 |
+ } |
12118 |
+ if (rc && (card->options.large_send == QETH_LARGE_SEND_TSO)) { |
12119 |
+ card->options.large_send = QETH_LARGE_SEND_NO; |
12120 |
+@@ -1578,12 +1592,8 @@ static int qeth_l3_get_unique_id_cb(stru |
12121 |
+ else { |
12122 |
+ card->info.unique_id = UNIQUE_ID_IF_CREATE_ADDR_FAILED | |
12123 |
+ UNIQUE_ID_NOT_BY_CARD; |
12124 |
+- PRINT_WARN("couldn't get a unique id from the card on device " |
12125 |
+- "%s (result=x%x), using default id. ipv6 " |
12126 |
+- "autoconfig on other lpars may lead to duplicate " |
12127 |
+- "ip addresses. please use manually " |
12128 |
+- "configured ones.\n", |
12129 |
+- CARD_BUS_ID(card), cmd->hdr.return_code); |
12130 |
++ dev_warn(&card->gdev->dev, "The network adapter failed to " |
12131 |
++ "generate a unique ID\n"); |
12132 |
+ } |
12133 |
+ return 0; |
12134 |
+ } |
12135 |
+@@ -3086,9 +3096,8 @@ static int __qeth_l3_set_online(struct c |
12136 |
+ if (rc) { |
12137 |
+ QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); |
12138 |
+ if (rc == 0xe080) { |
12139 |
+- PRINT_WARN("LAN on card %s if offline! " |
12140 |
+- "Waiting for STARTLAN from card.\n", |
12141 |
+- CARD_BUS_ID(card)); |
12142 |
++ dev_warn(&card->gdev->dev, |
12143 |
++ "The LAN is offline\n"); |
12144 |
+ card->lan_online = 0; |
12145 |
+ } |
12146 |
+ return rc; |
12147 |
+@@ -3194,8 +3203,8 @@ static int qeth_l3_recover(void *ptr) |
12148 |
+ if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD)) |
12149 |
+ return 0; |
12150 |
+ QETH_DBF_TEXT(TRACE, 2, "recover2"); |
12151 |
+- PRINT_WARN("Recovery of device %s started ...\n", |
12152 |
+- CARD_BUS_ID(card)); |
12153 |
++ dev_warn(&card->gdev->dev, |
12154 |
++ "A recovery process has been started for the device\n"); |
12155 |
+ card->use_hard_stop = 1; |
12156 |
+ __qeth_l3_set_offline(card->gdev, 1); |
12157 |
+ rc = __qeth_l3_set_online(card->gdev, 1); |
12158 |
+@@ -3203,14 +3212,14 @@ static int qeth_l3_recover(void *ptr) |
12159 |
+ qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); |
12160 |
+ qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); |
12161 |
+ if (!rc) |
12162 |
+- PRINT_INFO("Device %s successfully recovered!\n", |
12163 |
+- CARD_BUS_ID(card)); |
12164 |
++ dev_info(&card->gdev->dev, |
12165 |
++ "Device successfully recovered!\n"); |
12166 |
+ else { |
12167 |
+ rtnl_lock(); |
12168 |
+ dev_close(card->dev); |
12169 |
+ rtnl_unlock(); |
12170 |
+- PRINT_INFO("Device %s could not be recovered!\n", |
12171 |
+- CARD_BUS_ID(card)); |
12172 |
++ dev_warn(&card->gdev->dev, "The qeth device driver " |
12173 |
++ "failed to recover an error on the device\n"); |
12174 |
+ } |
12175 |
+ return 0; |
12176 |
+ } |
12177 |
+@@ -3344,7 +3353,7 @@ static int qeth_l3_register_notifiers(vo |
12178 |
+ return rc; |
12179 |
+ } |
12180 |
+ #else |
12181 |
+- PRINT_WARN("layer 3 discipline no IPv6 support\n"); |
12182 |
++ pr_warning("There is no IPv6 support for the layer 3 discipline\n"); |
12183 |
+ #endif |
12184 |
+ return 0; |
12185 |
+ } |
12186 |
+@@ -3363,7 +3372,7 @@ static int __init qeth_l3_init(void) |
12187 |
+ { |
12188 |
+ int rc = 0; |
12189 |
+ |
12190 |
+- PRINT_INFO("register layer 3 discipline\n"); |
12191 |
++ pr_info("register layer 3 discipline\n"); |
12192 |
+ rc = qeth_l3_register_notifiers(); |
12193 |
+ return rc; |
12194 |
+ } |
12195 |
+@@ -3371,7 +3380,7 @@ static int __init qeth_l3_init(void) |
12196 |
+ static void __exit qeth_l3_exit(void) |
12197 |
+ { |
12198 |
+ qeth_l3_unregister_notifiers(); |
12199 |
+- PRINT_INFO("unregister layer 3 discipline\n"); |
12200 |
++ pr_info("unregister layer 3 discipline\n"); |
12201 |
+ } |
12202 |
+ |
12203 |
+ module_init(qeth_l3_init); |
12204 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_aux.c |
12205 |
+=================================================================== |
12206 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_aux.c |
12207 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_aux.c |
12208 |
+@@ -25,7 +25,11 @@ |
12209 |
+ * Sven Schuetz |
12210 |
+ */ |
12211 |
+ |
12212 |
++#define KMSG_COMPONENT "zfcp" |
12213 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12214 |
++ |
12215 |
+ #include <linux/miscdevice.h> |
12216 |
++#include <linux/seq_file.h> |
12217 |
+ #include "zfcp_ext.h" |
12218 |
+ |
12219 |
+ static char *device; |
12220 |
+@@ -100,7 +104,7 @@ static int __init zfcp_device_setup(char |
12221 |
+ |
12222 |
+ err_out: |
12223 |
+ kfree(str); |
12224 |
+- pr_err("zfcp: %s is not a valid SCSI device\n", devstr); |
12225 |
++ pr_err("%s is not a valid SCSI device\n", devstr); |
12226 |
+ return 0; |
12227 |
+ } |
12228 |
+ |
12229 |
+@@ -184,13 +188,13 @@ static int __init zfcp_module_init(void) |
12230 |
+ |
12231 |
+ retval = misc_register(&zfcp_cfdc_misc); |
12232 |
+ if (retval) { |
12233 |
+- pr_err("zfcp: Registering the misc device zfcp_cfdc failed\n"); |
12234 |
++ pr_err("Registering the misc device zfcp_cfdc failed\n"); |
12235 |
+ goto out_misc; |
12236 |
+ } |
12237 |
+ |
12238 |
+ retval = zfcp_ccw_register(); |
12239 |
+ if (retval) { |
12240 |
+- pr_err("zfcp: The zfcp device driver could not register with " |
12241 |
++ pr_err("The zfcp device driver could not register with " |
12242 |
+ "the common I/O layer\n"); |
12243 |
+ goto out_ccw_register; |
12244 |
+ } |
12245 |
+@@ -434,6 +438,16 @@ static void _zfcp_status_read_scheduler( |
12246 |
+ stat_work)); |
12247 |
+ } |
12248 |
+ |
12249 |
++static void zfcp_print_sl(struct seq_file *m, struct service_level *sl) |
12250 |
++{ |
12251 |
++ struct zfcp_adapter *adapter = |
12252 |
++ container_of(sl, struct zfcp_adapter, service_level); |
12253 |
++ |
12254 |
++ seq_printf(m, "zfcp: %s microcode level %x\n", |
12255 |
++ dev_name(&adapter->ccw_device->dev), |
12256 |
++ adapter->fsf_lic_version); |
12257 |
++} |
12258 |
++ |
12259 |
+ /** |
12260 |
+ * zfcp_adapter_enqueue - enqueue a new adapter to the list |
12261 |
+ * @ccw_device: pointer to the struct cc_device |
12262 |
+@@ -498,6 +512,8 @@ int zfcp_adapter_enqueue(struct ccw_devi |
12263 |
+ INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler); |
12264 |
+ INIT_WORK(&adapter->scan_work, _zfcp_scan_ports_later); |
12265 |
+ |
12266 |
++ adapter->service_level.seq_print = zfcp_print_sl; |
12267 |
++ |
12268 |
+ /* mark adapter unusable as long as sysfs registration is not complete */ |
12269 |
+ atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); |
12270 |
+ |
12271 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_ccw.c |
12272 |
+=================================================================== |
12273 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_ccw.c |
12274 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_ccw.c |
12275 |
+@@ -6,6 +6,9 @@ |
12276 |
+ * Copyright IBM Corporation 2002, 2008 |
12277 |
+ */ |
12278 |
+ |
12279 |
++#define KMSG_COMPONENT "zfcp" |
12280 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12281 |
++ |
12282 |
+ #include "zfcp_ext.h" |
12283 |
+ |
12284 |
+ /** |
12285 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_cfdc.c |
12286 |
+=================================================================== |
12287 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_cfdc.c |
12288 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_cfdc.c |
12289 |
+@@ -7,6 +7,9 @@ |
12290 |
+ * Copyright IBM Corporation 2008 |
12291 |
+ */ |
12292 |
+ |
12293 |
++#define KMSG_COMPONENT "zfcp" |
12294 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12295 |
++ |
12296 |
+ #include <linux/types.h> |
12297 |
+ #include <linux/miscdevice.h> |
12298 |
+ #include <asm/ccwdev.h> |
12299 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_dbf.c |
12300 |
+=================================================================== |
12301 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_dbf.c |
12302 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_dbf.c |
12303 |
+@@ -6,6 +6,9 @@ |
12304 |
+ * Copyright IBM Corporation 2002, 2008 |
12305 |
+ */ |
12306 |
+ |
12307 |
++#define KMSG_COMPONENT "zfcp" |
12308 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12309 |
++ |
12310 |
+ #include <linux/ctype.h> |
12311 |
+ #include <asm/debug.h> |
12312 |
+ #include "zfcp_ext.h" |
12313 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_def.h |
12314 |
+=================================================================== |
12315 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_def.h |
12316 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_def.h |
12317 |
+@@ -33,6 +33,7 @@ |
12318 |
+ #include <asm/qdio.h> |
12319 |
+ #include <asm/debug.h> |
12320 |
+ #include <asm/ebcdic.h> |
12321 |
++#include <asm/sysinfo.h> |
12322 |
+ #include "zfcp_dbf.h" |
12323 |
+ #include "zfcp_fsf.h" |
12324 |
+ |
12325 |
+@@ -515,6 +516,7 @@ struct zfcp_adapter { |
12326 |
+ struct fsf_qtcb_bottom_port *stats_reset_data; |
12327 |
+ unsigned long stats_reset; |
12328 |
+ struct work_struct scan_work; |
12329 |
++ struct service_level service_level; |
12330 |
+ atomic_t qdio_outb_full; /* queue full incidents */ |
12331 |
+ }; |
12332 |
+ |
12333 |
+@@ -583,6 +585,8 @@ struct zfcp_fsf_req { |
12334 |
+ unsigned long long issued; /* request sent time (STCK) */ |
12335 |
+ struct zfcp_unit *unit; |
12336 |
+ void (*handler)(struct zfcp_fsf_req *); |
12337 |
++ u16 qdio_outb_usage;/* usage of outbound queue */ |
12338 |
++ u16 qdio_inb_usage; /* usage of inbound queue */ |
12339 |
+ }; |
12340 |
+ |
12341 |
+ /* driver data */ |
12342 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_erp.c |
12343 |
+=================================================================== |
12344 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_erp.c |
12345 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_erp.c |
12346 |
+@@ -6,6 +6,9 @@ |
12347 |
+ * Copyright IBM Corporation 2002, 2008 |
12348 |
+ */ |
12349 |
+ |
12350 |
++#define KMSG_COMPONENT "zfcp" |
12351 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12352 |
++ |
12353 |
+ #include "zfcp_ext.h" |
12354 |
+ |
12355 |
+ #define ZFCP_MAX_ERPS 3 |
12356 |
+@@ -1282,8 +1285,11 @@ static void zfcp_erp_action_cleanup(stru |
12357 |
+ break; |
12358 |
+ |
12359 |
+ case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
12360 |
+- if (result != ZFCP_ERP_SUCCEEDED) |
12361 |
++ if (result != ZFCP_ERP_SUCCEEDED) { |
12362 |
++ unregister_service_level(&adapter->service_level); |
12363 |
+ zfcp_erp_rports_del(adapter); |
12364 |
++ } else |
12365 |
++ register_service_level(&adapter->service_level); |
12366 |
+ zfcp_adapter_put(adapter); |
12367 |
+ break; |
12368 |
+ } |
12369 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fc.c |
12370 |
+=================================================================== |
12371 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_fc.c |
12372 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fc.c |
12373 |
+@@ -6,6 +6,9 @@ |
12374 |
+ * Copyright IBM Corporation 2008 |
12375 |
+ */ |
12376 |
+ |
12377 |
++#define KMSG_COMPONENT "zfcp" |
12378 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12379 |
++ |
12380 |
+ #include "zfcp_ext.h" |
12381 |
+ |
12382 |
+ struct ct_iu_gpn_ft_req { |
12383 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.c |
12384 |
+=================================================================== |
12385 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_fsf.c |
12386 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.c |
12387 |
+@@ -6,6 +6,10 @@ |
12388 |
+ * Copyright IBM Corporation 2002, 2008 |
12389 |
+ */ |
12390 |
+ |
12391 |
++#define KMSG_COMPONENT "zfcp" |
12392 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12393 |
++ |
12394 |
++#include <linux/blktrace_api.h> |
12395 |
+ #include "zfcp_ext.h" |
12396 |
+ |
12397 |
+ static void zfcp_fsf_request_timeout_handler(unsigned long data) |
12398 |
+@@ -778,6 +782,7 @@ static int zfcp_fsf_req_send(struct zfcp |
12399 |
+ list_add_tail(&req->list, &adapter->req_list[idx]); |
12400 |
+ spin_unlock_irqrestore(&adapter->req_list_lock, flags); |
12401 |
+ |
12402 |
++ req->qdio_outb_usage = atomic_read(&req_q->count); |
12403 |
+ req->issued = get_clock(); |
12404 |
+ if (zfcp_qdio_send(req)) { |
12405 |
+ del_timer(&req->timer); |
12406 |
+@@ -2079,6 +2084,36 @@ static void zfcp_fsf_req_latency(struct |
12407 |
+ spin_unlock_irqrestore(&unit->latencies.lock, flags); |
12408 |
+ } |
12409 |
+ |
12410 |
++#ifdef CONFIG_BLK_DEV_IO_TRACE |
12411 |
++static void zfcp_fsf_trace_latency(struct zfcp_fsf_req *fsf_req) |
12412 |
++{ |
12413 |
++ struct fsf_qual_latency_info *lat_inf; |
12414 |
++ struct scsi_cmnd *scsi_cmnd = (struct scsi_cmnd *)fsf_req->data; |
12415 |
++ struct request *req = scsi_cmnd->request; |
12416 |
++ struct zfcp_blk_drv_data trace; |
12417 |
++ int ticks = fsf_req->adapter->timer_ticks; |
12418 |
++ |
12419 |
++ trace.flags = 0; |
12420 |
++ trace.magic = ZFCP_BLK_DRV_DATA_MAGIC; |
12421 |
++ if (fsf_req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA) { |
12422 |
++ trace.flags |= ZFCP_BLK_LAT_VALID; |
12423 |
++ lat_inf = &fsf_req->qtcb->prefix.prot_status_qual.latency_info; |
12424 |
++ trace.channel_lat = lat_inf->channel_lat * ticks; |
12425 |
++ trace.fabric_lat = lat_inf->fabric_lat * ticks; |
12426 |
++ } |
12427 |
++ if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) |
12428 |
++ trace.flags |= ZFCP_BLK_REQ_ERROR; |
12429 |
++ trace.inb_usage = fsf_req->qdio_inb_usage; |
12430 |
++ trace.outb_usage = fsf_req->qdio_outb_usage; |
12431 |
++ |
12432 |
++ blk_add_driver_data(req->q, req, &trace, sizeof(trace)); |
12433 |
++} |
12434 |
++#else |
12435 |
++static inline void zfcp_fsf_trace_latency(struct zfcp_fsf_req *fsf_req) |
12436 |
++{ |
12437 |
++} |
12438 |
++#endif |
12439 |
++ |
12440 |
+ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req) |
12441 |
+ { |
12442 |
+ struct scsi_cmnd *scpnt; |
12443 |
+@@ -2114,6 +2149,8 @@ static void zfcp_fsf_send_fcp_command_ta |
12444 |
+ if (req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA) |
12445 |
+ zfcp_fsf_req_latency(req); |
12446 |
+ |
12447 |
++ zfcp_fsf_trace_latency(req); |
12448 |
++ |
12449 |
+ if (unlikely(fcp_rsp_iu->validity.bits.fcp_rsp_len_valid)) { |
12450 |
+ if (fcp_rsp_info[3] == RSP_CODE_GOOD) |
12451 |
+ set_host_byte(scpnt, DID_OK); |
12452 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.h |
12453 |
+=================================================================== |
12454 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_fsf.h |
12455 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_fsf.h |
12456 |
+@@ -439,4 +439,16 @@ struct fsf_qtcb { |
12457 |
+ u8 log[FSF_QTCB_LOG_SIZE]; |
12458 |
+ } __attribute__ ((packed)); |
12459 |
+ |
12460 |
++struct zfcp_blk_drv_data { |
12461 |
++#define ZFCP_BLK_DRV_DATA_MAGIC 0x1 |
12462 |
++ u32 magic; |
12463 |
++#define ZFCP_BLK_LAT_VALID 0x1 |
12464 |
++#define ZFCP_BLK_REQ_ERROR 0x2 |
12465 |
++ u16 flags; |
12466 |
++ u8 inb_usage; |
12467 |
++ u8 outb_usage; |
12468 |
++ u64 channel_lat; |
12469 |
++ u64 fabric_lat; |
12470 |
++} __attribute__ ((packed)); |
12471 |
++ |
12472 |
+ #endif /* FSF_H */ |
12473 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_qdio.c |
12474 |
+=================================================================== |
12475 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_qdio.c |
12476 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_qdio.c |
12477 |
+@@ -6,6 +6,9 @@ |
12478 |
+ * Copyright IBM Corporation 2002, 2008 |
12479 |
+ */ |
12480 |
+ |
12481 |
++#define KMSG_COMPONENT "zfcp" |
12482 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12483 |
++ |
12484 |
+ #include "zfcp_ext.h" |
12485 |
+ |
12486 |
+ /* FIXME(tune): free space should be one max. SBAL chain plus what? */ |
12487 |
+@@ -115,6 +118,7 @@ static void zfcp_qdio_reqid_check(struct |
12488 |
+ spin_unlock_irqrestore(&adapter->req_list_lock, flags); |
12489 |
+ |
12490 |
+ fsf_req->sbal_response = sbal_idx; |
12491 |
++ fsf_req->qdio_inb_usage = atomic_read(&adapter->resp_q.count); |
12492 |
+ zfcp_fsf_req_complete(fsf_req); |
12493 |
+ } |
12494 |
+ |
12495 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_scsi.c |
12496 |
+=================================================================== |
12497 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_scsi.c |
12498 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_scsi.c |
12499 |
+@@ -6,6 +6,9 @@ |
12500 |
+ * Copyright IBM Corporation 2002, 2008 |
12501 |
+ */ |
12502 |
+ |
12503 |
++#define KMSG_COMPONENT "zfcp" |
12504 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12505 |
++ |
12506 |
+ #include "zfcp_ext.h" |
12507 |
+ #include <asm/atomic.h> |
12508 |
+ |
12509 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_sysfs.c |
12510 |
+=================================================================== |
12511 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/scsi/zfcp_sysfs.c |
12512 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/scsi/zfcp_sysfs.c |
12513 |
+@@ -6,6 +6,9 @@ |
12514 |
+ * Copyright IBM Corporation 2008 |
12515 |
+ */ |
12516 |
+ |
12517 |
++#define KMSG_COMPONENT "zfcp" |
12518 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12519 |
++ |
12520 |
+ #include "zfcp_ext.h" |
12521 |
+ |
12522 |
+ #define ZFCP_DEV_ATTR(_feat, _name, _mode, _show, _store) \ |
12523 |
+Index: linux-2.6.27-gentoo-r7/drivers/s390/sysinfo.c |
12524 |
+=================================================================== |
12525 |
+--- linux-2.6.27-gentoo-r7.orig/drivers/s390/sysinfo.c |
12526 |
++++ linux-2.6.27-gentoo-r7/drivers/s390/sysinfo.c |
12527 |
+@@ -1,17 +1,21 @@ |
12528 |
+ /* |
12529 |
+ * drivers/s390/sysinfo.c |
12530 |
+ * |
12531 |
+- * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation |
12532 |
+- * Author(s): Ulrich Weigand (Ulrich.Weigand@××××××.com) |
12533 |
++ * Copyright IBM Corp. 2001, 2008 |
12534 |
++ * Author(s): Ulrich Weigand (Ulrich.Weigand@××××××.com) |
12535 |
++ * Martin Schwidefsky <schwidefsky@××××××.com> |
12536 |
+ */ |
12537 |
+ |
12538 |
+ #include <linux/kernel.h> |
12539 |
+ #include <linux/mm.h> |
12540 |
+ #include <linux/proc_fs.h> |
12541 |
++#include <linux/seq_file.h> |
12542 |
+ #include <linux/init.h> |
12543 |
+ #include <linux/delay.h> |
12544 |
++#include <linux/module.h> |
12545 |
+ #include <asm/ebcdic.h> |
12546 |
+ #include <asm/sysinfo.h> |
12547 |
++#include <asm/cpcmd.h> |
12548 |
+ |
12549 |
+ /* Sigh, math-emu. Don't ask. */ |
12550 |
+ #include <asm/sfp-util.h> |
12551 |
+@@ -271,6 +275,125 @@ static __init int create_proc_sysinfo(vo |
12552 |
+ |
12553 |
+ __initcall(create_proc_sysinfo); |
12554 |
+ |
12555 |
++/* |
12556 |
++ * Service levels interface. |
12557 |
++ */ |
12558 |
++ |
12559 |
++static DECLARE_RWSEM(service_level_sem); |
12560 |
++static LIST_HEAD(service_level_list); |
12561 |
++ |
12562 |
++int register_service_level(struct service_level *slr) |
12563 |
++{ |
12564 |
++ struct service_level *ptr; |
12565 |
++ |
12566 |
++ down_write(&service_level_sem); |
12567 |
++ list_for_each_entry(ptr, &service_level_list, list) |
12568 |
++ if (ptr == slr) { |
12569 |
++ up_write(&service_level_sem); |
12570 |
++ return -EEXIST; |
12571 |
++ } |
12572 |
++ list_add_tail(&slr->list, &service_level_list); |
12573 |
++ up_write(&service_level_sem); |
12574 |
++ return 0; |
12575 |
++} |
12576 |
++EXPORT_SYMBOL(register_service_level); |
12577 |
++ |
12578 |
++int unregister_service_level(struct service_level *slr) |
12579 |
++{ |
12580 |
++ struct service_level *ptr, *next; |
12581 |
++ int rc = -ENOENT; |
12582 |
++ |
12583 |
++ down_write(&service_level_sem); |
12584 |
++ list_for_each_entry_safe(ptr, next, &service_level_list, list) { |
12585 |
++ if (ptr != slr) |
12586 |
++ continue; |
12587 |
++ list_del(&ptr->list); |
12588 |
++ rc = 0; |
12589 |
++ break; |
12590 |
++ } |
12591 |
++ up_write(&service_level_sem); |
12592 |
++ return rc; |
12593 |
++} |
12594 |
++EXPORT_SYMBOL(unregister_service_level); |
12595 |
++ |
12596 |
++static void *service_level_start(struct seq_file *m, loff_t *pos) |
12597 |
++{ |
12598 |
++ down_read(&service_level_sem); |
12599 |
++ return seq_list_start(&service_level_list, *pos); |
12600 |
++} |
12601 |
++ |
12602 |
++static void *service_level_next(struct seq_file *m, void *p, loff_t *pos) |
12603 |
++{ |
12604 |
++ return seq_list_next(p, &service_level_list, pos); |
12605 |
++} |
12606 |
++ |
12607 |
++static void service_level_stop(struct seq_file *m, void *p) |
12608 |
++{ |
12609 |
++ up_read(&service_level_sem); |
12610 |
++} |
12611 |
++ |
12612 |
++static int service_level_show(struct seq_file *m, void *p) |
12613 |
++{ |
12614 |
++ struct service_level *slr; |
12615 |
++ |
12616 |
++ slr = list_entry(p, struct service_level, list); |
12617 |
++ slr->seq_print(m, slr); |
12618 |
++ return 0; |
12619 |
++} |
12620 |
++ |
12621 |
++static const struct seq_operations service_level_seq_ops = { |
12622 |
++ .start = service_level_start, |
12623 |
++ .next = service_level_next, |
12624 |
++ .stop = service_level_stop, |
12625 |
++ .show = service_level_show |
12626 |
++}; |
12627 |
++ |
12628 |
++static int service_level_open(struct inode *inode, struct file *file) |
12629 |
++{ |
12630 |
++ return seq_open(file, &service_level_seq_ops); |
12631 |
++} |
12632 |
++ |
12633 |
++static const struct file_operations service_level_ops = { |
12634 |
++ .open = service_level_open, |
12635 |
++ .read = seq_read, |
12636 |
++ .llseek = seq_lseek, |
12637 |
++ .release = seq_release |
12638 |
++}; |
12639 |
++ |
12640 |
++static void service_level_vm_print(struct seq_file *m, |
12641 |
++ struct service_level *slr) |
12642 |
++{ |
12643 |
++ char *query_buffer, *str; |
12644 |
++ |
12645 |
++ query_buffer = kmalloc(1024, GFP_KERNEL | GFP_DMA); |
12646 |
++ if (!query_buffer) |
12647 |
++ return; |
12648 |
++ cpcmd("QUERY CPLEVEL", query_buffer, 1024, NULL); |
12649 |
++ str = strchr(query_buffer, '\n'); |
12650 |
++ if (str) |
12651 |
++ *str = 0; |
12652 |
++ seq_printf(m, "VM: %s\n", query_buffer); |
12653 |
++ kfree(query_buffer); |
12654 |
++} |
12655 |
++ |
12656 |
++static struct service_level service_level_vm = { |
12657 |
++ .seq_print = service_level_vm_print |
12658 |
++}; |
12659 |
++ |
12660 |
++static __init int create_proc_service_level(void) |
12661 |
++{ |
12662 |
++ proc_create("service_levels", 0, NULL, &service_level_ops); |
12663 |
++ if (MACHINE_IS_VM) |
12664 |
++ register_service_level(&service_level_vm); |
12665 |
++ return 0; |
12666 |
++} |
12667 |
++ |
12668 |
++subsys_initcall(create_proc_service_level); |
12669 |
++ |
12670 |
++/* |
12671 |
++ * Bogomips calculation based on cpu capability. |
12672 |
++ */ |
12673 |
++ |
12674 |
+ int get_cpu_capability(unsigned int *capability) |
12675 |
+ { |
12676 |
+ struct sysinfo_1_2_2 *info; |
12677 |
+Index: linux-2.6.27-gentoo-r7/include/linux/blktrace_api.h |
12678 |
+=================================================================== |
12679 |
+--- linux-2.6.27-gentoo-r7.orig/include/linux/blktrace_api.h |
12680 |
++++ linux-2.6.27-gentoo-r7/include/linux/blktrace_api.h |
12681 |
+@@ -21,6 +21,7 @@ enum blktrace_cat { |
12682 |
+ BLK_TC_NOTIFY = 1 << 10, /* special message */ |
12683 |
+ BLK_TC_AHEAD = 1 << 11, /* readahead */ |
12684 |
+ BLK_TC_META = 1 << 12, /* metadata */ |
12685 |
++ BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ |
12686 |
+ |
12687 |
+ BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
12688 |
+ }; |
12689 |
+@@ -47,6 +48,7 @@ enum blktrace_act { |
12690 |
+ __BLK_TA_SPLIT, /* bio was split */ |
12691 |
+ __BLK_TA_BOUNCE, /* bio was bounced */ |
12692 |
+ __BLK_TA_REMAP, /* bio was remapped */ |
12693 |
++ __BLK_TA_DRV_DATA, /* driver-specific binary data */ |
12694 |
+ }; |
12695 |
+ |
12696 |
+ /* |
12697 |
+@@ -77,6 +79,7 @@ enum blktrace_notify { |
12698 |
+ #define BLK_TA_SPLIT (__BLK_TA_SPLIT) |
12699 |
+ #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) |
12700 |
+ #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) |
12701 |
++#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA)) |
12702 |
+ |
12703 |
+ #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) |
12704 |
+ #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) |
12705 |
+@@ -307,6 +310,34 @@ static inline void blk_add_trace_remap(s |
12706 |
+ __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); |
12707 |
+ } |
12708 |
+ |
12709 |
++/** |
12710 |
++ * blk_add_driver_data - Add binary message with driver-specific data |
12711 |
++ * @q: queue the io is for |
12712 |
++ * @rq: io request |
12713 |
++ * @data: driver-specific data |
12714 |
++ * @len: length of driver-specific data |
12715 |
++ * |
12716 |
++ * Description: |
12717 |
++ * Some drivers might want to write driver-specific data per request. |
12718 |
++ * |
12719 |
++ **/ |
12720 |
++static inline void blk_add_driver_data(struct request_queue *q, |
12721 |
++ struct request *rq, |
12722 |
++ void *data, size_t len) |
12723 |
++{ |
12724 |
++ struct blk_trace *bt = q->blk_trace; |
12725 |
++ |
12726 |
++ if (likely(!bt)) |
12727 |
++ return; |
12728 |
++ |
12729 |
++ if (blk_pc_request(rq)) |
12730 |
++ __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA, |
12731 |
++ rq->errors, len, data); |
12732 |
++ else |
12733 |
++ __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, |
12734 |
++ 0, BLK_TA_DRV_DATA, rq->errors, len, data); |
12735 |
++} |
12736 |
++ |
12737 |
+ extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, |
12738 |
+ char __user *arg); |
12739 |
+ extern int blk_trace_startstop(struct request_queue *q, int start); |
12740 |
+@@ -320,6 +351,7 @@ extern int blk_trace_remove(struct reque |
12741 |
+ #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) |
12742 |
+ #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) |
12743 |
+ #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) |
12744 |
++#define blk_add_driver_data(q, rq, data, len) do {} while (0) |
12745 |
+ #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) |
12746 |
+ #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) |
12747 |
+ #define blk_trace_startstop(q, start) (-ENOTTY) |
12748 |
+Index: linux-2.6.27-gentoo-r7/include/linux/kernel.h |
12749 |
+=================================================================== |
12750 |
+--- linux-2.6.27-gentoo-r7.orig/include/linux/kernel.h |
12751 |
++++ linux-2.6.27-gentoo-r7/include/linux/kernel.h |
12752 |
+@@ -288,28 +288,32 @@ static inline char *pack_hex_byte(char * |
12753 |
+ return buf; |
12754 |
+ } |
12755 |
+ |
12756 |
+-#define pr_emerg(fmt, arg...) \ |
12757 |
+- printk(KERN_EMERG fmt, ##arg) |
12758 |
+-#define pr_alert(fmt, arg...) \ |
12759 |
+- printk(KERN_ALERT fmt, ##arg) |
12760 |
+-#define pr_crit(fmt, arg...) \ |
12761 |
+- printk(KERN_CRIT fmt, ##arg) |
12762 |
+-#define pr_err(fmt, arg...) \ |
12763 |
+- printk(KERN_ERR fmt, ##arg) |
12764 |
+-#define pr_warning(fmt, arg...) \ |
12765 |
+- printk(KERN_WARNING fmt, ##arg) |
12766 |
+-#define pr_notice(fmt, arg...) \ |
12767 |
+- printk(KERN_NOTICE fmt, ##arg) |
12768 |
+-#define pr_info(fmt, arg...) \ |
12769 |
+- printk(KERN_INFO fmt, ##arg) |
12770 |
++#ifndef pr_fmt |
12771 |
++#define pr_fmt(fmt) fmt |
12772 |
++#endif |
12773 |
++ |
12774 |
++#define pr_emerg(fmt, ...) \ |
12775 |
++ printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
12776 |
++#define pr_alert(fmt, ...) \ |
12777 |
++ printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
12778 |
++#define pr_crit(fmt, ...) \ |
12779 |
++ printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
12780 |
++#define pr_err(fmt, ...) \ |
12781 |
++ printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
12782 |
++#define pr_warning(fmt, ...) \ |
12783 |
++ printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
12784 |
++#define pr_notice(fmt, ...) \ |
12785 |
++ printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
12786 |
++#define pr_info(fmt, ...) \ |
12787 |
++ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
12788 |
+ |
12789 |
+ #ifdef DEBUG |
12790 |
+ /* If you are writing a driver, please use dev_dbg instead */ |
12791 |
+-#define pr_debug(fmt, arg...) \ |
12792 |
+- printk(KERN_DEBUG fmt, ##arg) |
12793 |
++#define pr_debug(fmt, ...) \ |
12794 |
++ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
12795 |
+ #else |
12796 |
+-#define pr_debug(fmt, arg...) \ |
12797 |
+- ({ if (0) printk(KERN_DEBUG fmt, ##arg); 0; }) |
12798 |
++#define pr_debug(fmt, ...) \ |
12799 |
++ ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) |
12800 |
+ #endif |
12801 |
+ |
12802 |
+ /* |
12803 |
+Index: linux-2.6.27-gentoo-r7/net/iucv/af_iucv.c |
12804 |
+=================================================================== |
12805 |
+--- linux-2.6.27-gentoo-r7.orig/net/iucv/af_iucv.c |
12806 |
++++ linux-2.6.27-gentoo-r7/net/iucv/af_iucv.c |
12807 |
+@@ -8,6 +8,9 @@ |
12808 |
+ * Author(s): Jennifer Hunt <jenhunt@××××××.com> |
12809 |
+ */ |
12810 |
+ |
12811 |
++#define KMSG_COMPONENT "af_iucv" |
12812 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12813 |
++ |
12814 |
+ #include <linux/module.h> |
12815 |
+ #include <linux/types.h> |
12816 |
+ #include <linux/list.h> |
12817 |
+@@ -616,6 +619,8 @@ static int iucv_sock_sendmsg(struct kioc |
12818 |
+ struct iucv_sock *iucv = iucv_sk(sk); |
12819 |
+ struct sk_buff *skb; |
12820 |
+ struct iucv_message txmsg; |
12821 |
++ char user_id[9]; |
12822 |
++ char appl_id[9]; |
12823 |
+ int err; |
12824 |
+ |
12825 |
+ err = sock_error(sk); |
12826 |
+@@ -651,8 +656,15 @@ static int iucv_sock_sendmsg(struct kioc |
12827 |
+ err = iucv_message_send(iucv->path, &txmsg, 0, 0, |
12828 |
+ (void *) skb->data, skb->len); |
12829 |
+ if (err) { |
12830 |
+- if (err == 3) |
12831 |
+- printk(KERN_ERR "AF_IUCV msg limit exceeded\n"); |
12832 |
++ if (err == 3) { |
12833 |
++ user_id[8] = 0; |
12834 |
++ memcpy(user_id, iucv->dst_user_id, 8); |
12835 |
++ appl_id[8] = 0; |
12836 |
++ memcpy(appl_id, iucv->dst_name, 8); |
12837 |
++ pr_err("Application %s on z/VM guest %s" |
12838 |
++ " exceeds message limit\n", |
12839 |
++ user_id, appl_id); |
12840 |
++ } |
12841 |
+ skb_unlink(skb, &iucv->send_skb_q); |
12842 |
+ err = -EPIPE; |
12843 |
+ goto fail; |
12844 |
+@@ -1190,7 +1202,8 @@ static int __init afiucv_init(void) |
12845 |
+ int err; |
12846 |
+ |
12847 |
+ if (!MACHINE_IS_VM) { |
12848 |
+- printk(KERN_ERR "AF_IUCV connection needs VM as base\n"); |
12849 |
++ pr_err("The af_iucv module cannot be loaded" |
12850 |
++ " without z/VM\n"); |
12851 |
+ err = -EPROTONOSUPPORT; |
12852 |
+ goto out; |
12853 |
+ } |
12854 |
+Index: linux-2.6.27-gentoo-r7/net/iucv/iucv.c |
12855 |
+=================================================================== |
12856 |
+--- linux-2.6.27-gentoo-r7.orig/net/iucv/iucv.c |
12857 |
++++ linux-2.6.27-gentoo-r7/net/iucv/iucv.c |
12858 |
+@@ -30,6 +30,9 @@ |
12859 |
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
12860 |
+ */ |
12861 |
+ |
12862 |
++#define KMSG_COMPONENT "iucv" |
12863 |
++#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
12864 |
++ |
12865 |
+ #include <linux/module.h> |
12866 |
+ #include <linux/moduleparam.h> |
12867 |
+ #include <linux/spinlock.h> |
12868 |
+@@ -424,8 +427,8 @@ static void iucv_declare_cpu(void *data) |
12869 |
+ err = "Paging or storage error"; |
12870 |
+ break; |
12871 |
+ } |
12872 |
+- printk(KERN_WARNING "iucv_register: iucv_declare_buffer " |
12873 |
+- "on cpu %i returned error 0x%02x (%s)\n", cpu, rc, err); |
12874 |
++ pr_warning("Defining an interrupt buffer on CPU %i" |
12875 |
++ " failed with 0x%02x (%s)\n", cpu, rc, err); |
12876 |
+ return; |
12877 |
+ } |
12878 |
+ |
12879 |
+@@ -1572,7 +1575,7 @@ static void iucv_external_interrupt(u16 |
12880 |
+ BUG_ON(p->iptype < 0x01 || p->iptype > 0x09); |
12881 |
+ work = kmalloc(sizeof(struct iucv_irq_list), GFP_ATOMIC); |
12882 |
+ if (!work) { |
12883 |
+- printk(KERN_WARNING "iucv_external_interrupt: out of memory\n"); |
12884 |
++ pr_warning("iucv_external_interrupt: out of memory\n"); |
12885 |
+ return; |
12886 |
+ } |
12887 |
+ memcpy(&work->data, p, sizeof(work->data)); |