Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x-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
  • Loading branch information
Linus Torvalds committed May 30, 2008
2 parents e3aa51f + 0066ed5 commit 9db8ee3
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 87 deletions.
3 changes: 3 additions & 0 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ config ARCH_SPARSEMEM_ENABLE
config ARCH_SPARSEMEM_DEFAULT
def_bool y

config ARCH_SELECT_MEMORY_MODEL
def_bool y

source "mm/Kconfig"

comment "I/O subsystem configuration"
Expand Down
8 changes: 8 additions & 0 deletions arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static void appldata_work_fn(struct work_struct *work)

P_DEBUG(" -= Work Queue =-\n");
i = 0;
get_online_cpus();
spin_lock(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
ops = list_entry(lh, struct appldata_ops, list);
Expand All @@ -140,6 +141,7 @@ static void appldata_work_fn(struct work_struct *work)
}
}
spin_unlock(&appldata_ops_lock);
put_online_cpus();
}

/*
Expand Down Expand Up @@ -266,12 +268,14 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
len = *lenp;
if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
return -EFAULT;
get_online_cpus();
spin_lock(&appldata_timer_lock);
if (buf[0] == '1')
__appldata_vtimer_setup(APPLDATA_ADD_TIMER);
else if (buf[0] == '0')
__appldata_vtimer_setup(APPLDATA_DEL_TIMER);
spin_unlock(&appldata_timer_lock);
put_online_cpus();
out:
*lenp = len;
*ppos += len;
Expand Down Expand Up @@ -314,10 +318,12 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
return -EINVAL;
}

get_online_cpus();
spin_lock(&appldata_timer_lock);
appldata_interval = interval;
__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
spin_unlock(&appldata_timer_lock);
put_online_cpus();

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

get_online_cpus();
for_each_online_cpu(i)
appldata_online_cpu(i);
put_online_cpus();

/* Register cpu hotplug notifier */
register_hotcpu_notifier(&appldata_nb);
Expand Down
11 changes: 8 additions & 3 deletions arch/s390/defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.25
# Wed Apr 30 11:07:45 2008
# Linux kernel version: 2.6.26-rc4
# Fri May 30 09:49:33 2008
#
CONFIG_SCHED_MC=y
CONFIG_MMU=y
Expand Down Expand Up @@ -103,6 +103,7 @@ CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
Expand Down Expand Up @@ -173,6 +174,7 @@ CONFIG_PREEMPT=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
# CONFIG_DISCONTIGMEM_MANUAL is not set
Expand Down Expand Up @@ -210,6 +212,7 @@ CONFIG_FORCE_MAX_ZONEORDER=9
CONFIG_PFAULT=y
# CONFIG_SHARED_KERNEL is not set
# CONFIG_CMM is not set
# CONFIG_PAGE_STATES is not set
CONFIG_VIRT_TIMER=y
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_APPLDATA_BASE is not set
Expand Down Expand Up @@ -620,6 +623,7 @@ CONFIG_S390_VMUR=m
#
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
CONFIG_ACCESSIBILITY=y

#
# File systems
Expand Down Expand Up @@ -754,11 +758,12 @@ CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
CONFIG_HEADERS_CHECK=y
# CONFIG_HEADERS_CHECK is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
CONFIG_DEBUG_PREEMPT=y
# CONFIG_DEBUG_RT_MUTEXES is not set
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static const unsigned char formats[][7] = {
[INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 }, /* e.g. madbr */
[INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 },/* e.g. didbr */
[INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 },/* e.g. .insn */
[INSTR_RRF_R0RR] = { 0xff, R_24,R_28,R_16,0,0,0 }, /* e.g. idte */
[INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 }, /* e.g. idte */
[INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 }, /* e.g. fixr */
[INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 }, /* e.g. cfebr */
[INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 }, /* e.g. sske */
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ static int __devinit smp_add_present_cpu(int cpu)

#ifdef CONFIG_HOTPLUG_CPU

int smp_rescan_cpus(void)
int __ref smp_rescan_cpus(void)
{
cpumask_t newcpus;
int cpu;
Expand Down
49 changes: 23 additions & 26 deletions arch/s390/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,34 @@ char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));

void show_mem(void)
{
int i, total = 0, reserved = 0;
int shared = 0, cached = 0;
unsigned long i, total = 0, reserved = 0;
unsigned long shared = 0, cached = 0;
unsigned long flags;
struct page *page;
pg_data_t *pgdat;

printk("Mem-info:\n");
show_free_areas();
i = max_mapnr;
while (i-- > 0) {
if (!pfn_valid(i))
continue;
page = pfn_to_page(i);
total++;
if (PageReserved(page))
reserved++;
else if (PageSwapCache(page))
cached++;
else if (page_count(page))
shared += page_count(page) - 1;
for_each_online_pgdat(pgdat) {
pgdat_resize_lock(pgdat, &flags);
for (i = 0; i < pgdat->node_spanned_pages; i++) {
if (!pfn_valid(pgdat->node_start_pfn + i))
continue;
page = pfn_to_page(pgdat->node_start_pfn + i);
total++;
if (PageReserved(page))
reserved++;
else if (PageSwapCache(page))
cached++;
else if (page_count(page))
shared += page_count(page) - 1;
}
pgdat_resize_unlock(pgdat, &flags);
}
printk("%d pages of RAM\n", total);
printk("%d reserved pages\n", reserved);
printk("%d pages shared\n", shared);
printk("%d pages swap cached\n", cached);

printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
printk("%lu pages slab\n",
global_page_state(NR_SLAB_RECLAIMABLE) +
global_page_state(NR_SLAB_UNRECLAIMABLE));
printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));
printk("%ld pages of RAM\n", total);
printk("%ld reserved pages\n", reserved);
printk("%ld pages shared\n", shared);
printk("%ld pages swap cached\n", cached);
}

/*
Expand Down
18 changes: 13 additions & 5 deletions arch/s390/mm/vmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,32 @@ struct memory_segment {

static LIST_HEAD(mem_segs);

static pud_t *vmem_pud_alloc(void)
static void __ref *vmem_alloc_pages(unsigned int order)
{
if (slab_is_available())
return (void *)__get_free_pages(GFP_KERNEL, order);
return alloc_bootmem_pages((1 << order) * PAGE_SIZE);
}

static inline pud_t *vmem_pud_alloc(void)
{
pud_t *pud = NULL;

#ifdef CONFIG_64BIT
pud = vmemmap_alloc_block(PAGE_SIZE * 4, 0);
pud = vmem_alloc_pages(2);
if (!pud)
return NULL;
clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4);
#endif
return pud;
}

static pmd_t *vmem_pmd_alloc(void)
static inline pmd_t *vmem_pmd_alloc(void)
{
pmd_t *pmd = NULL;

#ifdef CONFIG_64BIT
pmd = vmemmap_alloc_block(PAGE_SIZE * 4, 0);
pmd = vmem_alloc_pages(2);
if (!pmd)
return NULL;
clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4);
Expand Down Expand Up @@ -207,13 +214,14 @@ int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node)
if (pte_none(*pt_dir)) {
unsigned long new_page;

new_page =__pa(vmemmap_alloc_block(PAGE_SIZE, 0));
new_page =__pa(vmem_alloc_pages(0));
if (!new_page)
goto out;
pte = pfn_pte(new_page >> PAGE_SHIFT, PAGE_KERNEL);
*pt_dir = pte;
}
}
memset(start, 0, nr * sizeof(struct page));
ret = 0;
out:
flush_tlb_kernel_range(start_addr, end_addr);
Expand Down
28 changes: 14 additions & 14 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static void dasd_return_cqr_cb(struct dasd_ccw_req *, void *);
*/
static wait_queue_head_t dasd_init_waitq;
static wait_queue_head_t dasd_flush_wq;
static wait_queue_head_t generic_waitq;

/*
* Allocate memory for a new device structure.
Expand Down Expand Up @@ -1151,11 +1152,15 @@ static void __dasd_device_process_final_queue(struct dasd_device *device,
struct list_head *l, *n;
struct dasd_ccw_req *cqr;
struct dasd_block *block;
void (*callback)(struct dasd_ccw_req *, void *data);
void *callback_data;

list_for_each_safe(l, n, final_queue) {
cqr = list_entry(l, struct dasd_ccw_req, devlist);
list_del_init(&cqr->devlist);
block = cqr->block;
callback = cqr->callback;
callback_data = cqr->callback_data;
if (block)
spin_lock_bh(&block->queue_lock);
switch (cqr->status) {
Expand All @@ -1176,7 +1181,7 @@ static void __dasd_device_process_final_queue(struct dasd_device *device,
BUG();
}
if (cqr->callback != NULL)
(cqr->callback)(cqr, cqr->callback_data);
(callback)(cqr, callback_data);
if (block)
spin_unlock_bh(&block->queue_lock);
}
Expand Down Expand Up @@ -1406,17 +1411,15 @@ static inline int _wait_for_wakeup(struct dasd_ccw_req *cqr)
*/
int dasd_sleep_on(struct dasd_ccw_req *cqr)
{
wait_queue_head_t wait_q;
struct dasd_device *device;
int rc;

device = cqr->startdev;

init_waitqueue_head (&wait_q);
cqr->callback = dasd_wakeup_cb;
cqr->callback_data = (void *) &wait_q;
cqr->callback_data = (void *) &generic_waitq;
dasd_add_request_tail(cqr);
wait_event(wait_q, _wait_for_wakeup(cqr));
wait_event(generic_waitq, _wait_for_wakeup(cqr));

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

device = cqr->startdev;
init_waitqueue_head (&wait_q);
cqr->callback = dasd_wakeup_cb;
cqr->callback_data = (void *) &wait_q;
cqr->callback_data = (void *) &generic_waitq;
dasd_add_request_tail(cqr);
rc = wait_event_interruptible(wait_q, _wait_for_wakeup(cqr));
rc = wait_event_interruptible(generic_waitq, _wait_for_wakeup(cqr));
if (rc == -ERESTARTSYS) {
dasd_cancel_req(cqr);
/* wait (non-interruptible) for final status */
wait_event(wait_q, _wait_for_wakeup(cqr));
wait_event(generic_waitq, _wait_for_wakeup(cqr));
}
rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO;
return rc;
Expand All @@ -1466,7 +1467,6 @@ static inline int _dasd_term_running_cqr(struct dasd_device *device)

int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
{
wait_queue_head_t wait_q;
struct dasd_device *device;
int rc;

Expand All @@ -1478,9 +1478,8 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
return rc;
}

init_waitqueue_head (&wait_q);
cqr->callback = dasd_wakeup_cb;
cqr->callback_data = (void *) &wait_q;
cqr->callback_data = (void *) &generic_waitq;
cqr->status = DASD_CQR_QUEUED;
list_add(&cqr->devlist, &device->ccw_queue);

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

spin_unlock_irq(get_ccwdev_lock(device->cdev));

wait_event(wait_q, _wait_for_wakeup(cqr));
wait_event(generic_waitq, _wait_for_wakeup(cqr));

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

init_waitqueue_head(&dasd_init_waitq);
init_waitqueue_head(&dasd_flush_wq);
init_waitqueue_head(&generic_waitq);

/* register 'common' DASD debug area, used for all DBF_XXX calls */
dasd_debug_area = debug_register("dasd", 1, 1, 8 * sizeof(long));
Expand Down
9 changes: 4 additions & 5 deletions drivers/s390/char/raw3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
struct raw3270_request *rq)
{
unsigned long flags;
wait_queue_head_t wq;
int rc;

#ifdef CONFIG_TN3270_CONSOLE
Expand All @@ -566,20 +565,20 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
return rq->rc;
}
#endif
init_waitqueue_head(&wq);
rq->callback = raw3270_wake_init;
rq->callback_data = &wq;
rq->callback_data = &raw3270_wait_queue;
spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
rc = __raw3270_start(rp, view, rq);
spin_unlock_irqrestore(get_ccwdev_lock(view->dev->cdev), flags);
if (rc)
return rc;
/* Now wait for the completion. */
rc = wait_event_interruptible(wq, raw3270_request_final(rq));
rc = wait_event_interruptible(raw3270_wait_queue,
raw3270_request_final(rq));
if (rc == -ERESTARTSYS) { /* Interrupted by a signal. */
raw3270_halt_io(view->dev, rq);
/* No wait for the halt to complete. */
wait_event(wq, raw3270_request_final(rq));
wait_event(raw3270_wait_queue, raw3270_request_final(rq));
return -ERESTARTSYS;
}
return rq->rc;
Expand Down
Loading

0 comments on commit 9db8ee3

Please sign in to comment.