aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-06 15:34:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-06 15:34:53 -0400
commit2bf1bef0d6c3636353938dd1f183a4522957fc35 (patch)
tree3d0aae8c8454e60b0e53f456b7e94127d91f9ccf /drivers/s390
parentd7ab7302f970a254997687a1cdede421a5635c68 (diff)
parent996b4a7d8f4e5dd531369396f2312b97e9400cdc (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull more s390 updates from Martin Schwidefsky: "This is the second batch of s390 patches for the 3.10 merge window. Heiko improved the memory detection, this fixes kdump for large memory sizes. Some kvm related memory management work, new ipldev/condev keywords in cio and bug fixes." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/mem_detect: remove artificial kdump memory types s390/mm: add pte invalidation notifier for kvm s390/zcrypt: ap bus rescan problem when toggle crypto adapters on/off s390/memory hotplug,sclp: get rid of per memory increment usecount s390/memory hotplug: provide memory_block_size_bytes() function s390/mem_detect: limit memory detection loop to "mem=" parameter s390/kdump,bootmem: fix bootmem allocator bitmap size s390: get rid of odd global real_memory_size s390/kvm: Change the virtual memory mapping location for Virtio devices s390/zcore: calculate real memory size using own get_mem_size function s390/mem_detect: add DAT sanity check s390/mem_detect: fix lockdep irq tracing s390/mem_detect: move memory detection code to mm folder s390/zfcpdump: exploit new cio_ignore keywords s390/cio: add condev keyword to cio_ignore s390/cio: add ipldev keyword to cio_ignore s390/uaccess: add "fallthrough" comments
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/sclp_cmd.c20
-rw-r--r--drivers/s390/char/zcore.c34
-rw-r--r--drivers/s390/cio/blacklist.c28
-rw-r--r--drivers/s390/crypto/ap_bus.c17
4 files changed, 52 insertions, 47 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 178836ec252b..bf07c3a188d4 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -345,7 +345,6 @@ struct memory_increment {
345 struct list_head list; 345 struct list_head list;
346 u16 rn; 346 u16 rn;
347 int standby; 347 int standby;
348 int usecount;
349}; 348};
350 349
351struct assign_storage_sccb { 350struct assign_storage_sccb {
@@ -463,21 +462,10 @@ static int sclp_mem_change_state(unsigned long start, unsigned long size,
463 break; 462 break;
464 if (start > istart + rzm - 1) 463 if (start > istart + rzm - 1)
465 continue; 464 continue;
466 if (online) { 465 if (online)
467 if (incr->usecount++)
468 continue;
469 /*
470 * Don't break the loop if one assign fails. Loop may
471 * be walked again on CANCEL and we can't save
472 * information if state changed before or not.
473 * So continue and increase usecount for all increments.
474 */
475 rc |= sclp_assign_storage(incr->rn); 466 rc |= sclp_assign_storage(incr->rn);
476 } else { 467 else
477 if (--incr->usecount)
478 continue;
479 sclp_unassign_storage(incr->rn); 468 sclp_unassign_storage(incr->rn);
480 }
481 } 469 }
482 return rc ? -EIO : 0; 470 return rc ? -EIO : 0;
483} 471}
@@ -561,8 +549,6 @@ static void __init sclp_add_standby_memory(void)
561 add_memory_merged(0); 549 add_memory_merged(0);
562} 550}
563 551
564#define MEM_SCT_SIZE (1UL << SECTION_SIZE_BITS)
565
566static void __init insert_increment(u16 rn, int standby, int assigned) 552static void __init insert_increment(u16 rn, int standby, int assigned)
567{ 553{
568 struct memory_increment *incr, *new_incr; 554 struct memory_increment *incr, *new_incr;
@@ -574,8 +560,6 @@ static void __init insert_increment(u16 rn, int standby, int assigned)
574 return; 560 return;
575 new_incr->rn = rn; 561 new_incr->rn = rn;
576 new_incr->standby = standby; 562 new_incr->standby = standby;
577 if (!standby)
578 new_incr->usecount = rzm > MEM_SCT_SIZE ? rzm/MEM_SCT_SIZE : 1;
579 last_rn = 0; 563 last_rn = 0;
580 prev = &sclp_mem_list; 564 prev = &sclp_mem_list;
581 list_for_each_entry(incr, &sclp_mem_list, list) { 565 list_for_each_entry(incr, &sclp_mem_list, list) {
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 22820610022c..9e5e14686e75 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -426,7 +426,7 @@ static int zcore_memmap_open(struct inode *inode, struct file *filp)
426 GFP_KERNEL); 426 GFP_KERNEL);
427 if (!chunk_array) 427 if (!chunk_array)
428 return -ENOMEM; 428 return -ENOMEM;
429 detect_memory_layout(chunk_array); 429 detect_memory_layout(chunk_array, 0);
430 buf = kzalloc(MEMORY_CHUNKS * CHUNK_INFO_SIZE, GFP_KERNEL); 430 buf = kzalloc(MEMORY_CHUNKS * CHUNK_INFO_SIZE, GFP_KERNEL);
431 if (!buf) { 431 if (!buf) {
432 kfree(chunk_array); 432 kfree(chunk_array);
@@ -557,7 +557,7 @@ static void __init set_lc_mask(struct save_area *map)
557/* 557/*
558 * Initialize dump globals for a given architecture 558 * Initialize dump globals for a given architecture
559 */ 559 */
560static int __init sys_info_init(enum arch_id arch) 560static int __init sys_info_init(enum arch_id arch, unsigned long mem_end)
561{ 561{
562 int rc; 562 int rc;
563 563
@@ -579,7 +579,7 @@ static int __init sys_info_init(enum arch_id arch)
579 rc = init_cpu_info(arch); 579 rc = init_cpu_info(arch);
580 if (rc) 580 if (rc)
581 return rc; 581 return rc;
582 sys_info.mem_size = real_memory_size; 582 sys_info.mem_size = mem_end;
583 583
584 return 0; 584 return 0;
585} 585}
@@ -601,7 +601,7 @@ static int __init check_sdias(void)
601 return 0; 601 return 0;
602} 602}
603 603
604static int __init get_mem_size(unsigned long *mem) 604static int __init get_mem_info(unsigned long *mem, unsigned long *end)
605{ 605{
606 int i; 606 int i;
607 struct mem_chunk *chunk_array; 607 struct mem_chunk *chunk_array;
@@ -610,33 +610,31 @@ static int __init get_mem_size(unsigned long *mem)
610 GFP_KERNEL); 610 GFP_KERNEL);
611 if (!chunk_array) 611 if (!chunk_array)
612 return -ENOMEM; 612 return -ENOMEM;
613 detect_memory_layout(chunk_array); 613 detect_memory_layout(chunk_array, 0);
614 for (i = 0; i < MEMORY_CHUNKS; i++) { 614 for (i = 0; i < MEMORY_CHUNKS; i++) {
615 if (chunk_array[i].size == 0) 615 if (chunk_array[i].size == 0)
616 break; 616 break;
617 *mem += chunk_array[i].size; 617 *mem += chunk_array[i].size;
618 *end = max(*end, chunk_array[i].addr + chunk_array[i].size);
618 } 619 }
619 kfree(chunk_array); 620 kfree(chunk_array);
620 return 0; 621 return 0;
621} 622}
622 623
623static int __init zcore_header_init(int arch, struct zcore_header *hdr) 624static void __init zcore_header_init(int arch, struct zcore_header *hdr,
625 unsigned long mem_size)
624{ 626{
625 int rc, i;
626 unsigned long memory = 0;
627 u32 prefix; 627 u32 prefix;
628 int i;
628 629
629 if (arch == ARCH_S390X) 630 if (arch == ARCH_S390X)
630 hdr->arch_id = DUMP_ARCH_S390X; 631 hdr->arch_id = DUMP_ARCH_S390X;
631 else 632 else
632 hdr->arch_id = DUMP_ARCH_S390; 633 hdr->arch_id = DUMP_ARCH_S390;
633 rc = get_mem_size(&memory); 634 hdr->mem_size = mem_size;
634 if (rc) 635 hdr->rmem_size = mem_size;
635 return rc;
636 hdr->mem_size = memory;
637 hdr->rmem_size = memory;
638 hdr->mem_end = sys_info.mem_size; 636 hdr->mem_end = sys_info.mem_size;
639 hdr->num_pages = memory / PAGE_SIZE; 637 hdr->num_pages = mem_size / PAGE_SIZE;
640 hdr->tod = get_tod_clock(); 638 hdr->tod = get_tod_clock();
641 get_cpu_id(&hdr->cpu_id); 639 get_cpu_id(&hdr->cpu_id);
642 for (i = 0; zfcpdump_save_areas[i]; i++) { 640 for (i = 0; zfcpdump_save_areas[i]; i++) {
@@ -647,7 +645,6 @@ static int __init zcore_header_init(int arch, struct zcore_header *hdr)
647 hdr->lc_vec[hdr->cpu_cnt] = prefix; 645 hdr->lc_vec[hdr->cpu_cnt] = prefix;
648 hdr->cpu_cnt++; 646 hdr->cpu_cnt++;
649 } 647 }
650 return 0;
651} 648}
652 649
653/* 650/*
@@ -682,9 +679,11 @@ static int __init zcore_reipl_init(void)
682 679
683static int __init zcore_init(void) 680static int __init zcore_init(void)
684{ 681{
682 unsigned long mem_size, mem_end;
685 unsigned char arch; 683 unsigned char arch;
686 int rc; 684 int rc;
687 685
686 mem_size = mem_end = 0;
688 if (ipl_info.type != IPL_TYPE_FCP_DUMP) 687 if (ipl_info.type != IPL_TYPE_FCP_DUMP)
689 return -ENODATA; 688 return -ENODATA;
690 if (OLDMEM_BASE) 689 if (OLDMEM_BASE)
@@ -727,13 +726,14 @@ static int __init zcore_init(void)
727 } 726 }
728#endif /* CONFIG_64BIT */ 727#endif /* CONFIG_64BIT */
729 728
730 rc = sys_info_init(arch); 729 rc = get_mem_info(&mem_size, &mem_end);
731 if (rc) 730 if (rc)
732 goto fail; 731 goto fail;
733 732
734 rc = zcore_header_init(arch, &zcore_header); 733 rc = sys_info_init(arch, mem_end);
735 if (rc) 734 if (rc)
736 goto fail; 735 goto fail;
736 zcore_header_init(arch, &zcore_header, mem_size);
737 737
738 rc = zcore_reipl_init(); 738 rc = zcore_reipl_init();
739 if (rc) 739 if (rc)
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index 2d2a966a3b39..a9fe3de2dec1 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * S/390 common I/O routines -- blacklisting of specific devices 2 * S/390 common I/O routines -- blacklisting of specific devices
3 * 3 *
4 * Copyright IBM Corp. 1999, 2002 4 * Copyright IBM Corp. 1999, 2013
5 * Author(s): Ingo Adlung (adlung@de.ibm.com) 5 * Author(s): Ingo Adlung (adlung@de.ibm.com)
6 * Cornelia Huck (cornelia.huck@de.ibm.com) 6 * Cornelia Huck (cornelia.huck@de.ibm.com)
7 * Arnd Bergmann (arndb@de.ibm.com) 7 * Arnd Bergmann (arndb@de.ibm.com)
@@ -17,8 +17,9 @@
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18#include <linux/device.h> 18#include <linux/device.h>
19 19
20#include <asm/cio.h>
21#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21#include <asm/cio.h>
22#include <asm/ipl.h>
22 23
23#include "blacklist.h" 24#include "blacklist.h"
24#include "cio.h" 25#include "cio.h"
@@ -172,6 +173,29 @@ static int blacklist_parse_parameters(char *str, range_action action,
172 to_cssid = __MAX_CSSID; 173 to_cssid = __MAX_CSSID;
173 to_ssid = __MAX_SSID; 174 to_ssid = __MAX_SSID;
174 to = __MAX_SUBCHANNEL; 175 to = __MAX_SUBCHANNEL;
176 } else if (strcmp(parm, "ipldev") == 0) {
177 if (ipl_info.type == IPL_TYPE_CCW) {
178 from_cssid = 0;
179 from_ssid = ipl_info.data.ccw.dev_id.ssid;
180 from = ipl_info.data.ccw.dev_id.devno;
181 } else if (ipl_info.type == IPL_TYPE_FCP ||
182 ipl_info.type == IPL_TYPE_FCP_DUMP) {
183 from_cssid = 0;
184 from_ssid = ipl_info.data.fcp.dev_id.ssid;
185 from = ipl_info.data.fcp.dev_id.devno;
186 } else {
187 continue;
188 }
189 to_cssid = from_cssid;
190 to_ssid = from_ssid;
191 to = from;
192 } else if (strcmp(parm, "condev") == 0) {
193 if (console_devno == -1)
194 continue;
195
196 from_cssid = to_cssid = 0;
197 from_ssid = to_ssid = 0;
198 from = to = console_devno;
175 } else { 199 } else {
176 rc = parse_busid(strsep(&parm, "-"), &from_cssid, 200 rc = parse_busid(strsep(&parm, "-"), &from_cssid,
177 &from_ssid, &from, msgtrigger); 201 &from_ssid, &from, msgtrigger);
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index b8b340ac5332..9de41aa14896 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -954,15 +954,11 @@ EXPORT_SYMBOL(ap_driver_unregister);
954 954
955void ap_bus_force_rescan(void) 955void ap_bus_force_rescan(void)
956{ 956{
957 /* Delete the AP bus rescan timer. */ 957 /* reconfigure the AP bus rescan timer. */
958 del_timer(&ap_config_timer); 958 mod_timer(&ap_config_timer, jiffies + ap_config_time * HZ);
959 959 /* processing a asynchronous bus rescan */
960 /* processing a synchonuous bus rescan */ 960 queue_work(ap_work_queue, &ap_config_work);
961 ap_scan_bus(NULL); 961 flush_work(&ap_config_work);
962
963 /* Setup the AP bus rescan timer again. */
964 ap_config_timer.expires = jiffies + ap_config_time * HZ;
965 add_timer(&ap_config_timer);
966} 962}
967EXPORT_SYMBOL(ap_bus_force_rescan); 963EXPORT_SYMBOL(ap_bus_force_rescan);
968 964
@@ -1305,8 +1301,9 @@ static void ap_scan_bus(struct work_struct *unused)
1305 int rc, i; 1301 int rc, i;
1306 1302
1307 ap_query_configuration(); 1303 ap_query_configuration();
1308 if (ap_select_domain() != 0) 1304 if (ap_select_domain() != 0) {
1309 return; 1305 return;
1306 }
1310 for (i = 0; i < AP_DEVICES; i++) { 1307 for (i = 0; i < AP_DEVICES; i++) {
1311 qid = AP_MKQID(i, ap_domain_index); 1308 qid = AP_MKQID(i, ap_domain_index);
1312 dev = bus_find_device(&ap_bus_type, NULL, 1309 dev = bus_find_device(&ap_bus_type, NULL,