Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322996
b: refs/heads/master
c: 12d7b10
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Haberland authored and Martin Schwidefsky committed Sep 17, 2012
1 parent 8228bdf commit 4b22d2b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 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: 4db84d4f07b87c452c6000e0595dc9570ed21b41
refs/heads/master: 12d7b1078bb374fc3e2955b9f2815415a66157b6
11 changes: 11 additions & 0 deletions trunk/drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,7 @@ static int _dasd_sleep_on(struct dasd_ccw_req *maincqr, int interruptible)
test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) &&
(!dasd_eer_enabled(device))) {
cqr->status = DASD_CQR_FAILED;
cqr->intrc = -EAGAIN;
continue;
}
/* Don't try to start requests if device is stopped */
Expand Down Expand Up @@ -3270,6 +3271,16 @@ void dasd_generic_path_event(struct ccw_device *cdev, int *path_event)
dasd_schedule_device_bh(device);
}
if (path_event[chp] & PE_PATHGROUP_ESTABLISHED) {
if (!(device->path_data.opm & eventlpm) &&
!(device->path_data.tbvpm & eventlpm)) {
/*
* we can not establish a pathgroup on an
* unavailable path, so trigger a path
* verification first
*/
device->path_data.tbvpm |= eventlpm;
dasd_schedule_device_bh(device);
}
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Pathgroup re-established\n");
if (device->discipline->kick_validate)
Expand Down
32 changes: 25 additions & 7 deletions trunk/drivers/s390/block/dasd_eckd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,8 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device,
* call might change behaviour of DASD devices.
*/
static int
dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav)
dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav,
unsigned long flags)
{
struct dasd_ccw_req *cqr;
int rc;
Expand All @@ -1516,18 +1517,28 @@ dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav)
if (IS_ERR(cqr))
return PTR_ERR(cqr);

/*
* set flags e.g. turn on failfast, to prevent blocking
* the calling function should handle failed requests
*/
cqr->flags |= flags;

rc = dasd_sleep_on(cqr);
if (!rc)
/* trigger CIO to reprobe devices */
css_schedule_reprobe();
else if (cqr->intrc == -EAGAIN)
rc = -EAGAIN;

dasd_sfree_request(cqr, cqr->memdev);
return rc;
}

/*
* Valide storage server of current device.
*/
static void dasd_eckd_validate_server(struct dasd_device *device)
static int dasd_eckd_validate_server(struct dasd_device *device,
unsigned long flags)
{
int rc;
struct dasd_eckd_private *private;
Expand All @@ -1536,17 +1547,18 @@ static void dasd_eckd_validate_server(struct dasd_device *device)
private = (struct dasd_eckd_private *) device->private;
if (private->uid.type == UA_BASE_PAV_ALIAS ||
private->uid.type == UA_HYPER_PAV_ALIAS)
return;
return 0;
if (dasd_nopav || MACHINE_IS_VM)
enable_pav = 0;
else
enable_pav = 1;
rc = dasd_eckd_psf_ssc(device, enable_pav);
rc = dasd_eckd_psf_ssc(device, enable_pav, flags);

/* may be requested feature is not available on server,
* therefore just report error and go ahead */
DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "PSF-SSC for SSID %04x "
"returned rc=%d", private->uid.ssid, rc);
return rc;
}

/*
Expand All @@ -1556,7 +1568,13 @@ static void dasd_eckd_do_validate_server(struct work_struct *work)
{
struct dasd_device *device = container_of(work, struct dasd_device,
kick_validate);
dasd_eckd_validate_server(device);
if (dasd_eckd_validate_server(device, DASD_CQR_FLAGS_FAILFAST)
== -EAGAIN) {
/* schedule worker again if failed */
schedule_work(&device->kick_validate);
return;
}

dasd_put_device(device);
}

Expand Down Expand Up @@ -1685,7 +1703,7 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
if (rc)
goto out_err2;

dasd_eckd_validate_server(device);
dasd_eckd_validate_server(device, 0);

/* device may report different configuration data after LCU setup */
rc = dasd_eckd_read_conf(device);
Expand Down Expand Up @@ -4153,7 +4171,7 @@ static int dasd_eckd_restore_device(struct dasd_device *device)
rc = dasd_alias_make_device_known_to_lcu(device);
if (rc)
return rc;
dasd_eckd_validate_server(device);
dasd_eckd_validate_server(device, DASD_CQR_FLAGS_FAILFAST);

/* RE-Read Configuration Data */
rc = dasd_eckd_read_conf(device);
Expand Down

0 comments on commit 4b22d2b

Please sign in to comment.