diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-02-07 01:47:12 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-07 01:47:12 -0500 |
commit | 3c9b3a8575b4f2551e3b5b74ffa1c3559c6338eb (patch) | |
tree | 7f8d84353852401ec74e005f6f0b1eb958b9a70d /drivers/s390 | |
parent | c0d3c0c0ce94d3db893577ae98e64414d92e49d8 (diff) | |
parent | c03296a868ae7c91aa2d8b372184763b18f16d7a (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/s390')
85 files changed, 1314 insertions, 249 deletions
diff --git a/drivers/s390/Kconfig b/drivers/s390/Kconfig index a86a650f3d6..721787cc5a1 100644 --- a/drivers/s390/Kconfig +++ b/drivers/s390/Kconfig @@ -51,6 +51,13 @@ config UNIX98_PTY_COUNT When not in use, each additional set of 256 PTYs occupy approximately 8 KB of kernel memory on 32-bit architectures. +config HANGCHECK_TIMER + tristate "Hangcheck timer" + help + The hangcheck-timer module detects when the system has gone + out to lunch past a certain margin. It can reboot the system + or merely print a warning. + source "drivers/char/watchdog/Kconfig" comment "S/390 character device drivers" diff --git a/drivers/s390/block/Kconfig b/drivers/s390/block/Kconfig index 6f50cc9323d..6912399d093 100644 --- a/drivers/s390/block/Kconfig +++ b/drivers/s390/block/Kconfig @@ -55,13 +55,21 @@ config DASD_DIAG Disks under VM. If you are not running under VM or unsure what it is, say "N". +config DASD_EER + tristate "Extended error reporting (EER)" + depends on DASD + help + This driver provides a character device interface to the + DASD extended error reporting. This is only needed if you want to + use applications written for the EER facility. + config DASD_CMB tristate "Compatibility interface for DASD channel measurement blocks" depends on DASD help - This driver provides an additional interface to the channel measurement - facility, which is normally accessed though sysfs, with a set of - ioctl functions specific to the dasd driver. + This driver provides an additional interface to the channel + measurement facility, which is normally accessed though sysfs, with + a set of ioctl functions specific to the dasd driver. This is only needed if you want to use applications written for linux-2.4 dasd channel measurement facility interface. diff --git a/drivers/s390/block/Makefile b/drivers/s390/block/Makefile index 58c6780134f..0c0d871e8f5 100644 --- a/drivers/s390/block/Makefile +++ b/drivers/s390/block/Makefile @@ -5,6 +5,7 @@ dasd_eckd_mod-objs := dasd_eckd.o dasd_3990_erp.o dasd_9343_erp.o dasd_fba_mod-objs := dasd_fba.o dasd_3370_erp.o dasd_9336_erp.o dasd_diag_mod-objs := dasd_diag.o +dasd_eer_mod-objs := dasd_eer.o dasd_mod-objs := dasd.o dasd_ioctl.o dasd_proc.o dasd_devmap.o \ dasd_genhd.o dasd_erp.o @@ -13,5 +14,6 @@ obj-$(CONFIG_DASD_DIAG) += dasd_diag_mod.o obj-$(CONFIG_DASD_ECKD) += dasd_eckd_mod.o obj-$(CONFIG_DASD_FBA) += dasd_fba_mod.o obj-$(CONFIG_DASD_CMB) += dasd_cmb.o +obj-$(CONFIG_DASD_EER) += dasd_eer.o obj-$(CONFIG_BLK_DEV_XPRAM) += xpram.o obj-$(CONFIG_DCSSBLK) += dcssblk.o diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index ef4c687e7c0..08c88fcd896 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -7,7 +7,6 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * - * $Revision: 1.172 $ */ #include <linux/config.h> @@ -19,6 +18,7 @@ #include <linux/slab.h> #include <linux/buffer_head.h> #include <linux/hdreg.h> +#include <linux/notifier.h> #include <asm/ccwdev.h> #include <asm/ebcdic.h> @@ -58,6 +58,7 @@ static void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *); static void dasd_flush_ccw_queue(struct dasd_device *, int); static void dasd_tasklet(struct dasd_device *); static void do_kick_device(void *data); +static void dasd_disable_eer(struct dasd_device *device); /* * SECTION: Operations on the device structure. @@ -152,6 +153,8 @@ dasd_state_new_to_known(struct dasd_device *device) static inline void dasd_state_known_to_new(struct dasd_device * device) { + /* disable extended error reporting for this device */ + dasd_disable_eer(device); /* Forget the discipline information. */ device->discipline = NULL; device->state = DASD_STATE_NEW; @@ -675,11 +678,8 @@ dasd_term_IO(struct dasd_ccw_req * cqr) rc = ccw_device_clear(device->cdev, (long) cqr); switch (rc) { case 0: /* termination successful */ - if (cqr->retries > 0) { - cqr->retries--; - cqr->status = DASD_CQR_CLEAR; - } else - cqr->status = DASD_CQR_FAILED; + cqr->retries--; + cqr->status = DASD_CQR_CLEAR; cqr->stopclk = get_clock(); DBF_DEV_EVENT(DBF_DEBUG, device, "terminate cqr %p successful", @@ -871,6 +871,9 @@ dasd_handle_state_change_pending(struct dasd_device *device) struct dasd_ccw_req *cqr; struct list_head *l, *n; + /* first of all call extended error reporting */ + dasd_write_eer_trigger(DASD_EER_STATECHANGE, device, NULL); + device->stopped &= ~DASD_STOPPED_PENDING; /* restart all 'running' IO on queue */ @@ -1090,6 +1093,19 @@ restart: } goto restart; } + + /* first of all call extended error reporting */ + if (device->eer && cqr->status == DASD_CQR_FAILED) { + dasd_write_eer_trigger(DASD_EER_FATALERROR, + device, cqr); + + /* restart request */ + cqr->status = DASD_CQR_QUEUED; + cqr->retries = 255; + device->stopped |= DASD_STOPPED_QUIESCE; + goto restart; + } + /* Process finished ERP request. */ if (cqr->refers) { __dasd_process_erp(device, cqr); @@ -1227,7 +1243,8 @@ __dasd_start_head(struct dasd_device * device) cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); /* check FAILFAST */ if (device->stopped & ~DASD_STOPPED_PENDING && - test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags)) { + test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && + (!device->eer)) { cqr->status = DASD_CQR_FAILED; dasd_schedule_bh(device); } @@ -1308,7 +1325,7 @@ dasd_tasklet(struct dasd_device * device) /* Now call the callback function of requests with final status */ list_for_each_safe(l, n, &final_queue) { cqr = list_entry(l, struct dasd_ccw_req, list); - list_del(&cqr->list); + list_del_init(&cqr->list); if (cqr->callback != NULL) (cqr->callback)(cqr, cqr->callback_data); } @@ -1393,7 +1410,9 @@ _wait_for_wakeup(struct dasd_ccw_req *cqr) device = cqr->device; spin_lock_irq(get_ccwdev_lock(device->cdev)); - rc = cqr->status == DASD_CQR_DONE || cqr->status == DASD_CQR_FAILED; + rc = ((cqr->status == DASD_CQR_DONE || + cqr->status == DASD_CQR_FAILED) && + list_empty(&cqr->list)); spin_unlock_irq(get_ccwdev_lock(device->cdev)); return rc; } @@ -1457,15 +1476,37 @@ dasd_sleep_on_interruptible(struct dasd_ccw_req * cqr) while (!finished) { rc = wait_event_interruptible(wait_q, _wait_for_wakeup(cqr)); if (rc != -ERESTARTSYS) { - /* Request status is either done or failed. */ - rc = (cqr->status == DASD_CQR_FAILED) ? -EIO : 0; + /* Request is final (done or failed) */ + rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; break; } spin_lock_irq(get_ccwdev_lock(device->cdev)); - if (cqr->status == DASD_CQR_IN_IO && - device->discipline->term_IO(cqr) == 0) { - list_del(&cqr->list); + switch (cqr->status) { + case DASD_CQR_IN_IO: + /* terminate runnig cqr */ + if (device->discipline->term_IO) { + cqr->retries = -1; + device->discipline->term_IO(cqr); + /*nished = + * wait (non-interruptible) for final status + * because signal ist still pending + */ + spin_unlock_irq(get_ccwdev_lock(device->cdev)); + wait_event(wait_q, _wait_for_wakeup(cqr)); + spin_lock_irq(get_ccwdev_lock(device->cdev)); + rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO; + finished = 1; + } + break; + case DASD_CQR_QUEUED: + /* request */ + list_del_init(&cqr->list); + rc = -EIO; finished = 1; + break; + default: + /* cqr with 'non-interruptable' status - just wait */ + break; } spin_unlock_irq(get_ccwdev_lock(device->cdev)); } @@ -1945,6 +1986,9 @@ dasd_generic_notify(struct ccw_device *cdev, int event) switch (event) { case CIO_GONE: case CIO_NO_PATH: + /* first of all call extended error reporting */ + dasd_write_eer_trigger(DASD_EER_NOPATH, device, NULL); + if (device->state < DASD_STATE_BASIC) break; /* Device is active. We want to keep it. */ @@ -2002,6 +2046,51 @@ dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver) put_driver(drv); } +/* + * notifications for extended error reports + */ +static struct notifier_block *dasd_eer_chain; + +int +dasd_register_eer_notifier(struct notifier_block *nb) +{ + return notifier_chain_register(&dasd_eer_chain, nb); +} + +int +dasd_unregister_eer_notifier(struct notifier_block *nb) +{ + return notifier_chain_unregister(&dasd_eer_chain, nb); +} + +/* + * Notify the registered error reporting module of a problem + */ +void +dasd_write_eer_trigger(unsigned int id, struct dasd_device *device, + struct dasd_ccw_req *cqr) +{ + if (device->eer) { + struct dasd_eer_trigger temp; + temp.id = id; + temp.device = device; + temp.cqr = cqr; + notifier_call_chain(&dasd_eer_chain, DASD_EER_TRIGGER, + (void *)&temp); + } +} + +/* + * Tell the registered error reporting module to disable error reporting for + * a given device and to cleanup any private data structures on that device. + */ +static void +dasd_disable_eer(struct dasd_device *device) +{ + notifier_call_chain(&dasd_eer_chain, DASD_EER_DISABLE, (void *)device); +} + + static int __init dasd_init(void) { @@ -2083,6 +2172,11 @@ EXPORT_SYMBOL_GPL(dasd_generic_set_online); EXPORT_SYMBOL_GPL(dasd_generic_set_offline); EXPORT_SYMBOL_GPL(dasd_generic_auto_online); +EXPORT_SYMBOL(dasd_register_eer_notifier); +EXPORT_SYMBOL(dasd_unregister_eer_notifier); +EXPORT_SYMBOL(dasd_write_eer_trigger); + + /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/drivers/s390/block/dasd_3370_erp.c b/drivers/s390/block/dasd_3370_erp.c index 84565c8f584..1d11c2a9525 100644 --- a/drivers/s390/block/dasd_3370_erp.c +++ b/drivers/s390/block/dasd_3370_erp.c @@ -4,7 +4,6 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * - * $Revision: 1.9 $ */ #define PRINTK_HEADER "dasd_erp(3370)" diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c index c143ecb53d9..c811380b907 100644 --- a/drivers/s390/block/dasd_3990_erp.c +++ b/drivers/s390/block/dasd_3990_erp.c @@ -5,7 +5,6 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001 * - * $Revision: 1.36 $ */ #include <linux/timer.h> @@ -1109,6 +1108,9 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) case 0x0B: DEV_MESSAGE(KERN_WARNING, device, "%s", "FORMAT F - Volume is suspended duplex"); + /* call extended error reporting (EER) */ + dasd_write_eer_trigger(DASD_EER_PPRCSUSPEND, device, + erp->refers); break; case 0x0C: DEV_MESSAGE(KERN_WARNING, device, "%s", diff --git a/drivers/s390/block/dasd_9336_erp.c b/drivers/s390/block/dasd_9336_erp.c index 01e87170a3a..dc861446d05 100644 --- a/drivers/s390/block/dasd_9336_erp.c +++ b/drivers/s390/block/dasd_9336_erp.c @@ -4,7 +4,6 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * - * $Revision: 1.8 $ */ #define PRINTK_HEADER "dasd_erp(9336)" diff --git a/drivers/s390/block/dasd_9343_erp.c b/drivers/s390/block/dasd_9343_erp.c index 2a23b74faf3..4a5b79569aa 100644 --- a/drivers/s390/block/dasd_9343_erp.c +++ b/drivers/s390/block/dasd_9343_erp.c @@ -4,7 +4,6 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 * - * $Revision: 1.13 $ */ #define PRINTK_HEADER "dasd_erp(9343)" diff --git a/drivers/s390/block/dasd_cmb.c b/drivers/s390/block/dasd_cmb.c index 4f365bff275..e88f73ee72c 100644 --- a/drivers/s390/block/dasd_cmb.c +++ b/drivers/s390/block/dasd_cmb.c @@ -1,6 +1,4 @@ /* - * linux/drivers/s390/block/dasd_cmb.c ($Revision: 1.9 $) - * * Linux on zSeries Channel Measurement Facility support * (dasd device driver interface) * diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index caee16a3dc6..1629b27c48a 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -11,7 +11,6 @@ * functions may not be called from interrupt context. In particular * dasd_get_device is a no-no from interrupt context. * - * $Revision: 1.43 $ */ #include <linux/config.h> diff --git a/drivers/s390/block/ |