Skip to content

Commit

Permalink
[S390] dasd: revalidate server for new pathgroup
Browse files Browse the repository at this point in the history
If a pathgroup is established we get an event and have to revalidate
the server to propagate supported features like PAV and enable them.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Stefan Haberland authored and Martin Schwidefsky committed Jan 18, 2012
1 parent f9f8d02 commit f163303
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3261,6 +3261,12 @@ void dasd_generic_path_event(struct ccw_device *cdev, int *path_event)
device->path_data.tbvpm |= eventlpm;
dasd_schedule_device_bh(device);
}
if (path_event[chp] & PE_PATHGROUP_ESTABLISHED) {
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Pathgroup re-established\n");
if (device->discipline->kick_validate)
device->discipline->kick_validate(device);
}
}
dasd_put_device(device);
}
Expand Down
22 changes: 22 additions & 0 deletions drivers/s390/block/dasd_eckd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,24 @@ static void dasd_eckd_validate_server(struct dasd_device *device)
"returned rc=%d", private->uid.ssid, rc);
}

/*
* worker to do a validate server in case of a lost pathgroup
*/
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);
dasd_put_device(device);
}

static void dasd_eckd_kick_validate_server(struct dasd_device *device)
{
dasd_get_device(device);
/* queue call to do_validate_server to the kernel event daemon. */
schedule_work(&device->kick_validate);
}

static u32 get_fcx_max_data(struct dasd_device *device)
{
#if defined(CONFIG_64BIT)
Expand Down Expand Up @@ -1595,6 +1613,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
int readonly;
unsigned long value;

/* setup work queue for validate server*/
INIT_WORK(&device->kick_validate, dasd_eckd_do_validate_server);

if (!ccw_device_is_pathgroup(device->cdev)) {
dev_warn(&device->cdev->dev,
"A channel path group could not be established\n");
Expand Down Expand Up @@ -4259,6 +4280,7 @@ static struct dasd_discipline dasd_eckd_discipline = {
.restore = dasd_eckd_restore_device,
.reload = dasd_eckd_reload_device,
.get_uid = dasd_eckd_get_uid,
.kick_validate = dasd_eckd_kick_validate_server,
};

static int __init
Expand Down
2 changes: 2 additions & 0 deletions drivers/s390/block/dasd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ struct dasd_discipline {
int (*reload) (struct dasd_device *);

int (*get_uid) (struct dasd_device *, struct dasd_uid *);
void (*kick_validate) (struct dasd_device *);
};

extern struct dasd_discipline *dasd_diag_discipline_pointer;
Expand Down Expand Up @@ -455,6 +456,7 @@ struct dasd_device {
struct work_struct kick_work;
struct work_struct restore_device;
struct work_struct reload_device;
struct work_struct kick_validate;
struct timer_list timer;

debug_info_t *debug_area;
Expand Down

0 comments on commit f163303

Please sign in to comment.