Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Martin Schwidefsky:
"Mostly cleanups and bug-fixes, with two exceptions.

The first is lazy flushing of I/O-TLBs for PCI to improve performance,
the second is software dirty bits in the pmd for the madvise-free
implementation"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (24 commits)
s390/locking: Reenable optimistic spinning
s390/mm: implement dirty bits for large segment table entries
KVM: s390/mm: Fix page table locking vs. split pmd lock
s390/dasd: fix camel case
s390/3215: fix hanging console issue
s390/irq: improve displayed interrupt order in /proc/interrupts
s390/seccomp: fix error return for filtered system calls
s390/pci: introduce lazy IOTLB flushing for DMA unmap
dasd: fix error recovery for alias devices during format
dasd: fix list_del corruption during format
dasd: fix unresponsive device during format
dasd: use aliases for formatted devices during format
s390/pci: fix kmsg component
s390/kdump: Return NOTIFY_OK for all actions other than MEM_GOING_OFFLINE
s390/watchdog: Fix module name in Kconfig help text
s390/dasd: replace seq_printf by seq_puts
s390/dasd: replace pr_warning by pr_warn
s390/dasd: Move EXPORT_SYMBOL after function/variable
s390/dasd: remove unnecessary null test before debugfs_remove
s390/zfcp: use qdio buffer helpers
...

+618 -442
+7
Documentation/kernel-parameters.txt
··· 3058 3058 3059 3059 S [KNL] Run init in single mode 3060 3060 3061 + s390_iommu= [HW,S390] 3062 + Set s390 IOTLB flushing mode 3063 + strict 3064 + With strict flushing every unmap operation will result in 3065 + an IOTLB flush. Default is lazy flushing before reuse, 3066 + which is faster. 3067 + 3061 3068 sa1100ir [NET] 3062 3069 See drivers/net/irda/sa1100_ir.c. 3063 3070
+1
arch/s390/Kconfig
··· 92 92 select ARCH_INLINE_WRITE_UNLOCK_IRQ 93 93 select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE 94 94 select ARCH_SAVE_PAGE_KEYS if HIBERNATION 95 + select ARCH_SUPPORTS_ATOMIC_RMW 95 96 select ARCH_USE_CMPXCHG_LOCKREF 96 97 select ARCH_WANT_IPC_PARSE_VERSION 97 98 select BUILDTIME_EXTABLE_SORT
+109 -88
arch/s390/include/asm/pgtable.h
··· 287 287 #define _SEGMENT_ENTRY_INVALID 0x20 /* invalid segment table entry */ 288 288 #define _SEGMENT_ENTRY_COMMON 0x10 /* common segment bit */ 289 289 #define _SEGMENT_ENTRY_PTL 0x0f /* page table length */ 290 - #define _SEGMENT_ENTRY_NONE _SEGMENT_ENTRY_PROTECT 290 + 291 + #define _SEGMENT_ENTRY_DIRTY 0 /* No sw dirty bit for 31-bit */ 292 + #define _SEGMENT_ENTRY_YOUNG 0 /* No sw young bit for 31-bit */ 293 + #define _SEGMENT_ENTRY_READ 0 /* No sw read bit for 31-bit */ 294 + #define _SEGMENT_ENTRY_WRITE 0 /* No sw write bit for 31-bit */ 295 + #define _SEGMENT_ENTRY_LARGE 0 /* No large pages for 31-bit */ 296 + #define _SEGMENT_ENTRY_BITS_LARGE 0 297 + #define _SEGMENT_ENTRY_ORIGIN_LARGE 0 291 298 292 299 #define _SEGMENT_ENTRY (_SEGMENT_ENTRY_PTL) 293 300 #define _SEGMENT_ENTRY_EMPTY (_SEGMENT_ENTRY_INVALID) ··· 357 350 358 351 /* Bits in the segment table entry */ 359 352 #define _SEGMENT_ENTRY_BITS 0xfffffffffffffe33UL 360 - #define _SEGMENT_ENTRY_BITS_LARGE 0xfffffffffff1ff33UL 353 + #define _SEGMENT_ENTRY_BITS_LARGE 0xfffffffffff0ff33UL 361 354 #define _SEGMENT_ENTRY_ORIGIN_LARGE ~0xfffffUL /* large page address */ 362 355 #define _SEGMENT_ENTRY_ORIGIN ~0x7ffUL/* segment table origin */ 363 356 #define _SEGMENT_ENTRY_PROTECT 0x200 /* page protection bit */ ··· 366 359 #define _SEGMENT_ENTRY (0) 367 360 #define _SEGMENT_ENTRY_EMPTY (_SEGMENT_ENTRY_INVALID) 368 361 369 - #define _SEGMENT_ENTRY_LARGE 0x400 /* STE-format control, large page */ 370 - #define _SEGMENT_ENTRY_CO 0x100 /* change-recording override */ 371 - #define _SEGMENT_ENTRY_SPLIT 0x001 /* THP splitting bit */ 372 - #define _SEGMENT_ENTRY_YOUNG 0x002 /* SW segment young bit */ 373 - #define _SEGMENT_ENTRY_NONE _SEGMENT_ENTRY_YOUNG 362 + #define _SEGMENT_ENTRY_DIRTY 0x2000 /* SW segment dirty bit */ 363 + #define _SEGMENT_ENTRY_YOUNG 0x1000 /* SW segment young bit */ 364 + #define _SEGMENT_ENTRY_SPLIT 0x0800 /* THP splitting bit */ 365 + #define _SEGMENT_ENTRY_LARGE 0x0400 /* STE-format control, large page */ 366 + #define _SEGMENT_ENTRY_CO 0x0100 /* change-recording override */ 367 + #define _SEGMENT_ENTRY_READ 0x0002 /* SW segment read bit */ 368 + #define _SEGMENT_ENTRY_WRITE 0x0001 /* SW segment write bit */ 374 369 375 370 /* 376 371 * Segment table entry encoding (R = read-only, I = invalid, y = young bit): 377 - * ..R...I...y. 378 - * prot-none, old ..0...1...1. 379 - * prot-none, young ..1...1...1. 380 - * read-only, old ..1...1...0. 381 - * read-only, young ..1...0...1. 382 - * read-write, old ..0...1...0. 383 - * read-write, young ..0...0...1. 372 + * dy..R...I...wr 373 + * prot-none, clean, old 00..1...1...00 374 + * prot-none, clean, young 01..1...1...00 375 + * prot-none, dirty, old 10..1...1...00 376 + * prot-none, dirty, young 11..1...1...00 377 + * read-only, clean, old 00..1...1...01 378 + * read-only, clean, young 01..1...0...01 379 + * read-only, dirty, old 10..1...1...01 380 + * read-only, dirty, young 11..1...0...01 381 + * read-write, clean, old 00..1...1...11 382 + * read-write, clean, young 01..1...0...11 383 + * read-write, dirty, old 10..0...1...11 384 + * read-write, dirty, young 11..0...0...11 384 385 * The segment table origin is used to distinguish empty (origin==0) from 385 386 * read-write, old segment table entries (origin!=0) 386 387 */ 387 388 388 - #define _SEGMENT_ENTRY_SPLIT_BIT 0 /* THP splitting bit number */ 389 - 390 - /* Set of bits not changed in pmd_modify */ 391 - #define _SEGMENT_CHG_MASK (_SEGMENT_ENTRY_ORIGIN | _SEGMENT_ENTRY_LARGE \ 392 - | _SEGMENT_ENTRY_SPLIT | _SEGMENT_ENTRY_CO) 389 + #define _SEGMENT_ENTRY_SPLIT_BIT 11 /* THP splitting bit number */ 393 390 394 391 /* Page status table bits for virtualization */ 395 392 #define PGSTE_ACC_BITS 0xf000000000000000UL ··· 466 455 * Segment entry (large page) protection definitions. 467 456 */ 468 457 #define SEGMENT_NONE __pgprot(_SEGMENT_ENTRY_INVALID | \ 469 - _SEGMENT_ENTRY_NONE) 470 - #define SEGMENT_READ __pgprot(_SEGMENT_ENTRY_INVALID | \ 471 458 _SEGMENT_ENTRY_PROTECT) 472 - #define SEGMENT_WRITE __pgprot(_SEGMENT_ENTRY_INVALID) 459 + #define SEGMENT_READ __pgprot(_SEGMENT_ENTRY_PROTECT | \ 460 + _SEGMENT_ENTRY_READ) 461 + #define SEGMENT_WRITE __pgprot(_SEGMENT_ENTRY_READ | \ 462 + _SEGMENT_ENTRY_WRITE) 473 463 474 464 static inline int mm_has_pgste(struct mm_struct *mm) 475 465 { ··· 581 569 582 570 static inline int pmd_large(pmd_t pmd) 583 571 { 584 - #ifdef CONFIG_64BIT 585 572 return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0; 586 - #else 587 - return 0; 588 - #endif 589 573 } 590 574 591 - static inline int pmd_prot_none(pmd_t pmd) 575 + static inline int pmd_pfn(pmd_t pmd) 592 576 { 593 - return (pmd_val(pmd) & _SEGMENT_ENTRY_INVALID) && 594 - (pmd_val(pmd) & _SEGMENT_ENTRY_NONE); 577 + unsigned long origin_mask; 578 + 579 + origin_mask = _SEGMENT_ENTRY_ORIGIN; 580 + if (pmd_large(pmd)) 581 + origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE; 582 + return (pmd_val(pmd) & origin_mask) >> PAGE_SHIFT; 595 583 } 596 584 597 585 static inline int pmd_bad(pmd_t pmd) 598 586 { 599 - #ifdef CONFIG_64BIT 600 587 if (pmd_large(pmd)) 601 588 return (pmd_val(pmd) & ~_SEGMENT_ENTRY_BITS_LARGE) != 0; 602 - #endif 603 589 return (pmd_val(pmd) & ~_SEGMENT_ENTRY_BITS) != 0; 604 590 } 605 591 ··· 617 607 #define __HAVE_ARCH_PMD_WRITE 618 608 static inline int pmd_write(pmd_t pmd) 619 609 { 620 - if (pmd_prot_none(pmd)) 621 - return 0; 622 - return (pmd_val(pmd) & _SEGMENT_ENTRY_PROTECT) == 0; 610 + return (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) != 0; 611 + } 612 + 613 + static inline int pmd_dirty(pmd_t pmd) 614 + { 615 + int dirty = 1; 616 + if (pmd_large(pmd)) 617 + dirty = (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0; 618 + return dirty; 623 619 } 624 620 625 621 static inline int pmd_young(pmd_t pmd) 626 622 { 627 - int young = 0; 628 - #ifdef CONFIG_64BIT 629 - if (pmd_prot_none(pmd)) 630 - young = (pmd_val(pmd) & _SEGMENT_ENTRY_PROTECT) != 0; 631 - else 623 + int young = 1; 624 + if (pmd_large(pmd)) 632 625 young = (pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG) != 0; 633 - #endif 634 626 return young; 635 627 } 636 628 ··· 1403 1391 #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 1404 1392 #define pte_page(x) pfn_to_page(pte_pfn(x)) 1405 1393 1406 - #define pmd_page(pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT) 1394 + #define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd)) 1407 1395 1408 1396 /* Find an entry in the lowest level page table.. */ 1409 1397 #define pte_offset(pmd, addr) ((pte_t *) pmd_deref(*(pmd)) + pte_index(addr)) ··· 1425 1413 return pgprot_val(SEGMENT_WRITE); 1426 1414 } 1427 1415 1416 + static inline pmd_t pmd_wrprotect(pmd_t pmd) 1417 + { 1418 + pmd_val(pmd) &= ~_SEGMENT_ENTRY_WRITE; 1419 + pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 1420 + return pmd; 1421 + } 1422 + 1423 + static inline pmd_t pmd_mkwrite(pmd_t pmd) 1424 + { 1425 + pmd_val(pmd) |= _SEGMENT_ENTRY_WRITE; 1426 + if (pmd_large(pmd) && !(pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY)) 1427 + return pmd; 1428 + pmd_val(pmd) &= ~_SEGMENT_ENTRY_PROTECT; 1429 + return pmd; 1430 + } 1431 + 1432 + static inline pmd_t pmd_mkclean(pmd_t pmd) 1433 + { 1434 + if (pmd_large(pmd)) { 1435 + pmd_val(pmd) &= ~_SEGMENT_ENTRY_DIRTY; 1436 + pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 1437 + } 1438 + return pmd; 1439 + } 1440 + 1441 + static inline pmd_t pmd_mkdirty(pmd_t pmd) 1442 + { 1443 + if (pmd_large(pmd)) { 1444 + pmd_val(pmd) |= _SEGMENT_ENTRY_DIRTY; 1445 + if (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) 1446 + pmd_val(pmd) &= ~_SEGMENT_ENTRY_PROTECT; 1447 + } 1448 + return pmd; 1449 + } 1450 + 1428 1451 static inline pmd_t pmd_mkyoung(pmd_t pmd) 1429 1452 { 1430 - #ifdef CONFIG_64BIT 1431 - if (pmd_prot_none(pmd)) { 1432 - pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 1433 - } else { 1453 + if (pmd_large(pmd)) { 1434 1454 pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG; 1435 - pmd_val(pmd) &= ~_SEGMENT_ENTRY_INVALID; 1455 + if (pmd_val(pmd) & _SEGMENT_ENTRY_READ) 1456 + pmd_val(pmd) &= ~_SEGMENT_ENTRY_INVALID; 1436 1457 } 1437 - #endif 1438 1458 return pmd; 1439 1459 } 1440 1460 1441 1461 static inline pmd_t pmd_mkold(pmd_t pmd) 1442 1462 { 1443 - #ifdef CONFIG_64BIT 1444 - if (pmd_prot_none(pmd)) { 1445 - pmd_val(pmd) &= ~_SEGMENT_ENTRY_PROTECT; 1446 - } else { 1463 + if (pmd_large(pmd)) { 1447 1464 pmd_val(pmd) &= ~_SEGMENT_ENTRY_YOUNG; 1448 1465 pmd_val(pmd) |= _SEGMENT_ENTRY_INVALID; 1449 1466 } 1450 - #endif 1451 1467 return pmd; 1452 1468 } 1453 1469 1454 1470 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) 1455 1471 { 1456 - int young; 1457 - 1458 - young = pmd_young(pmd); 1459 - pmd_val(pmd) &= _SEGMENT_CHG_MASK; 1472 + if (pmd_large(pmd)) { 1473 + pmd_val(pmd) &= _SEGMENT_ENTRY_ORIGIN_LARGE | 1474 + _SEGMENT_ENTRY_DIRTY | _SEGMENT_ENTRY_YOUNG | 1475 + _SEGMENT_ENTRY_LARGE | _SEGMENT_ENTRY_SPLIT; 1476 + pmd_val(pmd) |= massage_pgprot_pmd(newprot); 1477 + if (!(pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY)) 1478 + pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 1479 + if (!(pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG)) 1480 + pmd_val(pmd) |= _SEGMENT_ENTRY_INVALID; 1481 + return pmd; 1482 + } 1483 + pmd_val(pmd) &= _SEGMENT_ENTRY_ORIGIN; 1460 1484 pmd_val(pmd) |= massage_pgprot_pmd(newprot); 1461 - if (young) 1462 - pmd = pmd_mkyoung(pmd); 1463 1485 return pmd; 1464 1486 } 1465 1487 ··· 1501 1455 { 1502 1456 pmd_t __pmd; 1503 1457 pmd_val(__pmd) = physpage + massage_pgprot_pmd(pgprot); 1504 - return pmd_mkyoung(__pmd); 1458 + return __pmd; 1505 1459 } 1506 1460 1507 - static inline pmd_t pmd_mkwrite(pmd_t pmd) 1508 - { 1509 - /* Do not clobber PROT_NONE segments! */ 1510 - if (!pmd_prot_none(pmd)) 1511 - pmd_val(pmd) &= ~_SEGMENT_ENTRY_PROTECT; 1512 - return pmd; 1513 - } 1514 1461 #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLB_PAGE */ 1515 1462 1516 1463 static inline void __pmdp_csp(pmd_t *pmdp) ··· 1594 1555 1595 1556 static inline int pmd_trans_splitting(pmd_t pmd) 1596 1557 { 1597 - return pmd_val(pmd) & _SEGMENT_ENTRY_SPLIT; 1558 + return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) && 1559 + (pmd_val(pmd) & _SEGMENT_ENTRY_SPLIT); 1598 1560 } 1599 1561 1600 1562 static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, 1601 1563 pmd_t *pmdp, pmd_t entry) 1602 1564 { 1603 - if (!(pmd_val(entry) & _SEGMENT_ENTRY_INVALID) && MACHINE_HAS_EDAT1) 1604 - pmd_val(entry) |= _SEGMENT_ENTRY_CO; 1605 1565 *pmdp = entry; 1606 1566 } 1607 1567 1608 1568 static inline pmd_t pmd_mkhuge(pmd_t pmd) 1609 1569 { 1610 1570 pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE; 1611 - return pmd; 1612 - } 1613 - 1614 - static inline pmd_t pmd_wrprotect(pmd_t pmd) 1615 - { 1616 - /* Do not clobber PROT_NONE segments! */ 1617 - if (!pmd_prot_none(pmd)) 1618 - pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 1619 - return pmd; 1620 - } 1621 - 1622 - static inline pmd_t pmd_mkdirty(pmd_t pmd) 1623 - { 1624 - /* No dirty bit in the segment table entry. */ 1571 + pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG; 1572 + pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 1625 1573 return pmd; 1626 1574 } 1627 1575 ··· 1672 1646 static inline int has_transparent_hugepage(void) 1673 1647 { 1674 1648 return MACHINE_HAS_HPAGE ? 1 : 0; 1675 - } 1676 - 1677 - static inline unsigned long pmd_pfn(pmd_t pmd) 1678 - { 1679 - return pmd_val(pmd) >> PAGE_SHIFT; 1680 1649 } 1681 1650 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 1682 1651
+4
arch/s390/include/asm/qdio.h
··· 415 415 #define QDIO_FLAG_SYNC_OUTPUT 0x02 416 416 #define QDIO_FLAG_PCI_OUT 0x10 417 417 418 + int qdio_alloc_buffers(struct qdio_buffer **buf, unsigned int count); 419 + void qdio_free_buffers(struct qdio_buffer **buf, unsigned int count); 420 + void qdio_reset_buffers(struct qdio_buffer **buf, unsigned int count); 421 + 418 422 extern int qdio_allocate(struct qdio_initialize *); 419 423 extern int qdio_establish(struct qdio_initialize *); 420 424 extern int qdio_activate(struct ccw_device *);
+1 -1
arch/s390/include/asm/syscall.h
··· 54 54 struct pt_regs *regs, 55 55 int error, long val) 56 56 { 57 - regs->gprs[2] = error ? -error : val; 57 + regs->gprs[2] = error ? error : val; 58 58 } 59 59 60 60 static inline void syscall_get_arguments(struct task_struct *task,
+50 -45
arch/s390/kernel/irq.c
··· 30 30 EXPORT_PER_CPU_SYMBOL_GPL(irq_stat); 31 31 32 32 struct irq_class { 33 + int irq; 33 34 char *name; 34 35 char *desc; 35 36 }; ··· 46 45 * up with having a sum which accounts each interrupt twice. 47 46 */ 48 47 static const struct irq_class irqclass_main_desc[NR_IRQS_BASE] = { 49 - [EXT_INTERRUPT] = {.name = "EXT"}, 50 - [IO_INTERRUPT] = {.name = "I/O"}, 51 - [THIN_INTERRUPT] = {.name = "AIO"}, 48 + {.irq = EXT_INTERRUPT, .name = "EXT"}, 49 + {.irq = IO_INTERRUPT, .name = "I/O"}, 50 + {.irq = THIN_INTERRUPT, .name = "AIO"}, 52 51 }; 53 52 54 53 /* ··· 57 56 * In addition this list contains non external / I/O events like NMIs. 58 57 */ 59 58 static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = { 60 - [IRQEXT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"}, 61 - [IRQEXT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"}, 62 - [IRQEXT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"}, 63 - [IRQEXT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"}, 64 - [IRQEXT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"}, 65 - [IRQEXT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, 66 - [IRQEXT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"}, 67 - [IRQEXT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"}, 68 - [IRQEXT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"}, 69 - [IRQEXT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"}, 70 - [IRQEXT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, 71 - [IRQEXT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, 72 - [IRQEXT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, 73 - [IRQIO_CIO] = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, 74 - [IRQIO_QAI] = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, 75 - [IRQIO_DAS] = {.name = "DAS", .desc = "[I/O] DASD"}, 76 - [IRQIO_C15] = {.name = "C15", .desc = "[I/O] 3215"}, 77 - [IRQIO_C70] = {.name = "C70", .desc = "[I/O] 3270"}, 78 - [IRQIO_TAP] = {.name = "TAP", .desc = "[I/O] Tape"}, 79 - [IRQIO_VMR] = {.name = "VMR", .desc = "[I/O] Unit Record Devices"}, 80 - [IRQIO_LCS] = {.name = "LCS", .desc = "[I/O] LCS"}, 81 - [IRQIO_CLW] = {.name = "CLW", .desc = "[I/O] CLAW"}, 82 - [IRQIO_CTC] = {.name = "CTC", .desc = "[I/O] CTC"}, 83 - [IRQIO_APB] = {.name = "APB", .desc = "[I/O] AP Bus"}, 84 - [IRQIO_ADM] = {.name = "ADM", .desc = "[I/O] EADM Subchannel"}, 85 - [IRQIO_CSC] = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"}, 86 - [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, 87 - [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, 88 - [IRQIO_VIR] = {.name = "VIR", .desc = "[I/O] Virtual I/O Devices"}, 89 - [IRQIO_VAI] = {.name = "VAI", .desc = "[I/O] Virtual I/O Devices AI"}, 90 - [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, 91 - [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"}, 59 + {.irq = IRQEXT_CLK, .name = "CLK", .desc = "[EXT] Clock Comparator"}, 60 + {.irq = IRQEXT_EXC, .name = "EXC", .desc = "[EXT] External Call"}, 61 + {.irq = IRQEXT_EMS, .name = "EMS", .desc = "[EXT] Emergency Signal"}, 62 + {.irq = IRQEXT_TMR, .name = "TMR", .desc = "[EXT] CPU Timer"}, 63 + {.irq = IRQEXT_TLA, .name = "TAL", .desc = "[EXT] Timing Alert"}, 64 + {.irq = IRQEXT_PFL, .name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, 65 + {.irq = IRQEXT_DSD, .name = "DSD", .desc = "[EXT] DASD Diag"}, 66 + {.irq = IRQEXT_VRT, .name = "VRT", .desc = "[EXT] Virtio"}, 67 + {.irq = IRQEXT_SCP, .name = "SCP", .desc = "[EXT] Service Call"}, 68 + {.irq = IRQEXT_IUC, .name = "IUC", .desc = "[EXT] IUCV"}, 69 + {.irq = IRQEXT_CMS, .name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, 70 + {.irq = IRQEXT_CMC, .name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, 71 + {.irq = IRQEXT_CMR, .name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, 72 + {.irq = IRQIO_CIO, .name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, 73 + {.irq = IRQIO_QAI, .name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, 74 + {.irq = IRQIO_DAS, .name = "DAS", .desc = "[I/O] DASD"}, 75 + {.irq = IRQIO_C15, .name = "C15", .desc = "[I/O] 3215"}, 76 + {.irq = IRQIO_C70, .name = "C70", .desc = "[I/O] 3270"}, 77 + {.irq = IRQIO_TAP, .name = "TAP", .desc = "[I/O] Tape"}, 78 + {.irq = IRQIO_VMR, .name = "VMR", .desc = "[I/O] Unit Record Devices"}, 79 + {.irq = IRQIO_LCS, .name = "LCS", .desc = "[I/O] LCS"}, 80 + {.irq = IRQIO_CLW, .name = "CLW", .desc = "[I/O] CLAW"}, 81 + {.irq = IRQIO_CTC, .name = "CTC", .desc = "[I/O] CTC"}, 82 + {.irq = IRQIO_APB, .name = "APB", .desc = "[I/O] AP Bus"}, 83 + {.irq = IRQIO_ADM, .name = "ADM", .desc = "[I/O] EADM Subchannel"}, 84 + {.irq = IRQIO_CSC, .name = "CSC", .desc = "[I/O] CHSC Subchannel"}, 85 + {.irq = IRQIO_PCI, .name = "PCI", .desc = "[I/O] PCI Interrupt" }, 86 + {.irq = IRQIO_MSI, .name = "MSI", .desc = "[I/O] MSI Interrupt" }, 87 + {.irq = IRQIO_VIR, .name = "VIR", .desc = "[I/O] Virtual I/O Devices"}, 88 + {.irq = IRQIO_VAI, .name = "VAI", .desc = "[I/O] Virtual I/O Devices AI"}, 89 + {.irq = NMI_NMI, .name = "NMI", .desc = "[NMI] Machine Check"}, 90 + {.irq = CPU_RST, .name = "RST", .desc = "[CPU] CPU Restart"}, 92 91 }; 93 92 94 93 void __init init_IRQ(void) ··· 117 116 */ 118 117 int show_interrupts(struct seq_file *p, void *v) 119 118 { 120 - int irq = *(loff_t *) v; 121 - int cpu; 119 + int index = *(loff_t *) v; 120 + int cpu, irq; 122 121 123 122 get_online_cpus(); 124 - if (irq == 0) { 123 + if (index == 0) { 125 124 seq_puts(p, " "); 126 125 for_each_online_cpu(cpu) 127 126 seq_printf(p, "CPU%d ", cpu); 128 127 seq_putc(p, '\n'); 129 128 goto out; 130 129 } 131 - if (irq < NR_IRQS) { 132 - if (irq >= NR_IRQS_BASE) 130 + if (index < NR_IRQS) { 131 + if (index >= NR_IRQS_BASE) 133 132 goto out; 134 - seq_printf(p, "%s: ", irqclass_main_desc[irq].name); 133 + /* Adjust index to process irqclass_main_desc array entries */ 134 + index--; 135 + seq_printf(p, "%s: ", irqclass_main_desc[index].name); 136 + irq = irqclass_main_desc[index].irq; 135 137 for_each_online_cpu(cpu) 136 138 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, cpu)); 137 139 seq_putc(p, '\n'); 138 140 goto out; 139 141 } 140 - for (irq = 0; irq < NR_ARCH_IRQS; irq++) { 141 - seq_printf(p, "%s: ", irqclass_sub_desc[irq].name); 142 + for (index = 0; index < NR_ARCH_IRQS; index++) { 143 + seq_printf(p, "%s: ", irqclass_sub_desc[index].name); 144 + irq = irqclass_sub_desc[index].irq; 142 145 for_each_online_cpu(cpu) 143 146 seq_printf(p, "%10u ", 144 147 per_cpu(irq_stat, cpu).irqs[irq]); 145 - if (irqclass_sub_desc[irq].desc) 146 - seq_printf(p, " %s", irqclass_sub_desc[irq].desc); 148 + if (irqclass_sub_desc[index].desc) 149 + seq_printf(p, " %s", irqclass_sub_desc[index].desc); 147 150 seq_putc(p, '\n'); 148 151 } 149 152 out:
+2
arch/s390/kernel/setup.c
··· 501 501 { 502 502 struct memory_notify *arg = data; 503 503 504 + if (action != MEM_GOING_OFFLINE) 505 + return NOTIFY_OK; 504 506 if (arg->start_pfn < PFN_DOWN(resource_size(&crashk_res))) 505 507 return NOTIFY_BAD; 506 508 if (arg->start_pfn > PFN_DOWN(crashk_res.end))
+47 -56
arch/s390/mm/hugetlbpage.c
··· 10 10 11 11 static inline pmd_t __pte_to_pmd(pte_t pte) 12 12 { 13 - int none, young, prot; 14 13 pmd_t pmd; 15 14 16 15 /* 17 - * Convert encoding pte bits pmd bits 18 - * .IR...wrdytp ..R...I...y. 19 - * empty .10...000000 -> ..0...1...0. 20 - * prot-none, clean, old .11...000001 -> ..0...1...1. 21 - * prot-none, clean, young .11...000101 -> ..1...1...1. 22 - * prot-none, dirty, old .10...001001 -> ..0...1...1. 23 - * prot-none, dirty, young .10...001101 -> ..1...1...1. 24 - * read-only, clean, old .11...010001 -> ..1...1...0. 25 - * read-only, clean, young .01...010101 -> ..1...0...1. 26 - * read-only, dirty, old .11...011001 -> ..1...1...0. 27 - * read-only, dirty, young .01...011101 -> ..1...0...1. 28 - * read-write, clean, old .11...110001 -> ..0...1...0. 29 - * read-write, clean, young .01...110101 -> ..0...0...1. 30 - * read-write, dirty, old .10...111001 -> ..0...1...0. 31 - * read-write, dirty, young .00...111101 -> ..0...0...1. 32 - * Huge ptes are dirty by definition, a clean pte is made dirty 33 - * by the conversion. 16 + * Convert encoding pte bits pmd bits 17 + * .IR...wrdytp dy..R...I...wr 18 + * empty .10...000000 -> 00..0...1...00 19 + * prot-none, clean, old .11...000001 -> 00..1...1...00 20 + * prot-none, clean, young .11...000101 -> 01..1...1...00 21 + * prot-none, dirty, old .10...001001 -> 10..1...1...00 22 + * prot-none, dirty, young .10...001101 -> 11..1...1...00 23 + * read-only, clean, old .11...010001 -> 00..1...1...01 24 + * read-only, clean, young .01...010101 -> 01..1...0...01 25 + * read-only, dirty, old .11...011001 -> 10..1...1...01 26 + * read-only, dirty, young .01...011101 -> 11..1...0...01 27 + * read-write, clean, old .11...110001 -> 00..0...1...11 28 + * read-write, clean, young .01...110101 -> 01..0...0...11 29 + * read-write, dirty, old .10...111001 -> 10..0...1...11 30 + * read-write, dirty, young .00...111101 -> 11..0...0...11 34 31 */ 35 32 if (pte_present(pte)) { 36 33 pmd_val(pmd) = pte_val(pte) & PAGE_MASK; 37 - if (pte_val(pte) & _PAGE_INVALID) 38 - pmd_val(pmd) |= _SEGMENT_ENTRY_INVALID; 39 - none = (pte_val(pte) & _PAGE_PRESENT) && 40 - !(pte_val(pte) & _PAGE_READ) && 41 - !(pte_val(pte) & _PAGE_WRITE); 42 - prot = (pte_val(pte) & _PAGE_PROTECT) && 43 - !(pte_val(pte) & _PAGE_WRITE); 44 - young = pte_val(pte) & _PAGE_YOUNG; 45 - if (none || young) 46 - pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG; 47 - if (prot || (none && young)) 48 - pmd_val(pmd) |= _SEGMENT_ENTRY_PROTECT; 34 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_READ) >> 4; 35 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_WRITE) >> 4; 36 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_INVALID) >> 5; 37 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_PROTECT); 38 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_DIRTY) << 10; 39 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_YOUNG) << 10; 49 40 } else 50 41 pmd_val(pmd) = _SEGMENT_ENTRY_INVALID; 51 42 return pmd; ··· 47 56 pte_t pte; 48 57 49 58 /* 50 - * Convert encoding pmd bits pte bits 51 - * ..R...I...y. .IR...wrdytp 52 - * empty ..0...1...0. -> .10...000000 53 - * prot-none, old ..0...1...1. -> .10...001001 54 - * prot-none, young ..1...1...1. -> .10...001101 55 - * read-only, old ..1...1...0. -> .11...011001 56 - * read-only, young ..1...0...1. -> .01...011101 57 - * read-write, old ..0...1...0. -> .10...111001 58 - * read-write, young ..0...0...1. -> .00...111101 59 - * Huge ptes are dirty by definition 59 + * Convert encoding pmd bits pte bits 60 + * dy..R...I...wr .IR...wrdytp 61 + * empty 00..0...1...00 -> .10...001100 62 + * prot-none, clean, old 00..0...1...00 -> .10...000001 63 + * prot-none, clean, young 01..0...1...00 -> .10...000101 64 + * prot-none, dirty, old 10..0...1...00 -> .10...001001 65 + * prot-none, dirty, young 11..0...1...00 -> .10...001101 66 + * read-only, clean, old 00..1...1...01 -> .11...010001 67 + * read-only, clean, young 01..1...1...01 -> .11...010101 68 + * read-only, dirty, old 10..1...1...01 -> .11...011001 69 + * read-only, dirty, young 11..1...1...01 -> .11...011101 70 + * read-write, clean, old 00..0...1...11 -> .10...110001 71 + * read-write, clean, young 01..0...1...11 -> .10...110101 72 + * read-write, dirty, old 10..0...1...11 -> .10...111001 73 + * read-write, dirty, young 11..0...1...11 -> .10...111101 60 74 */ 61 75 if (pmd_present(pmd)) { 62 - pte_val(pte) = _PAGE_PRESENT | _PAGE_LARGE | _PAGE_DIRTY | 63 - (pmd_val(pmd) & PAGE_MASK); 64 - if (pmd_val(pmd) & _SEGMENT_ENTRY_INVALID) 65 - pte_val(pte) |= _PAGE_INVALID; 66 - if (pmd_prot_none(pmd)) { 67 - if (pmd_val(pmd) & _SEGMENT_ENTRY_PROTECT) 68 - pte_val(pte) |= _PAGE_YOUNG; 69 - } else { 70 - pte_val(pte) |= _PAGE_READ; 71 - if (pmd_val(pmd) & _SEGMENT_ENTRY_PROTECT) 72 - pte_val(pte) |= _PAGE_PROTECT; 73 - else 74 - pte_val(pte) |= _PAGE_WRITE; 75 - if (pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG) 76 - pte_val(pte) |= _PAGE_YOUNG; 77 - } 76 + pte_val(pte) = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN_LARGE; 77 + pte_val(pte) |= _PAGE_LARGE | _PAGE_PRESENT; 78 + pte_val(pte) |= (pmd_val(pmd) & _SEGMENT_ENTRY_READ) << 4; 79 + pte_val(pte) |= (pmd_val(pmd) & _SEGMENT_ENTRY_WRITE) << 4; 80 + pte_val(pte) |= (pmd_val(pmd) & _SEGMENT_ENTRY_INVALID) << 5; 81 + pte_val(pte) |= (pmd_val(pmd) & _SEGMENT_ENTRY_PROTECT); 82 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_DIRTY) << 10; 83 + pmd_val(pmd) |= (pte_val(pte) & _PAGE_YOUNG) << 10; 78 84 } else 79 85 pte_val(pte) = _PAGE_INVALID; 80 86 return pte; ··· 84 96 85 97 pmd = __pte_to_pmd(pte); 86 98 if (!MACHINE_HAS_HPAGE) { 99 + /* Emulated huge ptes loose the dirty and young bit */ 87 100 pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN; 88 101 pmd_val(pmd) |= pte_page(pte)[1].index; 89 102 } else ··· 102 113 origin = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN; 103 114 pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN; 104 115 pmd_val(pmd) |= *(unsigned long *) origin; 116 + /* Emulated huge ptes are young and dirty by definition */ 117 + pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY; 105 118 } 106 119 return __pmd_to_pte(pmd); 107 120 }
+6 -2
arch/s390/mm/pgtable.c
··· 1279 1279 { 1280 1280 unsigned long next, *table, *new; 1281 1281 struct page *page; 1282 + spinlock_t *ptl; 1282 1283 pmd_t *pmd; 1283 1284 1284 1285 pmd = pmd_offset(pud, addr); ··· 1297 1296 if (!new) 1298 1297 return -ENOMEM; 1299 1298 1300 - spin_lock(&mm->page_table_lock); 1299 + ptl = pmd_lock(mm, pmd); 1301 1300 if (likely((unsigned long *) pmd_deref(*pmd) == table)) { 1302 1301 /* Nuke pmd entry pointing to the "short" page table */ 1303 1302 pmdp_flush_lazy(mm, addr, pmd); ··· 1311 1310 page_table_free_rcu(tlb, table); 1312 1311 new = NULL; 1313 1312 } 1314 - spin_unlock(&mm->page_table_lock); 1313 + spin_unlock(ptl); 1315 1314 if (new) { 1316 1315 page_table_free_pgste(new); 1317 1316 goto again; ··· 1433 1432 { 1434 1433 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 1435 1434 1435 + entry = pmd_mkyoung(entry); 1436 + if (dirty) 1437 + entry = pmd_mkdirty(entry); 1436 1438 if (pmd_same(*pmdp, entry)) 1437 1439 return 0; 1438 1440 pmdp_invalidate(vma, address, pmdp);
+2 -2
arch/s390/pci/pci.c
··· 15 15 * Thomas Klein 16 16 */ 17 17 18 - #define COMPONENT "zPCI" 19 - #define pr_fmt(fmt) COMPONENT ": " fmt 18 + #define KMSG_COMPONENT "zpci" 19 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 20 20 21 21 #include <linux/kernel.h> 22 22 #include <linux/slab.h>
+2 -2
arch/s390/pci/pci_clp.c
··· 5 5 * Jan Glauber <jang@linux.vnet.ibm.com> 6 6 */ 7 7 8 - #define COMPONENT "zPCI" 9 - #define pr_fmt(fmt) COMPONENT ": " fmt 8 + #define KMSG_COMPONENT "zpci" 9 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 10 10 11 11 #include <linux/kernel.h> 12 12 #include <linux/slab.h>
+2 -2
arch/s390/pci/pci_debug.c
··· 5 5 * Jan Glauber <jang@linux.vnet.ibm.com> 6 6 */ 7 7 8 - #define COMPONENT "zPCI" 9 - #define pr_fmt(fmt) COMPONENT ": " fmt 8 + #define KMSG_COMPONENT "zpci" 9 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 10 10 11 11 #include <linux/kernel.h> 12 12 #include <linux/seq_file.h>
+36 -14
arch/s390/pci/pci_dma.c
··· 16 16 17 17 static struct kmem_cache *dma_region_table_cache; 18 18 static struct kmem_cache *dma_page_table_cache; 19 + static int s390_iommu_strict; 20 + 21 + static int zpci_refresh_global(struct zpci_dev *zdev) 22 + { 23 + return zpci_refresh_trans((u64) zdev->fh << 32, zdev->start_dma, 24 + zdev->iommu_pages * PAGE_SIZE); 25 + } 19 26 20 27 static unsigned long *dma_alloc_cpu_table(void) 21 28 { ··· 162 155 } 163 156 164 157 /* 165 - * rpcit is not required to establish new translations when previously 166 - * invalid translation-table entries are validated, however it is 167 - * required when altering previously valid entries. 158 + * With zdev->tlb_refresh == 0, rpcit is not required to establish new 159 + * translations when previously invalid translation-table entries are 160 + * validated. With lazy unmap, it also is skipped for previously valid 161 + * entries, but a global rpcit is then required before any address can 162 + * be re-used, i.e. after each iommu bitmap wrap-around. 168 163 */ 169 164 if (!zdev->tlb_refresh && 170 - ((flags & ZPCI_PTE_VALID_MASK) == ZPCI_PTE_VALID)) 171 - /* 172 - * TODO: also need to check that the old entry is indeed INVALID 173 - * and not only for one page but for the whole range... 174 - * -> now we WARN_ON in that case but with lazy unmap that 175 - * needs to be redone! 176 - */ 165 + (!s390_iommu_strict || 166 + ((flags & ZPCI_PTE_VALID_MASK) == ZPCI_PTE_VALID))) 177 167 goto no_refresh; 178 168 179 169 rc = zpci_refresh_trans((u64) zdev->fh << 32, start_dma_addr, ··· 224 220 static unsigned long dma_alloc_iommu(struct zpci_dev *zdev, int size) 225 221 { 226 222 unsigned long offset, flags; 223 + int wrap = 0; 227 224 228 225 spin_lock_irqsave(&zdev->iommu_bitmap_lock, flags); 229 226 offset = __dma_alloc_iommu(zdev, zdev->next_bit, size); 230 - if (offset == -1) 227 + if (offset == -1) { 228 + /* wrap-around */ 231 229 offset = __dma_alloc_iommu(zdev, 0, size); 230 + wrap = 1; 231 + } 232 232 233 233 if (offset != -1) { 234 234 zdev->next_bit = offset + size; 235 - if (zdev->next_bit >= zdev->iommu_pages) 236 - zdev->next_bit = 0; 235 + if (!zdev->tlb_refresh && !s390_iommu_strict && wrap) 236 + /* global flush after wrap-around with lazy unmap */ 237 + zpci_refresh_global(zdev); 237 238 } 238 239 spin_unlock_irqrestore(&zdev->iommu_bitmap_lock, flags); 239 240 return offset; ··· 252 243 if (!zdev->iommu_bitmap) 253 244 goto out; 254 245 bitmap_clear(zdev->iommu_bitmap, offset, size); 255 - if (offset >= zdev->next_bit) 246 + /* 247 + * Lazy flush for unmap: need to move next_bit to avoid address re-use 248 + * until wrap-around. 249 + */ 250 + if (!s390_iommu_strict && offset >= zdev->next_bit) 256 251 zdev->next_bit = offset + size; 257 252 out: 258 253 spin_unlock_irqrestore(&zdev->iommu_bitmap_lock, flags); ··· 517 504 /* dma_supported is unconditionally true without a callback */ 518 505 }; 519 506 EXPORT_SYMBOL_GPL(s390_dma_ops); 507 + 508 + static int __init s390_iommu_setup(char *str) 509 + { 510 + if (!strncmp(str, "strict", 6)) 511 + s390_iommu_strict = 1; 512 + return 0; 513 + } 514 + 515 + __setup("s390_iommu=", s390_iommu_setup);
+2 -2
arch/s390/pci/pci_event.c
··· 5 5 * Jan Glauber <jang@linux.vnet.ibm.com> 6 6 */ 7 7 8 - #define COMPONENT "zPCI" 9 - #define pr_fmt(fmt) COMPONENT ": " fmt 8 + #define KMSG_COMPONENT "zpci" 9 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 10 10 11 11 #include <linux/kernel.h> 12 12 #include <linux/pci.h>
+2 -2
arch/s390/pci/pci_sysfs.c
··· 5 5 * Jan Glauber <jang@linux.vnet.ibm.com> 6 6 */ 7 7 8 - #define COMPONENT "zPCI" 9 - #define pr_fmt(fmt) COMPONENT ": " fmt 8 + #define KMSG_COMPONENT "zpci" 9 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 10 10 11 11 #include <linux/kernel.h> 12 12 #include <linux/stat.h>
+2 -2
drivers/pci/hotplug/s390_pci_hpc.c
··· 7 7 * Jan Glauber <jang@linux.vnet.ibm.com> 8 8 */ 9 9 10 - #define COMPONENT "zPCI hpc" 11 - #define pr_fmt(fmt) COMPONENT ": " fmt 10 + #define KMSG_COMPONENT "zpci" 11 + #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 12 12 13 13 #include <linux/module.h> 14 14 #include <linux/kernel.h>
+102 -94
drivers/s390/block/dasd.c
··· 42 42 * SECTION: exported variables of dasd.c 43 43 */ 44 44 debug_info_t *dasd_debug_area; 45 + EXPORT_SYMBOL(dasd_debug_area); 45 46 static struct dentry *dasd_debugfs_root_entry; 46 47 struct dasd_discipline *dasd_diag_discipline_pointer; 48 + EXPORT_SYMBOL(dasd_diag_discipline_pointer); 47 49 void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *); 48 50 49 51 MODULE_AUTHOR("Holger Smolinski <Holger.Smolinski@de.ibm.com>"); ··· 166 164 167 165 return block; 168 166 } 167 + EXPORT_SYMBOL_GPL(dasd_alloc_block); 169 168 170 169 /* 171 170 * Free memory of a device structure. ··· 175 172 { 176 173 kfree(block); 177 174 } 175 + EXPORT_SYMBOL_GPL(dasd_free_block); 178 176 179 177 /* 180 178 * Make a new device known to the system. ··· 285 281 { 286 282 int rc; 287 283 284 + if (device->discipline->basic_to_known) { 285 + rc = device->discipline->basic_to_known(device); 286 + if (rc) 287 + return rc; 288 + } 289 + 288 290 if (device->block) { 289 291 dasd_profile_exit(&device->block->profile); 290 - if (device->block->debugfs_dentry) 291 - debugfs_remove(device->block->debugfs_dentry); 292 + debugfs_remove(device->block->debugfs_dentry); 292 293 dasd_gendisk_free(device->block); 293 294 dasd_block_clear_timer(device->block); 294 295 } ··· 302 293 return rc; 303 294 dasd_device_clear_timer(device); 304 295 dasd_profile_exit(&device->profile); 305 - if (device->debugfs_dentry) 306 - debugfs_remove(device->debugfs_dentry); 307 - 296 + debugfs_remove(device->debugfs_dentry); 308 297 DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device); 309 298 if (device->debug_area != NULL) { 310 299 debug_unregister(device->debug_area); ··· 381 374 { 382 375 int rc; 383 376 384 - if (device->discipline->ready_to_basic) { 385 - rc = device->discipline->ready_to_basic(device); 386 - if (rc) 387 - return rc; 388 - } 389 377 device->state = DASD_STATE_BASIC; 390 378 if (device->block) { 391 379 struct dasd_block *block = device->block; ··· 581 579 /* queue call to dasd_kick_device to the kernel event daemon. */ 582 580 schedule_work(&device->kick_work); 583 581 } 582 + EXPORT_SYMBOL(dasd_kick_device); 584 583 585 584 /* 586 585 * dasd_reload_device will schedule a call do do_reload_device to the kernel ··· 642 639 mutex_unlock(&device->state_mutex); 643 640 dasd_put_device(device); 644 641 } 642 + EXPORT_SYMBOL(dasd_set_target_state); 645 643 646 644 /* 647 645 * Enable devices with device numbers in [from..to]. ··· 665 661 if (device->discipline->kick_validate) 666 662 device->discipline->kick_validate(device); 667 663 } 664 + EXPORT_SYMBOL(dasd_enable_device); 668 665 669 666 /* 670 667 * SECTION: device operation (interrupt handler, start i/o, term i/o ...) ··· 977 972 seq_printf(m, "total_sectors %u\n", data->dasd_io_sects); 978 973 seq_printf(m, "total_pav %u\n", data->dasd_io_alias); 979 974 seq_printf(m, "total_hpf %u\n", data->dasd_io_tpm); 980 - seq_printf(m, "histogram_sectors "); 975 + seq_puts(m, "histogram_sectors "); 981 976 dasd_stats_array(m, data->dasd_io_secs); 982 - seq_printf(m, "histogram_io_times "); 977 + seq_puts(m, "histogram_io_times "); 983 978 dasd_stats_array(m, data->dasd_io_times); 984 - seq_printf(m, "histogram_io_times_weighted "); 979 + seq_puts(m, "histogram_io_times_weighted "); 985 980 dasd_stats_array(m, data->dasd_io_timps); 986 - seq_printf(m, "histogram_time_build_to_ssch "); 981 + seq_puts(m, "histogram_time_build_to_ssch "); 987 982 dasd_stats_array(m, data->dasd_io_time1); 988 - seq_printf(m, "histogram_time_ssch_to_irq "); 983 + seq_puts(m, "histogram_time_ssch_to_irq "); 989 984 dasd_stats_array(m, data->dasd_io_time2); 990 - seq_printf(m, "histogram_time_ssch_to_irq_weighted "); 985 + seq_puts(m, "histogram_time_ssch_to_irq_weighted "); 991 986 dasd_stats_array(m, data->dasd_io_time2ps); 992 - seq_printf(m, "histogram_time_irq_to_end "); 987 + seq_puts(m, "histogram_time_irq_to_end "); 993 988 dasd_stats_array(m, data->dasd_io_time3); 994 - seq_printf(m, "histogram_ccw_queue_length "); 989 + seq_puts(m, "histogram_ccw_queue_length "); 995 990 dasd_stats_array(m, data->dasd_io_nr_req); 996 991 seq_printf(m, "total_read_requests %u\n", data->dasd_read_reqs); 997 992 seq_printf(m, "total_read_sectors %u\n", data->dasd_read_sects); 998 993 seq_printf(m, "total_read_pav %u\n", data->dasd_read_alias); 999 994 seq_printf(m, "total_read_hpf %u\n", data->dasd_read_tpm); 1000 - seq_printf(m, "histogram_read_sectors "); 995 + seq_puts(m, "histogram_read_sectors "); 1001 996 dasd_stats_array(m, data->dasd_read_secs); 1002 - seq_printf(m, "histogram_read_times "); 997 + seq_puts(m, "histogram_read_times "); 1003 998 dasd_stats_array(m, data->dasd_read_times); 1004 - seq_printf(m, "histogram_read_time_build_to_ssch "); 999 + seq_puts(m, "histogram_read_time_build_to_ssch "); 1005 1000 dasd_stats_array(m, data->dasd_read_time1); 1006 - seq_printf(m, "histogram_read_time_ssch_to_irq "); 1001 + seq_puts(m, "histogram_read_time_ssch_to_irq "); 1007 1002 dasd_stats_array(m, data->dasd_read_time2); 1008 - seq_printf(m, "histogram_read_time_irq_to_end "); 1003 + seq_puts(m, "histogram_read_time_irq_to_end "); 1009 1004 dasd_stats_array(m, data->dasd_read_time3); 1010 - seq_printf(m, "histogram_read_ccw_queue_length "); 1005 + seq_puts(m, "histogram_read_ccw_queue_length "); 1011 1006 dasd_stats_array(m, data->dasd_read_nr_req); 1012 1007 } 1013 1008 ··· 1021 1016 data = profile->data; 1022 1017 if (!data) { 1023 1018 spin_unlock_bh(&profile->lock); 1024 - seq_printf(m, "disabled\n"); 1019 + seq_puts(m, "disabled\n"); 1025 1020 return 0; 1026 1021 } 1027 1022 dasd_stats_seq_print(m, data); ··· 1074 1069 static int dasd_stats_global_show(struct seq_file *m, void *v) 1075 1070 { 1076 1071 if (!dasd_global_profile_level) { 1077 - seq_printf(m, "disabled\n"); 1072 + seq_puts(m, "disabled\n"); 1078 1073 return 0; 1079 1074 } 1080 1075 dasd_stats_seq_print(m, &dasd_global_profile_data); ··· 1116 1111 static void dasd_profile_exit(struct dasd_profile *profile) 1117 1112 { 1118 1113 dasd_profile_off(profile); 1119 - if (profile->dentry) { 1120 - debugfs_remove(profile->dentry); 1121 - profile->dentry = NULL; 1122 - } 1114 + debugfs_remove(profile->dentry); 1115 + profile->dentry = NULL; 1123 1116 } 1124 1117 1125 1118 static void dasd_statistics_removeroot(void) 1126 1119 { 1127 1120 dasd_global_profile_level = DASD_PROFILE_OFF; 1128 - if (dasd_global_profile_dentry) { 1129 - debugfs_remove(dasd_global_profile_dentry); 1130 - dasd_global_profile_dentry = NULL; 1131 - } 1132 - if (dasd_debugfs_global_entry) 1133 - debugfs_remove(dasd_debugfs_global_entry); 1134 - if (dasd_debugfs_root_entry) 1135 - debugfs_remove(dasd_debugfs_root_entry); 1121 + debugfs_remove(dasd_global_profile_dentry); 1122 + dasd_global_profile_dentry = NULL; 1123 + debugfs_remove(dasd_debugfs_global_entry); 1124 + debugfs_remove(dasd_debugfs_root_entry); 1136 1125 } 1137 1126 1138 1127 static void dasd_statistics_createroot(void) ··· 1177 1178 1178 1179 int dasd_stats_generic_show(struct seq_file *m, void *v) 1179 1180 { 1180 - seq_printf(m, "Statistics are not activated in this kernel\n"); 1181 + seq_puts(m, "Statistics are not activated in this kernel\n"); 1181 1182 return 0; 1182 1183 } 1183 1184 ··· 1242 1243 dasd_get_device(device); 1243 1244 return cqr; 1244 1245 } 1246 + EXPORT_SYMBOL(dasd_kmalloc_request); 1245 1247 1246 1248 struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, 1247 1249 int datasize, ··· 1282 1282 dasd_get_device(device); 1283 1283 return cqr; 1284 1284 } 1285 + EXPORT_SYMBOL(dasd_smalloc_request); 1285 1286 1286 1287 /* 1287 1288 * Free memory of a channel program. This function needs to free all the ··· 1305 1304 kfree(cqr); 1306 1305 dasd_put_device(device); 1307 1306 } 1307 + EXPORT_SYMBOL(dasd_kfree_request); 1308 1308 1309 1309 void dasd_sfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device) 1310 1310 { ··· 1316 1314 spin_unlock_irqrestore(&device->mem_lock, flags); 1317 1315 dasd_put_device(device); 1318 1316 } 1317 + EXPORT_SYMBOL(dasd_sfree_request); 1319 1318 1320 1319 /* 1321 1320 * Check discipline magic in cqr. ··· 1394 1391 dasd_schedule_device_bh(device); 1395 1392 return rc; 1396 1393 } 1394 + EXPORT_SYMBOL(dasd_term_IO); 1397 1395 1398 1396 /* 1399 1397 * Start the i/o. This start_IO can fail if the channel is really busy. ··· 1513 1509 cqr->intrc = rc; 1514 1510 return rc; 1515 1511 } 1512 + EXPORT_SYMBOL(dasd_start_IO); 1516 1513 1517 1514 /* 1518 1515 * Timeout function for dasd devices. This is used for different purposes ··· 1546 1541 else 1547 1542 mod_timer(&device->timer, jiffies + expires); 1548 1543 } 1544 + EXPORT_SYMBOL(dasd_device_set_timer); 1549 1545 1550 1546 /* 1551 1547 * Clear timeout for a device. ··· 1555 1549 { 1556 1550 del_timer(&device->timer); 1557 1551 } 1552 + EXPORT_SYMBOL(dasd_device_clear_timer); 1558 1553 1559 1554 static void dasd_handle_killed_request(struct ccw_device *cdev, 1560 1555 unsigned long intparm) ··· 1608 1601 if (device->block) 1609 1602 dasd_schedule_block_bh(device->block); 1610 1603 } 1604 + EXPORT_SYMBOL_GPL(dasd_generic_handle_state_change); 1611 1605 1612 1606 /* 1613 1607 * Interrupt handler for "normal" ssch-io based dasd devices. ··· 1675 1667 if (cqr->status == DASD_CQR_CLEAR_PENDING && 1676 1668 scsw_fctl(&irb->scsw) & SCSW_FCTL_CLEAR_FUNC) { 1677 1669 cqr->status = DASD_CQR_CLEARED; 1670 + if (cqr->callback_data == DASD_SLEEPON_START_TAG) 1671 + cqr->callback_data = DASD_SLEEPON_END_TAG; 1678 1672 dasd_device_clear_timer(device); 1679 1673 wake_up(&dasd_flush_wq); 1674 + wake_up(&generic_waitq); 1680 1675 dasd_schedule_device_bh(device); 1681 1676 return; 1682 1677 } ··· 1733 1722 dasd_device_clear_timer(device); 1734 1723 dasd_schedule_device_bh(device); 1735 1724 } 1725 + EXPORT_SYMBOL(dasd_int_handler); 1736 1726 1737 1727 enum uc_todo dasd_generic_uc_handler(struct ccw_device *cdev, struct irb *irb) 1738 1728 { ··· 2007 1995 __dasd_device_process_final_queue(device, &flush_queue); 2008 1996 return rc; 2009 1997 } 1998 + EXPORT_SYMBOL_GPL(dasd_flush_device_queue); 2010 1999 2011 2000 /* 2012 2001 * Acquire the device lock and process queues for the device. ··· 2047 2034 dasd_get_device(device); 2048 2035 tasklet_hi_schedule(&device->tasklet); 2049 2036 } 2037 + EXPORT_SYMBOL(dasd_schedule_device_bh); 2050 2038 2051 2039 void dasd_device_set_stop_bits(struct dasd_device *device, int bits) 2052 2040 { ··· 2080 2066 dasd_schedule_device_bh(device); 2081 2067 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); 2082 2068 } 2069 + EXPORT_SYMBOL(dasd_add_request_head); 2083 2070 2084 2071 /* 2085 2072 * Queue a request to the tail of the device ccw_queue. ··· 2099 2084 dasd_schedule_device_bh(device); 2100 2085 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); 2101 2086 } 2087 + EXPORT_SYMBOL(dasd_add_request_tail); 2102 2088 2103 2089 /* 2104 2090 * Wakeup helper for the 'sleep_on' functions. ··· 2307 2291 2308 2292 rc = 0; 2309 2293 list_for_each_entry_safe(cqr, n, ccw_queue, blocklist) { 2310 - if (__dasd_sleep_on_erp(cqr)) 2311 - rc = 1; 2294 + /* 2295 + * for alias devices simplify error recovery and 2296 + * return to upper layer 2297 + */ 2298 + if (cqr->startdev != cqr->basedev && 2299 + (cqr->status == DASD_CQR_TERMINATED || 2300 + cqr->status == DASD_CQR_NEED_ERP)) 2301 + return -EAGAIN; 2302 + else { 2303 + /* normal recovery for basedev IO */ 2304 + if (__dasd_sleep_on_erp(cqr)) { 2305 + if (!cqr->status == DASD_CQR_TERMINATED && 2306 + !cqr->status == DASD_CQR_NEED_ERP) 2307 + break; 2308 + rc = 1; 2309 + } 2310 + } 2312 2311 } 2313 2312 if (rc) 2314 2313 goto retry; 2315 - 2316 2314 2317 2315 return 0; 2318 2316 } ··· 2339 2309 { 2340 2310 return _dasd_sleep_on(cqr, 0); 2341 2311 } 2312 + EXPORT_SYMBOL(dasd_sleep_on); 2342 2313 2343 2314 /* 2344 2315 * Start requests from a ccw_queue and wait for their completion. ··· 2358 2327 { 2359 2328 return _dasd_sleep_on(cqr, 1); 2360 2329 } 2330 + EXPORT_SYMBOL(dasd_sleep_on_interruptible); 2361 2331 2362 2332 /* 2363 2333 * Whoa nelly now it gets really hairy. For some functions (e.g. steal lock ··· 2433 2401 2434 2402 return rc; 2435 2403 } 2404 + EXPORT_SYMBOL(dasd_sleep_on_immediatly); 2436 2405 2437 2406 /* 2438 2407 * Cancels a request that was started with dasd_sleep_on_req. ··· 2456 2423 case DASD_CQR_QUEUED: 2457 2424 /* request was not started - just set to cleared */ 2458 2425 cqr->status = DASD_CQR_CLEARED; 2426 + if (cqr->callback_data == DASD_SLEEPON_START_TAG) 2427 + cqr->callback_data = DASD_SLEEPON_END_TAG; 2459 2428 break; 2460 2429 case DASD_CQR_IN_IO: 2461 2430 /* request in IO - terminate IO and release again */ ··· 2477 2442 dasd_schedule_device_bh(device); 2478 2443 return rc; 2479 2444 } 2445 + EXPORT_SYMBOL(dasd_cancel_req); 2480 2446 2481 2447 /* 2482 2448 * SECTION: Operations of the dasd_block layer. ··· 2511 2475 else 2512 2476 mod_timer(&block->timer, jiffies + expires); 2513 2477 } 2478 + EXPORT_SYMBOL(dasd_block_set_timer); 2514 2479 2515 2480 /* 2516 2481 * Clear timeout for a dasd_block. ··· 2520 2483 { 2521 2484 del_timer(&block->timer); 2522 2485 } 2486 + EXPORT_SYMBOL(dasd_block_clear_timer); 2523 2487 2524 2488 /* 2525 2489 * Process finished error recovery ccw. ··· 2902 2864 dasd_get_device(block->base); 2903 2865 tasklet_hi_schedule(&block->tasklet); 2904 2866 } 2867 + EXPORT_SYMBOL(dasd_schedule_block_bh); 2905 2868 2906 2869 2907 2870 /* ··· 3241 3202 3242 3203 ret = ccw_device_set_online(cdev); 3243 3204 if (ret) 3244 - pr_warning("%s: Setting the DASD online failed with rc=%d\n", 3245 - dev_name(&cdev->dev), ret); 3205 + pr_warn("%s: Setting the DASD online failed with rc=%d\n", 3206 + dev_name(&cdev->dev), ret); 3246 3207 } 3247 3208 3248 3209 /* ··· 3273 3234 async_schedule(dasd_generic_auto_online, cdev); 3274 3235 return 0; 3275 3236 } 3237 + EXPORT_SYMBOL_GPL(dasd_generic_probe); 3276 3238 3277 3239 /* 3278 3240 * This will one day be called from a global not_oper handler. ··· 3316 3276 3317 3277 dasd_remove_sysfs_files(cdev); 3318 3278 } 3279 + EXPORT_SYMBOL_GPL(dasd_generic_remove); 3319 3280 3320 3281 /* 3321 3282 * Activate a device. This is called from dasd_{eckd,fba}_probe() when either ··· 3339 3298 discipline = base_discipline; 3340 3299 if (device->features & DASD_FEATURE_USEDIAG) { 3341 3300 if (!dasd_diag_discipline_pointer) { 3342 - pr_warning("%s Setting the DASD online failed because " 3343 - "of missing DIAG discipline\n", 3344 - dev_name(&cdev->dev)); 3301 + pr_warn("%s Setting the DASD online failed because of missing DIAG discipline\n", 3302 + dev_name(&cdev->dev)); 3345 3303 dasd_delete_device(device); 3346 3304 return -ENODEV; 3347 3305 } ··· 3361 3321 /* check_device will allocate block device if necessary */ 3362 3322 rc = discipline->check_device(device); 3363 3323 if (rc) { 3364 - pr_warning("%s Setting the DASD online with discipline %s " 3365 - "failed with rc=%i\n", 3366 - dev_name(&cdev->dev), discipline->name, rc); 3324 + pr_warn("%s Setting the DASD online with discipline %s failed with rc=%i\n", 3325 + dev_name(&cdev->dev), discipline->name, rc); 3367 3326 module_put(discipline->owner); 3368 3327 module_put(base_discipline->owner); 3369 3328 dasd_delete_device(device); ··· 3371 3332 3372 3333 dasd_set_target_state(device, DASD_STATE_ONLINE); 3373 3334 if (device->state <= DASD_STATE_KNOWN) { 3374 - pr_warning("%s Setting the DASD online failed because of a " 3375 - "missing discipline\n", dev_name(&cdev->dev)); 3335 + pr_warn("%s Setting the DASD online failed because of a missing discipline\n", 3336 + dev_name(&cdev->dev)); 3376 3337 rc = -ENODEV; 3377 3338 dasd_set_target_state(device, DASD_STATE_NEW); 3378 3339 if (device->block) ··· 3387 3348 dasd_put_device(device); 3388 3349 return rc; 3389 3350 } 3351 + EXPORT_SYMBOL_GPL(dasd_generic_set_online); 3390 3352 3391 3353 int dasd_generic_set_offline(struct ccw_device *cdev) 3392 3354 { ··· 3411 3371 open_count = atomic_read(&device->block->open_count); 3412 3372 if (open_count > max_count) { 3413 3373 if (open_count > 0) 3414 - pr_warning("%s: The DASD cannot be set offline " 3415 - "with open count %i\n", 3416 - dev_name(&cdev->dev), open_count); 3374 + pr_warn("%s: The DASD cannot be set offline with open count %i\n", 3375 + dev_name(&cdev->dev), open_count); 3417 3376 else 3418 - pr_warning("%s: The DASD cannot be set offline " 3419 - "while it is in use\n", 3420 - dev_name(&cdev->dev)); 3377 + pr_warn("%s: The DASD cannot be set offline while it is in use\n", 3378 + dev_name(&cdev->dev)); 3421 3379 clear_bit(DASD_FLAG_OFFLINE, &device->flags); 3422 3380 dasd_put_device(device); 3423 3381 return -EBUSY; ··· 3489 3451 dasd_put_device(device); 3490 3452 return rc; 3491 3453 } 3454 + EXPORT_SYMBOL_GPL(dasd_generic_set_offline); 3492 3455 3493 3456 int dasd_generic_last_path_gone(struct dasd_device *device) 3494 3457 { ··· 3531 3492 dasd_schedule_device_bh(device); 3532 3493 if (device->block) 3533 3494 dasd_schedule_block_bh(device->block); 3495 + 3496 + if (!device->stopped) 3497 + wake_up(&generic_waitq); 3498 + 3534 3499 return 1; 3535 3500 } 3536 3501 EXPORT_SYMBOL_GPL(dasd_generic_path_operational); ··· 3566 3523 dasd_put_device(device); 3567 3524 return ret; 3568 3525 } 3526 + EXPORT_SYMBOL_GPL(dasd_generic_notify); 3569 3527 3570 3528 void dasd_generic_path_event(struct ccw_device *cdev, int *path_event) 3571 3529 { ··· 3916 3872 3917 3873 module_init(dasd_init); 3918 3874 module_exit(dasd_exit); 3919 - 3920 - EXPORT_SYMBOL(dasd_debug_area); 3921 - EXPORT_SYMBOL(dasd_diag_discipline_pointer); 3922 - 3923 - EXPORT_SYMBOL(dasd_add_request_head); 3924 - EXPORT_SYMBOL(dasd_add_request_tail); 3925 - EXPORT_SYMBOL(dasd_cancel_req); 3926 - EXPORT_SYMBOL(dasd_device_clear_timer); 3927 - EXPORT_SYMBOL(dasd_block_clear_timer); 3928 - EXPORT_SYMBOL(dasd_enable_device); 3929 - EXPORT_SYMBOL(dasd_int_handler); 3930 - EXPORT_SYMBOL(dasd_kfree_request); 3931 - EXPORT_SYMBOL(dasd_kick_device); 3932 - EXPORT_SYMBOL(dasd_kmalloc_request); 3933 - EXPORT_SYMBOL(dasd_schedule_device_bh); 3934 - EXPORT_SYMBOL(dasd_schedule_block_bh); 3935 - EXPORT_SYMBOL(dasd_set_target_state); 3936 - EXPORT_SYMBOL(dasd_device_set_timer); 3937 - EXPORT_SYMBOL(dasd_block_set_timer); 3938 - EXPORT_SYMBOL(dasd_sfree_request); 3939 - EXPORT_SYMBOL(dasd_sleep_on); 3940 - EXPORT_SYMBOL(dasd_sleep_on_immediatly); 3941 - EXPORT_SYMBOL(dasd_sleep_on_interruptible); 3942 - EXPORT_SYMBOL(dasd_smalloc_request); 3943 - EXPORT_SYMBOL(dasd_start_IO); 3944 - EXPORT_SYMBOL(dasd_term_IO); 3945 - 3946 - EXPORT_SYMBOL_GPL(dasd_generic_probe); 3947 - EXPORT_SYMBOL_GPL(dasd_generic_remove); 3948 - EXPORT_SYMBOL_GPL(dasd_generic_notify); 3949 - EXPORT_SYMBOL_GPL(dasd_generic_set_online); 3950 - EXPORT_SYMBOL_GPL(dasd_generic_set_offline); 3951 - EXPORT_SYMBOL_GPL(dasd_generic_handle_state_change); 3952 - EXPORT_SYMBOL_GPL(dasd_flush_device_queue); 3953 - EXPORT_SYMBOL_GPL(dasd_alloc_block); 3954 - EXPORT_SYMBOL_GPL(dasd_free_block);
+19 -11
drivers/s390/block/dasd_eckd.c
··· 2039 2039 return 0; 2040 2040 }; 2041 2041 2042 - static int dasd_eckd_ready_to_basic(struct dasd_device *device) 2042 + static int dasd_eckd_basic_to_known(struct dasd_device *device) 2043 2043 { 2044 2044 return dasd_alias_remove_device(device); 2045 2045 }; ··· 2061 2061 2062 2062 static struct dasd_ccw_req * 2063 2063 dasd_eckd_build_format(struct dasd_device *base, 2064 - struct format_data_t *fdata) 2064 + struct format_data_t *fdata, 2065 + int enable_pav) 2065 2066 { 2066 2067 struct dasd_eckd_private *base_priv; 2067 2068 struct dasd_eckd_private *start_priv; 2068 - struct dasd_device *startdev; 2069 + struct dasd_device *startdev = NULL; 2069 2070 struct dasd_ccw_req *fcp; 2070 2071 struct eckd_count *ect; 2071 2072 struct ch_t address; ··· 2080 2079 int nr_tracks; 2081 2080 int use_prefix; 2082 2081 2083 - startdev = dasd_alias_get_start_dev(base); 2082 + if (enable_pav) 2083 + startdev = dasd_alias_get_start_dev(base); 2084 + 2084 2085 if (!startdev) 2085 2086 startdev = base; 2086 2087 ··· 2312 2309 2313 2310 fcp->startdev = startdev; 2314 2311 fcp->memdev = startdev; 2312 + fcp->basedev = base; 2315 2313 fcp->retries = 256; 2316 2314 fcp->expires = startdev->default_expires * HZ; 2317 2315 fcp->buildclk = get_tod_clock(); ··· 2323 2319 2324 2320 static int 2325 2321 dasd_eckd_format_device(struct dasd_device *base, 2326 - struct format_data_t *fdata) 2322 + struct format_data_t *fdata, 2323 + int enable_pav) 2327 2324 { 2328 2325 struct dasd_ccw_req *cqr, *n; 2329 2326 struct dasd_block *block; ··· 2332 2327 struct list_head format_queue; 2333 2328 struct dasd_device *device; 2334 2329 int old_stop, format_step; 2335 - int step, rc = 0; 2330 + int step, rc = 0, sleep_rc; 2336 2331 2337 2332 block = base->block; 2338 2333 private = (struct dasd_eckd_private *) base->private; ··· 2366 2361 } 2367 2362 2368 2363 INIT_LIST_HEAD(&format_queue); 2369 - old_stop = fdata->stop_unit; 2370 2364 2365 + old_stop = fdata->stop_unit; 2371 2366 while (fdata->start_unit <= 1) { 2372 2367 fdata->stop_unit = fdata->start_unit; 2373 - cqr = dasd_eckd_build_format(base, fdata); 2368 + cqr = dasd_eckd_build_format(base, fdata, enable_pav); 2374 2369 list_add(&cqr->blocklist, &format_queue); 2375 2370 2376 2371 fdata->stop_unit = old_stop; ··· 2388 2383 if (step > format_step) 2389 2384 fdata->stop_unit = fdata->start_unit + format_step - 1; 2390 2385 2391 - cqr = dasd_eckd_build_format(base, fdata); 2386 + cqr = dasd_eckd_build_format(base, fdata, enable_pav); 2392 2387 if (IS_ERR(cqr)) { 2393 2388 if (PTR_ERR(cqr) == -ENOMEM) { 2394 2389 /* ··· 2408 2403 } 2409 2404 2410 2405 sleep: 2411 - dasd_sleep_on_queue(&format_queue); 2406 + sleep_rc = dasd_sleep_on_queue(&format_queue); 2412 2407 2413 2408 list_for_each_entry_safe(cqr, n, &format_queue, blocklist) { 2414 2409 device = cqr->startdev; ··· 2419 2414 dasd_sfree_request(cqr, device); 2420 2415 private->count--; 2421 2416 } 2417 + 2418 + if (sleep_rc) 2419 + return sleep_rc; 2422 2420 2423 2421 /* 2424 2422 * in case of ENOMEM we need to retry after ··· 4519 4511 .verify_path = dasd_eckd_verify_path, 4520 4512 .basic_to_ready = dasd_eckd_basic_to_ready, 4521 4513 .online_to_ready = dasd_eckd_online_to_ready, 4522 - .ready_to_basic = dasd_eckd_ready_to_basic, 4514 + .basic_to_known = dasd_eckd_basic_to_known, 4523 4515 .fill_geometry = dasd_eckd_fill_geometry, 4524 4516 .start_IO = dasd_start_IO, 4525 4517 .term_IO = dasd_term_IO,
+3 -2
drivers/s390/block/dasd_int.h
··· 175 175 struct dasd_block *block; /* the originating block device */ 176 176 struct dasd_device *memdev; /* the device used to allocate this */ 177 177 struct dasd_device *startdev; /* device the request is started on */ 178 + struct dasd_device *basedev; /* base device if no block->base */ 178 179 void *cpaddr; /* address of ccw or tcw */ 179 180 unsigned char cpmode; /* 0 = cmd mode, 1 = itcw */ 180 181 char status; /* status of this request */ ··· 305 304 */ 306 305 int (*basic_to_ready) (struct dasd_device *); 307 306 int (*online_to_ready) (struct dasd_device *); 308 - int (*ready_to_basic) (struct dasd_device *); 307 + int (*basic_to_known)(struct dasd_device *); 309 308 310 309 /* (struct dasd_device *); 311 310 * Device operation functions. build_cp creates a ccw chain for ··· 322 321 int (*term_IO) (struct dasd_ccw_req *); 323 322 void (*handle_terminated_request) (struct dasd_ccw_req *); 324 323 int (*format_device) (struct dasd_device *, 325 - struct format_data_t *); 324 + struct format_data_t *, int enable_pav); 326 325 int (*free_cp) (struct dasd_ccw_req *, struct request *); 327 326 328 327 /*
+26 -5
drivers/s390/block/dasd_ioctl.c
··· 203 203 dasd_format(struct dasd_block *block, struct format_data_t *fdata) 204 204 { 205 205 struct dasd_device *base; 206 - int rc; 206 + int enable_pav = 1; 207 + int rc, retries; 208 + int start, stop; 207 209 208 210 base = block->base; 209 211 if (base->discipline->format_device == NULL) ··· 233 231 bdput(bdev); 234 232 } 235 233 236 - rc = base->discipline->format_device(base, fdata); 237 - if (rc) 238 - return rc; 234 + retries = 255; 235 + /* backup start- and endtrack for retries */ 236 + start = fdata->start_unit; 237 + stop = fdata->stop_unit; 238 + do { 239 + rc = base->discipline->format_device(base, fdata, enable_pav); 240 + if (rc) { 241 + if (rc == -EAGAIN) { 242 + retries--; 243 + /* disable PAV in case of errors */ 244 + enable_pav = 0; 245 + fdata->start_unit = start; 246 + fdata->stop_unit = stop; 247 + } else 248 + return rc; 249 + } else 250 + /* success */ 251 + break; 252 + } while (retries); 239 253 240 - return 0; 254 + if (!retries) 255 + return -EIO; 256 + else 257 + return 0; 241 258 } 242 259 243 260 /*
+17 -15
drivers/s390/char/con3215.c
··· 288 288 unsigned long flags; 289 289 290 290 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); 291 - if (raw->flags & RAW3215_TIMER_RUNS) { 292 - del_timer(&raw->timer); 293 - raw->flags &= ~RAW3215_TIMER_RUNS; 294 - if (!(raw->port.flags & ASYNC_SUSPENDED)) { 295 - raw3215_mk_write_req(raw); 296 - raw3215_start_io(raw); 291 + raw->flags &= ~RAW3215_TIMER_RUNS; 292 + if (!(raw->port.flags & ASYNC_SUSPENDED)) { 293 + raw3215_mk_write_req(raw); 294 + raw3215_start_io(raw); 295 + if ((raw->queued_read || raw->queued_write) && 296 + !(raw->flags & RAW3215_WORKING) && 297 + !(raw->flags & RAW3215_TIMER_RUNS)) { 298 + raw->timer.expires = RAW3215_TIMEOUT + jiffies; 299 + add_timer(&raw->timer); 300 + raw->flags |= RAW3215_TIMER_RUNS; 297 301 } 298 302 } 299 303 spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); ··· 321 317 (raw->flags & RAW3215_FLUSHING)) { 322 318 /* execute write requests bigger than minimum size */ 323 319 raw3215_start_io(raw); 324 - if (raw->flags & RAW3215_TIMER_RUNS) { 325 - del_timer(&raw->timer); 326 - raw->flags &= ~RAW3215_TIMER_RUNS; 327 - } 328 - } else if (!(raw->flags & RAW3215_TIMER_RUNS)) { 329 - /* delay small writes */ 330 - raw->timer.expires = RAW3215_TIMEOUT + jiffies; 331 - add_timer(&raw->timer); 332 - raw->flags |= RAW3215_TIMER_RUNS; 333 320 } 321 + } 322 + if ((raw->queued_read || raw->queued_write) && 323 + !(raw->flags & RAW3215_WORKING) && 324 + !(raw->flags & RAW3215_TIMER_RUNS)) { 325 + raw->timer.expires = RAW3215_TIMEOUT + jiffies; 326 + add_timer(&raw->timer); 327 + raw->flags |= RAW3215_TIMER_RUNS; 334 328 } 335 329 } 336 330
+53
drivers/s390/cio/qdio_setup.c
··· 17 17 #include "qdio.h" 18 18 #include "qdio_debug.h" 19 19 20 + #define QBUFF_PER_PAGE (PAGE_SIZE / sizeof(struct qdio_buffer)) 21 + 20 22 static struct kmem_cache *qdio_q_cache; 21 23 static struct kmem_cache *qdio_aob_cache; 22 24 ··· 33 31 kmem_cache_free(qdio_aob_cache, aob); 34 32 } 35 33 EXPORT_SYMBOL_GPL(qdio_release_aob); 34 + 35 + /** 36 + * qdio_free_buffers() - free qdio buffers 37 + * @buf: array of pointers to qdio buffers 38 + * @count: number of qdio buffers to free 39 + */ 40 + void qdio_free_buffers(struct qdio_buffer **buf, unsigned int count) 41 + { 42 + int pos; 43 + 44 + for (pos = 0; pos < count; pos += QBUFF_PER_PAGE) 45 + free_page((unsigned long) buf[pos]); 46 + } 47 + EXPORT_SYMBOL_GPL(qdio_free_buffers); 48 + 49 + /** 50 + * qdio_alloc_buffers() - allocate qdio buffers 51 + * @buf: array of pointers to qdio buffers 52 + * @count: number of qdio buffers to allocate 53 + */ 54 + int qdio_alloc_buffers(struct qdio_buffer **buf, unsigned int count) 55 + { 56 + int pos; 57 + 58 + for (pos = 0; pos < count; pos += QBUFF_PER_PAGE) { 59 + buf[pos] = (void *) get_zeroed_page(GFP_KERNEL); 60 + if (!buf[pos]) { 61 + qdio_free_buffers(buf, count); 62 + return -ENOMEM; 63 + } 64 + } 65 + for (pos = 0; pos < count; pos++) 66 + if (pos % QBUFF_PER_PAGE) 67 + buf[pos] = buf[pos - 1] + 1; 68 + return 0; 69 + } 70 + EXPORT_SYMBOL_GPL(qdio_alloc_buffers); 71 + 72 + /** 73 + * qdio_reset_buffers() - reset qdio buffers 74 + * @buf: array of pointers to qdio buffers 75 + * @count: number of qdio buffers that will be zeroed 76 + */ 77 + void qdio_reset_buffers(struct qdio_buffer **buf, unsigned int count) 78 + { 79 + int pos; 80 + 81 + for (pos = 0; pos < count; pos++) 82 + memset(buf[pos], 0, sizeof(struct qdio_buffer)); 83 + } 84 + EXPORT_SYMBOL_GPL(qdio_reset_buffers); 36 85 37 86 /* 38 87 * qebsm is only available under 64bit but the adapter sets the feature
+4 -4
drivers/s390/net/qeth_core.h
··· 439 439 }; 440 440 441 441 struct qeth_qdio_q { 442 - struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q]; 442 + struct qdio_buffer *qdio_bufs[QDIO_MAX_BUFFERS_PER_Q]; 443 443 struct qeth_qdio_buffer bufs[QDIO_MAX_BUFFERS_PER_Q]; 444 444 int next_buf_to_init; 445 - } __attribute__ ((aligned(256))); 445 + }; 446 446 447 447 struct qeth_qdio_out_buffer { 448 448 struct qdio_buffer *buffer; ··· 465 465 }; 466 466 467 467 struct qeth_qdio_out_q { 468 - struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q]; 468 + struct qdio_buffer *qdio_bufs[QDIO_MAX_BUFFERS_PER_Q]; 469 469 struct qeth_qdio_out_buffer *bufs[QDIO_MAX_BUFFERS_PER_Q]; 470 470 struct qdio_outbuf_state *bufstates; /* convenience pointer */ 471 471 int queue_no; ··· 483 483 atomic_t used_buffers; 484 484 /* indicates whether PCI flag must be set (or if one is outstanding) */ 485 485 atomic_t set_pci_flags_count; 486 - } __attribute__ ((aligned(256))); 486 + }; 487 487 488 488 struct qeth_qdio_info { 489 489 atomic_t state;
+97 -64
drivers/s390/net/qeth_core_main.c
··· 292 292 } 293 293 EXPORT_SYMBOL_GPL(qeth_realloc_buffer_pool); 294 294 295 + static void qeth_free_qdio_queue(struct qeth_qdio_q *q) 296 + { 297 + if (!q) 298 + return; 299 + 300 + qdio_free_buffers(q->qdio_bufs, QDIO_MAX_BUFFERS_PER_Q); 301 + kfree(q); 302 + } 303 + 304 + static struct qeth_qdio_q *qeth_alloc_qdio_queue(void) 305 + { 306 + struct qeth_qdio_q *q = kzalloc(sizeof(*q), GFP_KERNEL); 307 + int i; 308 + 309 + if (!q) 310 + return NULL; 311 + 312 + if (qdio_alloc_buffers(q->qdio_bufs, QDIO_MAX_BUFFERS_PER_Q)) { 313 + kfree(q); 314 + return NULL; 315 + } 316 + 317 + for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; ++i) 318 + q->bufs[i].buffer = q->qdio_bufs[i]; 319 + 320 + QETH_DBF_HEX(SETUP, 2, &q, sizeof(void *)); 321 + return q; 322 + } 323 + 295 324 static inline int qeth_cq_init(struct qeth_card *card) 296 325 { 297 326 int rc; 298 327 299 328 if (card->options.cq == QETH_CQ_ENABLED) { 300 329 QETH_DBF_TEXT(SETUP, 2, "cqinit"); 301 - memset(card->qdio.c_q->qdio_bufs, 0, 302 - QDIO_MAX_BUFFERS_PER_Q * sizeof(struct qdio_buffer)); 330 + qdio_reset_buffers(card->qdio.c_q->qdio_bufs, 331 + QDIO_MAX_BUFFERS_PER_Q); 303 332 card->qdio.c_q->next_buf_to_init = 127; 304 333 rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, 305 334 card->qdio.no_in_queues - 1, 0, ··· 352 323 struct qdio_outbuf_state *outbuf_states; 353 324 354 325 QETH_DBF_TEXT(SETUP, 2, "cqon"); 355 - card->qdio.c_q = kzalloc(sizeof(struct qeth_qdio_q), 356 - GFP_KERNEL); 326 + card->qdio.c_q = qeth_alloc_qdio_queue(); 357 327 if (!card->qdio.c_q) { 358 328 rc = -1; 359 329 goto kmsg_out; 360 330 } 361 - QETH_DBF_HEX(SETUP, 2, &card->qdio.c_q, sizeof(void *)); 362 - 363 - for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; ++i) { 364 - card->qdio.c_q->bufs[i].buffer = 365 - &card->qdio.c_q->qdio_bufs[i]; 366 - } 367 - 368 331 card->qdio.no_in_queues = 2; 369 - 370 332 card->qdio.out_bufstates = 371 333 kzalloc(card->qdio.no_out_queues * 372 334 QDIO_MAX_BUFFERS_PER_Q * ··· 381 361 out: 382 362 return rc; 383 363 free_cq_out: 384 - kfree(card->qdio.c_q); 364 + qeth_free_qdio_queue(card->qdio.c_q); 385 365 card->qdio.c_q = NULL; 386 366 kmsg_out: 387 367 dev_err(&card->gdev->dev, "Failed to create completion queue\n"); ··· 392 372 { 393 373 if (card->qdio.c_q) { 394 374 --card->qdio.no_in_queues; 395 - kfree(card->qdio.c_q); 375 + qeth_free_qdio_queue(card->qdio.c_q); 396 376 card->qdio.c_q = NULL; 397 377 } 398 378 kfree(card->qdio.out_bufstates); ··· 1299 1279 free_page((unsigned long)pool_entry->elements[i]); 1300 1280 list_del(&pool_entry->init_list); 1301 1281 kfree(pool_entry); 1302 - } 1303 - } 1304 - 1305 - static void qeth_free_qdio_buffers(struct qeth_card *card) 1306 - { 1307 - int i, j; 1308 - 1309 - if (atomic_xchg(&card->qdio.state, QETH_QDIO_UNINITIALIZED) == 1310 - QETH_QDIO_UNINITIALIZED) 1311 - return; 1312 - 1313 - qeth_free_cq(card); 1314 - cancel_delayed_work_sync(&card->buffer_reclaim_work); 1315 - for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { 1316 - if (card->qdio.in_q->bufs[j].rx_skb) 1317 - dev_kfree_skb_any(card->qdio.in_q->bufs[j].rx_skb); 1318 - } 1319 - kfree(card->qdio.in_q); 1320 - card->qdio.in_q = NULL; 1321 - /* inbound buffer pool */ 1322 - qeth_free_buffer_pool(card); 1323 - /* free outbound qdio_qs */ 1324 - if (card->qdio.out_qs) { 1325 - for (i = 0; i < card->qdio.no_out_queues; ++i) { 1326 - qeth_clear_outq_buffers(card->qdio.out_qs[i], 1); 1327 - kfree(card->qdio.out_qs[i]); 1328 - } 1329 - kfree(card->qdio.out_qs); 1330 - card->qdio.out_qs = NULL; 1331 1282 } 1332 1283 } 1333 1284 ··· 2383 2392 rc = -ENOMEM; 2384 2393 goto out; 2385 2394 } 2386 - newbuf->buffer = &q->qdio_bufs[bidx]; 2395 + newbuf->buffer = q->qdio_bufs[bidx]; 2387 2396 skb_queue_head_init(&newbuf->skb_list); 2388 2397 lockdep_set_class(&newbuf->skb_list.lock, &qdio_out_skb_queue_key); 2389 2398 newbuf->q = q; ··· 2402 2411 return rc; 2403 2412 } 2404 2413 2414 + static void qeth_free_qdio_out_buf(struct qeth_qdio_out_q *q) 2415 + { 2416 + if (!q) 2417 + return; 2418 + 2419 + qdio_free_buffers(q->qdio_bufs, QDIO_MAX_BUFFERS_PER_Q); 2420 + kfree(q); 2421 + } 2422 + 2423 + static struct qeth_qdio_out_q *qeth_alloc_qdio_out_buf(void) 2424 + { 2425 + struct qeth_qdio_out_q *q = kzalloc(sizeof(*q), GFP_KERNEL); 2426 + 2427 + if (!q) 2428 + return NULL; 2429 + 2430 + if (qdio_alloc_buffers(q->qdio_bufs, QDIO_MAX_BUFFERS_PER_Q)) { 2431 + kfree(q); 2432 + return NULL; 2433 + } 2434 + return q; 2435 + } 2405 2436 2406 2437 static int qeth_alloc_qdio_buffers(struct qeth_card *card) 2407 2438 { ··· 2435 2422 QETH_QDIO_ALLOCATED) != QETH_QDIO_UNINITIALIZED) 2436 2423 return 0; 2437 2424 2438 - card->qdio.in_q = kzalloc(sizeof(struct qeth_qdio_q), 2439 - GFP_KERNEL); 2425 + QETH_DBF_TEXT(SETUP, 2, "inq"); 2426 + card->qdio.in_q = qeth_alloc_qdio_queue(); 2440 2427 if (!card->qdio.in_q) 2441 2428 goto out_nomem; 2442 - QETH_DBF_TEXT(SETUP, 2, "inq"); 2443 - QETH_DBF_HEX(SETUP, 2, &card->qdio.in_q, sizeof(void *)); 2444 - memset(card->qdio.in_q, 0, sizeof(struct qeth_qdio_q)); 2445 - /* give inbound qeth_qdio_buffers their qdio_buffers */ 2446 - for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; ++i) { 2447 - card->qdio.in_q->bufs[i].buffer = 2448 - &card->qdio.in_q->qdio_bufs[i]; 2449 - card->qdio.in_q->bufs[i].rx_skb = NULL; 2450 - } 2429 + 2451 2430 /* inbound buffer pool */ 2452 2431 if (qeth_alloc_buffer_pool(card)) 2453 2432 goto out_freeinq; ··· 2451 2446 if (!card->qdio.out_qs) 2452 2447 goto out_freepool; 2453 2448 for (i = 0; i < card->qdio.no_out_queues; ++i) { 2454 - card->qdio.out_qs[i] = kzalloc(sizeof(struct qeth_qdio_out_q), 2455 - GFP_KERNEL); 2449 + card->qdio.out_qs[i] = qeth_alloc_qdio_out_buf(); 2456 2450 if (!card->qdio.out_qs[i]) 2457 2451 goto out_freeoutq; 2458 2452 QETH_DBF_TEXT_(SETUP, 2, "outq %i", i); ··· 2480 2476 } 2481 2477 out_freeoutq: 2482 2478 while (i > 0) { 2483 - kfree(card->qdio.out_qs[--i]); 2479 + qeth_free_qdio_out_buf(card->qdio.out_qs[--i]); 2484 2480 qeth_clear_outq_buffers(card->qdio.out_qs[i], 1); 2485 2481 } 2486 2482 kfree(card->qdio.out_qs); ··· 2488 2484 out_freepool: 2489 2485 qeth_free_buffer_pool(card); 2490 2486 out_freeinq: 2491 - kfree(card->qdio.in_q); 2487 + qeth_free_qdio_queue(card->qdio.in_q); 2492 2488 card->qdio.in_q = NULL; 2493 2489 out_nomem: 2494 2490 atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED); 2495 2491 return -ENOMEM; 2492 + } 2493 + 2494 + static void qeth_free_qdio_buffers(struct qeth_card *card) 2495 + { 2496 + int i, j; 2497 + 2498 + if (atomic_xchg(&card->qdio.state, QETH_QDIO_UNINITIALIZED) == 2499 + QETH_QDIO_UNINITIALIZED) 2500 + return; 2501 + 2502 + qeth_free_cq(card); 2503 + cancel_delayed_work_sync(&card->buffer_reclaim_work); 2504 + for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { 2505 + if (card->qdio.in_q->bufs[j].rx_skb) 2506 + dev_kfree_skb_any(card->qdio.in_q->bufs[j].rx_skb); 2507 + } 2508 + qeth_free_qdio_queue(card->qdio.in_q); 2509 + card->qdio.in_q = NULL; 2510 + /* inbound buffer pool */ 2511 + qeth_free_buffer_pool(card); 2512 + /* free outbound qdio_qs */ 2513 + if (card->qdio.out_qs) { 2514 + for (i = 0; i < card->qdio.no_out_queues; ++i) { 2515 + qeth_clear_outq_buffers(card->qdio.out_qs[i], 1); 2516 + qeth_free_qdio_out_buf(card->qdio.out_qs[i]); 2517 + } 2518 + kfree(card->qdio.out_qs); 2519 + card->qdio.out_qs = NULL; 2520 + } 2496 2521 } 2497 2522 2498 2523 static void qeth_create_qib_param_field(struct qeth_card *card, ··· 2821 2788 QETH_DBF_TEXT(SETUP, 2, "initqdqs"); 2822 2789 2823 2790 /* inbound queue */ 2824 - memset(card->qdio.in_q->qdio_bufs, 0, 2825 - QDIO_MAX_BUFFERS_PER_Q * sizeof(struct qdio_buffer)); 2791 + qdio_reset_buffers(card->qdio.in_q->qdio_bufs, 2792 + QDIO_MAX_BUFFERS_PER_Q); 2826 2793 qeth_initialize_working_pool_list(card); 2827 2794 /*give only as many buffers to hardware as we have buffer pool entries*/ 2828 2795 for (i = 0; i < card->qdio.in_buf_pool.buf_count - 1; ++i) ··· 2844 2811 2845 2812 /* outbound queue */ 2846 2813 for (i = 0; i < card->qdio.no_out_queues; ++i) { 2847 - memset(card->qdio.out_qs[i]->qdio_bufs, 0, 2848 - QDIO_MAX_BUFFERS_PER_Q * sizeof(struct qdio_buffer)); 2814 + qdio_reset_buffers(card->qdio.out_qs[i]->qdio_bufs, 2815 + QDIO_MAX_BUFFERS_PER_Q); 2849 2816 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { 2850 2817 qeth_clear_output_buffer(card->qdio.out_qs[i], 2851 2818 card->qdio.out_qs[i]->bufs[j], ··· 3602 3569 3603 3570 for (i = first_element; i < first_element + count; ++i) { 3604 3571 int bidx = i % QDIO_MAX_BUFFERS_PER_Q; 3605 - struct qdio_buffer *buffer = &cq->qdio_bufs[bidx]; 3572 + struct qdio_buffer *buffer = cq->qdio_bufs[bidx]; 3606 3573 int e; 3607 3574 3608 3575 e = 0;
+21 -28
drivers/s390/scsi/zfcp_qdio.c
··· 14 14 #include "zfcp_ext.h" 15 15 #include "zfcp_qdio.h" 16 16 17 - #define QBUFF_PER_PAGE (PAGE_SIZE / sizeof(struct qdio_buffer)) 18 - 19 17 static bool enable_multibuffer = 1; 20 18 module_param_named(datarouter, enable_multibuffer, bool, 0400); 21 19 MODULE_PARM_DESC(datarouter, "Enable hardware data router support (default on)"); 22 - 23 - static int zfcp_qdio_buffers_enqueue(struct qdio_buffer **sbal) 24 - { 25 - int pos; 26 - 27 - for (pos = 0; pos < QDIO_MAX_BUFFERS_PER_Q; pos += QBUFF_PER_PAGE) { 28 - sbal[pos] = (struct qdio_buffer *) get_zeroed_page(GFP_KERNEL); 29 - if (!sbal[pos]) 30 - return -ENOMEM; 31 - } 32 - for (pos = 0; pos < QDIO_MAX_BUFFERS_PER_Q; pos++) 33 - if (pos % QBUFF_PER_PAGE) 34 - sbal[pos] = sbal[pos - 1] + 1; 35 - return 0; 36 - } 37 20 38 21 static void zfcp_qdio_handler_error(struct zfcp_qdio *qdio, char *id, 39 22 unsigned int qdio_err) ··· 309 326 static int zfcp_qdio_allocate(struct zfcp_qdio *qdio) 310 327 { 311 328 struct qdio_initialize init_data; 329 + int ret; 312 330 313 - if (zfcp_qdio_buffers_enqueue(qdio->req_q) || 314 - zfcp_qdio_buffers_enqueue(qdio->res_q)) 331 + ret = qdio_alloc_buffers(qdio->req_q, QDIO_MAX_BUFFERS_PER_Q); 332 + if (ret) 315 333 return -ENOMEM; 334 + 335 + ret = qdio_alloc_buffers(qdio->res_q, QDIO_MAX_BUFFERS_PER_Q); 336 + if (ret) 337 + goto free_req_q; 316 338 317 339 zfcp_qdio_setup_init_data(&init_data, qdio); 318 340 init_waitqueue_head(&qdio->req_q_wq); 319 341 320 - return qdio_allocate(&init_data); 342 + ret = qdio_allocate(&init_data); 343 + if (ret) 344 + goto free_res_q; 345 + 346 + return 0; 347 + 348 + free_res_q: 349 + qdio_free_buffers(qdio->res_q, QDIO_MAX_BUFFERS_PER_Q); 350 + free_req_q: 351 + qdio_free_buffers(qdio->req_q, QDIO_MAX_BUFFERS_PER_Q); 352 + return ret; 321 353 } 322 354 323 355 /** ··· 446 448 447 449 void zfcp_qdio_destroy(struct zfcp_qdio *qdio) 448 450 { 449 - int p; 450 - 451 451 if (!qdio) 452 452 return; 453 453 454 454 if (qdio->adapter->ccw_device) 455 455 qdio_free(qdio->adapter->ccw_device); 456 456 457 - for (p = 0; p < QDIO_MAX_BUFFERS_PER_Q; p += QBUFF_PER_PAGE) { 458 - free_page((unsigned long) qdio->req_q[p]); 459 - free_page((unsigned long) qdio->res_q[p]); 460 - } 461 - 457 + qdio_free_buffers(qdio->req_q, QDIO_MAX_BUFFERS_PER_Q); 458 + qdio_free_buffers(qdio->res_q, QDIO_MAX_BUFFERS_PER_Q); 462 459 kfree(qdio); 463 460 } 464 461 ··· 468 475 qdio->adapter = adapter; 469 476 470 477 if (zfcp_qdio_allocate(qdio)) { 471 - zfcp_qdio_destroy(qdio); 478 + kfree(qdio); 472 479 return -ENOMEM; 473 480 } 474 481
+1 -1
drivers/watchdog/Kconfig
··· 1293 1293 both. 1294 1294 1295 1295 To compile this driver as a module, choose M here. The module 1296 - will be called vmwatchdog. 1296 + will be called diag288_wdt. 1297 1297 1298 1298 # SUPERH (sh + sh64) Architecture 1299 1299