aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-02-13 00:50:07 -0500
committerArnd Bergmann <arnd@arndb.de>2012-02-13 00:50:26 -0500
commitffafe770a4160862476405a442d28ee48d2249ef (patch)
tree5bb7d5913427c245c61dd5eb384321dff386f841 /drivers/s390/block
parent0dcd627896fb87b2e78a1ed78e469591208cffcd (diff)
parentda911782be4c82dc1222aa0cb5bef28605d1e117 (diff)
Merge branch 'v3.3-samsung-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes
* 'v3.3-samsung-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: (2 commits) ARM: EXYNOS: Add cpu-offset property in gic device tree node ARM: EXYNOS: Bring exynos4-dt up to date Linux 3.3-rc3 This includes an update to the v3.3-rc3 release from v3.3-rc2 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/s390/block')
-rw-r--r--drivers/s390/block/dasd.c6
-rw-r--r--drivers/s390/block/dasd_alias.c64
-rw-r--r--drivers/s390/block/dasd_eckd.c63
-rw-r--r--drivers/s390/block/dasd_int.h2
4 files changed, 46 insertions, 89 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index eef27a197c00..110137e7ec81 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -3261,6 +3261,12 @@ void dasd_generic_path_event(struct ccw_device *cdev, int *path_event)
3261 device->path_data.tbvpm |= eventlpm; 3261 device->path_data.tbvpm |= eventlpm;
3262 dasd_schedule_device_bh(device); 3262 dasd_schedule_device_bh(device);
3263 } 3263 }
3264 if (path_event[chp] & PE_PATHGROUP_ESTABLISHED) {
3265 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
3266 "Pathgroup re-established\n");
3267 if (device->discipline->kick_validate)
3268 device->discipline->kick_validate(device);
3269 }
3264 } 3270 }
3265 dasd_put_device(device); 3271 dasd_put_device(device);
3266} 3272}
diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c
index 553b3c5abb0a..b3beed5434e4 100644
--- a/drivers/s390/block/dasd_alias.c
+++ b/drivers/s390/block/dasd_alias.c
@@ -189,14 +189,12 @@ int dasd_alias_make_device_known_to_lcu(struct dasd_device *device)
189 unsigned long flags; 189 unsigned long flags;
190 struct alias_server *server, *newserver; 190 struct alias_server *server, *newserver;
191 struct alias_lcu *lcu, *newlcu; 191 struct alias_lcu *lcu, *newlcu;
192 int is_lcu_known;
193 struct dasd_uid uid; 192 struct dasd_uid uid;
194 193
195 private = (struct dasd_eckd_private *) device->private; 194 private = (struct dasd_eckd_private *) device->private;
196 195
197 device->discipline->get_uid(device, &uid); 196 device->discipline->get_uid(device, &uid);
198 spin_lock_irqsave(&aliastree.lock, flags); 197 spin_lock_irqsave(&aliastree.lock, flags);
199 is_lcu_known = 1;
200 server = _find_server(&uid); 198 server = _find_server(&uid);
201 if (!server) { 199 if (!server) {
202 spin_unlock_irqrestore(&aliastree.lock, flags); 200 spin_unlock_irqrestore(&aliastree.lock, flags);
@@ -208,7 +206,6 @@ int dasd_alias_make_device_known_to_lcu(struct dasd_device *device)
208 if (!server) { 206 if (!server) {
209 list_add(&newserver->server, &aliastree.serverlist); 207 list_add(&newserver->server, &aliastree.serverlist);
210 server = newserver; 208 server = newserver;
211 is_lcu_known = 0;
212 } else { 209 } else {
213 /* someone was faster */ 210 /* someone was faster */
214 _free_server(newserver); 211 _free_server(newserver);
@@ -226,12 +223,10 @@ int dasd_alias_make_device_known_to_lcu(struct dasd_device *device)
226 if (!lcu) { 223 if (!lcu) {
227 list_add(&newlcu->lcu, &server->lculist); 224 list_add(&newlcu->lcu, &server->lculist);
228 lcu = newlcu; 225 lcu = newlcu;
229 is_lcu_known = 0;
230 } else { 226 } else {
231 /* someone was faster */ 227 /* someone was faster */
232 _free_lcu(newlcu); 228 _free_lcu(newlcu);
233 } 229 }
234 is_lcu_known = 0;
235 } 230 }
236 spin_lock(&lcu->lock); 231 spin_lock(&lcu->lock);
237 list_add(&device->alias_list, &lcu->inactive_devices); 232 list_add(&device->alias_list, &lcu->inactive_devices);
@@ -239,64 +234,7 @@ int dasd_alias_make_device_known_to_lcu(struct dasd_device *device)
239 spin_unlock(&lcu->lock); 234 spin_unlock(&lcu->lock);
240 spin_unlock_irqrestore(&aliastree.lock, flags); 235 spin_unlock_irqrestore(&aliastree.lock, flags);
241 236
242 return is_lcu_known; 237 return 0;
243}
244
245/*
246 * The first device to be registered on an LCU will have to do
247 * some additional setup steps to configure that LCU on the
248 * storage server. All further devices should wait with their
249 * initialization until the first device is done.
250 * To synchronize this work, the first device will call
251 * dasd_alias_lcu_setup_complete when it is done, and all
252 * other devices will wait for it with dasd_alias_wait_for_lcu_setup.
253 */
254void dasd_alias_lcu_setup_complete(struct dasd_device *device)
255{
256 unsigned long flags;
257 struct alias_server *server;
258 struct alias_lcu *lcu;
259 struct dasd_uid uid;
260
261 device->discipline->get_uid(device, &uid);
262 lcu = NULL;
263 spin_lock_irqsave(&aliastree.lock, flags);
264 server = _find_server(&uid);
265 if (server)
266 lcu = _find_lcu(server, &uid);
267 spin_unlock_irqrestore(&aliastree.lock, flags);
268 if (!lcu) {
269 DBF_EVENT_DEVID(DBF_ERR, device->cdev,
270 "could not find lcu for %04x %02x",
271 uid.ssid, uid.real_unit_addr);
272 WARN_ON(1);
273 return;
274 }
275 complete_all(&lcu->lcu_setup);
276}
277
278void dasd_alias_wait_for_lcu_setup(struct dasd_device *device)
279{
280 unsigned long flags;
281 struct alias_server *server;
282 struct alias_lcu *lcu;
283 struct dasd_uid uid;
284
285 device->discipline->get_uid(device, &uid);
286 lcu = NULL;
287 spin_lock_irqsave(&aliastree.lock, flags);
288 server = _find_server(&uid);
289 if (server)
290 lcu = _find_lcu(server, &uid);
291 spin_unlock_irqrestore(&aliastree.lock, flags);
292 if (!lcu) {
293 DBF_EVENT_DEVID(DBF_ERR, device->cdev,
294 "could not find lcu for %04x %02x",
295 uid.ssid, uid.real_unit_addr);
296 WARN_ON(1);
297 return;
298 }
299 wait_for_completion(&lcu->lcu_setup);
300} 238}
301 239
302/* 240/*
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index bbcd5e9206ee..70880be26015 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1534,6 +1534,10 @@ static void dasd_eckd_validate_server(struct dasd_device *device)
1534 struct dasd_eckd_private *private; 1534 struct dasd_eckd_private *private;
1535 int enable_pav; 1535 int enable_pav;
1536 1536
1537 private = (struct dasd_eckd_private *) device->private;
1538 if (private->uid.type == UA_BASE_PAV_ALIAS ||
1539 private->uid.type == UA_HYPER_PAV_ALIAS)
1540 return;
1537 if (dasd_nopav || MACHINE_IS_VM) 1541 if (dasd_nopav || MACHINE_IS_VM)
1538 enable_pav = 0; 1542 enable_pav = 0;
1539 else 1543 else
@@ -1542,11 +1546,28 @@ static void dasd_eckd_validate_server(struct dasd_device *device)
1542 1546
1543 /* may be requested feature is not available on server, 1547 /* may be requested feature is not available on server,
1544 * therefore just report error and go ahead */ 1548 * therefore just report error and go ahead */
1545 private = (struct dasd_eckd_private *) device->private;
1546 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "PSF-SSC for SSID %04x " 1549 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "PSF-SSC for SSID %04x "
1547 "returned rc=%d", private->uid.ssid, rc); 1550 "returned rc=%d", private->uid.ssid, rc);
1548} 1551}
1549 1552
1553/*
1554 * worker to do a validate server in case of a lost pathgroup
1555 */
1556static void dasd_eckd_do_validate_server(struct work_struct *work)
1557{
1558 struct dasd_device *device = container_of(work, struct dasd_device,
1559 kick_validate);
1560 dasd_eckd_validate_server(device);
1561 dasd_put_device(device);
1562}
1563
1564static void dasd_eckd_kick_validate_server(struct dasd_device *device)
1565{
1566 dasd_get_device(device);
1567 /* queue call to do_validate_server to the kernel event daemon. */
1568 schedule_work(&device->kick_validate);
1569}
1570
1550static u32 get_fcx_max_data(struct dasd_device *device) 1571static u32 get_fcx_max_data(struct dasd_device *device)
1551{ 1572{
1552#if defined(CONFIG_64BIT) 1573#if defined(CONFIG_64BIT)
@@ -1588,10 +1609,13 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
1588 struct dasd_eckd_private *private; 1609 struct dasd_eckd_private *private;
1589 struct dasd_block *block; 1610 struct dasd_block *block;
1590 struct dasd_uid temp_uid; 1611 struct dasd_uid temp_uid;
1591 int is_known, rc, i; 1612 int rc, i;
1592 int readonly; 1613 int readonly;
1593 unsigned long value; 1614 unsigned long value;
1594 1615
1616 /* setup work queue for validate server*/
1617 INIT_WORK(&device->kick_validate, dasd_eckd_do_validate_server);
1618
1595 if (!ccw_device_is_pathgroup(device->cdev)) { 1619 if (!ccw_device_is_pathgroup(device->cdev)) {
1596 dev_warn(&device->cdev->dev, 1620 dev_warn(&device->cdev->dev,
1597 "A channel path group could not be established\n"); 1621 "A channel path group could not be established\n");
@@ -1651,22 +1675,12 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
1651 block->base = device; 1675 block->base = device;
1652 } 1676 }
1653 1677
1654 /* register lcu with alias handling, enable PAV if this is a new lcu */ 1678 /* register lcu with alias handling, enable PAV */
1655 is_known = dasd_alias_make_device_known_to_lcu(device); 1679 rc = dasd_alias_make_device_known_to_lcu(device);
1656 if (is_known < 0) { 1680 if (rc)
1657 rc = is_known;
1658 goto out_err2; 1681 goto out_err2;
1659 } 1682
1660 /* 1683 dasd_eckd_validate_server(device);
1661 * dasd_eckd_validate_server is done on the first device that
1662 * is found for an LCU. All later other devices have to wait
1663 * for it, so they will read the correct feature codes.
1664 */
1665 if (!is_known) {
1666 dasd_eckd_validate_server(device);
1667 dasd_alias_lcu_setup_complete(device);
1668 } else
1669 dasd_alias_wait_for_lcu_setup(device);
1670 1684
1671 /* device may report different configuration data after LCU setup */ 1685 /* device may report different configuration data after LCU setup */
1672 rc = dasd_eckd_read_conf(device); 1686 rc = dasd_eckd_read_conf(device);
@@ -4098,7 +4112,7 @@ static int dasd_eckd_restore_device(struct dasd_device *device)
4098{ 4112{
4099 struct dasd_eckd_private *private; 4113 struct dasd_eckd_private *private;
4100 struct dasd_eckd_characteristics temp_rdc_data; 4114 struct dasd_eckd_characteristics temp_rdc_data;
4101 int is_known, rc; 4115 int rc;
4102 struct dasd_uid temp_uid; 4116 struct dasd_uid temp_uid;
4103 unsigned long flags; 4117 unsigned long flags;
4104 4118
@@ -4121,14 +4135,10 @@ static int dasd_eckd_restore_device(struct dasd_device *device)
4121 goto out_err; 4135 goto out_err;
4122 4136
4123 /* register lcu with alias handling, enable PAV if this is a new lcu */ 4137 /* register lcu with alias handling, enable PAV if this is a new lcu */
4124 is_known = dasd_alias_make_device_known_to_lcu(device); 4138 rc = dasd_alias_make_device_known_to_lcu(device);
4125 if (is_known < 0) 4139 if (rc)
4126 return is_known; 4140 return rc;
4127 if (!is_known) { 4141 dasd_eckd_validate_server(device);
4128 dasd_eckd_validate_server(device);
4129 dasd_alias_lcu_setup_complete(device);
4130 } else
4131 dasd_alias_wait_for_lcu_setup(device);
4132 4142
4133 /* RE-Read Configuration Data */ 4143 /* RE-Read Configuration Data */
4134 rc = dasd_eckd_read_conf(device); 4144 rc = dasd_eckd_read_conf(device);
@@ -4270,6 +4280,7 @@ static struct dasd_discipline dasd_eckd_discipline = {
4270 .restore = dasd_eckd_restore_device, 4280 .restore = dasd_eckd_restore_device,
4271 .reload = dasd_eckd_reload_device, 4281 .reload = dasd_eckd_reload_device,
4272 .get_uid = dasd_eckd_get_uid, 4282 .get_uid = dasd_eckd_get_uid,
4283 .kick_validate = dasd_eckd_kick_validate_server,
4273}; 4284};
4274 4285
4275static int __init 4286static int __init
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index afe8c33422ed..33a6743ddc55 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -355,6 +355,7 @@ struct dasd_discipline {
355 int (*reload) (struct dasd_device *); 355 int (*reload) (struct dasd_device *);
356 356
357 int (*get_uid) (struct dasd_device *, struct dasd_uid *); 357 int (*get_uid) (struct dasd_device *, struct dasd_uid *);
358 void (*kick_validate) (struct dasd_device *);
358}; 359};
359 360
360extern struct dasd_discipline *dasd_diag_discipline_pointer; 361extern struct dasd_discipline *dasd_diag_discipline_pointer;
@@ -455,6 +456,7 @@ struct dasd_device {
455 struct work_struct kick_work; 456 struct work_struct kick_work;
456 struct work_struct restore_device; 457 struct work_struct restore_device;
457 struct work_struct reload_device; 458 struct work_struct reload_device;
459 struct work_struct kick_validate;
458 struct timer_list timer; 460 struct timer_list timer;
459 461
460 debug_info_t *debug_area; 462 debug_info_t *debug_area;