s390: dasd extended error reporting module.
Subsystems (2)
PATCH 3/3 s390: dasd extended error reporting module.
From: Stefan Weinhuber <[email protected]>
[patch 3/3] s390: dasd extended error reporting module.
The DASD extended error reporting is a facility that allows to get detailed information about certain problems in the DASD I/O. This information can be used to implement fail-over applications that can recover these problems.
---
arch/s390/kernel/compat_ioctl.c | 2 drivers/s390/block/Kconfig | 14 drivers/s390/block/Makefile | 2 drivers/s390/block/dasd.c | 76 ++ drivers/s390/block/dasd_3990_erp.c | 5 drivers/s390/block/dasd_eckd.h | 3 drivers/s390/block/dasd_eer.c | 1091 +++++++++++++++++++++++++++++++++++++ drivers/s390/block/dasd_int.h | 37 + include/asm-s390/dasd.h | 15 9 files changed, 1237 insertions(+), 8 deletions(-)
arch/s390/kernel/compat_ioctl.c +2 -0
@@ -63,6 +63,8 @@ COMPATIBLE_IOCTL(BIODASDSATTR) COMPATIBLE_IOCTL(BIODASDCMFENABLE) COMPATIBLE_IOCTL(BIODASDCMFDISABLE) COMPATIBLE_IOCTL(BIODASDREADALLCMB) +COMPATIBLE_IOCTL(BIODASDEERSET) +COMPATIBLE_IOCTL(BIODASDEERGET) COMPATIBLE_IOCTL(TUBICMD) COMPATIBLE_IOCTL(TUBOCMD)
drivers/s390/block/dasd_3990_erp.c +4 -1
@@ -5,7 +5,7 @@* Bugreports.to..: <[email protected]> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001 * -* $Revision: 1.36 $ +* $Revision: 1.38 $ */ #include <linux/timer.h>
@@ -1109,6 +1109,9 @@ dasd_3990_handle_env_data(struct dasd_cccase 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",
drivers/s390/block/dasd.c +75 -1
130 lines not on this page · raw message
drivers/s390/block/dasd_eckd.h +2 -1
@@ -5,7 +5,7 @@* Bugreports.to..: <[email protected]> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * -* $Revision: 1.10 $ +* $Revision: 1.11 $ */ #ifndef DASD_ECKD_H
@@ -30,6 +30,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
drivers/s390/block/dasd_eer.c +1091 -0
1,091 lines not on this page · raw message
drivers/s390/block/dasd_int.h +37 -0
@@ -276,6 +276,34 @@ struct dasd_discipline {extern struct dasd_discipline *dasd_diag_discipline_pointer; + +/* +* Notification numbers for extended error reporting notifications: +* The DASD_EER_DISABLE notification is sent before a dasd_device (and it's +* eer pointer) is freed. The error reporting module needs to do all necessary +* cleanup steps. +* The DASD_EER_TRIGGER notification sends the actual error reports (triggers). +*/ +#define DASD_EER_DISABLE 0 +#define DASD_EER_TRIGGER 1 + +/* Trigger IDs for extended error reporting DASD_EER_TRIGGER notification */ +#define DASD_EER_FATALERROR 1 +#define DASD_EER_NOPATH 2 +#define DASD_EER_STATECHANGE 3 +#define DASD_EER_PPRCSUSPEND 4 + +/* +* The dasd_eer_trigger structure contains all data that we need to send +* along with an DASD_EER_TRIGGER notification. +*/ +struct dasd_eer_trigger { +unsigned int id; +struct dasd_device *device; +struct dasd_ccw_req *cqr; +}; + +struct dasd_device {/* Block device stuff. */ struct gendisk *gdp;
@@ -289,6 +317,9 @@ struct dasd_device {unsigned long flags;/* per device flags */ unsigned short features;/* copy of devmap-features (read-only!) */ +/* extended error reporting stuff (eer) */ +void *eer; +/* Device discipline stuff. */ struct dasd_discipline *discipline;char *private;
@@ -489,6 +520,12 @@ int dasd_generic_set_online(struct ccw_dint dasd_generic_set_offline (struct ccw_device *cdev);int dasd_generic_notify (struct ccw_device *,int );void dasd_generic_auto_online (struct ccw_driver *); +int dasd_register_eer_notifier (struct notifier_block *); +int dasd_unregister_eer_notifier (struct notifier_block *); +void dasd_write_eer_trigger (unsigned int ,struct dasd_device *, +struct dasd_ccw_req *); + +/* externals in dasd_devmap.c */ extern int dasd_max_devindex;
drivers/s390/block/Kconfig +11 -3
@@ -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.
drivers/s390/block/Makefile +2 -0
@@ -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 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
include/asm-s390/dasd.h +13 -2
@@ -8,7 +8,7 @@* any future changes wrt the API will result in a change of the APIVERSION reported * to userspace by the DASDAPIVER-ioctl * -* $Revision: 1.6 $ +* $Revision: 1.7 $ * */
@@ -206,7 +206,8 @@ typedef struct attrib_data_t {* * Here ist how the ioctl-nr should be used: * 0 - 31 DASD driver itself -* 32 - 239 still open +* 32 - 229 still open +* 230 - 239 DASD extended error reporting * 240 - 255 reserved for EMC *******************************************************************************/
@@ -238,12 +239,22 @@ typedef struct attrib_data_t {#define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t)/* Get Attributes (cache operations) */ #define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t) +/* retrieve extended error-reporting value */ +#define BIODASDEERGET _IOR(DASD_IOCTL_LETTER,6,int)/* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */ #define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t)/* Set Attributes (cache operations) */ #define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t) +/* retrieve extended error-reporting value */ +#define BIODASDEERSET _IOW(DASD_IOCTL_LETTER,3,int) + + +/* remove all records from the eer buffer */ +#define DASD_EER_PURGE _IO(DASD_IOCTL_LETTER,230) +/* set the number of pages that are used for the internal eer buffer */ +#define DASD_EER_SETBUFSIZE _IOW(DASD_IOCTL_LETTER,230,int)#endif /* DASD_H */
Quoted 29 lines · Martin Schwidefsky
From: Stefan Weinhuber <[email protected]>
[patch 3/3] s390: dasd extended error reporting module.
The DASD extended error reporting is a facility that allows to get detailed information about certain problems in the DASD I/O. This information can be used to implement fail-over applications that can recover these problems.
Signed-off-by Stefan Weinhuber <[email protected]>Signed-off-by Martin Schwidefsky <[email protected]>---
arch/s390/kernel/compat_ioctl.c | 2 drivers/s390/block/Kconfig | 14 drivers/s390/block/Makefile | 2 drivers/s390/block/dasd.c | 76 ++ drivers/s390/block/dasd_3990_erp.c | 5 drivers/s390/block/dasd_eckd.h | 3 drivers/s390/block/dasd_eer.c | 1091 +++++++++++++++++++++++++++++++++++++ drivers/s390/block/dasd_int.h | 37 + include/asm-s390/dasd.h | 15 9 files changed, 1237 insertions(+), 8 deletions(-)diff -urpN
linux-2.6/arch/s390/kernel/compat_ioctl.clinux-2.6-patched/arch/s390/kernel/compat_ioctl.c
arch/s390/kernel/compat_ioctl.c COMPATIBLE_IOCTL(BIODASDSATTR) · line 67
Quoted 5 lines
arch/s390/kernel/compat_ioctl.c +2
-0@@ -63,6 +63,8 @@ COMPATIBLE_IOCTL(BIODASDSATTR) COMPATIBLE_IOCTL(BIODASDCMFENABLE) COMPATIBLE_IOCTL(BIODASDCMFDISABLE) COMPATIBLE_IOCTL(BIODASDREADALLCMB) +COMPATIBLE_IOCTL(BIODASDEERSET) +COMPATIBLE_IOCTL(BIODASDEERGET)
Nack, now new ioctls in compat_ioctl.c, please. In fact that file is gone in -mm, so please submit this patch ontop of the -mm tree.
And is there a chance for a better interface than the notifier lists? The code looks rather awkward because of it.
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Martin Schwidefsky
From: Stefan Weinhuber <[email protected]>
[patch 3/3] s390: dasd extended error reporting module.
Nack, now new ioctls in
compat_ioctl.c, please. In fact that file is gone in -mm, so please submit this patch ontop of the -mm tree.
Hmm, that's true. In that case it's probably best to wait until the first wave of patches out of -mm have hit the git tree and then I recreate the patch from our internal tree. The current patch dependecies are starting to make my head ache.
Quoted 2 lines
And is there a chance for a better interface than the notifier lists? The code looks rather awkward because of it.
Older versions of the code had an own registration function for a callback pointer for the events. It only accepted one user and sort of reinvented the notify functionality. I'd prefer notifiers compare to the old solution. If you have a clever idea, we are listening.
On a side not, Arnd just told my about the bug in the dasd_eckd discipline. We need to check the discipline in the eckd specific ioctls. I'll tell the appropriate people (well in fact I already did because they are on CC:). As for adding a per discipline .ioctl function, that won't work because of cmb and eer. These modules do not implement a discipline but still have to add ioctls.
Signature · 6 lines
blue skies, Martin Martin Schwidefsky Linux for zSeries Development & Services IBM Deutschland Entwicklung GmbH
Quoted 6 lines · Martin Schwidefsky
On a side not, Arnd just told my about the bug in the
dasd_eckddiscipline. We need to check the discipline in the eckd specific ioctls. I'll tell the appropriate people (well in fact I already did because they are on CC:). As for adding a per discipline .ioctl function, that won't work because of cmb and eer. These modules do not implement a discipline but still have to add ioctls.
cmd shouldn't be a module of it's own (see patch just sent), and the same is true of this module. Functionality that doesn't have it's own fundamental objects to operate on should be separate modules. If you use modules ala dlopen()ed .so libraries in userspace you will always get code that's a piece of junk and full of bugs.