diff options
Diffstat (limited to 'drivers/s390/block/dasd_erp.c')
-rw-r--r-- | drivers/s390/block/dasd_erp.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c index caa5d91420f8..8f10000851a3 100644 --- a/drivers/s390/block/dasd_erp.c +++ b/drivers/s390/block/dasd_erp.c | |||
@@ -46,6 +46,8 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize, | |||
46 | if (cqr == NULL) | 46 | if (cqr == NULL) |
47 | return ERR_PTR(-ENOMEM); | 47 | return ERR_PTR(-ENOMEM); |
48 | memset(cqr, 0, sizeof(struct dasd_ccw_req)); | 48 | memset(cqr, 0, sizeof(struct dasd_ccw_req)); |
49 | INIT_LIST_HEAD(&cqr->devlist); | ||
50 | INIT_LIST_HEAD(&cqr->blocklist); | ||
49 | data = (char *) cqr + ((sizeof(struct dasd_ccw_req) + 7L) & -8L); | 51 | data = (char *) cqr + ((sizeof(struct dasd_ccw_req) + 7L) & -8L); |
50 | cqr->cpaddr = NULL; | 52 | cqr->cpaddr = NULL; |
51 | if (cplength > 0) { | 53 | if (cplength > 0) { |
@@ -66,7 +68,7 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize, | |||
66 | } | 68 | } |
67 | 69 | ||
68 | void | 70 | void |
69 | dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device) | 71 | dasd_free_erp_request(struct dasd_ccw_req *cqr, struct dasd_device * device) |
70 | { | 72 | { |
71 | unsigned long flags; | 73 | unsigned long flags; |
72 | 74 | ||
@@ -81,11 +83,11 @@ dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device) | |||
81 | * dasd_default_erp_action just retries the current cqr | 83 | * dasd_default_erp_action just retries the current cqr |
82 | */ | 84 | */ |
83 | struct dasd_ccw_req * | 85 | struct dasd_ccw_req * |
84 | dasd_default_erp_action(struct dasd_ccw_req * cqr) | 86 | dasd_default_erp_action(struct dasd_ccw_req *cqr) |
85 | { | 87 | { |
86 | struct dasd_device *device; | 88 | struct dasd_device *device; |
87 | 89 | ||
88 | device = cqr->device; | 90 | device = cqr->startdev; |
89 | 91 | ||
90 | /* just retry - there is nothing to save ... I got no sense data.... */ | 92 | /* just retry - there is nothing to save ... I got no sense data.... */ |
91 | if (cqr->retries > 0) { | 93 | if (cqr->retries > 0) { |
@@ -93,12 +95,12 @@ dasd_default_erp_action(struct dasd_ccw_req * cqr) | |||
93 | "default ERP called (%i retries left)", | 95 | "default ERP called (%i retries left)", |
94 | cqr->retries); | 96 | cqr->retries); |
95 | cqr->lpm = LPM_ANYPATH; | 97 | cqr->lpm = LPM_ANYPATH; |
96 | cqr->status = DASD_CQR_QUEUED; | 98 | cqr->status = DASD_CQR_FILLED; |
97 | } else { | 99 | } else { |
98 | DEV_MESSAGE (KERN_WARNING, device, "%s", | 100 | DEV_MESSAGE (KERN_WARNING, device, "%s", |
99 | "default ERP called (NO retry left)"); | 101 | "default ERP called (NO retry left)"); |
100 | cqr->status = DASD_CQR_FAILED; | 102 | cqr->status = DASD_CQR_FAILED; |
101 | cqr->stopclk = get_clock (); | 103 | cqr->stopclk = get_clock(); |
102 | } | 104 | } |
103 | return cqr; | 105 | return cqr; |
104 | } /* end dasd_default_erp_action */ | 106 | } /* end dasd_default_erp_action */ |
@@ -117,15 +119,12 @@ dasd_default_erp_action(struct dasd_ccw_req * cqr) | |||
117 | * RETURN VALUES | 119 | * RETURN VALUES |
118 | * cqr pointer to the original CQR | 120 | * cqr pointer to the original CQR |
119 | */ | 121 | */ |
120 | struct dasd_ccw_req * | 122 | struct dasd_ccw_req *dasd_default_erp_postaction(struct dasd_ccw_req *cqr) |
121 | dasd_default_erp_postaction(struct dasd_ccw_req * cqr) | ||
122 | { | 123 | { |
123 | struct dasd_device *device; | ||
124 | int success; | 124 | int success; |
125 | 125 | ||
126 | BUG_ON(cqr->refers == NULL || cqr->function == NULL); | 126 | BUG_ON(cqr->refers == NULL || cqr->function == NULL); |
127 | 127 | ||
128 | device = cqr->device; | ||
129 | success = cqr->status == DASD_CQR_DONE; | 128 | success = cqr->status == DASD_CQR_DONE; |
130 | 129 | ||
131 | /* free all ERPs - but NOT the original cqr */ | 130 | /* free all ERPs - but NOT the original cqr */ |
@@ -133,10 +132,10 @@ dasd_default_erp_postaction(struct dasd_ccw_req * cqr) | |||
133 | struct dasd_ccw_req *refers; | 132 | struct dasd_ccw_req *refers; |
134 | 133 | ||
135 | refers = cqr->refers; | 134 | refers = cqr->refers; |
136 | /* remove the request from the device queue */ | 135 | /* remove the request from the block queue */ |
137 | list_del(&cqr->list); | 136 | list_del(&cqr->blocklist); |
138 | /* free the finished erp request */ | 137 | /* free the finished erp request */ |
139 | dasd_free_erp_request(cqr, device); | 138 | dasd_free_erp_request(cqr, cqr->memdev); |
140 | cqr = refers; | 139 | cqr = refers; |
141 | } | 140 | } |
142 | 141 | ||
@@ -157,7 +156,7 @@ dasd_log_sense(struct dasd_ccw_req *cqr, struct irb *irb) | |||
157 | { | 156 | { |
158 | struct dasd_device *device; | 157 | struct dasd_device *device; |
159 | 158 | ||
160 | device = cqr->device; | 159 | device = cqr->startdev; |
161 | /* dump sense data */ | 160 | /* dump sense data */ |
162 | if (device->discipline && device->discipline->dump_sense) | 161 | if (device->discipline && device->discipline->dump_sense) |
163 | device->discipline->dump_sense(device, cqr, irb); | 162 | device->discipline->dump_sense(device, cqr, irb); |