Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23378
b: refs/heads/master
c: 20c6446
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Weinhuber authored and Linus Torvalds committed Mar 24, 2006
1 parent 24eadc9 commit d6adf6a
Show file tree
Hide file tree
Showing 9 changed files with 813 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 554a826e0a29f1a88e5a5332f0718c059885ec17
refs/heads/master: 20c644680af1ef9a6b36c0873f59498c98b07ab1
8 changes: 8 additions & 0 deletions trunk/drivers/s390/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ config DASD_DIAG
Disks under VM. If you are not running under VM or unsure what it is,
say "N".

config DASD_EER
bool "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.

endif
3 changes: 3 additions & 0 deletions trunk/drivers/s390/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ dasd_fba_mod-objs := dasd_fba.o dasd_3370_erp.o dasd_9336_erp.o
dasd_diag_mod-objs := dasd_diag.o
dasd_mod-objs := dasd.o dasd_ioctl.o dasd_proc.o dasd_devmap.o \
dasd_genhd.o dasd_erp.o
ifdef CONFIG_DASD_EER
dasd_mod-objs += dasd_eer.o
endif

obj-$(CONFIG_DASD) += dasd_mod.o
obj-$(CONFIG_DASD_DIAG) += dasd_diag_mod.o
Expand Down
29 changes: 28 additions & 1 deletion trunk/drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,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_eer_disable(device);
/* Forget the discipline information. */
if (device->discipline)
module_put(device->discipline->owner);
Expand Down Expand Up @@ -892,6 +894,9 @@ dasd_handle_state_change_pending(struct dasd_device *device)
struct dasd_ccw_req *cqr;
struct list_head *l, *n;

/* First of all start sense subsystem status request. */
dasd_eer_snss(device);

device->stopped &= ~DASD_STOPPED_PENDING;

/* restart all 'running' IO on queue */
Expand Down Expand Up @@ -1111,6 +1116,19 @@ __dasd_process_ccw_queue(struct dasd_device * device,
}
goto restart;
}

/* First of all call extended error reporting. */
if (dasd_eer_enabled(device) &&
cqr->status == DASD_CQR_FAILED) {
dasd_eer_write(device, cqr, DASD_EER_FATALERROR);

/* 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);
Expand Down Expand Up @@ -1248,7 +1266,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) &&
(!dasd_eer_enabled(device))) {
cqr->status = DASD_CQR_FAILED;
dasd_schedule_bh(device);
}
Expand Down Expand Up @@ -1807,6 +1826,7 @@ dasd_exit(void)
#ifdef CONFIG_PROC_FS
dasd_proc_exit();
#endif
dasd_eer_exit();
if (dasd_page_cache != NULL) {
kmem_cache_destroy(dasd_page_cache);
dasd_page_cache = NULL;
Expand Down Expand Up @@ -2003,6 +2023,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_eer_write(device, NULL, DASD_EER_NOPATH);

if (device->state < DASD_STATE_BASIC)
break;
/* Device is active. We want to keep it. */
Expand Down Expand Up @@ -2060,6 +2083,7 @@ dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver)
put_driver(drv);
}


static int __init
dasd_init(void)
{
Expand Down Expand Up @@ -2092,6 +2116,9 @@ dasd_init(void)
rc = dasd_parse();
if (rc)
goto failed;
rc = dasd_eer_init();
if (rc)
goto failed;
#ifdef CONFIG_PROC_FS
rc = dasd_proc_init();
if (rc)
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/s390/block/dasd_3990_erp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,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_eer_write(device, erp->refers,
DASD_EER_PPRCSUSPEND);
break;
case 0x0C:
DEV_MESSAGE(KERN_WARNING, device, "%s",
Expand Down
41 changes: 41 additions & 0 deletions trunk/drivers/s390/block/dasd_devmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,51 @@ dasd_discipline_show(struct device *dev, struct device_attribute *attr, char *bu

static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);

/*
* extended error-reporting
*/
static ssize_t
dasd_eer_show(struct device *dev, struct device_attribute *attr, char *buf)
{
struct dasd_devmap *devmap;
int eer_flag;

devmap = dasd_find_busid(dev->bus_id);
if (!IS_ERR(devmap) && devmap->device)
eer_flag = dasd_eer_enabled(devmap->device);
else
eer_flag = 0;
return snprintf(buf, PAGE_SIZE, eer_flag ? "1\n" : "0\n");
}

static ssize_t
dasd_eer_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct dasd_devmap *devmap;
int rc;

devmap = dasd_devmap_from_cdev(to_ccwdev(dev));
if (IS_ERR(devmap))
return PTR_ERR(devmap);
if (!devmap->device)
return count;
if (buf[0] == '1') {
rc = dasd_eer_enable(devmap->device);
if (rc)
return rc;
} else
dasd_eer_disable(devmap->device);
return count;
}

static DEVICE_ATTR(eer_enabled, 0644, dasd_eer_show, dasd_eer_store);

static struct attribute * dasd_attrs[] = {
&dev_attr_readonly.attr,
&dev_attr_discipline.attr,
&dev_attr_use_diag.attr,
&dev_attr_eer_enabled.attr,
NULL,
};

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/s390/block/dasd_eckd.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define DASD_ECKD_CCW_PSF 0x27
#define DASD_ECKD_CCW_RSSD 0x3e
#define DASD_ECKD_CCW_LOCATE_RECORD 0x47
#define DASD_ECKD_CCW_SNSS 0x54
#define DASD_ECKD_CCW_DEFINE_EXTENT 0x63
#define DASD_ECKD_CCW_WRITE_MT 0x85
#define DASD_ECKD_CCW_READ_MT 0x86
Expand Down
Loading

0 comments on commit d6adf6a

Please sign in to comment.