Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[pandora-kernel.git] / drivers / s390 / char / sclp.c
index 2c7a1ee..1fd8f21 100644 (file)
@@ -399,6 +399,7 @@ sclp_tod_from_jiffies(unsigned long jiffies)
 void
 sclp_sync_wait(void)
 {
+       unsigned long long old_tick;
        unsigned long flags;
        unsigned long cr0, cr0_sync;
        u64 timeout;
@@ -419,11 +420,12 @@ sclp_sync_wait(void)
        if (!irq_context)
                local_bh_disable();
        /* Enable service-signal interruption, disable timer interrupts */
+       old_tick = local_tick_disable();
        trace_hardirqs_on();
        __ctl_store(cr0, 0, 0);
        cr0_sync = cr0;
+       cr0_sync &= 0xffff00a0;
        cr0_sync |= 0x00000200;
-       cr0_sync &= 0xFFFFF3AC;
        __ctl_load(cr0_sync, 0, 0);
        __raw_local_irq_stosm(0x01);
        /* Loop until driver state indicates finished request */
@@ -439,9 +441,9 @@ sclp_sync_wait(void)
        __ctl_load(cr0, 0, 0);
        if (!irq_context)
                _local_bh_enable();
+       local_tick_enable(old_tick);
        local_irq_restore(flags);
 }
-
 EXPORT_SYMBOL(sclp_sync_wait);
 
 /* Dispatch changes in send and receive mask to registered listeners. */
@@ -506,6 +508,8 @@ sclp_state_change_cb(struct evbuf_header *evbuf)
        if (scbuf->validity_sclp_send_mask)
                sclp_send_mask = scbuf->sclp_send_mask;
        spin_unlock_irqrestore(&sclp_lock, flags);
+       if (scbuf->validity_sclp_active_facility_mask)
+               sclp_facilities = scbuf->sclp_active_facility_mask;
        sclp_dispatch_state_change();
 }
 
@@ -782,11 +786,9 @@ sclp_check_handler(__u16 code)
        /* Is this the interrupt we are waiting for? */
        if (finished_sccb == 0)
                return;
-       if (finished_sccb != (u32) (addr_t) sclp_init_sccb) {
-               printk(KERN_WARNING SCLP_HEADER "unsolicited interrupt "
-                      "for buffer at 0x%x\n", finished_sccb);
-               return;
-       }
+       if (finished_sccb != (u32) (addr_t) sclp_init_sccb)
+               panic("sclp: unsolicited interrupt for buffer at 0x%x\n",
+                     finished_sccb);
        spin_lock(&sclp_lock);
        if (sclp_running_state == sclp_running_state_running) {
                sclp_init_req.status = SCLP_REQ_DONE;
@@ -883,8 +885,6 @@ sclp_init(void)
        unsigned long flags;
        int rc;
 
-       if (!MACHINE_HAS_SCLP)
-               return -ENODEV;
        spin_lock_irqsave(&sclp_lock, flags);
        /* Check for previous or running initialization */
        if (sclp_init_state != sclp_init_state_uninitialized) {