diff options
author | Horst Hummel <horst.hummel@de.ibm.com> | 2006-12-08 09:54:15 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-12-08 09:54:15 -0500 |
commit | 9575bf265711cabe7147a68003a56a9f19f034da (patch) | |
tree | d13dc1c76470ba24fc1d8333adf6890a45df327a | |
parent | 85eca8503997cf3a869b159954f703530c865299 (diff) |
[S390] New DASD feature for ERP related logging
It is now possible to enable/disable ERP related logging without re-compile
and re-ipl. A additional sysfs-attribute 'erplog' allows to switch the
logging non-interruptive.
Signed-off-by: Horst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/block/dasd.c | 8 | ||||
-rw-r--r-- | drivers/s390/block/dasd_3990_erp.c | 23 | ||||
-rw-r--r-- | drivers/s390/block/dasd_devmap.c | 49 | ||||
-rw-r--r-- | drivers/s390/block/dasd_int.h | 4 | ||||
-rw-r--r-- | include/asm-s390/dasd.h | 2 |
5 files changed, 64 insertions, 22 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 2af2d9b53d18..492b68bcd7cc 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -1050,10 +1050,10 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
1050 | } | 1050 | } |
1051 | } else { /* error */ | 1051 | } else { /* error */ |
1052 | memcpy(&cqr->irb, irb, sizeof (struct irb)); | 1052 | memcpy(&cqr->irb, irb, sizeof (struct irb)); |
1053 | #ifdef ERP_DEBUG | 1053 | if (device->features & DASD_FEATURE_ERPLOG) { |
1054 | /* dump sense data */ | 1054 | /* dump sense data */ |
1055 | dasd_log_sense(cqr, irb); | 1055 | dasd_log_sense(cqr, irb); |
1056 | #endif | 1056 | } |
1057 | switch (era) { | 1057 | switch (era) { |
1058 | case dasd_era_fatal: | 1058 | case dasd_era_fatal: |
1059 | cqr->status = DASD_CQR_FAILED; | 1059 | cqr->status = DASD_CQR_FAILED; |
diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c index 669805d4402d..4d01040c2c63 100644 --- a/drivers/s390/block/dasd_3990_erp.c +++ b/drivers/s390/block/dasd_3990_erp.c | |||
@@ -2641,14 +2641,12 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) | |||
2641 | struct dasd_ccw_req *erp = NULL; | 2641 | struct dasd_ccw_req *erp = NULL; |
2642 | struct dasd_device *device = cqr->device; | 2642 | struct dasd_device *device = cqr->device; |
2643 | __u32 cpa = cqr->irb.scsw.cpa; | 2643 | __u32 cpa = cqr->irb.scsw.cpa; |
2644 | struct dasd_ccw_req *temp_erp = NULL; | ||
2644 | 2645 | ||
2645 | #ifdef ERP_DEBUG | 2646 | if (device->features & DASD_FEATURE_ERPLOG) { |
2646 | /* print current erp_chain */ | 2647 | /* print current erp_chain */ |
2647 | DEV_MESSAGE(KERN_ERR, device, "%s", | 2648 | DEV_MESSAGE(KERN_ERR, device, "%s", |
2648 | "ERP chain at BEGINNING of ERP-ACTION"); | 2649 | "ERP chain at BEGINNING of ERP-ACTION"); |
2649 | { | ||
2650 | struct dasd_ccw_req *temp_erp = NULL; | ||
2651 | |||
2652 | for (temp_erp = cqr; | 2650 | for (temp_erp = cqr; |
2653 | temp_erp != NULL; temp_erp = temp_erp->refers) { | 2651 | temp_erp != NULL; temp_erp = temp_erp->refers) { |
2654 | 2652 | ||
@@ -2658,7 +2656,6 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) | |||
2658 | temp_erp->refers); | 2656 | temp_erp->refers); |
2659 | } | 2657 | } |
2660 | } | 2658 | } |
2661 | #endif /* ERP_DEBUG */ | ||
2662 | 2659 | ||
2663 | /* double-check if current erp/cqr was successfull */ | 2660 | /* double-check if current erp/cqr was successfull */ |
2664 | if ((cqr->irb.scsw.cstat == 0x00) && | 2661 | if ((cqr->irb.scsw.cstat == 0x00) && |
@@ -2695,11 +2692,10 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) | |||
2695 | erp = dasd_3990_erp_handle_match_erp(cqr, erp); | 2692 | erp = dasd_3990_erp_handle_match_erp(cqr, erp); |
2696 | } | 2693 | } |
2697 | 2694 | ||
2698 | #ifdef ERP_DEBUG | 2695 | if (device->features & DASD_FEATURE_ERPLOG) { |
2699 | /* print current erp_chain */ | 2696 | /* print current erp_chain */ |
2700 | DEV_MESSAGE(KERN_ERR, device, "%s", "ERP chain at END of ERP-ACTION"); | 2697 | DEV_MESSAGE(KERN_ERR, device, "%s", |
2701 | { | 2698 | "ERP chain at END of ERP-ACTION"); |
2702 | struct dasd_ccw_req *temp_erp = NULL; | ||
2703 | for (temp_erp = erp; | 2699 | for (temp_erp = erp; |
2704 | temp_erp != NULL; temp_erp = temp_erp->refers) { | 2700 | temp_erp != NULL; temp_erp = temp_erp->refers) { |
2705 | 2701 | ||
@@ -2709,7 +2705,6 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) | |||
2709 | temp_erp->refers); | 2705 | temp_erp->refers); |
2710 | } | 2706 | } |
2711 | } | 2707 | } |
2712 | #endif /* ERP_DEBUG */ | ||
2713 | 2708 | ||
2714 | if (erp->status == DASD_CQR_FAILED) | 2709 | if (erp->status == DASD_CQR_FAILED) |
2715 | dasd_log_ccw(erp, 1, cpa); | 2710 | dasd_log_ccw(erp, 1, cpa); |
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index cf28ccc57948..5943266152f5 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c | |||
@@ -202,6 +202,8 @@ dasd_feature_list(char *str, char **endp) | |||
202 | features |= DASD_FEATURE_READONLY; | 202 | features |= DASD_FEATURE_READONLY; |
203 | else if (len == 4 && !strncmp(str, "diag", 4)) | 203 | else if (len == 4 && !strncmp(str, "diag", 4)) |
204 | features |= DASD_FEATURE_USEDIAG; | 204 | features |= DASD_FEATURE_USEDIAG; |
205 | else if (len == 6 && !strncmp(str, "erplog", 6)) | ||
206 | features |= DASD_FEATURE_ERPLOG; | ||
205 | else { | 207 | else { |
206 | MESSAGE(KERN_WARNING, | 208 | MESSAGE(KERN_WARNING, |
207 | "unsupported feature: %*s, " | 209 | "unsupported feature: %*s, " |
@@ -709,6 +711,52 @@ dasd_ro_store(struct device *dev, struct device_attribute *attr, | |||
709 | } | 711 | } |
710 | 712 | ||
711 | static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store); | 713 | static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store); |
714 | /* | ||
715 | * erplog controls the logging of ERP related data | ||
716 | * (e.g. failing channel programs). | ||
717 | */ | ||
718 | static ssize_t | ||
719 | dasd_erplog_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
720 | { | ||
721 | struct dasd_devmap *devmap; | ||
722 | int erplog; | ||
723 | |||
724 | devmap = dasd_find_busid(dev->bus_id); | ||
725 | if (!IS_ERR(devmap)) | ||
726 | erplog = (devmap->features & DASD_FEATURE_ERPLOG) != 0; | ||
727 | else | ||
728 | erplog = (DASD_FEATURE_DEFAULT & DASD_FEATURE_ERPLOG) != 0; | ||
729 | return snprintf(buf, PAGE_SIZE, erplog ? "1\n" : "0\n"); | ||
730 | } | ||
731 | |||
732 | static ssize_t | ||
733 | dasd_erplog_store(struct device *dev, struct device_attribute *attr, | ||
734 | const char *buf, size_t count) | ||
735 | { | ||
736 | struct dasd_devmap *devmap; | ||
737 | int val; | ||
738 | char *endp; | ||
739 | |||
740 | devmap = dasd_devmap_from_cdev(to_ccwdev(dev)); | ||
741 | if (IS_ERR(devmap)) | ||
742 | return PTR_ERR(devmap); | ||
743 | |||
744 | val = simple_strtoul(buf, &endp, 0); | ||
745 | if (((endp + 1) < (buf + count)) || (val > 1)) | ||
746 | return -EINVAL; | ||
747 | |||
748 | spin_lock(&dasd_devmap_lock); | ||
749 | if (val) | ||
750 | devmap->features |= DASD_FEATURE_ERPLOG; | ||
751 | else | ||
752 | devmap->features &= ~DASD_FEATURE_ERPLOG; | ||
753 | if (devmap->device) | ||
754 | devmap->device->features = devmap->features; | ||
755 | spin_unlock(&dasd_devmap_lock); | ||
756 | return count; | ||
757 | } | ||
758 | |||
759 | static DEVICE_ATTR(erplog, 0644, dasd_erplog_show, dasd_erplog_store); | ||
712 | 760 | ||
713 | /* | 761 | /* |
714 | * use_diag controls whether the driver should use diag rather than ssch | 762 | * use_diag controls whether the driver should use diag rather than ssch |
@@ -896,6 +944,7 @@ static struct attribute * dasd_attrs[] = { | |||
896 | &dev_attr_uid.attr, | 944 | &dev_attr_uid.attr, |
897 | &dev_attr_use_diag.attr, | 945 | &dev_attr_use_diag.attr, |
898 | &dev_attr_eer_enabled.attr, | 946 | &dev_attr_eer_enabled.attr, |
947 | &dev_attr_erplog.attr, | ||
899 | NULL, | 948 | NULL, |
900 | }; | 949 | }; |
901 | 950 | ||
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index dc5dd509434d..fb725e3b08fe 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h | |||
@@ -13,10 +13,6 @@ | |||
13 | 13 | ||
14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
15 | 15 | ||
16 | /* erp debugging in dasd.c and dasd_3990_erp.c */ | ||
17 | #define ERP_DEBUG | ||
18 | |||
19 | |||
20 | /* we keep old device allocation scheme; IOW, minors are still in 0..255 */ | 16 | /* we keep old device allocation scheme; IOW, minors are still in 0..255 */ |
21 | #define DASD_PER_MAJOR (1U << (MINORBITS - DASD_PARTN_BITS)) | 17 | #define DASD_PER_MAJOR (1U << (MINORBITS - DASD_PARTN_BITS)) |
22 | #define DASD_PARTN_MASK ((1 << DASD_PARTN_BITS) - 1) | 18 | #define DASD_PARTN_MASK ((1 << DASD_PARTN_BITS) - 1) |
diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index c042f9578081..604f68fa6f56 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h | |||
@@ -69,11 +69,13 @@ typedef struct dasd_information2_t { | |||
69 | * 0x01: readonly (ro) | 69 | * 0x01: readonly (ro) |
70 | * 0x02: use diag discipline (diag) | 70 | * 0x02: use diag discipline (diag) |
71 | * 0x04: set the device initially online (internal use only) | 71 | * 0x04: set the device initially online (internal use only) |
72 | * 0x08: enable ERP related logging | ||
72 | */ | 73 | */ |
73 | #define DASD_FEATURE_DEFAULT 0x00 | 74 | #define DASD_FEATURE_DEFAULT 0x00 |
74 | #define DASD_FEATURE_READONLY 0x01 | 75 | #define DASD_FEATURE_READONLY 0x01 |
75 | #define DASD_FEATURE_USEDIAG 0x02 | 76 | #define DASD_FEATURE_USEDIAG 0x02 |
76 | #define DASD_FEATURE_INITIAL_ONLINE 0x04 | 77 | #define DASD_FEATURE_INITIAL_ONLINE 0x04 |
78 | #define DASD_FEATURE_ERPLOG 0x08 | ||
77 | 79 | ||
78 | #define DASD_PARTN_BITS 2 | 80 | #define DASD_PARTN_BITS 2 |
79 | 81 | ||