Skip to content

Commit 9db8ee3

Browse files
committed
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] Update default configuration. [S390] disassembler: fix idte instruction format. [S390] tape: fix race with stack local wait_queue_head_t. [S390] 3270: fix race with stack local wait_queue_head_t. [S390] dasd: use a generic wait_queue for sleep_on [S390] sclp_vt220: fix scheduling while atomic bug. [S390] showmem: Only walk spanned pages. [S390] appldata: prevent cpu hotplug when walking cpu_online_map. [S390] Fix section mismatch warnings. [S390] s390 types: make dma_addr_t 64 bit capable [S390] tape: Fix race condition in tape block device driver [S390] fix sparsemem related compile error with allnoconfig on s390
2 parents e3aa51f + 0066ed5 commit 9db8ee3

15 files changed

Lines changed: 101 additions & 87 deletions

File tree

‎arch/s390/Kconfig‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ config ARCH_SPARSEMEM_ENABLE
308308
config ARCH_SPARSEMEM_DEFAULT
309309
def_bool y
310310

311+
config ARCH_SELECT_MEMORY_MODEL
312+
def_bool y
313+
311314
source "mm/Kconfig"
312315

313316
comment "I/O subsystem configuration"

‎arch/s390/appldata/appldata_base.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static void appldata_work_fn(struct work_struct *work)
130130

131131
P_DEBUG(" -= Work Queue =-\n");
132132
i = 0;
133+
get_online_cpus();
133134
spin_lock(&appldata_ops_lock);
134135
list_for_each(lh, &appldata_ops_list) {
135136
ops = list_entry(lh, struct appldata_ops, list);
@@ -140,6 +141,7 @@ static void appldata_work_fn(struct work_struct *work)
140141
}
141142
}
142143
spin_unlock(&appldata_ops_lock);
144+
put_online_cpus();
143145
}
144146

145147
/*
@@ -266,12 +268,14 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
266268
len = *lenp;
267269
if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
268270
return -EFAULT;
271+
get_online_cpus();
269272
spin_lock(&appldata_timer_lock);
270273
if (buf[0] == '1')
271274
__appldata_vtimer_setup(APPLDATA_ADD_TIMER);
272275
else if (buf[0] == '0')
273276
__appldata_vtimer_setup(APPLDATA_DEL_TIMER);
274277
spin_unlock(&appldata_timer_lock);
278+
put_online_cpus();
275279
out:
276280
*lenp = len;
277281
*ppos += len;
@@ -314,10 +318,12 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
314318
return -EINVAL;
315319
}
316320

321+
get_online_cpus();
317322
spin_lock(&appldata_timer_lock);
318323
appldata_interval = interval;
319324
__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
320325
spin_unlock(&appldata_timer_lock);
326+
put_online_cpus();
321327

322328
P_INFO("Monitoring CPU interval set to %u milliseconds.\n",
323329
interval);
@@ -556,8 +562,10 @@ static int __init appldata_init(void)
556562
return -ENOMEM;
557563
}
558564

565+
get_online_cpus();
559566
for_each_online_cpu(i)
560567
appldata_online_cpu(i);
568+
put_online_cpus();
561569

562570
/* Register cpu hotplug notifier */
563571
register_hotcpu_notifier(&appldata_nb);

‎arch/s390/defconfig‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Automatically generated make config: don't edit
3-
# Linux kernel version: 2.6.25
4-
# Wed Apr 30 11:07:45 2008
3+
# Linux kernel version: 2.6.26-rc4
4+
# Fri May 30 09:49:33 2008
55
#
66
CONFIG_SCHED_MC=y
77
CONFIG_MMU=y
@@ -103,6 +103,7 @@ CONFIG_RT_MUTEXES=y
103103
# CONFIG_TINY_SHMEM is not set
104104
CONFIG_BASE_SMALL=0
105105
CONFIG_MODULES=y
106+
# CONFIG_MODULE_FORCE_LOAD is not set
106107
CONFIG_MODULE_UNLOAD=y
107108
# CONFIG_MODULE_FORCE_UNLOAD is not set
108109
CONFIG_MODVERSIONS=y
@@ -173,6 +174,7 @@ CONFIG_PREEMPT=y
173174
# CONFIG_PREEMPT_RCU is not set
174175
CONFIG_ARCH_SPARSEMEM_ENABLE=y
175176
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
177+
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
176178
CONFIG_SELECT_MEMORY_MODEL=y
177179
# CONFIG_FLATMEM_MANUAL is not set
178180
# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -210,6 +212,7 @@ CONFIG_FORCE_MAX_ZONEORDER=9
210212
CONFIG_PFAULT=y
211213
# CONFIG_SHARED_KERNEL is not set
212214
# CONFIG_CMM is not set
215+
# CONFIG_PAGE_STATES is not set
213216
CONFIG_VIRT_TIMER=y
214217
CONFIG_VIRT_CPU_ACCOUNTING=y
215218
# CONFIG_APPLDATA_BASE is not set
@@ -620,6 +623,7 @@ CONFIG_S390_VMUR=m
620623
#
621624
# CONFIG_MEMSTICK is not set
622625
# CONFIG_NEW_LEDS is not set
626+
CONFIG_ACCESSIBILITY=y
623627

624628
#
625629
# File systems
@@ -754,11 +758,12 @@ CONFIG_FRAME_WARN=2048
754758
CONFIG_MAGIC_SYSRQ=y
755759
# CONFIG_UNUSED_SYMBOLS is not set
756760
CONFIG_DEBUG_FS=y
757-
CONFIG_HEADERS_CHECK=y
761+
# CONFIG_HEADERS_CHECK is not set
758762
CONFIG_DEBUG_KERNEL=y
759763
# CONFIG_SCHED_DEBUG is not set
760764
# CONFIG_SCHEDSTATS is not set
761765
# CONFIG_TIMER_STATS is not set
766+
# CONFIG_DEBUG_OBJECTS is not set
762767
# CONFIG_DEBUG_SLAB is not set
763768
CONFIG_DEBUG_PREEMPT=y
764769
# CONFIG_DEBUG_RT_MUTEXES is not set

‎arch/s390/kernel/dis.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static const unsigned char formats[][7] = {
208208
[INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 }, /* e.g. madbr */
209209
[INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 },/* e.g. didbr */
210210
[INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 },/* e.g. .insn */
211-
[INSTR_RRF_R0RR] = { 0xff, R_24,R_28,R_16,0,0,0 }, /* e.g. idte */
211+
[INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 }, /* e.g. idte */
212212
[INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 }, /* e.g. fixr */
213213
[INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 }, /* e.g. cfebr */
214214
[INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 }, /* e.g. sske */

‎arch/s390/kernel/smp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ static int __devinit smp_add_present_cpu(int cpu)
10891089

10901090
#ifdef CONFIG_HOTPLUG_CPU
10911091

1092-
int smp_rescan_cpus(void)
1092+
int __ref smp_rescan_cpus(void)
10931093
{
10941094
cpumask_t newcpus;
10951095
int cpu;

‎arch/s390/mm/init.c‎

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,34 @@ char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
4444

4545
void show_mem(void)
4646
{
47-
int i, total = 0, reserved = 0;
48-
int shared = 0, cached = 0;
47+
unsigned long i, total = 0, reserved = 0;
48+
unsigned long shared = 0, cached = 0;
49+
unsigned long flags;
4950
struct page *page;
51+
pg_data_t *pgdat;
5052

5153
printk("Mem-info:\n");
5254
show_free_areas();
53-
i = max_mapnr;
54-
while (i-- > 0) {
55-
if (!pfn_valid(i))
56-
continue;
57-
page = pfn_to_page(i);
58-
total++;
59-
if (PageReserved(page))
60-
reserved++;
61-
else if (PageSwapCache(page))
62-
cached++;
63-
else if (page_count(page))
64-
shared += page_count(page) - 1;
55+
for_each_online_pgdat(pgdat) {
56+
pgdat_resize_lock(pgdat, &flags);
57+
for (i = 0; i < pgdat->node_spanned_pages; i++) {
58+
if (!pfn_valid(pgdat->node_start_pfn + i))
59+
continue;
60+
page = pfn_to_page(pgdat->node_start_pfn + i);
61+
total++;
62+
if (PageReserved(page))
63+
reserved++;
64+
else if (PageSwapCache(page))
65+
cached++;
66+
else if (page_count(page))
67+
shared += page_count(page) - 1;
68+
}
69+
pgdat_resize_unlock(pgdat, &flags);
6570
}
66-
printk("%d pages of RAM\n", total);
67-
printk("%d reserved pages\n", reserved);
68-
printk("%d pages shared\n", shared);
69-
printk("%d pages swap cached\n", cached);
70-
71-
printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
72-
printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
73-
printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
74-
printk("%lu pages slab\n",
75-
global_page_state(NR_SLAB_RECLAIMABLE) +
76-
global_page_state(NR_SLAB_UNRECLAIMABLE));
77-
printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
71+
printk("%ld pages of RAM\n", total);
72+
printk("%ld reserved pages\n", reserved);
73+
printk("%ld pages shared\n", shared);
74+
printk("%ld pages swap cached\n", cached);
7875
}
7976

8077
/*

‎arch/s390/mm/vmem.c‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,32 @@ struct memory_segment {
2727

2828
static LIST_HEAD(mem_segs);
2929

30-
static pud_t *vmem_pud_alloc(void)
30+
static void __ref *vmem_alloc_pages(unsigned int order)
31+
{
32+
if (slab_is_available())
33+
return (void *)__get_free_pages(GFP_KERNEL, order);
34+
return alloc_bootmem_pages((1 << order) * PAGE_SIZE);
35+
}
36+
37+
static inline pud_t *vmem_pud_alloc(void)
3138
{
3239
pud_t *pud = NULL;
3340

3441
#ifdef CONFIG_64BIT
35-
pud = vmemmap_alloc_block(PAGE_SIZE * 4, 0);
42+
pud = vmem_alloc_pages(2);
3643
if (!pud)
3744
return NULL;
3845
clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4);
3946
#endif
4047
return pud;
4148
}
4249

43-
static pmd_t *vmem_pmd_alloc(void)
50+
static inline pmd_t *vmem_pmd_alloc(void)
4451
{
4552
pmd_t *pmd = NULL;
4653

4754
#ifdef CONFIG_64BIT
48-
pmd = vmemmap_alloc_block(PAGE_SIZE * 4, 0);
55+
pmd = vmem_alloc_pages(2);
4956
if (!pmd)
5057
return NULL;
5158
clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4);
@@ -207,13 +214,14 @@ int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node)
207214
if (pte_none(*pt_dir)) {
208215
unsigned long new_page;
209216

210-
new_page =__pa(vmemmap_alloc_block(PAGE_SIZE, 0));
217+
new_page =__pa(vmem_alloc_pages(0));
211218
if (!new_page)
212219
goto out;
213220
pte = pfn_pte(new_page >> PAGE_SHIFT, PAGE_KERNEL);
214221
*pt_dir = pte;
215222
}
216223
}
224+
memset(start, 0, nr * sizeof(struct page));
217225
ret = 0;
218226
out:
219227
flush_tlb_kernel_range(start_addr, end_addr);

‎drivers/s390/block/dasd.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static void dasd_return_cqr_cb(struct dasd_ccw_req *, void *);
6363
*/
6464
static wait_queue_head_t dasd_init_waitq;
6565
static wait_queue_head_t dasd_flush_wq;
66+
static wait_queue_head_t generic_waitq;
6667

6768
/*
6869
* Allocate memory for a new device structure.
@@ -1151,11 +1152,15 @@ static void __dasd_device_process_final_queue(struct dasd_device *device,
11511152
struct list_head *l, *n;
11521153
struct dasd_ccw_req *cqr;
11531154
struct dasd_block *block;
1155+
void (*callback)(struct dasd_ccw_req *, void *data);
1156+
void *callback_data;
11541157

11551158
list_for_each_safe(l, n, final_queue) {
11561159
cqr = list_entry(l, struct dasd_ccw_req, devlist);
11571160
list_del_init(&cqr->devlist);
11581161
block = cqr->block;
1162+
callback = cqr->callback;
1163+
callback_data = cqr->callback_data;
11591164
if (block)
11601165
spin_lock_bh(&block->queue_lock);
11611166
switch (cqr->status) {
@@ -1176,7 +1181,7 @@ static void __dasd_device_process_final_queue(struct dasd_device *device,
11761181
BUG();
11771182
}
11781183
if (cqr->callback != NULL)
1179-
(cqr->callback)(cqr, cqr->callback_data);
1184+
(callback)(cqr, callback_data);
11801185
if (block)
11811186
spin_unlock_bh(&block->queue_lock);
11821187
}
@@ -1406,17 +1411,15 @@ static inline int _wait_for_wakeup(struct dasd_ccw_req *cqr)
14061411
*/
14071412
int dasd_sleep_on(struct dasd_ccw_req *cqr)
14081413
{
1409-
wait_queue_head_t wait_q;
14101414
struct dasd_device *device;
14111415
int rc;
14121416

14131417
device = cqr->startdev;
14141418

1415-
init_waitqueue_head (&wait_q);
14161419
cqr->callback = dasd_wakeup_cb;
1417-
cqr->callback_data = (void *) &wait_q;
1420+
cqr->callback_data = (void *) &generic_waitq;
14181421
dasd_add_request_tail(cqr);
1419-
wait_event(wait_q, _wait_for_wakeup(cqr));
1422+
wait_event(generic_waitq, _wait_for_wakeup(cqr));
14201423

14211424
/* Request status is either done or failed. */
14221425
rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO;
@@ -1429,20 +1432,18 @@ int dasd_sleep_on(struct dasd_ccw_req *cqr)
14291432
*/
14301433
int dasd_sleep_on_interruptible(struct dasd_ccw_req *cqr)
14311434
{
1432-
wait_queue_head_t wait_q;
14331435
struct dasd_device *device;
14341436
int rc;
14351437

14361438
device = cqr->startdev;
1437-
init_waitqueue_head (&wait_q);
14381439
cqr->callback = dasd_wakeup_cb;
1439-
cqr->callback_data = (void *) &wait_q;
1440+
cqr->callback_data = (void *) &generic_waitq;
14401441
dasd_add_request_tail(cqr);
1441-
rc = wait_event_interruptible(wait_q, _wait_for_wakeup(cqr));
1442+
rc = wait_event_interruptible(generic_waitq, _wait_for_wakeup(cqr));
14421443
if (rc == -ERESTARTSYS) {
14431444
dasd_cancel_req(cqr);
14441445
/* wait (non-interruptible) for final status */
1445-
wait_event(wait_q, _wait_for_wakeup(cqr));
1446+
wait_event(generic_waitq, _wait_for_wakeup(cqr));
14461447
}
14471448
rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO;
14481449
return rc;
@@ -1466,7 +1467,6 @@ static inline int _dasd_term_running_cqr(struct dasd_device *device)
14661467

14671468
int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
14681469
{
1469-
wait_queue_head_t wait_q;
14701470
struct dasd_device *device;
14711471
int rc;
14721472

@@ -1478,9 +1478,8 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
14781478
return rc;
14791479
}
14801480

1481-
init_waitqueue_head (&wait_q);
14821481
cqr->callback = dasd_wakeup_cb;
1483-
cqr->callback_data = (void *) &wait_q;
1482+
cqr->callback_data = (void *) &generic_waitq;
14841483
cqr->status = DASD_CQR_QUEUED;
14851484
list_add(&cqr->devlist, &device->ccw_queue);
14861485

@@ -1489,7 +1488,7 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
14891488

14901489
spin_unlock_irq(get_ccwdev_lock(device->cdev));
14911490

1492-
wait_event(wait_q, _wait_for_wakeup(cqr));
1491+
wait_event(generic_waitq, _wait_for_wakeup(cqr));
14931492

14941493
/* Request status is either done or failed. */
14951494
rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO;
@@ -2430,6 +2429,7 @@ static int __init dasd_init(void)
24302429

24312430
init_waitqueue_head(&dasd_init_waitq);
24322431
init_waitqueue_head(&dasd_flush_wq);
2432+
init_waitqueue_head(&generic_waitq);
24332433

24342434
/* register 'common' DASD debug area, used for all DBF_XXX calls */
24352435
dasd_debug_area = debug_register("dasd", 1, 1, 8 * sizeof(long));

‎drivers/s390/char/raw3270.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
549549
struct raw3270_request *rq)
550550
{
551551
unsigned long flags;
552-
wait_queue_head_t wq;
553552
int rc;
554553

555554
#ifdef CONFIG_TN3270_CONSOLE
@@ -566,20 +565,20 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
566565
return rq->rc;
567566
}
568567
#endif
569-
init_waitqueue_head(&wq);
570568
rq->callback = raw3270_wake_init;
571-
rq->callback_data = &wq;
569+
rq->callback_data = &raw3270_wait_queue;
572570
spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
573571
rc = __raw3270_start(rp, view, rq);
574572
spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
575573
if (rc)
576574
return rc;
577575
/* Now wait for the completion. */
578-
rc = wait_event_interruptible(wq, raw3270_request_final(rq));
576+
rc = wait_event_interruptible(raw3270_wait_queue,
577+
raw3270_request_final(rq));
579578
if (rc == -ERESTARTSYS) { /* Interrupted by a signal. */
580579
raw3270_halt_io(view->dev, rq);
581580
/* No wait for the halt to complete. */
582-
wait_event(wq, raw3270_request_final(rq));
581+
wait_event(raw3270_wait_queue, raw3270_request_final(rq));
583582
return -ERESTARTSYS;
584583
}
585584
return rq->rc;

0 commit comments

Comments
 (0)