GIT 6f5285657122f91b2d538a0b0a985cca8b1d67fd git://git390.osdl.marist.edu/pub/scm/linux-2.6.git#for-andrew commit Author: Stefan Haberland Date: Wed Feb 13 10:41:37 2008 +0100 [S390] sim handling Now the system reports system information messages (SIM) to the user. The System Reference Code (SRC) which is reported to the user gives the abbility to lookup the reason of the SIM online in the documentation of the storage server. Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky commit 71ff93b08a4914dc1611d6cb431ee866b248cd95 Author: Martin Schwidefsky Date: Wed Feb 13 10:41:29 2008 +0100 [S390] find bit corner case. Fix [ext2_]find_first_[zero_]bit for the corner case of an all clear or all set bit field by always handling that last word of the bit field with __ffz_word/__ffs_word. Signed-off-by: Martin Schwidefsky commit e781cebecdab128c6cbc085e43025150845c2850 Author: Stefan Weinhuber Date: Wed Feb 13 10:41:28 2008 +0100 [S390] dasd: fix locking in __dasd_device_process_final_queue After setting the status of the cqr and releasing the lock for the block cqr queue, we call the cqr callback function, which will usually just trigger the dasd_block_tasklet. But when the tasklet is already running the cqr might be processed before we invoke the callback function. In rare cases the callback pointer may already be invalid by the time we want to call it, which will result in a panic. Solution: Call the callback function first and then release the lock. Signed-off-by: Stefan Weinhuber Signed-off-by: Martin Schwidefsky commit 7f3ba93a3b29cc405af1644a282bf7d0cfd10488 Author: Heiko Carstens Date: Wed Feb 13 10:41:27 2008 +0100 [S390] Make sure enabled wait psw is loaded in default_idle. If both NO_IDLE_HZ and VIRT_TIMER are disabled default_idle won't load an enabled wait psw and busy loop instead. This is because the idle_chain is empty and the return value of atomic_notifier_call_chain will be NOTIFY_DONE, which causes default_idle to return instead of loading an enabled wait psw. Fix this by calling __atomic_notifier_call_chain instead and add proper return value handling. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit c050e24b5668861904512e21e2abd7c7e1cdf3e9 Author: Heiko Carstens Date: Wed Feb 13 10:41:26 2008 +0100 [S390] Let NR_CPUS default to 32/64 on s390/s390x. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky commit f90771b3432a5f92fd6b259bdfa840948e7ef940 Author: Cornelia Huck Date: Wed Feb 13 10:41:25 2008 +0100 [S390] cio: Do timed recovery on workqueue. We can't do our recovery in softirq context, so we schedule it from our timer function. Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky commit 1245fa552cb504e83b54bbb714c21df7f60b9164 Author: Cornelia Huck Date: Wed Feb 13 10:41:24 2008 +0100 [S390] cio: Remember to initialize recovery_lock. Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky arch/s390/Kconfig | 3 ++- arch/s390/kernel/process.c | 15 +++++++++------ drivers/s390/block/dasd.c | 12 ++++++------ drivers/s390/block/dasd_3990_erp.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/s390/block/dasd_int.h | 5 +++++ drivers/s390/cio/device.c | 15 +++++++++++++-- include/asm-s390/bitops.h | 20 ++++++++++++-------- 7 files changed, 83 insertions(+), 23 deletions(-) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 92a4f7b..b21444b 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -100,7 +100,8 @@ config NR_CPUS int "Maximum number of CPUs (2-64)" range 2 64 depends on SMP - default "32" + default "32" if !64BIT + default "64" if 64BIT help This allows you to specify the maximum number of CPUs which this kernel will support. The maximum supported value is 64 and the diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index a6a4729..1c59ec1 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -114,24 +114,27 @@ extern void s390_handle_mcck(void); static void default_idle(void) { int cpu, rc; + int nr_calls = 0; + void *hcpu; #ifdef CONFIG_SMP struct s390_idle_data *idle; #endif /* CPU is going idle. */ cpu = smp_processor_id(); - + hcpu = (void *)(long)cpu; local_irq_disable(); if (need_resched()) { local_irq_enable(); return; } - rc = atomic_notifier_call_chain(&idle_chain, - S390_CPU_IDLE, (void *)(long) cpu); - if (rc != NOTIFY_OK && rc != NOTIFY_DONE) - BUG(); - if (rc != NOTIFY_OK) { + rc = __atomic_notifier_call_chain(&idle_chain, S390_CPU_IDLE, hcpu, -1, + &nr_calls); + if (rc == NOTIFY_BAD) { + nr_calls--; + __atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE, + hcpu, nr_calls, NULL); local_irq_enable(); return; } diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index d984e0f..ccf46c9 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1149,12 +1149,14 @@ 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; list_for_each_safe(l, n, final_queue) { cqr = list_entry(l, struct dasd_ccw_req, devlist); list_del_init(&cqr->devlist); - if (cqr->block) - spin_lock_bh(&cqr->block->queue_lock); + block = cqr->block; + if (block) + spin_lock_bh(&block->queue_lock); switch (cqr->status) { case DASD_CQR_SUCCESS: cqr->status = DASD_CQR_DONE; @@ -1172,15 +1174,13 @@ static void __dasd_device_process_final_queue(struct dasd_device *device, cqr, cqr->status); BUG(); } - if (cqr->block) - spin_unlock_bh(&cqr->block->queue_lock); if (cqr->callback != NULL) (cqr->callback)(cqr, cqr->callback_data); + if (block) + spin_unlock_bh(&block->queue_lock); } } - - /* * Take a look at the first request on the ccw queue and check * if it reached its expire time. If so, terminate the IO. diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c index f69714a..bf96775 100644 --- a/drivers/s390/block/dasd_3990_erp.c +++ b/drivers/s390/block/dasd_3990_erp.c @@ -1996,6 +1996,38 @@ dasd_3990_erp_compound(struct dasd_ccw_req * erp, char *sense) } /* end dasd_3990_erp_compound */ /* + *DASD_3990_ERP_HANDLE_SIM + * + *DESCRIPTION + * inspects the SIM SENSE data and starts an appropriate action + * + * PARAMETER + * sense sense data of the actual error + * + * RETURN VALUES + * none + */ +static void +dasd_3990_erp_handle_sim(struct dasd_ccw_req *erp, char *sense) +{ + struct dasd_device *device = erp->startdev; + + /* print message according to log or message to operator mode */ + if ((sense[24] & DASD_SIM_MSG_TO_OP) || (sense[1] & 0x10)) { + + /* print SIM SRC from RefCode */ + DEV_MESSAGE(KERN_ERR, device, "SIM - SRC: " + "%02x%02x%02x%02x", sense[22], + sense[23], sense[11], sense[12]); + } else if (sense[24] & DASD_SIM_LOG) { + /* print SIM SRC Refcode */ + DEV_MESSAGE(KERN_WARNING, device, "SIM - SRC: " + "%02x%02x%02x%02x", sense[22], + sense[23], sense[11], sense[12]); + } +} + +/* * DASD_3990_ERP_INSPECT_32 * * DESCRIPTION @@ -2018,6 +2050,10 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) erp->function = dasd_3990_erp_inspect_32; + /* check for SIM sense data */ + if ((sense[6] & DASD_SIM_SENSE) == DASD_SIM_SENSE) + dasd_3990_erp_handle_sim(erp, sense); + if (sense[25] & DASD_SENSE_BIT_0) { /* compound program action codes (byte25 bit 0 == '1') */ diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index 44b2984..5f5a884 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h @@ -72,6 +72,11 @@ struct dasd_block; #define DASD_SENSE_BIT_2 0x20 #define DASD_SENSE_BIT_3 0x10 +/* BIT DEFINITIONS FOR SIM SENSE */ +#define DASD_SIM_SENSE 0x0F +#define DASD_SIM_MSG_TO_OP 0x03 +#define DASD_SIM_LOG 0x0C + /* * SECTION: MACROs for klogd and s390 debug feature (dbf) */ diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index d35dc3f..fec004f 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -32,7 +32,7 @@ #include "io_sch.h" static struct timer_list recovery_timer; -static spinlock_t recovery_lock; +static DEFINE_SPINLOCK(recovery_lock); static int recovery_phase; static const unsigned long recovery_delay[] = { 3, 30, 300 }; @@ -1535,7 +1535,7 @@ static int recovery_check(struct device *dev, void *data) return 0; } -static void recovery_func(unsigned long data) +static void recovery_work_func(struct work_struct *unused) { int redo = 0; @@ -1553,6 +1553,17 @@ static void recovery_func(unsigned long data) CIO_MSG_EVENT(2, "recovery: end\n"); } +static DECLARE_WORK(recovery_work, recovery_work_func); + +static void recovery_func(unsigned long data) +{ + /* + * We can't do our recovery in softirq context and it's not + * performance critical, so we schedule it. + */ + schedule_work(&recovery_work); +} + void ccw_device_schedule_recovery(void) { unsigned long flags; diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index ab83c84..965394e 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h @@ -456,16 +456,18 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr, asm volatile( #ifndef __s390x__ - " ahi %1,31\n" - " srl %1,5\n" + " ahi %1,-1\n" + " sra %1,5\n" + " jz 1f\n" "0: c %2,0(%0,%3)\n" " jne 1f\n" " la %0,4(%0)\n" " brct %1,0b\n" "1:\n" #else - " aghi %1,63\n" - " srlg %1,%1,6\n" + " aghi %1,-1\n" + " srag %1,%1,6\n" + " jz 1f\n" "0: cg %2,0(%0,%3)\n" " jne 1f\n" " la %0,8(%0)\n" @@ -491,16 +493,18 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr, asm volatile( #ifndef __s390x__ - " ahi %1,31\n" - " srl %1,5\n" + " ahi %1,-1\n" + " sra %1,5\n" + " jz 1f\n" "0: c %2,0(%0,%3)\n" " jne 1f\n" " la %0,4(%0)\n" " brct %1,0b\n" "1:\n" #else - " aghi %1,63\n" - " srlg %1,%1,6\n" + " aghi %1,-1\n" + " srag %1,%1,6\n" + " jz 1f\n" "0: cg %2,0(%0,%3)\n" " jne 1f\n" " la %0,8(%0)\n"